oxc/crates
overlookmotel 0e32618664
refactor(parser): combine token kinds for skipped tokens (#2072)
Small optimization to the lexer.

Whitespace, line breaks, and comments are all skipped by
`read_next_token()`.

At present there's a different `Kind` for each, and `read_next_token()`
decides whether to skip with `matches!(kind, Kind::WhiteSpace |
Kind::NewLine | Kind::Comment | Kind::MultiLineComment)`.

These `Kind`s are used for no other purpose, so there seems little
reason to differentiate them.

This PR combines them all into `Kind::Skip`, so then the test of whether
to skip is reduced to `kind == Kind::Skip`.

Only produces ~0.3% performance bump on parser benchmarks. But, why
not?...
2024-01-18 21:14:12 +08:00
..
oxc Publish crates v0.5.0 2024-01-12 23:33:47 +08:00
oxc_allocator Publish crates v0.5.0 2024-01-12 23:33:47 +08:00
oxc_ast feat(transformer/typescript): remove type-related exports (#2056) 2024-01-17 16:04:30 +08:00
oxc_cli feat(linter): remove the --timings feature (#2049) 2024-01-16 14:21:04 +08:00
oxc_codegen fix(codegen): add parenthesis in binary expression by precedence (#2067) 2024-01-17 23:01:42 +08:00
oxc_diagnostics Publish crates v0.5.0 2024-01-12 23:33:47 +08:00
oxc_index Publish crates v0.5.0 2024-01-12 23:33:47 +08:00
oxc_js_regex
oxc_language_server refactor(linter): remove the LintSettings parameter from LintContext::new. (#2051) 2024-01-16 17:17:46 +08:00
oxc_linter fix(linter): eslint-plugin-import no-named-as-default-member rule (#2071) 2024-01-18 09:32:40 +08:00
oxc_macros feat(linter): remove the --timings feature (#2049) 2024-01-16 14:21:04 +08:00
oxc_minifier fix(codegen): add parenthesis in binary expression by precedence (#2067) 2024-01-17 23:01:42 +08:00
oxc_parser refactor(parser): combine token kinds for skipped tokens (#2072) 2024-01-18 21:14:12 +08:00
oxc_prettier fix(prettier): Correctly print export declaration (#2014) 2024-01-13 21:26:33 +08:00
oxc_semantic fix(semantic): incorrect reference flag (#2057) 2024-01-17 16:08:31 +08:00
oxc_span Publish crates v0.5.0 2024-01-12 23:33:47 +08:00
oxc_syntax fix(codegen): add parenthesis in binary expression by precedence (#2067) 2024-01-17 23:01:42 +08:00
oxc_transformer feat(transformer/typescript): keep imports if import specifiers is empty (#2058) 2024-01-17 16:14:31 +08:00
oxc_wasm refactor(linter): remove the LintSettings parameter from LintContext::new. (#2051) 2024-01-16 17:17:46 +08:00