Home / File/ named_utility_machine.rs — tailwindcss Source File

named_utility_machine.rs — tailwindcss Source File

Architecture documentation for named_utility_machine.rs, a rust file in the tailwindcss codebase. 10 imports, 0 dependents.

File rust OxideEngine Extractor 10 imports 5 functions

Entity Profile

Dependency Diagram

graph LR
  bf0a5a81_9d4d_13f4_80cb_898fcfafbf69["named_utility_machine.rs"]
  5d977ab3_eccc_64dd_6684_ec779f8861bb["super::"]
  bf0a5a81_9d4d_13f4_80cb_898fcfafbf69 --> 5d977ab3_eccc_64dd_6684_ec779f8861bb
  e4e20bdf_ad1e_e4a0_5cba_d0f5a5db787e["crate::cursor"]
  bf0a5a81_9d4d_13f4_80cb_898fcfafbf69 --> e4e20bdf_ad1e_e4a0_5cba_d0f5a5db787e
  b60f51a6_6e97_8e3d_707d_9068f03871c1["crate::extractor::arbitrary_value_machine::ArbitraryValueMachine"]
  bf0a5a81_9d4d_13f4_80cb_898fcfafbf69 --> b60f51a6_6e97_8e3d_707d_9068f03871c1
  d66749b3_ce8e_5343_5587_7508eb703b11["crate::extractor::arbitrary_variable_machine::ArbitraryVariableMachine"]
  bf0a5a81_9d4d_13f4_80cb_898fcfafbf69 --> d66749b3_ce8e_5343_5587_7508eb703b11
  6d7afe24_3888_fb97_9551_4a72cbafecf6["crate::extractor::boundary::is_valid_after_boundary"]
  bf0a5a81_9d4d_13f4_80cb_898fcfafbf69 --> 6d7afe24_3888_fb97_9551_4a72cbafecf6
  cd83abb6_a664_e16d_ddc8_60a3f23ba86a["crate::extractor::machine::"]
  bf0a5a81_9d4d_13f4_80cb_898fcfafbf69 --> cd83abb6_a664_e16d_ddc8_60a3f23ba86a
  5731c53a_0325_b3af_2918_bcb379bc8ec6["classification_macros::ClassifyBytes"]
  bf0a5a81_9d4d_13f4_80cb_898fcfafbf69 --> 5731c53a_0325_b3af_2918_bcb379bc8ec6
  8c86990d_3557_b3a2_1d12_d17da0d3fa51["std::marker::PhantomData"]
  bf0a5a81_9d4d_13f4_80cb_898fcfafbf69 --> 8c86990d_3557_b3a2_1d12_d17da0d3fa51
  9a9673b5_10d4_f716_360c_b2510082b102["crate::extractor::machine::Machine"]
  bf0a5a81_9d4d_13f4_80cb_898fcfafbf69 --> 9a9673b5_10d4_f716_360c_b2510082b102
  e4088d34_b5b4_ec51_b975_557a1536ec76["pretty_assertions::assert_eq"]
  bf0a5a81_9d4d_13f4_80cb_898fcfafbf69 --> e4088d34_b5b4_ec51_b975_557a1536ec76
  style bf0a5a81_9d4d_13f4_80cb_898fcfafbf69 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

use crate::cursor;
use crate::extractor::arbitrary_value_machine::ArbitraryValueMachine;
use crate::extractor::arbitrary_variable_machine::ArbitraryVariableMachine;
use crate::extractor::boundary::is_valid_after_boundary;
use crate::extractor::machine::{Machine, MachineState};
use classification_macros::ClassifyBytes;
use std::marker::PhantomData;

#[derive(Debug, Default)]
pub struct IdleState;

#[derive(Debug, Default)]
pub struct ParsingState;

/// Extracts named utilities from an input.
///
/// E.g.:
///
/// ```text
/// flex
/// ^^^^
///
/// bg-red-500
/// ^^^^^^^^^^
/// ```
#[derive(Debug, Default)]
pub struct NamedUtilityMachine<State = IdleState> {
    /// Start position of the utility
    start_pos: usize,

    arbitrary_variable_machine: ArbitraryVariableMachine,
    arbitrary_value_machine: ArbitraryValueMachine,

    _state: PhantomData<State>,
}

impl<State> NamedUtilityMachine<State> {
    #[inline(always)]
    fn transition<NextState>(&self) -> NamedUtilityMachine<NextState> {
        NamedUtilityMachine {
            start_pos: self.start_pos,
            arbitrary_variable_machine: Default::default(),
            arbitrary_value_machine: Default::default(),
            _state: PhantomData,
        }
    }
}

impl Machine for NamedUtilityMachine<IdleState> {
    #[inline(always)]
    fn reset(&mut self) {}

    #[inline]
    fn next(&mut self, cursor: &mut cursor::Cursor<'_>) -> MachineState {
        match cursor.curr.into() {
            Class::AlphaLower => match cursor.next.into() {
                // Valid single character utility in between quotes
                //
                // E.g.: `<div class="a"></div>`
                //                    ^
// ... (476 more lines)

Domain

Subdomains

Dependencies

  • classification_macros::ClassifyBytes
  • crate::cursor
  • crate::extractor::arbitrary_value_machine::ArbitraryValueMachine
  • crate::extractor::arbitrary_variable_machine::ArbitraryVariableMachine
  • crate::extractor::boundary::is_valid_after_boundary
  • crate::extractor::machine::
  • crate::extractor::machine::Machine
  • pretty_assertions::assert_eq
  • std::marker::PhantomData
  • super::

Frequently Asked Questions

What does named_utility_machine.rs do?
named_utility_machine.rs is a source file in the tailwindcss codebase, written in rust. It belongs to the OxideEngine domain, Extractor subdomain.
What functions are defined in named_utility_machine.rs?
named_utility_machine.rs defines 5 function(s): next, reset, test_named_utility_extraction, test_named_utility_machine_performance, transition.
What does named_utility_machine.rs depend on?
named_utility_machine.rs imports 10 module(s): classification_macros::ClassifyBytes, crate::cursor, crate::extractor::arbitrary_value_machine::ArbitraryValueMachine, crate::extractor::arbitrary_variable_machine::ArbitraryVariableMachine, crate::extractor::boundary::is_valid_after_boundary, crate::extractor::machine::, crate::extractor::machine::Machine, pretty_assertions::assert_eq, and 2 more.
Where is named_utility_machine.rs in the architecture?
named_utility_machine.rs is located at crates/oxide/src/extractor/named_utility_machine.rs (domain: OxideEngine, subdomain: Extractor, directory: crates/oxide/src/extractor).

Analyze Your Own Codebase

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

Try Supermodel Free