aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2025-07-03 18:03:17 +0200
committerGitHub <noreply@github.com>2025-07-03 18:03:17 +0200
commit2ffc196083122ac7813c7bf97ed4140cf42fb45e (patch)
tree231872d0028bf923047a7870409fc5e18aac4f0d /src
parent15c2a3e5cf38fd6274099baffc521022f319dd60 (diff)
parent88e32ed20996dc59815af4f62a4a10c212d608ea (diff)
Merge pull request #714 from BradLewis/fix/bitset-loop-locals
Store local variables when looping over bitsets
Diffstat (limited to 'src')
-rw-r--r--src/server/analysis.odin33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin
index 9f7018f..7170935 100644
--- a/src/server/analysis.odin
+++ b/src/server/analysis.odin
@@ -3550,6 +3550,39 @@ get_locals_for_range_stmt :: proc(
)
}
}
+ case SymbolBitSetValue:
+ if len(stmt.vals) >= 1 {
+ if ident, ok := unwrap_ident(stmt.vals[0]); ok {
+ store_local(
+ ast_context,
+ ident,
+ v.expr,
+ ident.pos.offset,
+ ident.name,
+ ast_context.non_mutable_only,
+ false,
+ true,
+ symbol.pkg,
+ false,
+ )
+ }
+ }
+ if len(stmt.vals) >= 2 {
+ if ident, ok := unwrap_ident(stmt.vals[1]); ok {
+ store_local(
+ ast_context,
+ ident,
+ make_int_ast(ast_context, ident.pos, ident.end),
+ ident.pos.offset,
+ ident.name,
+ ast_context.non_mutable_only,
+ false,
+ true,
+ symbol.pkg,
+ false,
+ )
+ }
+ }
}
}