diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2023-01-21 23:39:23 +0100 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2023-01-21 23:39:23 +0100 |
| commit | 532f4bf07c5830276dc4fef9ec497bf917adc8d5 (patch) | |
| tree | 0c9bb33cf560a4290d6b572d1aae4528e6d85dde /src/server | |
| parent | 421a620e731886bb76d6831a1b617d9e7cd9e873 (diff) | |
Fix bug where with `for in` in `for in`
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/analysis.odin | 22 | ||||
| -rw-r--r-- | src/server/symbol.odin | 13 |
2 files changed, 28 insertions, 7 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin index 6da15b0..142ee38 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -1133,6 +1133,7 @@ internal_resolve_type_expression :: proc( ast_context, v^, ast_context.field_name, + {}, true, ), true @@ -1185,6 +1186,7 @@ internal_resolve_type_expression :: proc( node, v^, ast_context.field_name, + {}, ), true case ^Basic_Directive: @@ -1634,6 +1636,10 @@ internal_resolve_type_identifier :: proc( } } + if local.pkg != "" { + ast_context.current_package = local.pkg + } + //Sometimes the locals are semi resolved and can no longer use the locals if local.global { ast_context.use_locals = false @@ -1665,7 +1671,7 @@ internal_resolve_type_identifier :: proc( return_symbol.name = node.name case ^Struct_Type: return_symbol, ok = - make_symbol_struct_from_ast(ast_context, v^, node), true + make_symbol_struct_from_ast(ast_context, v^, node, {}), true return_symbol.name = node.name case ^Bit_Set_Type: return_symbol, ok = @@ -1679,6 +1685,7 @@ internal_resolve_type_identifier :: proc( local.rhs, v.type^, node, + {}, ), true } else { @@ -1692,6 +1699,7 @@ internal_resolve_type_identifier :: proc( local.rhs, v.type^, node, + {}, ), true } @@ -1755,7 +1763,13 @@ internal_resolve_type_identifier :: proc( ) case ^Struct_Type: return_symbol, ok = - make_symbol_struct_from_ast(ast_context, v^, node), true + make_symbol_struct_from_ast( + ast_context, + v^, + node, + global.attributes, + ), + true return_symbol.name = node.name case ^Bit_Set_Type: return_symbol, ok = @@ -1777,6 +1791,7 @@ internal_resolve_type_identifier :: proc( global.expr, v.type^, node, + global.attributes, ), true } else { @@ -1790,6 +1805,7 @@ internal_resolve_type_identifier :: proc( global.expr, v.type^, node, + global.attributes, ), true } @@ -2392,6 +2408,7 @@ make_symbol_procedure_from_ast :: proc( n: ^ast.Node, v: ast.Proc_Type, name: ast.Ident, + attributes: []^ast.Attribute, ) -> Symbol { symbol := Symbol { range = common.get_token_range(name, ast_context.file.src), @@ -2662,6 +2679,7 @@ make_symbol_struct_from_ast :: proc( ast_context: ^AstContext, v: ast.Struct_Type, ident: ast.Ident, + attributes: []^ast.Attribute, inlined := false, ) -> Symbol { symbol := Symbol { diff --git a/src/server/symbol.odin b/src/server/symbol.odin index 215e01c..8f7a081 100644 --- a/src/server/symbol.odin +++ b/src/server/symbol.odin @@ -17,11 +17,13 @@ SymbolAndNode :: struct { } SymbolStructValue :: struct { - names: []string, - ranges: []common.Range, - types: []^ast.Expr, - usings: map[string]bool, - poly: ^ast.Field_List, + names: []string, + ranges: []common.Range, + types: []^ast.Expr, + usings: map[string]bool, + poly: ^ast.Field_List, + objc_name: string, + objc_is_class_method: bool, } SymbolPackageValue :: struct {} @@ -130,6 +132,7 @@ SymbolFlag :: enum { Anonymous, //Usually applied to structs that are defined inline inside another struct Variable, //Symbols that are variable, this means their value decl was mutable Local, + ObjC, } SymbolFlags :: bit_set[SymbolFlag] |