Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
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
  • Loading branch information
iansimonson committed Jul 19, 2023
commit 1ec244d16bc411fcad9588deb0dcb9fe991e4d0e
2 changes: 1 addition & 1 deletion lexers/embedded/odin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<rule pattern = "(true|false|nil)\b">
<token type = "KeywordConstant"/>
</rule>
<rule pattern = "(uint|u8|u16|u32|u64|int|i8|i16|i32|i64|f32|f64|complex|complex64|complex128|quaternion|quaternion64|quaternion128|byte|rune|string|bool|uintptr|rawptr)\b">
<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">
Expand Down
4 changes: 2 additions & 2 deletions lexers/testdata/odin.actual
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ and it should still work
*/

Data :: struct {
c: complex,
q: quaternion,
c: complex64,
q: quaternion256,
}

/* some other comment */
Expand Down
8 changes: 5 additions & 3 deletions lexers/testdata/odin.expected
Original file line number Diff line number Diff line change
Expand Up @@ -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":" "},
Expand All @@ -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":"::"},
Expand Down