Skip to main content

Module match_

Module match_ 

Source
Expand description

Port of src/validation/match.ts (match is a rust keyword: the module is match_).

Matches value tokens of the arena against the parsed value definition syntaxes.

  • a Context is a shared mutable cursor (Rc<RefCell<..>>, like the typescript context objects that are passed around and advanced in place). slice() shares the token buffer (offset), it does not copy the tokens
  • syntax identity (typescript object identity) is the Rc address; the stacks keep the syntaxes alive

Re-exports§

pub use super::match_syntax::match_syntax;
pub use super::match_syntax::peek_feature_tokens;

Structs§

CompiledStats
the number of values validated by the compiled matchers, see compiled_stats
ContextData
cursor over the tokens being validated
MFValue
result of is_mf_value
ValidationMatch
result of a match (ValidationMatch)

Constants§

SELECTOR_NODE_TYPES

Traits§

ContextExt
context helpers on the shared handle

Functions§

compiled_stats
the number of values validated by the compiled matchers on this thread, and the disagreements with the interpreter (verified mode, see set_compiled_validation)
create_validation_context
create a validation context: the comments are removed, the whitespace and !important are trimmed
declaration_validations
number of declaration values validated on this thread: an identical value is validated once
drop_error
a “drop” error of a token, with its location
get_mf_info
ValidationMediaFeature
is_css_wide_keyword
true if the value is a css wide keyword, ignoring the case
is_func_type
funcTypes: the function token types
is_mf_value
validate a media feature value
is_valid_declaration_value
validate the value tokens of a declaration node. the validations are cached
match_all_syntaxes
match all the syntaxes: the tokens must be consumed
match_declaration_syntax
validate the value of a declaration. the successful and the failed validations are cached by value encoding
match_selector_syntax
match a selector: the tokens are checked and normalized in place (combinators, whitespace)
set_compiled_validation
use the compiled matchers (see crate::validation::compiled): 0 not used, 1 used, 2 verified by the interpreter (see compiled_stats)
token_location
[file, line, column] of a token
token_type_name
EnumToken[type]
trim_array
trim leading and trailing whitespace

Type Aliases§

Context
shared validation context (ValidationContext)
Syntax