From fc742ab3b8fde5a70fa314c5ed2a1c94e503e877 Mon Sep 17 00:00:00 2001 From: Daniel Gavin Date: Tue, 27 Apr 2021 22:21:04 +0200 Subject: new tests --- src/server/analysis.odin | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/server') 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 { -- cgit v1.2.3