Home / Function/ next() — tailwindcss Function Reference

next() — tailwindcss Function Reference

Architecture documentation for the next() function in string_machine.rs from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  8a890760_7ee4_cfea_ac48_c9e856c8216b["next()"]
  e92d6055_7491_e838_01ff_8822a35d079f["string_machine.rs"]
  8a890760_7ee4_cfea_ac48_c9e856c8216b -->|defined in| e92d6055_7491_e838_01ff_8822a35d079f
  style 8a890760_7ee4_cfea_ac48_c9e856c8216b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

crates/oxide/src/extractor/string_machine.rs lines 32–68

    fn next(&mut self, cursor: &mut cursor::Cursor<'_>) -> MachineState {
        if Class::Quote != cursor.curr.into() {
            return MachineState::Idle;
        }

        // Start of a string
        let len = cursor.input.len();
        let start_pos = cursor.pos;
        let end_char = cursor.curr;

        cursor.advance();

        while cursor.pos < len {
            match cursor.curr.into() {
                Class::Escape => match cursor.next.into() {
                    // An escaped whitespace character is not allowed
                    Class::Whitespace => return MachineState::Idle,

                    // An escaped character, skip ahead to the next character
                    _ => cursor.advance(),
                },

                // End of the string
                Class::Quote if cursor.curr == end_char => return self.done(start_pos, cursor),

                // Any kind of whitespace is not allowed
                Class::Whitespace => return MachineState::Idle,

                // Everything else is valid
                _ => {}
            };

            cursor.advance()
        }

        MachineState::Idle
    }

Domain

Subdomains

Frequently Asked Questions

What does next() do?
next() is a function in the tailwindcss codebase, defined in crates/oxide/src/extractor/string_machine.rs.
Where is next() defined?
next() is defined in crates/oxide/src/extractor/string_machine.rs at line 32.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free