Repository: tailwindlabs/tailwindcss
File: crates/oxide/src/extractor/arbitrary_property_machine.rs (Rust)

Code before:
                // End of the CSS variable, must be followed by a `:`
                //
                // E.g.: `[--my-color:red]`
                //                   ^
                Class::Colon => {
                    cursor.advance_twice();
                    self.transition::<ParsingValueState>().next(cursor)
                }

                // Invalid arbitrary property
                _ => self.restart(),
            },
        }
    }
}

impl Machine for ArbitraryPropertyMachine<ParsingValueState> {
    #[inline(always)]
    fn reset(&mut self) {
        self.bracket_stack.reset();
    }

    #[inline]
    fn next(&mut self, cursor: &mut cursor::Cursor<'_>) -> MachineState {
        let len = cursor.input.len();
        let start_of_value = cursor.pos;
        while cursor.pos < len {
            match cursor.curr.into() {
                Class::Escape => match cursor.next.into() {
                    // An escaped whitespace character is not allowed
                    //
                    // E.g.: `[color:var(--my-\ color)]`
                    //                         ^
                    Class::Whitespace => return self.restart(),

                    // An escaped character, skip the next character, resume after
                    //
                    // E.g.: `[color:var(--my-\#color)]`
                    //                        ^
                    _ => cursor.advance_twice(),
                },

                Class::OpenParen | Class::OpenBracket | Class::OpenCurly => {
                    if !self.bracket_stack.push(cursor.curr) {
                        return self.restart();
                    }
                    cursor.advance();
                }

                Class::CloseParen | Class::CloseBracket | Class::CloseCurly
                    if !self.bracket_stack.is_empty() =>

Review comment (suggestion):
```suggestion
        let start_of_value_pos = cursor.pos;
```

Code after:
                // End of the CSS variable, must be followed by a `:`
                //
                // E.g.: `[--my-color:red]`
                //                   ^
                Class::Colon => {
                    cursor.advance_twice();
                    self.transition::<ParsingValueState>().next(cursor)
                }

                // Invalid arbitrary property
                _ => self.restart(),
            },
        }
    }
}

impl Machine for ArbitraryPropertyMachine<ParsingValueState> {
    #[inline(always)]
    fn reset(&mut self) {
        self.bracket_stack.reset();
    }

    #[inline]
    fn next(&mut self, cursor: &mut cursor::Cursor<'_>) -> MachineState {
        let len = cursor.input.len();
        let start_of_value_pos = cursor.pos;
        while cursor.pos < len {
            match cursor.curr.into() {
                Class::Escape => match cursor.next.into() {
                    // An escaped whitespace character is not allowed
                    //
                    // E.g.: `[color:var(--my-\ color)]`
                    //                         ^
                    Class::Whitespace => return self.restart(),

                    // An escaped character, skip the next character, resume after
                    //
                    // E.g.: `[color:var(--my-\#color)]`
                    //                        ^
                    _ => cursor.advance_twice(),
                },

                Class::OpenParen | Class::OpenBracket | Class::OpenCurly => {
                    if !self.bracket_stack.push(cursor.curr) {
                        return self.restart();
                    }
                    cursor.advance();
                }

                Class::CloseParen | Class::CloseBracket | Class::CloseCurly
                    if !self.bracket_stack.is_empty() =>