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

Code before:
                // 2. There must be at least a single character inside the brackets
                Class::CloseBracket
                    if self.start_pos + 1 != cursor.pos && self.bracket_stack.is_empty() =>
                {
                    return self.done(self.start_pos, cursor)
                }

                // Start of a string
                Class::Quote => return self.parse_string(cursor),

                // Another `:` inside of an arbitrary property is only valid inside of a string or
                // inside of brackets. Everywhere else, it's invalid.
                //
                // E.g.: `[color:red:blue]`
                //                  ^ Not valid
                // E.g.: `[background:url(https://example.com)]`
                //                             ^ Valid
                // E.g.: `[content:'a:b:c:']`
                //                   ^ ^ ^ Valid
                Class::Colon if self.bracket_stack.is_empty() => return self.restart(),

                // Any kind of whitespace is not allowed
                Class::Whitespace => return self.restart(),

                // URLs are not allowed
                Class::Slash if start_of_value == cursor.pos => return self.restart(),

                // Everything else is valid
                _ => cursor.advance(),
            };
        }

        self.restart()
    }
}

impl ArbitraryPropertyMachine<ParsingValueState> {
    fn parse_string(&mut self, cursor: &mut cursor::Cursor<'_>) -> MachineState {
        match self.string_machine.next(cursor) {
            MachineState::Idle => self.restart(),
            MachineState::Done(_) => {
                cursor.advance();
                self.next(cursor)
            }
        }
    }
}

#[derive(Clone, Copy, ClassifyBytes)]
enum Class {
    #[bytes(b'(')]

Review comment (suggestion):
```suggestion
                Class::Slash if start_of_value_pos == cursor.pos => return self.restart(),
```

Code after:
                // 2. There must be at least a single character inside the brackets
                Class::CloseBracket
                    if self.start_pos + 1 != cursor.pos && self.bracket_stack.is_empty() =>
                {
                    return self.done(self.start_pos, cursor)
                }

                // Start of a string
                Class::Quote => return self.parse_string(cursor),

                // Another `:` inside of an arbitrary property is only valid inside of a string or
                // inside of brackets. Everywhere else, it's invalid.
                //
                // E.g.: `[color:red:blue]`
                //                  ^ Not valid
                // E.g.: `[background:url(https://example.com)]`
                //                             ^ Valid
                // E.g.: `[content:'a:b:c:']`
                //                   ^ ^ ^ Valid
                Class::Colon if self.bracket_stack.is_empty() => return self.restart(),

                // Any kind of whitespace is not allowed
                Class::Whitespace => return self.restart(),

                // URLs are not allowed
                Class::Slash if start_of_value_pos == cursor.pos => return self.restart(),

                // Everything else is valid
                _ => cursor.advance(),
            };
        }

        self.restart()
    }
}

impl ArbitraryPropertyMachine<ParsingValueState> {
    fn parse_string(&mut self, cursor: &mut cursor::Cursor<'_>) -> MachineState {
        match self.string_machine.next(cursor) {
            MachineState::Idle => self.restart(),
            MachineState::Done(_) => {
                cursor.advance();
                self.next(cursor)
            }
        }
    }
}

#[derive(Clone, Copy, ClassifyBytes)]
enum Class {
    #[bytes(b'(')]