diff options
author | Valentin Popov <valentin@popov.link> | 2024-07-19 15:37:58 +0300 |
---|---|---|
committer | Valentin Popov <valentin@popov.link> | 2024-07-19 15:37:58 +0300 |
commit | a990de90fe41456a23e58bd087d2f107d321f3a1 (patch) | |
tree | 15afc392522a9e85dc3332235e311b7d39352ea9 /vendor/anstyle-parse/src/state/mod.rs | |
parent | 3d48cd3f81164bbfc1a755dc1d4a9a02f98c8ddd (diff) | |
download | fparkan-a990de90fe41456a23e58bd087d2f107d321f3a1.tar.xz fparkan-a990de90fe41456a23e58bd087d2f107d321f3a1.zip |
Deleted vendor folder
Diffstat (limited to 'vendor/anstyle-parse/src/state/mod.rs')
-rw-r--r-- | vendor/anstyle-parse/src/state/mod.rs | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/vendor/anstyle-parse/src/state/mod.rs b/vendor/anstyle-parse/src/state/mod.rs deleted file mode 100644 index 9194205..0000000 --- a/vendor/anstyle-parse/src/state/mod.rs +++ /dev/null @@ -1,41 +0,0 @@ -#[cfg(test)] -mod codegen; -mod definitions; -mod table; - -#[cfg(test)] -pub(crate) use definitions::pack; -pub(crate) use definitions::unpack; -pub use definitions::Action; -pub use definitions::State; - -/// Transition to next [`State`] -/// -/// Note: This does not directly support UTF-8. -/// - If the data is validated as UTF-8 (e.g. `str`) or single-byte C1 control codes are -/// unsupported, then treat [`Action::BeginUtf8`] and [`Action::Execute`] for UTF-8 continuations -/// as [`Action::Print`]. -/// - If the data is not validated, then a UTF-8 state machine will need to be implemented on top, -/// starting with [`Action::BeginUtf8`]. -/// -/// Note: When [`State::Anywhere`] is returned, revert back to the prior state. -#[inline] -pub const fn state_change(state: State, byte: u8) -> (State, Action) { - // Handle state changes in the anywhere state before evaluating changes - // for current state. - let mut change = state_change_(State::Anywhere, byte); - if change == 0 { - change = state_change_(state, byte); - } - - // Unpack into a state and action - unpack(change) -} - -#[inline] -const fn state_change_(state: State, byte: u8) -> u8 { - let state_idx = state as usize; - let byte_idx = byte as usize; - - table::STATE_CHANGES[state_idx][byte_idx] -} |