1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-03-17 20:58:08 +02:00

Add Odin lexer (#802)

* Add Odin lexer

Adds the odin.xml rules for a lexer along with odin.actual and
odin.expected

Should handle the majority of Odin syntax well enough including nested comments.
However for now I have just left attributes as one token rather than sub-parsing
the @(x = y) to be multiple tokens

* Revert hlsl, natural, and vhs.expected back to master

These upated when I was generating odin.expected. I am
not sure if it is better to update these as well or leave it
so I figured I would leave for now

* Add the sized bool types and all the big/little endian int types

Odin has a number of other built in integer types that are not
in most other languages. Make sure those are included
This commit is contained in:
Ian Simonson 2023-07-19 14:51:54 -07:00 committed by GitHub
parent b8ad4d6cab
commit e1e698df6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 647 additions and 0 deletions

113
lexers/embedded/odin.xml Normal file
View File

@ -0,0 +1,113 @@
<lexer>
<config>
<name>Odin</name>
<alias>odin</alias>
<filename>*.odin</filename>
<mime_type>text/odin</mime_type>
</config>
<rules>
<state name="NestedComment">
<rule pattern = "/[*]">
<token type = "CommentMultiline"/>
<push/>
</rule>
<rule pattern = "[*]/">
<token type = "CommentMultiline"/>
<pop depth = "1"/>
</rule>
<rule pattern = "[\s\S]">
<token type = "CommentMultiline"/>
</rule>
</state>
<state name="root">
<rule pattern = "\n">
<token type = "TextWhitespace"/>
</rule>
<rule pattern = "\s+">
<token type = "TextWhitespace"/>
</rule>
<rule pattern = "//.*?\n">
<token type = "CommentSingle"/>
</rule>
<rule pattern = "/[*]">
<token type = "CommentMultiline"/>
<push state="NestedComment"/>
</rule>
<rule pattern = "(import|package)\b">
<token type = "KeywordNamespace"/>
</rule>
<rule pattern = "(proc|struct|map|enum|union)\b">
<token type = "KeywordDeclaration"/>
</rule>
<rule pattern = "(asm|auto_cast|bit_set|break|case|cast|context|continue|defer|distinct|do|dynamic|else|enum|fallthrough|for|foreign|if|import|in|map|not_in|or_else|or_return|package|proc|return|struct|switch|transmute|typeid|union|using|when|where|panic|real|imag|len|cap|append|copy|delete|new|make|clearpanic|real|imag|len|cap|append|copy|delete|new|make|clear)\b">
<token type = "Keyword"/>
</rule>
<rule pattern = "(true|false|nil)\b">
<token type = "KeywordConstant"/>
</rule>
<rule pattern = "(uint|u8|u16|u32|u64|int|i8|i16|i32|i64|i16le|i32le|i64le|i128le|u16le|u32le|u64le|u128le|i16be|i32be|i64be|i128be|u16be|u32be|u64be|u128be|f16|f32|f64|complex32|complex64|complex128|quaternion64|quaternion128|quaternion256|byte|rune|string|cstring|typeid|any|bool|b8|b16|b32|b64|uintptr|rawptr)\b">
<token type = "KeywordType"/>
</rule>
<rule pattern = "\#[a-zA-Z_]+\b">
<token type = "NameDecorator"/>
</rule>
<rule pattern = "\@\(?[a-zA-Z_]+\b\s*(=\s*&quot;?[0-9a-zA-Z_.]+&quot;?)?\)?">
<token type = "NameAttribute"/>
</rule>
<rule pattern="[a-zA-Z_]\w*">
<token type="Name"/>
</rule>
<rule pattern="([a-zA-Z_]\w*)(\s*)(\()">
<token type="NameFunction"/>
</rule>
<rule pattern="[^\W\d]\w*">
<token type="NameOther"/>
</rule>
<rule pattern = "\d+i">
<token type = "LiteralNumber"/>
</rule>
<rule pattern = "\d+\.\d*([Ee][-+]\d+)?i">
<token type = "LiteralNumber"/>
</rule>
<rule pattern = "\.\d+([Ee][-+]\d+)?i">
<token type = "LiteralNumber"/>
</rule>
<rule pattern = "\d+[Ee][-+]\d+i">
<token type = "LiteralNumber"/>
</rule>
<rule pattern = "\d+(\.\d+[eE][+\-]?\d+|\.\d*|[eE][+\-]?\d+)">
<token type = "LiteralNumberFloat"/>
</rule>
<rule pattern = "\.\d+([eE][+\-]?\d+)?">
<token type = "LiteralNumberFloat"/>
</rule>
<rule pattern = "0o[0-7]+">
<token type = "LiteralNumberOct"/>
</rule>
<rule pattern = "0x[0-9a-fA-F_]+">
<token type = "LiteralNumberHex"/>
</rule>
<rule pattern = "0b[01_]+">
<token type = "LiteralNumberBin"/>
</rule>
<rule pattern = "(0|[1-9][0-9_]*)">
<token type = "LiteralNumberInteger"/>
</rule>
<rule pattern = "'(\\['&quot;\\abfnrtv]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|[^\\])'" >
<token type = "LiteralStringChar"/>
</rule>
<rule pattern = "(`)([^`]*)(`)" >
<token type = "LiteralString"/>
</rule>
<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;])" >
<token type = "Operator"/>
</rule>
<rule pattern="[{}()\[\],.;]">
<token type="Punctuation"/>
</rule>
</state>
</rules>
</lexer>

90
lexers/testdata/odin.actual vendored Normal file
View File

@ -0,0 +1,90 @@
package main
import "core:fmt"
/*
some comments in odin can
/* be nested! */
and it should still work
*/
Data :: struct {
c: complex64,
q: quaternion256,
}
/* some other comment */
E :: enum(u32) {
First,
Second,
Third,
}
E_Set :: distinct bit_set[E; u32]
foo_int :: proc(x: int) -> bool {
return false
}
foo_float :: proc(f: f32) -> bool {
return true
}
foo_en :: proc(e: E) -> bool {
return e == .Third
}
foo :: proc{foo_int, foo_float, foo_en}
SOME_CONSTANT :: #config(COMMAND_LINE_ARG, 3)
main :: proc() {
loc := #caller_location
m: map[string]struct{}
da: [dynamic]f64
len(da)
cap(da)
foo(32)
#panic("oof")
y := &da
y^ = make([dynamic]f64, 100)
defer delete(da)
x := []int{1, 2, 3, 4}
for v, i in x {
fmt.println(i, "-", v)
}
z := E_Set{.First, .Second}
z2 := E_Set{.Third}
assert(z | z2 == {.First, .Second, .Third})
}
@(test)
a_test_proc :: proc(t: ^testing.T) {
value: int
value = 3
testing.errnof("a format: %s", value)
}
@(disable = ODIN_DEBUG)
debug_thing :: proc(x, y, z: int) {
fmt.println(x, y, z)
}
@private
program := `
foo :: proc() {
fmt.println("hellope!")
}
`
@(private = "file")
pkg: int

444
lexers/testdata/odin.expected vendored Normal file
View File

@ -0,0 +1,444 @@
[
{"type":"KeywordNamespace","value":"package"},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"main"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"KeywordNamespace","value":"import"},
{"type":"TextWhitespace","value":" "},
{"type":"LiteralString","value":"\"core:fmt\""},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"CommentMultiline","value":"/*\nsome comments in odin can\n /* be nested! */\nand it should still work\n*/"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"Name","value":"Data"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"::"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordDeclaration","value":"struct"},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"{"},
{"type":"TextWhitespace","value":"\n\t"},
{"type":"Name","value":"c"},
{"type":"Operator","value":":"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordType","value":"complex64"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":"\n\t"},
{"type":"Name","value":"q"},
{"type":"Operator","value":":"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordType","value":"quaternion256"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":"\n"},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"CommentMultiline","value":"/* some other comment */"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"Name","value":"E"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"::"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordDeclaration","value":"enum"},
{"type":"Punctuation","value":"("},
{"type":"KeywordType","value":"u32"},
{"type":"Punctuation","value":")"},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"{"},
{"type":"TextWhitespace","value":"\n\t"},
{"type":"Name","value":"First"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":"\n\t"},
{"type":"Name","value":"Second"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":"\n\t"},
{"type":"Name","value":"Third"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":"\n"},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"Name","value":"E_Set"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"::"},
{"type":"TextWhitespace","value":" "},
{"type":"Keyword","value":"distinct"},
{"type":"TextWhitespace","value":" "},
{"type":"Keyword","value":"bit_set"},
{"type":"Punctuation","value":"["},
{"type":"Name","value":"E"},
{"type":"Punctuation","value":";"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordType","value":"u32"},
{"type":"Punctuation","value":"]"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"Name","value":"foo_int"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"::"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordDeclaration","value":"proc"},
{"type":"Punctuation","value":"("},
{"type":"Name","value":"x"},
{"type":"Operator","value":":"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordType","value":"int"},
{"type":"Punctuation","value":")"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"-\u003e"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordType","value":"bool"},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"{"},
{"type":"TextWhitespace","value":"\n\t"},
{"type":"Keyword","value":"return"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordConstant","value":"false"},
{"type":"TextWhitespace","value":"\n"},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"Name","value":"foo_float"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"::"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordDeclaration","value":"proc"},
{"type":"Punctuation","value":"("},
{"type":"Name","value":"f"},
{"type":"Operator","value":":"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordType","value":"f32"},
{"type":"Punctuation","value":")"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"-\u003e"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordType","value":"bool"},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"{"},
{"type":"TextWhitespace","value":"\n\t"},
{"type":"Keyword","value":"return"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordConstant","value":"true"},
{"type":"TextWhitespace","value":"\n"},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"Name","value":"foo_en"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"::"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordDeclaration","value":"proc"},
{"type":"Punctuation","value":"("},
{"type":"Name","value":"e"},
{"type":"Operator","value":":"},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"E"},
{"type":"Punctuation","value":")"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"-\u003e"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordType","value":"bool"},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"{"},
{"type":"TextWhitespace","value":"\n\t"},
{"type":"Keyword","value":"return"},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"e"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"=="},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"."},
{"type":"Name","value":"Third"},
{"type":"TextWhitespace","value":"\n"},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"Name","value":"foo"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"::"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordDeclaration","value":"proc"},
{"type":"Punctuation","value":"{"},
{"type":"Name","value":"foo_int"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"foo_float"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"foo_en"},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"Name","value":"SOME_CONSTANT"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"::"},
{"type":"TextWhitespace","value":" "},
{"type":"NameDecorator","value":"#config"},
{"type":"Punctuation","value":"("},
{"type":"Name","value":"COMMAND_LINE_ARG"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"NameOther","value":"3"},
{"type":"Punctuation","value":")"},
{"type":"TextWhitespace","value":"\n"},
{"type":"Name","value":"main"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"::"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordDeclaration","value":"proc"},
{"type":"Punctuation","value":"()"},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"{"},
{"type":"TextWhitespace","value":"\n\t"},
{"type":"Name","value":"loc"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":":="},
{"type":"TextWhitespace","value":" "},
{"type":"NameDecorator","value":"#caller_location"},
{"type":"TextWhitespace","value":"\n\n\t"},
{"type":"Name","value":"m"},
{"type":"Operator","value":":"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordDeclaration","value":"map"},
{"type":"Punctuation","value":"["},
{"type":"KeywordType","value":"string"},
{"type":"Punctuation","value":"]"},
{"type":"KeywordDeclaration","value":"struct"},
{"type":"Punctuation","value":"{}"},
{"type":"TextWhitespace","value":"\n\t"},
{"type":"Name","value":"da"},
{"type":"Operator","value":":"},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"["},
{"type":"Keyword","value":"dynamic"},
{"type":"Punctuation","value":"]"},
{"type":"KeywordType","value":"f64"},
{"type":"TextWhitespace","value":"\n\n\t"},
{"type":"Keyword","value":"len"},
{"type":"Punctuation","value":"("},
{"type":"Name","value":"da"},
{"type":"Punctuation","value":")"},
{"type":"TextWhitespace","value":"\n\t"},
{"type":"Keyword","value":"cap"},
{"type":"Punctuation","value":"("},
{"type":"Name","value":"da"},
{"type":"Punctuation","value":")"},
{"type":"TextWhitespace","value":"\n\n\t"},
{"type":"Name","value":"foo"},
{"type":"Punctuation","value":"("},
{"type":"NameOther","value":"32"},
{"type":"Punctuation","value":")"},
{"type":"TextWhitespace","value":"\n\n\t"},
{"type":"NameDecorator","value":"#panic"},
{"type":"Punctuation","value":"("},
{"type":"LiteralString","value":"\"oof\""},
{"type":"Punctuation","value":")"},
{"type":"TextWhitespace","value":"\n\n\t"},
{"type":"Name","value":"y"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":":="},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"\u0026"},
{"type":"Name","value":"da"},
{"type":"TextWhitespace","value":"\n\t"},
{"type":"Name","value":"y"},
{"type":"Operator","value":"^"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"="},
{"type":"TextWhitespace","value":" "},
{"type":"Keyword","value":"make"},
{"type":"Punctuation","value":"(["},
{"type":"Keyword","value":"dynamic"},
{"type":"Punctuation","value":"]"},
{"type":"KeywordType","value":"f64"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"NameOther","value":"100"},
{"type":"Punctuation","value":")"},
{"type":"TextWhitespace","value":"\n\t"},
{"type":"Keyword","value":"defer"},
{"type":"TextWhitespace","value":" "},
{"type":"Keyword","value":"delete"},
{"type":"Punctuation","value":"("},
{"type":"Name","value":"da"},
{"type":"Punctuation","value":")"},
{"type":"TextWhitespace","value":"\n\n\t"},
{"type":"Name","value":"x"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":":="},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"[]"},
{"type":"KeywordType","value":"int"},
{"type":"Punctuation","value":"{"},
{"type":"NameOther","value":"1"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"NameOther","value":"2"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"NameOther","value":"3"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"NameOther","value":"4"},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n\t"},
{"type":"Keyword","value":"for"},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"v"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"i"},
{"type":"TextWhitespace","value":" "},
{"type":"Keyword","value":"in"},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"x"},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"{"},
{"type":"TextWhitespace","value":"\n\t\t"},
{"type":"Name","value":"fmt"},
{"type":"Punctuation","value":"."},
{"type":"Name","value":"println"},
{"type":"Punctuation","value":"("},
{"type":"Name","value":"i"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"LiteralString","value":"\"-\""},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"v"},
{"type":"Punctuation","value":")"},
{"type":"TextWhitespace","value":"\n\t"},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n\n\t"},
{"type":"Name","value":"z"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":":="},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"E_Set"},
{"type":"Punctuation","value":"{."},
{"type":"Name","value":"First"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"."},
{"type":"Name","value":"Second"},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n\t"},
{"type":"Name","value":"z2"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":":="},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"E_Set"},
{"type":"Punctuation","value":"{."},
{"type":"Name","value":"Third"},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n\n\t"},
{"type":"Name","value":"assert"},
{"type":"Punctuation","value":"("},
{"type":"Name","value":"z"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"|"},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"z2"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"=="},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"{."},
{"type":"Name","value":"First"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"."},
{"type":"Name","value":"Second"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"."},
{"type":"Name","value":"Third"},
{"type":"Punctuation","value":"})"},
{"type":"TextWhitespace","value":"\n"},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"NameAttribute","value":"@(test)"},
{"type":"TextWhitespace","value":"\n"},
{"type":"Name","value":"a_test_proc"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"::"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordDeclaration","value":"proc"},
{"type":"Punctuation","value":"("},
{"type":"Name","value":"t"},
{"type":"Operator","value":":"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"^"},
{"type":"Name","value":"testing"},
{"type":"Punctuation","value":"."},
{"type":"Name","value":"T"},
{"type":"Punctuation","value":")"},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"{"},
{"type":"TextWhitespace","value":"\n\t"},
{"type":"Name","value":"value"},
{"type":"Operator","value":":"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordType","value":"int"},
{"type":"TextWhitespace","value":"\n\t"},
{"type":"Name","value":"value"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"="},
{"type":"TextWhitespace","value":" "},
{"type":"NameOther","value":"3"},
{"type":"TextWhitespace","value":"\n\t"},
{"type":"Name","value":"testing"},
{"type":"Punctuation","value":"."},
{"type":"Name","value":"errnof"},
{"type":"Punctuation","value":"("},
{"type":"LiteralString","value":"\"a format: %s\""},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"value"},
{"type":"Punctuation","value":")"},
{"type":"TextWhitespace","value":"\n"},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"NameAttribute","value":"@(disable = ODIN_DEBUG)"},
{"type":"TextWhitespace","value":"\n"},
{"type":"Name","value":"debug_thing"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"::"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordDeclaration","value":"proc"},
{"type":"Punctuation","value":"("},
{"type":"Name","value":"x"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"y"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"z"},
{"type":"Operator","value":":"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordType","value":"int"},
{"type":"Punctuation","value":")"},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"{"},
{"type":"TextWhitespace","value":"\n\t"},
{"type":"Name","value":"fmt"},
{"type":"Punctuation","value":"."},
{"type":"Name","value":"println"},
{"type":"Punctuation","value":"("},
{"type":"Name","value":"x"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"y"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"z"},
{"type":"Punctuation","value":")"},
{"type":"TextWhitespace","value":"\n"},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"NameAttribute","value":"@private\n"},
{"type":"Name","value":"program"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":":="},
{"type":"TextWhitespace","value":" "},
{"type":"LiteralString","value":"`\nfoo :: proc() {\n\tfmt.println(\"hellope!\")\n}\n`"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"NameAttribute","value":"@(private = \"file\")"},
{"type":"TextWhitespace","value":"\n"},
{"type":"Name","value":"pkg"},
{"type":"Operator","value":":"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordType","value":"int"},
{"type":"TextWhitespace","value":"\n\n"}
]