mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-01 21:29:26 -06:00
Fixes highlighting issue where hex literals with underscores after hex letters (like 0x01_02_0a_0b) would lose highlighting after the underscore. The problem was in Monaco's built-in Rust tokenizer regex pattern which only allowed one underscore at the end instead of throughout the hex number. Created custom Rust language mode (rustp) that patches Monaco's tokenizer to fix the hexadecimal pattern from /(0x[\da-fA-F]+)_?/ to /(0x[0-9a-fA-F_]+)/ allowing underscores throughout the hex number like other number formats. Also filed upstream issue: https://github.com/microsoft/monaco-editor/issues/4917 Fixes #7645 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>