From 1317a11d3f980d2f82ce7de1b257e2869c852988 Mon Sep 17 00:00:00 2001 From: Ian Simonson Date: Tue, 18 Jul 2023 18:13:11 -0700 Subject: [PATCH 1/3] 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 --- lexers/embedded/odin.xml | 113 ++++++++ lexers/testdata/hlsl.expected | 80 +++--- lexers/testdata/natural.expected | 10 +- lexers/testdata/odin.actual | 90 +++++++ lexers/testdata/odin.expected | 442 +++++++++++++++++++++++++++++++ lexers/testdata/vhs.expected | 104 ++++---- 6 files changed, 739 insertions(+), 100 deletions(-) create mode 100644 lexers/embedded/odin.xml create mode 100644 lexers/testdata/odin.actual create mode 100644 lexers/testdata/odin.expected diff --git a/lexers/embedded/odin.xml b/lexers/embedded/odin.xml new file mode 100644 index 000000000..21fdd22ab --- /dev/null +++ b/lexers/embedded/odin.xml @@ -0,0 +1,113 @@ + + + Odin + odin + *.odin + text/odin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lexers/testdata/hlsl.expected b/lexers/testdata/hlsl.expected index dcd0491e5..5a296ea26 100644 --- a/lexers/testdata/hlsl.expected +++ b/lexers/testdata/hlsl.expected @@ -1,40 +1,40 @@ -[ - {"type":"KeywordType","value":"float4"}, - {"type":"Text","value":" "}, - {"type":"Name","value":"vertex"}, - {"type":"Punctuation","value":"("}, - {"type":"KeywordType","value":"float3"}, - {"type":"Text","value":" "}, - {"type":"Name","value":"position"}, - {"type":"Punctuation","value":")"}, - {"type":"Text","value":" "}, - {"type":"Punctuation","value":"{"}, - {"type":"Text","value":"\n "}, - {"type":"Keyword","value":"return"}, - {"type":"Text","value":" "}, - {"type":"NameBuiltin","value":"mul"}, - {"type":"Punctuation","value":"("}, - {"type":"Name","value":"projection"}, - {"type":"Punctuation","value":","}, - {"type":"Text","value":" "}, - {"type":"NameBuiltin","value":"mul"}, - {"type":"Punctuation","value":"("}, - {"type":"Name","value":"view"}, - {"type":"Punctuation","value":","}, - {"type":"Text","value":" "}, - {"type":"NameBuiltin","value":"mul"}, - {"type":"Punctuation","value":"("}, - {"type":"Name","value":"model"}, - {"type":"Punctuation","value":","}, - {"type":"Text","value":" "}, - {"type":"KeywordType","value":"float4"}, - {"type":"Punctuation","value":"("}, - {"type":"Name","value":"position"}, - {"type":"Punctuation","value":","}, - {"type":"Text","value":" "}, - {"type":"LiteralNumberFloat","value":"1.0"}, - {"type":"Punctuation","value":"))));"}, - {"type":"Text","value":"\n"}, - {"type":"Punctuation","value":"}"}, - {"type":"Text","value":"\n"} -] \ No newline at end of file +[ + {"type":"KeywordType","value":"float4"}, + {"type":"Text","value":" "}, + {"type":"Name","value":"vertex"}, + {"type":"Punctuation","value":"("}, + {"type":"KeywordType","value":"float3"}, + {"type":"Text","value":" "}, + {"type":"Name","value":"position"}, + {"type":"Punctuation","value":")"}, + {"type":"Text","value":" "}, + {"type":"Punctuation","value":"{"}, + {"type":"Text","value":"\n "}, + {"type":"Keyword","value":"return"}, + {"type":"Text","value":" "}, + {"type":"NameBuiltin","value":"mul"}, + {"type":"Punctuation","value":"("}, + {"type":"Name","value":"projection"}, + {"type":"Punctuation","value":","}, + {"type":"Text","value":" "}, + {"type":"NameBuiltin","value":"mul"}, + {"type":"Punctuation","value":"("}, + {"type":"Name","value":"view"}, + {"type":"Punctuation","value":","}, + {"type":"Text","value":" "}, + {"type":"NameBuiltin","value":"mul"}, + {"type":"Punctuation","value":"("}, + {"type":"Name","value":"model"}, + {"type":"Punctuation","value":","}, + {"type":"Text","value":" "}, + {"type":"KeywordType","value":"float4"}, + {"type":"Punctuation","value":"("}, + {"type":"Name","value":"position"}, + {"type":"Punctuation","value":","}, + {"type":"Text","value":" "}, + {"type":"LiteralNumberFloat","value":"1.0"}, + {"type":"Punctuation","value":"))));"}, + {"type":"Text","value":"\n"}, + {"type":"Punctuation","value":"}"}, + {"type":"Text","value":"\n"} +] diff --git a/lexers/testdata/natural.expected b/lexers/testdata/natural.expected index 7f1bc807d..0e88688ae 100644 --- a/lexers/testdata/natural.expected +++ b/lexers/testdata/natural.expected @@ -16,9 +16,9 @@ {"type":"Other","value":"(A10)"}, {"type":"Text","value":" "}, {"type":"Keyword","value":"INIT"}, - {"type":"Operator","value":"<"}, + {"type":"Operator","value":"\u003c"}, {"type":"LiteralStringSingle","value":"'Hello'"}, - {"type":"Operator","value":">"}, + {"type":"Operator","value":"\u003e"}, {"type":"Text","value":"\n"}, {"type":"LiteralNumberInteger","value":"1"}, {"type":"Text","value":" "}, @@ -48,14 +48,12 @@ {"type":"Text","value":" "}, {"type":"NameVariable","value":"#VAR-NAME-1"}, {"type":"Text","value":"\n\n"}, - {"type":"Keyword","value":"DEFINE"}, {"type":"Text","value":" "}, {"type":"Keyword","value":"SUBROUTINE"}, {"type":"Text","value":" "}, {"type":"NameFunction","value":"MY-SUBROUTINE"}, {"type":"Text","value":"\n"}, - {"type":"Keyword","value":"FOR"}, {"type":"Text","value":" "}, {"type":"NameVariable","value":"#I"}, @@ -68,17 +66,13 @@ {"type":"Text","value":" "}, {"type":"LiteralNumberInteger","value":"10"}, {"type":"Text","value":"\n"}, - {"type":"Keyword","value":"ESCAPE"}, {"type":"Text","value":" "}, {"type":"Keyword","value":"MODULE"}, {"type":"Text","value":"\n"}, - {"type":"Keyword","value":"END-FOR"}, {"type":"Text","value":"\n"}, - {"type":"Keyword","value":"END-SUBROUTINE"}, - {"type":"Text","value":"\n\n"}, {"type":"Keyword","value":"END"}, {"type":"Text","value":"\n\n"} diff --git a/lexers/testdata/odin.actual b/lexers/testdata/odin.actual new file mode 100644 index 000000000..413619356 --- /dev/null +++ b/lexers/testdata/odin.actual @@ -0,0 +1,90 @@ +package main + +import "core:fmt" + +/* +some comments in odin can + /* be nested! */ +and it should still work +*/ + +Data :: struct { + c: complex, + q: quaternion, +} + +/* 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 + diff --git a/lexers/testdata/odin.expected b/lexers/testdata/odin.expected new file mode 100644 index 000000000..294134578 --- /dev/null +++ b/lexers/testdata/odin.expected @@ -0,0 +1,442 @@ +[ + {"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\t/* 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":"complex"}, + {"type":"Punctuation","value":","}, + {"type":"TextWhitespace","value":"\n\t"}, + {"type":"Name","value":"q"}, + {"type":"Operator","value":":"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordType","value":"quaternion"}, + {"type":"Punctuation","value":","}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Punctuation","value":"}"}, + {"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"} +] diff --git a/lexers/testdata/vhs.expected b/lexers/testdata/vhs.expected index 3c305efcb..b91cf5880 100644 --- a/lexers/testdata/vhs.expected +++ b/lexers/testdata/vhs.expected @@ -1,54 +1,54 @@ [ - {"type":"Comment","value":"# Where should we write the GIF?"}, - {"type":"TextWhitespace","value":"\n"}, - {"type":"Keyword","value":"Output"}, - {"type":"TextWhitespace","value":" "}, - {"type":"LiteralString","value":"demo.gif"}, - {"type":"TextWhitespace","value":"\n\n"}, - {"type":"Comment","value":"# Set up a 1200x600 terminal with 46px font."}, - {"type":"TextWhitespace","value":"\n"}, - {"type":"Keyword","value":"Set"}, - {"type":"TextWhitespace","value":" "}, - {"type":"NameBuiltin","value":"FontSize"}, - {"type":"TextWhitespace","value":" "}, - {"type":"LiteralNumber","value":"46"}, - {"type":"TextWhitespace","value":"\n"}, - {"type":"Keyword","value":"Set"}, - {"type":"TextWhitespace","value":" "}, - {"type":"NameBuiltin","value":"Width"}, - {"type":"TextWhitespace","value":" "}, - {"type":"LiteralNumber","value":"1200"}, - {"type":"TextWhitespace","value":"\n"}, - {"type":"Keyword","value":"Set"}, - {"type":"TextWhitespace","value":" "}, - {"type":"NameBuiltin","value":"Height"}, - {"type":"TextWhitespace","value":" "}, - {"type":"LiteralNumber","value":"600"}, - {"type":"TextWhitespace","value":"\n\n"}, - {"type":"Comment","value":"# Type a command in the terminal."}, - {"type":"TextWhitespace","value":"\n"}, - {"type":"Keyword","value":"Type"}, - {"type":"Punctuation", "value": "@"}, - {"type":"LiteralNumber", "value": "100"}, - {"type":"Text", "value": "ms"}, - {"type":"TextWhitespace","value":" "}, - {"type":"LiteralStringDouble","value":"\"echo 'Welcome to VHS!'\""}, - {"type":"TextWhitespace","value":"\n\n"}, - {"type":"Comment","value":"# Pause for dramatic effect..."}, - {"type":"TextWhitespace","value":"\n"}, - {"type":"Keyword","value":"Sleep"}, - {"type":"TextWhitespace","value":" "}, - {"type":"LiteralNumber","value":"500"}, - {"type":"Text","value":"ms"}, - {"type":"TextWhitespace","value":"\n\n"}, - {"type":"Comment","value":"# Run the command by pressing enter."}, - {"type":"TextWhitespace","value":"\n"}, - {"type":"Keyword","value":"Enter"}, - {"type":"TextWhitespace","value":"\n\n"}, - {"type":"Comment","value":"# Admire the output for a bit."}, - {"type":"TextWhitespace","value":"\n"}, - {"type":"Keyword","value":"Sleep"}, - {"type":"TextWhitespace","value":" "}, - {"type":"LiteralNumber","value":"5"}, - {"type":"Text","value":"s"} + {"type":"Comment","value":"# Where should we write the GIF?"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"Output"}, + {"type":"TextWhitespace","value":" "}, + {"type":"LiteralString","value":"demo.gif"}, + {"type":"TextWhitespace","value":"\n\n"}, + {"type":"Comment","value":"# Set up a 1200x600 terminal with 46px font."}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"Set"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"FontSize"}, + {"type":"TextWhitespace","value":" "}, + {"type":"LiteralNumber","value":"46"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"Set"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"Width"}, + {"type":"TextWhitespace","value":" "}, + {"type":"LiteralNumber","value":"1200"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"Set"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"Height"}, + {"type":"TextWhitespace","value":" "}, + {"type":"LiteralNumber","value":"600"}, + {"type":"TextWhitespace","value":"\n\n"}, + {"type":"Comment","value":"# Type a command in the terminal."}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"Type"}, + {"type":"Punctuation","value":"@"}, + {"type":"LiteralNumber","value":"100"}, + {"type":"Text","value":"ms"}, + {"type":"TextWhitespace","value":" "}, + {"type":"LiteralStringDouble","value":"\"echo 'Welcome to VHS!'\""}, + {"type":"TextWhitespace","value":"\n\n"}, + {"type":"Comment","value":"# Pause for dramatic effect..."}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"Sleep"}, + {"type":"TextWhitespace","value":" "}, + {"type":"LiteralNumber","value":"500"}, + {"type":"Text","value":"ms"}, + {"type":"TextWhitespace","value":"\n\n"}, + {"type":"Comment","value":"# Run the command by pressing enter."}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"Enter"}, + {"type":"TextWhitespace","value":"\n\n"}, + {"type":"Comment","value":"# Admire the output for a bit."}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"Sleep"}, + {"type":"TextWhitespace","value":" "}, + {"type":"LiteralNumber","value":"5"}, + {"type":"Text","value":"s"} ] From 9ff006f26f0b88eeb6dedea075827f9c70d06b3c Mon Sep 17 00:00:00 2001 From: Ian Simonson Date: Wed, 19 Jul 2023 08:42:59 -0700 Subject: [PATCH 2/3] 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 --- lexers/testdata/hlsl.expected | 80 ++++++++++++------------ lexers/testdata/natural.expected | 10 ++- lexers/testdata/vhs.expected | 104 +++++++++++++++---------------- 3 files changed, 100 insertions(+), 94 deletions(-) diff --git a/lexers/testdata/hlsl.expected b/lexers/testdata/hlsl.expected index 5a296ea26..dcd0491e5 100644 --- a/lexers/testdata/hlsl.expected +++ b/lexers/testdata/hlsl.expected @@ -1,40 +1,40 @@ -[ - {"type":"KeywordType","value":"float4"}, - {"type":"Text","value":" "}, - {"type":"Name","value":"vertex"}, - {"type":"Punctuation","value":"("}, - {"type":"KeywordType","value":"float3"}, - {"type":"Text","value":" "}, - {"type":"Name","value":"position"}, - {"type":"Punctuation","value":")"}, - {"type":"Text","value":" "}, - {"type":"Punctuation","value":"{"}, - {"type":"Text","value":"\n "}, - {"type":"Keyword","value":"return"}, - {"type":"Text","value":" "}, - {"type":"NameBuiltin","value":"mul"}, - {"type":"Punctuation","value":"("}, - {"type":"Name","value":"projection"}, - {"type":"Punctuation","value":","}, - {"type":"Text","value":" "}, - {"type":"NameBuiltin","value":"mul"}, - {"type":"Punctuation","value":"("}, - {"type":"Name","value":"view"}, - {"type":"Punctuation","value":","}, - {"type":"Text","value":" "}, - {"type":"NameBuiltin","value":"mul"}, - {"type":"Punctuation","value":"("}, - {"type":"Name","value":"model"}, - {"type":"Punctuation","value":","}, - {"type":"Text","value":" "}, - {"type":"KeywordType","value":"float4"}, - {"type":"Punctuation","value":"("}, - {"type":"Name","value":"position"}, - {"type":"Punctuation","value":","}, - {"type":"Text","value":" "}, - {"type":"LiteralNumberFloat","value":"1.0"}, - {"type":"Punctuation","value":"))));"}, - {"type":"Text","value":"\n"}, - {"type":"Punctuation","value":"}"}, - {"type":"Text","value":"\n"} -] +[ + {"type":"KeywordType","value":"float4"}, + {"type":"Text","value":" "}, + {"type":"Name","value":"vertex"}, + {"type":"Punctuation","value":"("}, + {"type":"KeywordType","value":"float3"}, + {"type":"Text","value":" "}, + {"type":"Name","value":"position"}, + {"type":"Punctuation","value":")"}, + {"type":"Text","value":" "}, + {"type":"Punctuation","value":"{"}, + {"type":"Text","value":"\n "}, + {"type":"Keyword","value":"return"}, + {"type":"Text","value":" "}, + {"type":"NameBuiltin","value":"mul"}, + {"type":"Punctuation","value":"("}, + {"type":"Name","value":"projection"}, + {"type":"Punctuation","value":","}, + {"type":"Text","value":" "}, + {"type":"NameBuiltin","value":"mul"}, + {"type":"Punctuation","value":"("}, + {"type":"Name","value":"view"}, + {"type":"Punctuation","value":","}, + {"type":"Text","value":" "}, + {"type":"NameBuiltin","value":"mul"}, + {"type":"Punctuation","value":"("}, + {"type":"Name","value":"model"}, + {"type":"Punctuation","value":","}, + {"type":"Text","value":" "}, + {"type":"KeywordType","value":"float4"}, + {"type":"Punctuation","value":"("}, + {"type":"Name","value":"position"}, + {"type":"Punctuation","value":","}, + {"type":"Text","value":" "}, + {"type":"LiteralNumberFloat","value":"1.0"}, + {"type":"Punctuation","value":"))));"}, + {"type":"Text","value":"\n"}, + {"type":"Punctuation","value":"}"}, + {"type":"Text","value":"\n"} +] \ No newline at end of file diff --git a/lexers/testdata/natural.expected b/lexers/testdata/natural.expected index 0e88688ae..7f1bc807d 100644 --- a/lexers/testdata/natural.expected +++ b/lexers/testdata/natural.expected @@ -16,9 +16,9 @@ {"type":"Other","value":"(A10)"}, {"type":"Text","value":" "}, {"type":"Keyword","value":"INIT"}, - {"type":"Operator","value":"\u003c"}, + {"type":"Operator","value":"<"}, {"type":"LiteralStringSingle","value":"'Hello'"}, - {"type":"Operator","value":"\u003e"}, + {"type":"Operator","value":">"}, {"type":"Text","value":"\n"}, {"type":"LiteralNumberInteger","value":"1"}, {"type":"Text","value":" "}, @@ -48,12 +48,14 @@ {"type":"Text","value":" "}, {"type":"NameVariable","value":"#VAR-NAME-1"}, {"type":"Text","value":"\n\n"}, + {"type":"Keyword","value":"DEFINE"}, {"type":"Text","value":" "}, {"type":"Keyword","value":"SUBROUTINE"}, {"type":"Text","value":" "}, {"type":"NameFunction","value":"MY-SUBROUTINE"}, {"type":"Text","value":"\n"}, + {"type":"Keyword","value":"FOR"}, {"type":"Text","value":" "}, {"type":"NameVariable","value":"#I"}, @@ -66,13 +68,17 @@ {"type":"Text","value":" "}, {"type":"LiteralNumberInteger","value":"10"}, {"type":"Text","value":"\n"}, + {"type":"Keyword","value":"ESCAPE"}, {"type":"Text","value":" "}, {"type":"Keyword","value":"MODULE"}, {"type":"Text","value":"\n"}, + {"type":"Keyword","value":"END-FOR"}, {"type":"Text","value":"\n"}, + {"type":"Keyword","value":"END-SUBROUTINE"}, + {"type":"Text","value":"\n\n"}, {"type":"Keyword","value":"END"}, {"type":"Text","value":"\n\n"} diff --git a/lexers/testdata/vhs.expected b/lexers/testdata/vhs.expected index b91cf5880..3c305efcb 100644 --- a/lexers/testdata/vhs.expected +++ b/lexers/testdata/vhs.expected @@ -1,54 +1,54 @@ [ - {"type":"Comment","value":"# Where should we write the GIF?"}, - {"type":"TextWhitespace","value":"\n"}, - {"type":"Keyword","value":"Output"}, - {"type":"TextWhitespace","value":" "}, - {"type":"LiteralString","value":"demo.gif"}, - {"type":"TextWhitespace","value":"\n\n"}, - {"type":"Comment","value":"# Set up a 1200x600 terminal with 46px font."}, - {"type":"TextWhitespace","value":"\n"}, - {"type":"Keyword","value":"Set"}, - {"type":"TextWhitespace","value":" "}, - {"type":"NameBuiltin","value":"FontSize"}, - {"type":"TextWhitespace","value":" "}, - {"type":"LiteralNumber","value":"46"}, - {"type":"TextWhitespace","value":"\n"}, - {"type":"Keyword","value":"Set"}, - {"type":"TextWhitespace","value":" "}, - {"type":"NameBuiltin","value":"Width"}, - {"type":"TextWhitespace","value":" "}, - {"type":"LiteralNumber","value":"1200"}, - {"type":"TextWhitespace","value":"\n"}, - {"type":"Keyword","value":"Set"}, - {"type":"TextWhitespace","value":" "}, - {"type":"NameBuiltin","value":"Height"}, - {"type":"TextWhitespace","value":" "}, - {"type":"LiteralNumber","value":"600"}, - {"type":"TextWhitespace","value":"\n\n"}, - {"type":"Comment","value":"# Type a command in the terminal."}, - {"type":"TextWhitespace","value":"\n"}, - {"type":"Keyword","value":"Type"}, - {"type":"Punctuation","value":"@"}, - {"type":"LiteralNumber","value":"100"}, - {"type":"Text","value":"ms"}, - {"type":"TextWhitespace","value":" "}, - {"type":"LiteralStringDouble","value":"\"echo 'Welcome to VHS!'\""}, - {"type":"TextWhitespace","value":"\n\n"}, - {"type":"Comment","value":"# Pause for dramatic effect..."}, - {"type":"TextWhitespace","value":"\n"}, - {"type":"Keyword","value":"Sleep"}, - {"type":"TextWhitespace","value":" "}, - {"type":"LiteralNumber","value":"500"}, - {"type":"Text","value":"ms"}, - {"type":"TextWhitespace","value":"\n\n"}, - {"type":"Comment","value":"# Run the command by pressing enter."}, - {"type":"TextWhitespace","value":"\n"}, - {"type":"Keyword","value":"Enter"}, - {"type":"TextWhitespace","value":"\n\n"}, - {"type":"Comment","value":"# Admire the output for a bit."}, - {"type":"TextWhitespace","value":"\n"}, - {"type":"Keyword","value":"Sleep"}, - {"type":"TextWhitespace","value":" "}, - {"type":"LiteralNumber","value":"5"}, - {"type":"Text","value":"s"} + {"type":"Comment","value":"# Where should we write the GIF?"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"Output"}, + {"type":"TextWhitespace","value":" "}, + {"type":"LiteralString","value":"demo.gif"}, + {"type":"TextWhitespace","value":"\n\n"}, + {"type":"Comment","value":"# Set up a 1200x600 terminal with 46px font."}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"Set"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"FontSize"}, + {"type":"TextWhitespace","value":" "}, + {"type":"LiteralNumber","value":"46"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"Set"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"Width"}, + {"type":"TextWhitespace","value":" "}, + {"type":"LiteralNumber","value":"1200"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"Set"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"Height"}, + {"type":"TextWhitespace","value":" "}, + {"type":"LiteralNumber","value":"600"}, + {"type":"TextWhitespace","value":"\n\n"}, + {"type":"Comment","value":"# Type a command in the terminal."}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"Type"}, + {"type":"Punctuation", "value": "@"}, + {"type":"LiteralNumber", "value": "100"}, + {"type":"Text", "value": "ms"}, + {"type":"TextWhitespace","value":" "}, + {"type":"LiteralStringDouble","value":"\"echo 'Welcome to VHS!'\""}, + {"type":"TextWhitespace","value":"\n\n"}, + {"type":"Comment","value":"# Pause for dramatic effect..."}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"Sleep"}, + {"type":"TextWhitespace","value":" "}, + {"type":"LiteralNumber","value":"500"}, + {"type":"Text","value":"ms"}, + {"type":"TextWhitespace","value":"\n\n"}, + {"type":"Comment","value":"# Run the command by pressing enter."}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"Enter"}, + {"type":"TextWhitespace","value":"\n\n"}, + {"type":"Comment","value":"# Admire the output for a bit."}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"Sleep"}, + {"type":"TextWhitespace","value":" "}, + {"type":"LiteralNumber","value":"5"}, + {"type":"Text","value":"s"} ] From 1ec244d16bc411fcad9588deb0dcb9fe991e4d0e Mon Sep 17 00:00:00 2001 From: Ian Simonson Date: Wed, 19 Jul 2023 09:07:09 -0700 Subject: [PATCH 3/3] 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 --- lexers/embedded/odin.xml | 2 +- lexers/testdata/odin.actual | 4 ++-- lexers/testdata/odin.expected | 8 +++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lexers/embedded/odin.xml b/lexers/embedded/odin.xml index 21fdd22ab..5fca0a39d 100644 --- a/lexers/embedded/odin.xml +++ b/lexers/embedded/odin.xml @@ -45,7 +45,7 @@ - + diff --git a/lexers/testdata/odin.actual b/lexers/testdata/odin.actual index 413619356..ae7801c05 100644 --- a/lexers/testdata/odin.actual +++ b/lexers/testdata/odin.actual @@ -9,8 +9,8 @@ and it should still work */ Data :: struct { - c: complex, - q: quaternion, + c: complex64, + q: quaternion256, } /* some other comment */ diff --git a/lexers/testdata/odin.expected b/lexers/testdata/odin.expected index 294134578..272c1c2e2 100644 --- a/lexers/testdata/odin.expected +++ b/lexers/testdata/odin.expected @@ -7,7 +7,7 @@ {"type":"TextWhitespace","value":" "}, {"type":"LiteralString","value":"\"core:fmt\""}, {"type":"TextWhitespace","value":"\n\n"}, - {"type":"CommentMultiline","value":"/*\nsome comments in odin can\n\t/* be nested! */\nand it should still work\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":" "}, @@ -20,17 +20,19 @@ {"type":"Name","value":"c"}, {"type":"Operator","value":":"}, {"type":"TextWhitespace","value":" "}, - {"type":"KeywordType","value":"complex"}, + {"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":"quaternion"}, + {"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":"::"},