oxc/crates/oxc_syntax/src
overlookmotel c335f92ada perf(syntax): reorder operator enum variants (#7351)
Re-order enum variants of `AssignmentOperator`, `BinaryOperator` and `UnaryOperator`.

* `Exponential` moved to after `Remainder` (so with the rest of the arithmetic operators).
* `Shift*` operators follow arithmetic operators.
* `AssignmentOperator::Bitwise*` ops moved to before `Logical*` ops (so all ops which correspond to `BinaryOperator`s are together).
* `*Or` always before `*And`.
* Plus/Addition always before Minus/Subtraction.

The purpose is to make the various methods on these types maximally efficient:

1. Group together variants so that `AssignmentOperator::is_*` methods can be executed with the minimum number of operations (essentially `variant - min <= max`).
2. Align the variants of `AssignmentOperator` and `BinaryOperator` so that conversion methods added in #7350 become very cheap too (essentially `if variant - min <= max { Some(variant + offset) } else { None }`).
2024-11-19 01:23:28 +00:00
..
generated perf(syntax): reorder operator enum variants (#7351) 2024-11-19 01:23:28 +00:00
class.rs docs(syntax): enable lint warnings on missing docs, and add a lot of documentation (#6611) 2024-10-15 22:50:45 +00:00
identifier.rs fix(identifier): add ZWSP to is_irregular_whitespace (#6662) 2024-10-18 22:20:02 +00:00
keyword.rs docs(syntax): enable lint warnings on missing docs, and add a lot of documentation (#6611) 2024-10-15 22:50:45 +00:00
lib.rs feat(parser): Generate Serialize impls in ast_tools (#6404) 2024-10-19 09:38:44 +01:00
module_graph_visitor.rs docs(syntax): enable lint warnings on missing docs, and add a lot of documentation (#6611) 2024-10-15 22:50:45 +00:00
module_record.rs docs(syntax): enable lint warnings on missing docs, and add a lot of documentation (#6611) 2024-10-15 22:50:45 +00:00
node.rs docs(syntax): enable lint warnings on missing docs, and add a lot of documentation (#6611) 2024-10-15 22:50:45 +00:00
number.rs docs(syntax): enable lint warnings on missing docs, and add a lot of documentation (#6611) 2024-10-15 22:50:45 +00:00
operator.rs perf(syntax): reorder operator enum variants (#7351) 2024-11-19 01:23:28 +00:00
precedence.rs docs(syntax): enable lint warnings on missing docs, and add a lot of documentation (#6611) 2024-10-15 22:50:45 +00:00
reference.rs docs(syntax): enable lint warnings on missing docs, and add a lot of documentation (#6611) 2024-10-15 22:50:45 +00:00
scope.rs docs(syntax): enable lint warnings on missing docs, and add a lot of documentation (#6611) 2024-10-15 22:50:45 +00:00
symbol.rs docs(syntax): enable lint warnings on missing docs, and add a lot of documentation (#6611) 2024-10-15 22:50:45 +00:00
xml_entities.rs docs(syntax): enable lint warnings on missing docs, and add a lot of documentation (#6611) 2024-10-15 22:50:45 +00:00