Files
compiler-explorer/static/modes/_all.ts
T
Matt GodboltandClaude f8974b4f5f Fix Rust hexadecimal literal syntax highlighting with underscores (#7766)
## Summary
- Fixes syntax highlighting issue where Rust hex literals with
underscores after hex letters (like `0x01_02_0a_0b`) would lose
highlighting after the underscore
- Created custom Rust language mode (`rustp`) that patches Monaco's
built-in tokenizer
- Filed upstream issue with Monaco Editor:
https://github.com/microsoft/monaco-editor/issues/4917

## Test plan
- [x] Verified fix works locally with test cases like `0x01_02_0a_0b`,
`0xFF_AA_BB_CC`, etc.
- [x] Confirmed all existing tests pass
- [x] Checked that TypeScript compilation and linting pass

🤖 Generated with [Claude Code](https://claude.ai/code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-06-06 16:21:27 -05:00

76 lines
2.5 KiB
TypeScript

// Copyright (c) 2021, Compiler Explorer Authors
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
import './ada-mode';
import './asm6502-mode';
import './asm-mode';
import './asmruby-mode';
import './c3-mode';
import './carbon-mode';
import './clean-mode';
import './cmake-mode';
import './cobol-mode';
import './cppcircle-mode';
import './cpp-for-opencl-mode';
import './cppfront-mode';
import './cppp-mode';
import './cppx-blue-mode';
import './cppx-gold-mode';
import './crystal-mode';
import './cuda-mode';
import './d-mode';
import './no-highlight-mode';
import './erlang-mode';
import './fortran-mode';
import './gccdump-rtl-gimple-mode';
import './glsl-mode';
import './haskell-mode';
import './hlsl-mode';
import './hook-mode';
import './hylo-mode';
import './ispc-mode';
import './jakt-mode';
import './llvm-ir-mode';
import './mlir-mode';
import './modula2-mode';
import './mojo-mode';
import './nc-mode';
import './nim-mode';
import './nix-mode';
import './ocaml-mode';
import './odin-mode';
import './openclc-mode';
import './ptx-mode';
import './rust-mode';
import './sail-mode';
import './slang-mode';
import './spice-mode';
import './spirv-mode';
import './sway-mode';
import './tablegen-mode';
import './v-mode';
import './vala-mode';
import './wat-mode';
import './zig-mode';