Expand description
Port of src/validation/first.ts: first token sets of the validation syntaxes.
The typescript caches are WeakMaps keyed by the syntax objects. The rust caches are keyed by the address of the
shared syntax tokens / sequences: an entry keeps the syntax alive (the address is not reused) and a sequence entry
is checked element by element (Rc::ptr_eq).
Structs§
- Alternative
Index - the alternatives of a syntax indexed by their first tokens
- First
Set - the first tokens of a syntax
- TypeSet
- set of token types (bitset)
Functions§
- first_
of - first tokens of a syntax token
- first_
of_ sequence - first tokens of a sequence of syntaxes
- is_
nullable - true if the syntax may match no token
- matching_
alternatives - the alternatives of a syntax that may match the first token of a value, in order. None when all of them may match
- may_
start_ with - true if a sequence of syntaxes may match tokens starting with a token