aboutsummaryrefslogtreecommitdiff
path: root/src/server/ast.odin
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-07-30 20:01:41 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-07-30 20:01:41 -0400
commit9662d034880dfcfe49474aba0589d8d831a04584 (patch)
tree642288f99bceb9d6b13d88f60c9b722f375be4c2 /src/server/ast.odin
parent0e4157ebfd357e5fdb181408185cca42dcd24047 (diff)
Correctly handle the alias of `u8` and `byte`
Diffstat (limited to 'src/server/ast.odin')
-rw-r--r--src/server/ast.odin11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/server/ast.odin b/src/server/ast.odin
index 8037d6f..79f14f6 100644
--- a/src/server/ast.odin
+++ b/src/server/ast.odin
@@ -70,6 +70,17 @@ keyword_map: map[string]bool = {
"uintptr" = true,
}
+are_keyword_aliases :: proc(a, b: string) -> bool {
+ // right now only the only alias is `byte` for `u8`, so this simple check will do
+ if a == "u8" && b == "byte" {
+ return true
+ }
+ if a == "byte" && b == "u8" {
+ return true
+ }
+ return false
+}
+
GlobalExpr :: struct {
name: string,
name_expr: ^ast.Expr,