lib/hyperscript/tokenizer.sx — tokenizes real _hyperscript syntax into typed token stream. Handles: Keywords (on, set, add, toggle, if, then, from, etc.) DOM literals (.class, #id, @attr, *style, :local, <sel/>) Strings (single/double quoted, escapes), template literals Numbers (integers, decimals, time units: 100ms, 2s) Operators (==, !=, +, -, 's possessive) Punctuation (parens, brackets, braces, commas, dots) Line comments (// to EOL) Parser will disambiguate .name as class vs property access from context. Possessive 's correctly distinguished from single-quote strings. 2952/2952 tests, zero failures. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
15 KiB
15 KiB