aboutsummaryrefslogtreecommitdiff
path: root/src/server/ast.odin
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-12 11:29:12 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-12 11:29:12 -0400
commit613c9e6d59dfcdc72dfb3fcc72e63f1ed277cbfc (patch)
tree754f21d9accf6ad7b9eecfd94870fd45ac062a54 /src/server/ast.odin
parent9e6c39fcd74edce577015d4c2a09cbad89adf958 (diff)
Use empty struct as map values when wanting a hashset
Diffstat (limited to 'src/server/ast.odin')
-rw-r--r--src/server/ast.odin124
1 files changed, 62 insertions, 62 deletions
diff --git a/src/server/ast.odin b/src/server/ast.odin
index 7c0921c..2bb13d0 100644
--- a/src/server/ast.odin
+++ b/src/server/ast.odin
@@ -9,66 +9,66 @@ import "core:odin/parser"
import path "core:path/slashpath"
import "core:strings"
-keyword_map: map[string]bool = {
- "typeid" = true,
- "string" = true,
- "cstring" = true,
- "int" = true,
- "uint" = true,
- "u8" = true,
- "i8" = true,
- "u16" = true,
- "i16" = true,
- "u32" = true,
- "i32" = true,
- "u64" = true,
- "i64" = true,
- "u128" = true,
- "i128" = true,
- "f16" = true,
- "f32" = true,
- "f64" = true,
- "bool" = true,
- "rawptr" = true,
- "any" = true,
- "b8" = true,
- "b16" = true,
- "b32" = true,
- "b64" = true,
- "true" = true,
- "false" = true,
- "nil" = true,
- "byte" = true,
- "rune" = true,
- "f16be" = true,
- "f16le" = true,
- "f32be" = true,
- "f32le" = true,
- "f64be" = true,
- "f64le" = true,
- "i16be" = true,
- "i16le" = true,
- "i32be" = true,
- "i32le" = true,
- "i64be" = true,
- "i64le" = true,
- "u16be" = true,
- "u16le" = true,
- "u32be" = true,
- "u32le" = true,
- "u64be" = true,
- "u64le" = true,
- "i128be" = true,
- "i128le" = true,
- "u128be" = true,
- "u128le" = true,
- "complex32" = true,
- "complex64" = true,
- "complex128" = true,
- "quaternion64" = true,
- "quaternion128" = true,
- "quaternion256" = true,
- "uintptr" = true,
+keyword_map: map[string]struct{} = {
+ "typeid" = {},
+ "string" = {},
+ "cstring" = {},
+ "int" = {},
+ "uint" = {},
+ "u8" = {},
+ "i8" = {},
+ "u16" = {},
+ "i16" = {},
+ "u32" = {},
+ "i32" = {},
+ "u64" = {},
+ "i64" = {},
+ "u128" = {},
+ "i128" = {},
+ "f16" = {},
+ "f32" = {},
+ "f64" = {},
+ "bool" = {},
+ "rawptr" = {},
+ "any" = {},
+ "b8" = {},
+ "b16" = {},
+ "b32" = {},
+ "b64" = {},
+ "true" = {},
+ "false" = {},
+ "nil" = {},
+ "byte" = {},
+ "rune" = {},
+ "f16be" = {},
+ "f16le" = {},
+ "f32be" = {},
+ "f32le" = {},
+ "f64be" = {},
+ "f64le" = {},
+ "i16be" = {},
+ "i16le" = {},
+ "i32be" = {},
+ "i32le" = {},
+ "i64be" = {},
+ "i64le" = {},
+ "u16be" = {},
+ "u16le" = {},
+ "u32be" = {},
+ "u32le" = {},
+ "u64be" = {},
+ "u64le" = {},
+ "i128be" = {},
+ "i128le" = {},
+ "u128be" = {},
+ "u128le" = {},
+ "complex32" = {},
+ "complex64" = {},
+ "complex128" = {},
+ "quaternion64" = {},
+ "quaternion128" = {},
+ "quaternion256" = {},
+ "uintptr" = {},
}
are_keyword_aliases :: proc(a, b: string) -> bool {
@@ -314,12 +314,12 @@ merge_attributes :: proc(attrs: []^ast.Attribute, foreign_attrs: []^ast.Attribut
}
new_attrs := make([dynamic]^ast.Attribute, context.temp_allocator)
- attr_names := make(map[string]bool, context.temp_allocator)
+ attr_names := make(map[string]struct{}, context.temp_allocator)
for attr in attrs {
append(&new_attrs, attr)
for elem in attr.elems {
if ident, _, ok := unwrap_attr_elem(elem); ok {
- attr_names[ident.name] = true
+ attr_names[ident.name] = {}
}
}
}