Skip to main content

Questions tagged [syntax-highlighting]

The tag has no usage guidance.

12 votes
2 answers
384 views

How could syntax highlighting work for 2D languages?

In my 2D esolang, Trilangle, most instructions are a single character, which makes syntax highlighting trivial. However, the "push" instructions are two characters each, which complicates ...
Bbrk24's user avatar
  • 9,127
3 votes
1 answer
145 views

How do I explain to a syntax highlighter to highlight `a` differently in `load s0, a` (where it is a hexadecimal constant) and `regbank a`? [duplicate]

In the syntax highlighter I have implemented in my PicoBlaze Simulator in JavaScript, the assembly code address 0 load s0, 0 load s0, a regbank a is highlighted as ...
FlatAssembler's user avatar
8 votes
2 answers
227 views

How to correctly highlight contextual keywords?

Contextual keywords are tokens that are keywords in some contexts, and identifiers in others. Consider this example, which SE's highlighter gets wrong: ...
Bbrk24's user avatar
  • 9,127