1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-03-19 21:10:15 +02:00

Fix attributes and <, > in Odin Lexer ()

This commit is contained in:
Ian Simonson 2023-07-20 17:26:33 -07:00 committed by GitHub
parent e1e698df6d
commit b8c853d742
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions
lexers

@ -51,7 +51,7 @@
<rule pattern = "\#[a-zA-Z_]+\b">
<token type = "NameDecorator"/>
</rule>
<rule pattern = "\@\(?[a-zA-Z_]+\b\s*(=\s*&quot;?[0-9a-zA-Z_.]+&quot;?)?\)?">
<rule pattern = "\@(\([a-zA-Z_]+\b\s*.*\)|\(?[a-zA-Z_]+\)?)">
<token type = "NameAttribute"/>
</rule>
<rule pattern="[a-zA-Z_]\w*">
@ -102,7 +102,7 @@
<rule pattern = "&quot;(\\\\|\\&quot;|[^&quot;])*&quot;" >
<token type = "LiteralString"/>
</rule>
<rule pattern = "(&lt;&lt;=|&gt;&gt;=|&lt;&lt;|&gt;&gt;|&lt;=|&gt;=|&amp;=|&amp;|\+=|-=|\*=|/=|%=|\||\^|=|&amp;&amp;|\|\||--|-&gt;|=|==|!=|:=|:|::|\.\.\&lt;|\.\.=|[+\-*/%&amp;])" >
<rule pattern = "(&lt;&lt;=|&gt;&gt;=|&lt;&lt;|&gt;&gt;|&lt;=|&gt;=|&amp;=|&amp;|\+=|-=|\*=|/=|%=|\||\^|=|&amp;&amp;|\|\||--|-&gt;|=|==|!=|:=|:|::|\.\.\&lt;|\.\.=|[&lt;&gt;+\-*/%&amp;])" >
<token type = "Operator"/>
</rule>
<rule pattern="[{}()\[\],.;]">

@ -73,7 +73,7 @@ a_test_proc :: proc(t: ^testing.T) {
testing.errnof("a format: %s", value)
}
@(disable = ODIN_DEBUG)
@(disable = LOG_LEVEL >= .Debug)
debug_thing :: proc(x, y, z: int) {
fmt.println(x, y, z)
}

@ -390,7 +390,7 @@
{"type":"TextWhitespace","value":"\n"},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"NameAttribute","value":"@(disable = ODIN_DEBUG)"},
{"type":"NameAttribute","value":"@(disable = LOG_LEVEL \u003e= .Debug)"},
{"type":"TextWhitespace","value":"\n"},
{"type":"Name","value":"debug_thing"},
{"type":"TextWhitespace","value":" "},
@ -427,7 +427,8 @@
{"type":"TextWhitespace","value":"\n"},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"NameAttribute","value":"@private\n"},
{"type":"NameAttribute","value":"@private"},
{"type":"TextWhitespace","value":"\n"},
{"type":"Name","value":"program"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":":="},