45 lines
1.3 KiB
Plaintext
45 lines
1.3 KiB
Plaintext
<SyntaxDefinition name="LEX" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
|
|
<Color name="Comment" foreground="#7A987A" />
|
|
<Color name="String" foreground="#C0BF86" />
|
|
<Color name="Digits" foreground="#6196BE" />
|
|
<Color name="Keyword" foreground="#66C2CF" />
|
|
<Color name="State" foreground="#A18DEF" fontWeight="bold"/>
|
|
|
|
<!-- This is the main ruleset. -->
|
|
<RuleSet>
|
|
|
|
<!-- Comments -->
|
|
<Span color="Comment" begin="//" />
|
|
<Span color="Comment" multiline="true" begin="/\*" end="\*/" />
|
|
|
|
<Rule color="State">
|
|
<\s*((\w+(\s*,\s*\w+)*|\*)|\*)\s*>
|
|
</Rule>
|
|
|
|
<!-- Strings -->
|
|
<Span color="String">
|
|
<Begin>"</Begin>
|
|
<End>"</End>
|
|
<RuleSet>
|
|
<!-- nested span for escape sequences -->
|
|
<Span begin="\\" end="." />
|
|
</RuleSet>
|
|
</Span>
|
|
|
|
<!-- Option -->
|
|
<Rule fontWeight="bold" color="Keyword">
|
|
^%\S+
|
|
</Rule>
|
|
|
|
<!-- Digits -->
|
|
<Rule color="Digits">
|
|
\b0[xX][0-9a-fA-F]+ # hex number
|
|
| \b
|
|
( \d+(\.[0-9]+)? #number with optional floating point
|
|
| \.[0-9]+ #or just starting with floating point
|
|
)
|
|
([eE][+-]?[0-9]+)? # optional exponent
|
|
</Rule>
|
|
|
|
</RuleSet>
|
|
</SyntaxDefinition> |