diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2021-04-27 22:21:04 +0200 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2021-04-27 22:21:04 +0200 |
| commit | fc742ab3b8fde5a70fa314c5ed2a1c94e503e877 (patch) | |
| tree | 57178511f76e9ddbaf7d2ee0fa9e846de6533a7d /src | |
| parent | 07e8e34144d2c8929c8eb40779488464d77308bc (diff) | |
new tests
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/analysis.odin | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin index 6c615e6..30ae974 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -767,6 +767,8 @@ resolve_type_identifier :: proc(ast_context: ^AstContext, node: ast.Ident) -> (i return make_symbol_array_from_ast(ast_context, v), true; case Dynamic_Array_Type: return make_symbol_dynamic_array_from_ast(ast_context, v), true; + case Map_Type: + return make_symbol_map_from_ast(ast_context, v), true; case Call_Expr: return resolve_type_expression(ast_context, local); case: @@ -1216,6 +1218,21 @@ make_symbol_dynamic_array_from_ast :: proc(ast_context: ^AstContext, v: ast.Dyna return symbol; } +make_symbol_map_from_ast :: proc(ast_context: ^AstContext, v: ast.Map_Type) -> index.Symbol { + + symbol := index.Symbol { + range = common.get_token_range(v.node, ast_context.file.src), + pkg = get_package_from_node(v.node), + }; + + symbol.value = index.SymbolMapValue { + key = v.key, + value = v.value, + }; + + return symbol; +} + make_symbol_basic_type_from_ast :: proc(ast_context: ^AstContext, n: ^ast.Node, v: ^ast.Ident) -> index.Symbol { symbol := index.Symbol { |