mirror of
https://github.com/alecthomas/chroma.git
synced 2025-03-19 21:10:15 +02:00
Fix attributes and <, > in Odin Lexer (#803)
This commit is contained in:
parent
e1e698df6d
commit
b8c853d742
lexers
@ -51,7 +51,7 @@
|
||||
<rule pattern = "\#[a-zA-Z_]+\b">
|
||||
<token type = "NameDecorator"/>
|
||||
</rule>
|
||||
<rule pattern = "\@\(?[a-zA-Z_]+\b\s*(=\s*"?[0-9a-zA-Z_.]+"?)?\)?">
|
||||
<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 = ""(\\\\|\\"|[^"])*"" >
|
||||
<token type = "LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern = "(<<=|>>=|<<|>>|<=|>=|&=|&|\+=|-=|\*=|/=|%=|\||\^|=|&&|\|\||--|->|=|==|!=|:=|:|::|\.\.\<|\.\.=|[+\-*/%&])" >
|
||||
<rule pattern = "(<<=|>>=|<<|>>|<=|>=|&=|&|\+=|-=|\*=|/=|%=|\||\^|=|&&|\|\||--|->|=|==|!=|:=|:|::|\.\.\<|\.\.=|[<>+\-*/%&])" >
|
||||
<token type = "Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[{}()\[\],.;]">
|
||||
|
2
lexers/testdata/odin.actual
vendored
2
lexers/testdata/odin.actual
vendored
@ -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)
|
||||
}
|
||||
|
5
lexers/testdata/odin.expected
vendored
5
lexers/testdata/odin.expected
vendored
@ -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":":="},
|
||||
|
Loading…
x
Reference in New Issue
Block a user