aboutsummaryrefslogtreecommitdiff
path: root/src/server/collector.odin
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-07 21:24:33 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-07 21:38:30 -0400
commit19ee061feef6f74b54a4ca5e36a8e3711907935b (patch)
tree0f9649a1bc288959f14da6712cff65274fc63d06 /src/server/collector.odin
parent7d334f6c9fff565b5d51c30e13db810f466e6241 (diff)
Distinguish between variables and types when parsing globals
Diffstat (limited to 'src/server/collector.odin')
-rw-r--r--src/server/collector.odin10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/server/collector.odin b/src/server/collector.odin
index 4588a39..a702546 100644
--- a/src/server/collector.odin
+++ b/src/server/collector.odin
@@ -663,7 +663,7 @@ collect_symbols :: proc(collection: ^SymbolCollection, file: ast.File, uri: stri
token = v^
symbol.value = collect_generic(collection, col_expr, package_map, uri)
- if expr.mutable {
+ if .Mutable in expr.flags {
token_type = .Variable
} else {
token_type = .Unresolved
@@ -671,7 +671,7 @@ collect_symbols :: proc(collection: ^SymbolCollection, file: ast.File, uri: stri
case ^ast.Comp_Lit:
generic := collect_generic(collection, col_expr, package_map, uri)
- if expr.mutable {
+ if .Mutable in expr.flags {
token_type = .Variable
} else {
token_type = .Unresolved
@@ -685,7 +685,7 @@ collect_symbols :: proc(collection: ^SymbolCollection, file: ast.File, uri: stri
// default
symbol.value = collect_generic(collection, col_expr, package_map, uri)
- if expr.mutable {
+ if .Mutable in expr.flags {
token_type = .Variable
} else {
token_type = .Unresolved
@@ -734,6 +734,10 @@ collect_symbols :: proc(collection: ^SymbolCollection, file: ast.File, uri: stri
symbol.flags |= {.PrivatePackage}
}
+ if .Variable in expr.flags {
+ symbol.flags |= {.Variable}
+ }
+
pkg: ^SymbolPackage
ok: bool