mirror of
https://github.com/astral-sh/ruff.git
synced 2026-11-21 20:29:20 +08:00
## Summary Changing the lexer's keyword set now takes one edit to the Rust list. The compiler finds a collision-free multiplier and builds the 64-slot table, so we can remove the Python generator and its lockfile. A two-byte keyword like `if` packs to `0x6669_0000_0000_0000`. Only the low two bytes of the multiplier affect its slot. We place keywords from shortest to longest, choosing each new byte of the multiplier without disturbing the shorter keywords. The lexer still selects a slot with one multiply and shift, then compares the full word.