Expand description
Port of src/parser/utils/canonical.ts.
Canonical strings: the spellings of the known units and function names (dB, translateX, …). They are
registered once and stored in a single text: the string table references ranges of this text, no string is created.
Functions§
- canonical_
code_ at - code unit of the canonical text
- canonical_
end - end of a packed range
- canonical_
slice - a range of the canonical text
- canonical_
start - start of a packed range
- register_
canonical - register a canonical string
returns the range of the string in the canonical text, packed:
start << 8 | length - with_
canonical_ text - run a function with the canonical text (ascii: the bytes are the code units)