diff --git a/cmd/scip/tests/reprolang/bindings/go/repro/ast.go b/cmd/scip/tests/reprolang/bindings/go/repro/ast.go index 05cb031f..903b84b9 100644 --- a/cmd/scip/tests/reprolang/bindings/go/repro/ast.go +++ b/cmd/scip/tests/reprolang/bindings/go/repro/ast.go @@ -27,7 +27,8 @@ func (r *relationships) identifiers() []*identifier { } type referenceStatement struct { - name *identifier + name *identifier + isForwardDecl bool } type identifier struct { diff --git a/cmd/scip/tests/reprolang/bindings/go/repro/parser.go b/cmd/scip/tests/reprolang/bindings/go/repro/parser.go index 8c2bd09e..f09ea735 100644 --- a/cmd/scip/tests/reprolang/bindings/go/repro/parser.go +++ b/cmd/scip/tests/reprolang/bindings/go/repro/parser.go @@ -62,7 +62,8 @@ func (s *reproSourceFile) loadStatements() { } case "reference_statement": s.references = append(s.references, &referenceStatement{ - name: newIdentifier(s, child.ChildByFieldName("name")), + name: newIdentifier(s, child.ChildByFieldName("name")), + isForwardDecl: child.ChildByFieldName("forward_decl") != nil, }) } } diff --git a/cmd/scip/tests/reprolang/bindings/go/repro/scip.go b/cmd/scip/tests/reprolang/bindings/go/repro/scip.go index 7501cc96..5a6bce71 100644 --- a/cmd/scip/tests/reprolang/bindings/go/repro/scip.go +++ b/cmd/scip/tests/reprolang/bindings/go/repro/scip.go @@ -63,7 +63,11 @@ func (s *reproSourceFile) occurrences() []*scip.Occurrence { emit(rel.relations) } for _, ref := range s.references { - result = append(result, ref.name.occurrence(scip.SymbolRole_UnspecifiedSymbolRole)) + role := scip.SymbolRole_UnspecifiedSymbolRole + if ref.isForwardDecl { + role = scip.SymbolRole_ForwardDeclaration + } + result = append(result, ref.name.occurrence(role)) } return result } diff --git a/cmd/scip/tests/reprolang/grammar.js b/cmd/scip/tests/reprolang/grammar.js index 67eddd1e..52652036 100644 --- a/cmd/scip/tests/reprolang/grammar.js +++ b/cmd/scip/tests/reprolang/grammar.js @@ -22,7 +22,12 @@ module.exports = grammar({ field('name', $.identifier), field('roles', repeat($._definition_relations)) ), - reference_statement: $ => seq('reference', field('name', $.identifier)), + reference_statement: $ => + seq( + 'reference', + field('forward_decl', optional('forward_decl')), + field('name', $.identifier) + ), _definition_relations: $ => choice( $.implementation_relation, diff --git a/cmd/scip/tests/reprolang/src/grammar.json b/cmd/scip/tests/reprolang/src/grammar.json index efeddbef..0197876d 100644 --- a/cmd/scip/tests/reprolang/src/grammar.json +++ b/cmd/scip/tests/reprolang/src/grammar.json @@ -99,6 +99,22 @@ "type": "STRING", "value": "reference" }, + { + "type": "FIELD", + "name": "forward_decl", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "forward_decl" + }, + { + "type": "BLANK" + } + ] + } + }, { "type": "FIELD", "name": "name", diff --git a/cmd/scip/tests/reprolang/src/node-types.json b/cmd/scip/tests/reprolang/src/node-types.json index 78239757..620e02ae 100644 --- a/cmd/scip/tests/reprolang/src/node-types.json +++ b/cmd/scip/tests/reprolang/src/node-types.json @@ -145,6 +145,16 @@ "type": "reference_statement", "named": true, "fields": { + "forward_decl": { + "multiple": false, + "required": false, + "types": [ + { + "type": "forward_decl", + "named": false + } + ] + }, "name": { "multiple": false, "required": true, @@ -274,6 +284,10 @@ "type": "definition", "named": false }, + { + "type": "forward_decl", + "named": false + }, { "type": "global", "named": false diff --git a/cmd/scip/tests/reprolang/src/parser.c b/cmd/scip/tests/reprolang/src/parser.c index dc10c634..622c432d 100644 --- a/cmd/scip/tests/reprolang/src/parser.c +++ b/cmd/scip/tests/reprolang/src/parser.c @@ -6,48 +6,49 @@ #endif #define LANGUAGE_VERSION 13 -#define STATE_COUNT 39 +#define STATE_COUNT 41 #define LARGE_STATE_COUNT 2 -#define SYMBOL_COUNT 32 +#define SYMBOL_COUNT 33 #define ALIAS_COUNT 0 -#define TOKEN_COUNT 14 +#define TOKEN_COUNT 15 #define EXTERNAL_TOKEN_COUNT 0 -#define FIELD_COUNT 7 +#define FIELD_COUNT 8 #define MAX_ALIAS_SEQUENCE_LENGTH 5 -#define PRODUCTION_ID_COUNT 8 +#define PRODUCTION_ID_COUNT 9 enum { sym_workspace_identifier = 1, anon_sym_LF = 2, anon_sym_definition = 3, anon_sym_reference = 4, - anon_sym_implements = 5, - anon_sym_type_defines = 6, - anon_sym_references = 7, - anon_sym_relationships = 8, - anon_sym_defined_by = 9, - anon_sym_POUND = 10, - aux_sym_comment_token1 = 11, - anon_sym_POUNDdocstring_COLON = 12, - anon_sym_global = 13, - sym_source_file = 14, - sym__statement = 15, - sym_definition_statement = 16, - sym_reference_statement = 17, - sym__definition_relations = 18, - sym_implementation_relation = 19, - sym_type_definition_relation = 20, - sym_references_relation = 21, - sym_relationships_statement = 22, - sym__all_relations = 23, - sym_defined_by_relation = 24, - sym_comment = 25, - sym_docstring = 26, - sym_identifier = 27, - sym_global_identifier = 28, - aux_sym_source_file_repeat1 = 29, - aux_sym_definition_statement_repeat1 = 30, - aux_sym_relationships_statement_repeat1 = 31, + anon_sym_forward_decl = 5, + anon_sym_implements = 6, + anon_sym_type_defines = 7, + anon_sym_references = 8, + anon_sym_relationships = 9, + anon_sym_defined_by = 10, + anon_sym_POUND = 11, + aux_sym_comment_token1 = 12, + anon_sym_POUNDdocstring_COLON = 13, + anon_sym_global = 14, + sym_source_file = 15, + sym__statement = 16, + sym_definition_statement = 17, + sym_reference_statement = 18, + sym__definition_relations = 19, + sym_implementation_relation = 20, + sym_type_definition_relation = 21, + sym_references_relation = 22, + sym_relationships_statement = 23, + sym__all_relations = 24, + sym_defined_by_relation = 25, + sym_comment = 26, + sym_docstring = 27, + sym_identifier = 28, + sym_global_identifier = 29, + aux_sym_source_file_repeat1 = 30, + aux_sym_definition_statement_repeat1 = 31, + aux_sym_relationships_statement_repeat1 = 32, }; static const char * const ts_symbol_names[] = { @@ -56,6 +57,7 @@ static const char * const ts_symbol_names[] = { [anon_sym_LF] = "\n", [anon_sym_definition] = "definition", [anon_sym_reference] = "reference", + [anon_sym_forward_decl] = "forward_decl", [anon_sym_implements] = "implements", [anon_sym_type_defines] = "type_defines", [anon_sym_references] = "references", @@ -91,6 +93,7 @@ static const TSSymbol ts_symbol_map[] = { [anon_sym_LF] = anon_sym_LF, [anon_sym_definition] = anon_sym_definition, [anon_sym_reference] = anon_sym_reference, + [anon_sym_forward_decl] = anon_sym_forward_decl, [anon_sym_implements] = anon_sym_implements, [anon_sym_type_defines] = anon_sym_type_defines, [anon_sym_references] = anon_sym_references, @@ -141,6 +144,10 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = false, }, + [anon_sym_forward_decl] = { + .visible = true, + .named = false, + }, [anon_sym_implements] = { .visible = true, .named = false, @@ -254,17 +261,19 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { enum { field_descriptors = 1, field_docstring = 2, - field_global = 3, - field_name = 4, - field_project_name = 5, - field_roles = 6, - field_workspace = 7, + field_forward_decl = 3, + field_global = 4, + field_name = 5, + field_project_name = 6, + field_roles = 7, + field_workspace = 8, }; static const char * const ts_field_names[] = { [0] = NULL, [field_descriptors] = "descriptors", [field_docstring] = "docstring", + [field_forward_decl] = "forward_decl", [field_global] = "global", [field_name] = "name", [field_project_name] = "project_name", @@ -278,8 +287,9 @@ static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = { [3] = {.index = 2, .length = 1}, [4] = {.index = 3, .length = 2}, [5] = {.index = 5, .length = 2}, - [6] = {.index = 7, .length = 3}, - [7] = {.index = 10, .length = 4}, + [6] = {.index = 7, .length = 2}, + [7] = {.index = 9, .length = 3}, + [8] = {.index = 12, .length = 4}, }; static const TSFieldMapEntry ts_field_map_entries[] = { @@ -293,13 +303,16 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_name, 1}, {field_roles, 2}, [5] = + {field_forward_decl, 1}, + {field_name, 2}, + [7] = {field_descriptors, 2}, {field_project_name, 1}, - [7] = + [9] = {field_docstring, 0}, {field_docstring, 1}, {field_name, 3}, - [10] = + [12] = {field_docstring, 0}, {field_docstring, 1}, {field_name, 3}, @@ -802,157 +815,194 @@ static bool ts_lex_keywords(TSLexer *lexer, TSStateId state) { switch (state) { case 0: if (lookahead == 'd') ADVANCE(1); - if (lookahead == 'g') ADVANCE(2); - if (lookahead == 'i') ADVANCE(3); - if (lookahead == 'r') ADVANCE(4); - if (lookahead == 't') ADVANCE(5); + if (lookahead == 'f') ADVANCE(2); + if (lookahead == 'g') ADVANCE(3); + if (lookahead == 'i') ADVANCE(4); + if (lookahead == 'r') ADVANCE(5); + if (lookahead == 't') ADVANCE(6); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') SKIP(0) END_STATE(); case 1: - if (lookahead == 'e') ADVANCE(6); + if (lookahead == 'e') ADVANCE(7); END_STATE(); case 2: - if (lookahead == 'l') ADVANCE(7); + if (lookahead == 'o') ADVANCE(8); END_STATE(); case 3: - if (lookahead == 'm') ADVANCE(8); + if (lookahead == 'l') ADVANCE(9); END_STATE(); case 4: - if (lookahead == 'e') ADVANCE(9); + if (lookahead == 'm') ADVANCE(10); END_STATE(); case 5: - if (lookahead == 'y') ADVANCE(10); + if (lookahead == 'e') ADVANCE(11); END_STATE(); case 6: - if (lookahead == 'f') ADVANCE(11); + if (lookahead == 'y') ADVANCE(12); END_STATE(); case 7: - if (lookahead == 'o') ADVANCE(12); + if (lookahead == 'f') ADVANCE(13); END_STATE(); case 8: - if (lookahead == 'p') ADVANCE(13); + if (lookahead == 'r') ADVANCE(14); END_STATE(); case 9: - if (lookahead == 'f') ADVANCE(14); + if (lookahead == 'o') ADVANCE(15); END_STATE(); case 10: - if (lookahead == 'p') ADVANCE(15); + if (lookahead == 'p') ADVANCE(16); END_STATE(); case 11: - if (lookahead == 'i') ADVANCE(16); + if (lookahead == 'f') ADVANCE(17); END_STATE(); case 12: - if (lookahead == 'b') ADVANCE(17); + if (lookahead == 'p') ADVANCE(18); END_STATE(); case 13: - if (lookahead == 'l') ADVANCE(18); + if (lookahead == 'i') ADVANCE(19); END_STATE(); case 14: - if (lookahead == 'e') ADVANCE(19); + if (lookahead == 'w') ADVANCE(20); END_STATE(); case 15: - if (lookahead == 'e') ADVANCE(20); + if (lookahead == 'b') ADVANCE(21); END_STATE(); case 16: - if (lookahead == 'n') ADVANCE(21); + if (lookahead == 'l') ADVANCE(22); END_STATE(); case 17: - if (lookahead == 'a') ADVANCE(22); + if (lookahead == 'e') ADVANCE(23); END_STATE(); case 18: - if (lookahead == 'e') ADVANCE(23); + if (lookahead == 'e') ADVANCE(24); END_STATE(); case 19: - if (lookahead == 'r') ADVANCE(24); + if (lookahead == 'n') ADVANCE(25); END_STATE(); case 20: - if (lookahead == '_') ADVANCE(25); + if (lookahead == 'a') ADVANCE(26); END_STATE(); case 21: - if (lookahead == 'e') ADVANCE(26); + if (lookahead == 'a') ADVANCE(27); END_STATE(); case 22: - if (lookahead == 'l') ADVANCE(27); + if (lookahead == 'e') ADVANCE(28); END_STATE(); case 23: - if (lookahead == 'm') ADVANCE(28); + if (lookahead == 'r') ADVANCE(29); END_STATE(); case 24: - if (lookahead == 'e') ADVANCE(29); + if (lookahead == '_') ADVANCE(30); END_STATE(); case 25: - if (lookahead == 'd') ADVANCE(30); + if (lookahead == 'e') ADVANCE(31); END_STATE(); case 26: - if (lookahead == 'd') ADVANCE(31); + if (lookahead == 'r') ADVANCE(32); END_STATE(); case 27: - ACCEPT_TOKEN(anon_sym_global); + if (lookahead == 'l') ADVANCE(33); END_STATE(); case 28: - if (lookahead == 'e') ADVANCE(32); + if (lookahead == 'm') ADVANCE(34); END_STATE(); case 29: - if (lookahead == 'n') ADVANCE(33); + if (lookahead == 'e') ADVANCE(35); END_STATE(); case 30: - if (lookahead == 'e') ADVANCE(34); + if (lookahead == 'd') ADVANCE(36); END_STATE(); case 31: - if (lookahead == '_') ADVANCE(35); + if (lookahead == 'd') ADVANCE(37); END_STATE(); case 32: - if (lookahead == 'n') ADVANCE(36); + if (lookahead == 'd') ADVANCE(38); END_STATE(); case 33: - if (lookahead == 'c') ADVANCE(37); + ACCEPT_TOKEN(anon_sym_global); END_STATE(); case 34: - if (lookahead == 'f') ADVANCE(38); + if (lookahead == 'e') ADVANCE(39); END_STATE(); case 35: - if (lookahead == 'b') ADVANCE(39); + if (lookahead == 'n') ADVANCE(40); END_STATE(); case 36: - if (lookahead == 't') ADVANCE(40); + if (lookahead == 'e') ADVANCE(41); END_STATE(); case 37: - if (lookahead == 'e') ADVANCE(41); + if (lookahead == '_') ADVANCE(42); END_STATE(); case 38: - if (lookahead == 'i') ADVANCE(42); + if (lookahead == '_') ADVANCE(43); END_STATE(); case 39: - if (lookahead == 'y') ADVANCE(43); + if (lookahead == 'n') ADVANCE(44); END_STATE(); case 40: - if (lookahead == 's') ADVANCE(44); + if (lookahead == 'c') ADVANCE(45); END_STATE(); case 41: - if (lookahead == 's') ADVANCE(45); + if (lookahead == 'f') ADVANCE(46); END_STATE(); case 42: - if (lookahead == 'n') ADVANCE(46); + if (lookahead == 'b') ADVANCE(47); END_STATE(); case 43: - ACCEPT_TOKEN(anon_sym_defined_by); + if (lookahead == 'd') ADVANCE(48); END_STATE(); case 44: - ACCEPT_TOKEN(anon_sym_implements); + if (lookahead == 't') ADVANCE(49); END_STATE(); case 45: - ACCEPT_TOKEN(anon_sym_references); + if (lookahead == 'e') ADVANCE(50); END_STATE(); case 46: - if (lookahead == 'e') ADVANCE(47); + if (lookahead == 'i') ADVANCE(51); END_STATE(); case 47: - if (lookahead == 's') ADVANCE(48); + if (lookahead == 'y') ADVANCE(52); END_STATE(); case 48: + if (lookahead == 'e') ADVANCE(53); + END_STATE(); + case 49: + if (lookahead == 's') ADVANCE(54); + END_STATE(); + case 50: + if (lookahead == 's') ADVANCE(55); + END_STATE(); + case 51: + if (lookahead == 'n') ADVANCE(56); + END_STATE(); + case 52: + ACCEPT_TOKEN(anon_sym_defined_by); + END_STATE(); + case 53: + if (lookahead == 'c') ADVANCE(57); + END_STATE(); + case 54: + ACCEPT_TOKEN(anon_sym_implements); + END_STATE(); + case 55: + ACCEPT_TOKEN(anon_sym_references); + END_STATE(); + case 56: + if (lookahead == 'e') ADVANCE(58); + END_STATE(); + case 57: + if (lookahead == 'l') ADVANCE(59); + END_STATE(); + case 58: + if (lookahead == 's') ADVANCE(60); + END_STATE(); + case 59: + ACCEPT_TOKEN(anon_sym_forward_decl); + END_STATE(); + case 60: ACCEPT_TOKEN(anon_sym_type_defines); END_STATE(); default: @@ -975,13 +1025,13 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [11] = {.lex_state = 1}, [12] = {.lex_state = 41}, [13] = {.lex_state = 1}, - [14] = {.lex_state = 1}, + [14] = {.lex_state = 40}, [15] = {.lex_state = 1}, [16] = {.lex_state = 1}, [17] = {.lex_state = 1}, [18] = {.lex_state = 1}, [19] = {.lex_state = 1}, - [20] = {.lex_state = 40}, + [20] = {.lex_state = 1}, [21] = {.lex_state = 40}, [22] = {.lex_state = 40}, [23] = {.lex_state = 40}, @@ -989,17 +1039,19 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [25] = {.lex_state = 40}, [26] = {.lex_state = 40}, [27] = {.lex_state = 40}, - [28] = {.lex_state = 2}, - [29] = {.lex_state = 40}, + [28] = {.lex_state = 40}, + [29] = {.lex_state = 41}, [30] = {.lex_state = 52}, - [31] = {.lex_state = 41}, + [31] = {.lex_state = 40}, [32] = {.lex_state = 2}, [33] = {.lex_state = 2}, [34] = {.lex_state = 2}, - [35] = {.lex_state = 40}, - [36] = {.lex_state = 2}, - [37] = {.lex_state = 0}, - [38] = {.lex_state = 52}, + [35] = {.lex_state = 2}, + [36] = {.lex_state = 40}, + [37] = {.lex_state = 2}, + [38] = {.lex_state = 2}, + [39] = {.lex_state = 0}, + [40] = {.lex_state = 52}, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { @@ -1008,6 +1060,7 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [sym_workspace_identifier] = ACTIONS(1), [anon_sym_definition] = ACTIONS(1), [anon_sym_reference] = ACTIONS(1), + [anon_sym_forward_decl] = ACTIONS(1), [anon_sym_implements] = ACTIONS(1), [anon_sym_type_defines] = ACTIONS(1), [anon_sym_references] = ACTIONS(1), @@ -1018,13 +1071,13 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_global] = ACTIONS(1), }, [1] = { - [sym_source_file] = STATE(37), + [sym_source_file] = STATE(39), [sym__statement] = STATE(2), - [sym_definition_statement] = STATE(36), - [sym_reference_statement] = STATE(36), - [sym_relationships_statement] = STATE(36), - [sym_comment] = STATE(36), - [sym_docstring] = STATE(28), + [sym_definition_statement] = STATE(38), + [sym_reference_statement] = STATE(38), + [sym_relationships_statement] = STATE(38), + [sym_comment] = STATE(38), + [sym_docstring] = STATE(32), [aux_sym_source_file_repeat1] = STATE(2), [ts_builtin_sym_end] = ACTIONS(3), [anon_sym_definition] = ACTIONS(5), @@ -1049,12 +1102,12 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_POUNDdocstring_COLON, ACTIONS(15), 1, ts_builtin_sym_end, - STATE(28), 1, + STATE(32), 1, sym_docstring, STATE(3), 2, sym__statement, aux_sym_source_file_repeat1, - STATE(36), 4, + STATE(38), 4, sym_definition_statement, sym_reference_statement, sym_relationships_statement, @@ -1072,12 +1125,12 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_POUND, ACTIONS(31), 1, anon_sym_POUNDdocstring_COLON, - STATE(28), 1, + STATE(32), 1, sym_docstring, STATE(3), 2, sym__statement, aux_sym_source_file_repeat1, - STATE(36), 4, + STATE(38), 4, sym_definition_statement, sym_reference_statement, sym_relationships_statement, @@ -1087,13 +1140,13 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_LF, ACTIONS(36), 1, anon_sym_implements, - ACTIONS(39), 1, + ACTIONS(38), 1, anon_sym_type_defines, - ACTIONS(42), 1, + ACTIONS(40), 1, anon_sym_references, - ACTIONS(45), 1, + ACTIONS(42), 1, anon_sym_defined_by, - STATE(4), 7, + STATE(5), 7, sym__definition_relations, sym_implementation_relation, sym_type_definition_relation, @@ -1102,17 +1155,17 @@ static const uint16_t ts_small_parse_table[] = { sym_defined_by_relation, aux_sym_relationships_statement_repeat1, [89] = 6, - ACTIONS(48), 1, + ACTIONS(44), 1, anon_sym_LF, - ACTIONS(50), 1, + ACTIONS(46), 1, anon_sym_implements, - ACTIONS(52), 1, + ACTIONS(49), 1, anon_sym_type_defines, - ACTIONS(54), 1, + ACTIONS(52), 1, anon_sym_references, - ACTIONS(56), 1, + ACTIONS(55), 1, anon_sym_defined_by, - STATE(4), 7, + STATE(5), 7, sym__definition_relations, sym_implementation_relation, sym_type_definition_relation, @@ -1121,17 +1174,17 @@ static const uint16_t ts_small_parse_table[] = { sym_defined_by_relation, aux_sym_relationships_statement_repeat1, [114] = 6, - ACTIONS(50), 1, + ACTIONS(36), 1, anon_sym_implements, - ACTIONS(52), 1, + ACTIONS(38), 1, anon_sym_type_defines, - ACTIONS(54), 1, + ACTIONS(40), 1, anon_sym_references, - ACTIONS(56), 1, + ACTIONS(42), 1, anon_sym_defined_by, ACTIONS(58), 1, anon_sym_LF, - STATE(5), 7, + STATE(4), 7, sym__definition_relations, sym_implementation_relation, sym_type_definition_relation, @@ -1140,11 +1193,11 @@ static const uint16_t ts_small_parse_table[] = { sym_defined_by_relation, aux_sym_relationships_statement_repeat1, [139] = 5, - ACTIONS(50), 1, + ACTIONS(36), 1, anon_sym_implements, - ACTIONS(52), 1, + ACTIONS(38), 1, anon_sym_type_defines, - ACTIONS(54), 1, + ACTIONS(40), 1, anon_sym_references, ACTIONS(60), 1, anon_sym_LF, @@ -1155,60 +1208,60 @@ static const uint16_t ts_small_parse_table[] = { sym_references_relation, aux_sym_definition_statement_repeat1, [159] = 5, - ACTIONS(50), 1, + ACTIONS(36), 1, anon_sym_implements, - ACTIONS(52), 1, + ACTIONS(38), 1, anon_sym_type_defines, - ACTIONS(54), 1, + ACTIONS(40), 1, anon_sym_references, ACTIONS(62), 1, anon_sym_LF, - STATE(11), 5, + STATE(9), 5, sym__definition_relations, sym_implementation_relation, sym_type_definition_relation, sym_references_relation, aux_sym_definition_statement_repeat1, [179] = 5, - ACTIONS(50), 1, + ACTIONS(64), 1, + anon_sym_LF, + ACTIONS(66), 1, anon_sym_implements, - ACTIONS(52), 1, + ACTIONS(69), 1, anon_sym_type_defines, - ACTIONS(54), 1, + ACTIONS(72), 1, anon_sym_references, - ACTIONS(64), 1, - anon_sym_LF, - STATE(8), 5, + STATE(9), 5, sym__definition_relations, sym_implementation_relation, sym_type_definition_relation, sym_references_relation, aux_sym_definition_statement_repeat1, [199] = 5, - ACTIONS(50), 1, + ACTIONS(36), 1, anon_sym_implements, - ACTIONS(52), 1, + ACTIONS(38), 1, anon_sym_type_defines, - ACTIONS(54), 1, + ACTIONS(40), 1, anon_sym_references, - ACTIONS(66), 1, + ACTIONS(75), 1, anon_sym_LF, - STATE(11), 5, + STATE(9), 5, sym__definition_relations, sym_implementation_relation, sym_type_definition_relation, sym_references_relation, aux_sym_definition_statement_repeat1, [219] = 5, - ACTIONS(68), 1, - anon_sym_LF, - ACTIONS(70), 1, + ACTIONS(36), 1, anon_sym_implements, - ACTIONS(73), 1, + ACTIONS(38), 1, anon_sym_type_defines, - ACTIONS(76), 1, + ACTIONS(40), 1, anon_sym_references, - STATE(11), 5, + ACTIONS(77), 1, + anon_sym_LF, + STATE(8), 5, sym__definition_relations, sym_implementation_relation, sym_type_definition_relation, @@ -1231,158 +1284,172 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_type_defines, anon_sym_references, anon_sym_defined_by, - [260] = 2, + [260] = 5, ACTIONS(87), 1, + sym_workspace_identifier, + ACTIONS(89), 1, + anon_sym_forward_decl, + ACTIONS(91), 1, + anon_sym_global, + STATE(13), 1, + sym_global_identifier, + STATE(37), 1, + sym_identifier, + [276] = 2, + ACTIONS(93), 1, anon_sym_LF, - ACTIONS(89), 4, + ACTIONS(95), 4, anon_sym_implements, anon_sym_type_defines, anon_sym_references, anon_sym_defined_by, - [270] = 2, - ACTIONS(91), 1, + [286] = 2, + ACTIONS(97), 1, anon_sym_LF, - ACTIONS(93), 4, + ACTIONS(99), 4, anon_sym_implements, anon_sym_type_defines, anon_sym_references, anon_sym_defined_by, - [280] = 2, - ACTIONS(95), 1, + [296] = 2, + ACTIONS(101), 1, anon_sym_LF, - ACTIONS(97), 4, + ACTIONS(103), 4, anon_sym_implements, anon_sym_type_defines, anon_sym_references, anon_sym_defined_by, - [290] = 2, - ACTIONS(99), 1, + [306] = 2, + ACTIONS(105), 1, anon_sym_LF, - ACTIONS(101), 4, + ACTIONS(107), 4, anon_sym_implements, anon_sym_type_defines, anon_sym_references, anon_sym_defined_by, - [300] = 2, - ACTIONS(103), 1, + [316] = 2, + ACTIONS(109), 1, anon_sym_LF, - ACTIONS(105), 4, + ACTIONS(111), 4, anon_sym_implements, anon_sym_type_defines, anon_sym_references, anon_sym_defined_by, - [310] = 2, - ACTIONS(107), 1, + [326] = 2, + ACTIONS(113), 1, anon_sym_LF, - ACTIONS(109), 4, + ACTIONS(115), 4, anon_sym_implements, anon_sym_type_defines, anon_sym_references, anon_sym_defined_by, - [320] = 4, - ACTIONS(111), 1, + [336] = 4, + ACTIONS(87), 1, sym_workspace_identifier, - ACTIONS(113), 1, + ACTIONS(91), 1, anon_sym_global, - STATE(15), 1, + STATE(13), 1, sym_global_identifier, - STATE(34), 1, - sym_identifier, - [333] = 4, - ACTIONS(111), 1, - sym_workspace_identifier, - ACTIONS(113), 1, - anon_sym_global, - STATE(6), 1, + STATE(17), 1, sym_identifier, - STATE(15), 1, - sym_global_identifier, - [346] = 4, - ACTIONS(111), 1, + [349] = 4, + ACTIONS(87), 1, sym_workspace_identifier, - ACTIONS(113), 1, + ACTIONS(91), 1, anon_sym_global, - STATE(7), 1, + STATE(11), 1, sym_identifier, - STATE(15), 1, + STATE(13), 1, sym_global_identifier, - [359] = 4, - ACTIONS(111), 1, + [362] = 4, + ACTIONS(87), 1, sym_workspace_identifier, - ACTIONS(113), 1, + ACTIONS(91), 1, anon_sym_global, - STATE(15), 1, + STATE(13), 1, sym_global_identifier, - STATE(17), 1, + STATE(18), 1, sym_identifier, - [372] = 4, - ACTIONS(111), 1, + [375] = 4, + ACTIONS(87), 1, sym_workspace_identifier, - ACTIONS(113), 1, + ACTIONS(91), 1, anon_sym_global, - STATE(15), 1, + STATE(13), 1, sym_global_identifier, STATE(16), 1, sym_identifier, - [385] = 4, - ACTIONS(111), 1, + [388] = 4, + ACTIONS(87), 1, sym_workspace_identifier, - ACTIONS(113), 1, + ACTIONS(91), 1, anon_sym_global, - STATE(13), 1, + STATE(6), 1, sym_identifier, - STATE(15), 1, + STATE(13), 1, sym_global_identifier, - [398] = 4, - ACTIONS(111), 1, + [401] = 4, + ACTIONS(87), 1, sym_workspace_identifier, - ACTIONS(113), 1, + ACTIONS(91), 1, anon_sym_global, - STATE(15), 1, + STATE(13), 1, sym_global_identifier, STATE(19), 1, sym_identifier, - [411] = 4, - ACTIONS(111), 1, + [414] = 4, + ACTIONS(87), 1, sym_workspace_identifier, - ACTIONS(113), 1, + ACTIONS(91), 1, + anon_sym_global, + STATE(13), 1, + sym_global_identifier, + STATE(33), 1, + sym_identifier, + [427] = 4, + ACTIONS(87), 1, + sym_workspace_identifier, + ACTIONS(91), 1, anon_sym_global, - STATE(9), 1, + STATE(7), 1, sym_identifier, - STATE(15), 1, + STATE(13), 1, sym_global_identifier, - [424] = 1, - ACTIONS(115), 1, - anon_sym_LF, - [428] = 1, + [440] = 1, ACTIONS(117), 1, - sym_workspace_identifier, - [432] = 1, + anon_sym_definition, + [444] = 1, ACTIONS(119), 1, aux_sym_comment_token1, - [436] = 1, + [448] = 1, ACTIONS(121), 1, - anon_sym_definition, - [440] = 1, + sym_workspace_identifier, + [452] = 1, ACTIONS(123), 1, anon_sym_LF, - [444] = 1, + [456] = 1, ACTIONS(125), 1, anon_sym_LF, - [448] = 1, + [460] = 1, ACTIONS(127), 1, anon_sym_LF, - [452] = 1, + [464] = 1, ACTIONS(129), 1, - sym_workspace_identifier, - [456] = 1, - ACTIONS(131), 1, anon_sym_LF, - [460] = 1, + [468] = 1, + ACTIONS(131), 1, + sym_workspace_identifier, + [472] = 1, ACTIONS(133), 1, - ts_builtin_sym_end, - [464] = 1, + anon_sym_LF, + [476] = 1, ACTIONS(135), 1, + anon_sym_LF, + [480] = 1, + ACTIONS(137), 1, + ts_builtin_sym_end, + [484] = 1, + ACTIONS(139), 1, aux_sym_comment_token1, }; @@ -1400,96 +1467,100 @@ static const uint32_t ts_small_parse_table_map[] = { [SMALL_STATE(12)] = 239, [SMALL_STATE(13)] = 250, [SMALL_STATE(14)] = 260, - [SMALL_STATE(15)] = 270, - [SMALL_STATE(16)] = 280, - [SMALL_STATE(17)] = 290, - [SMALL_STATE(18)] = 300, - [SMALL_STATE(19)] = 310, - [SMALL_STATE(20)] = 320, - [SMALL_STATE(21)] = 333, - [SMALL_STATE(22)] = 346, - [SMALL_STATE(23)] = 359, - [SMALL_STATE(24)] = 372, - [SMALL_STATE(25)] = 385, - [SMALL_STATE(26)] = 398, - [SMALL_STATE(27)] = 411, - [SMALL_STATE(28)] = 424, - [SMALL_STATE(29)] = 428, - [SMALL_STATE(30)] = 432, - [SMALL_STATE(31)] = 436, - [SMALL_STATE(32)] = 440, - [SMALL_STATE(33)] = 444, - [SMALL_STATE(34)] = 448, - [SMALL_STATE(35)] = 452, - [SMALL_STATE(36)] = 456, - [SMALL_STATE(37)] = 460, - [SMALL_STATE(38)] = 464, + [SMALL_STATE(15)] = 276, + [SMALL_STATE(16)] = 286, + [SMALL_STATE(17)] = 296, + [SMALL_STATE(18)] = 306, + [SMALL_STATE(19)] = 316, + [SMALL_STATE(20)] = 326, + [SMALL_STATE(21)] = 336, + [SMALL_STATE(22)] = 349, + [SMALL_STATE(23)] = 362, + [SMALL_STATE(24)] = 375, + [SMALL_STATE(25)] = 388, + [SMALL_STATE(26)] = 401, + [SMALL_STATE(27)] = 414, + [SMALL_STATE(28)] = 427, + [SMALL_STATE(29)] = 440, + [SMALL_STATE(30)] = 444, + [SMALL_STATE(31)] = 448, + [SMALL_STATE(32)] = 452, + [SMALL_STATE(33)] = 456, + [SMALL_STATE(34)] = 460, + [SMALL_STATE(35)] = 464, + [SMALL_STATE(36)] = 468, + [SMALL_STATE(37)] = 472, + [SMALL_STATE(38)] = 476, + [SMALL_STATE(39)] = 480, + [SMALL_STATE(40)] = 484, }; static const TSParseActionEntry ts_parse_actions[] = { [0] = {.entry = {.count = 0, .reusable = false}}, [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(), [3] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 0), - [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), - [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), - [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), + [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28), + [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), + [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(30), - [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(38), + [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(40), [15] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1), [17] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), - [19] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(22), - [22] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(20), - [25] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(21), + [19] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(28), + [22] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(14), + [25] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(25), [28] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(30), - [31] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(38), - [34] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_relationships_statement_repeat1, 2), - [36] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_relationships_statement_repeat1, 2), SHIFT_REPEAT(23), - [39] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_relationships_statement_repeat1, 2), SHIFT_REPEAT(24), - [42] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_relationships_statement_repeat1, 2), SHIFT_REPEAT(25), - [45] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_relationships_statement_repeat1, 2), SHIFT_REPEAT(26), - [48] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_relationships_statement, 3, .production_id = 4), - [50] = {.entry = {.count = 1, .reusable = false}}, SHIFT(23), - [52] = {.entry = {.count = 1, .reusable = false}}, SHIFT(24), - [54] = {.entry = {.count = 1, .reusable = false}}, SHIFT(25), - [56] = {.entry = {.count = 1, .reusable = false}}, SHIFT(26), + [31] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(40), + [34] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_relationships_statement, 3, .production_id = 4), + [36] = {.entry = {.count = 1, .reusable = false}}, SHIFT(26), + [38] = {.entry = {.count = 1, .reusable = false}}, SHIFT(23), + [40] = {.entry = {.count = 1, .reusable = false}}, SHIFT(21), + [42] = {.entry = {.count = 1, .reusable = false}}, SHIFT(24), + [44] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_relationships_statement_repeat1, 2), + [46] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_relationships_statement_repeat1, 2), SHIFT_REPEAT(26), + [49] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_relationships_statement_repeat1, 2), SHIFT_REPEAT(23), + [52] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_relationships_statement_repeat1, 2), SHIFT_REPEAT(21), + [55] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_relationships_statement_repeat1, 2), SHIFT_REPEAT(24), [58] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_relationships_statement, 2, .production_id = 2), [60] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_definition_statement, 2, .production_id = 2), - [62] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_definition_statement, 5, .production_id = 7), - [64] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_definition_statement, 4, .production_id = 6), - [66] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_definition_statement, 3, .production_id = 4), - [68] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_definition_statement_repeat1, 2), - [70] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_definition_statement_repeat1, 2), SHIFT_REPEAT(23), - [73] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_definition_statement_repeat1, 2), SHIFT_REPEAT(24), - [76] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_definition_statement_repeat1, 2), SHIFT_REPEAT(25), + [62] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_definition_statement, 5, .production_id = 8), + [64] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_definition_statement_repeat1, 2), + [66] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_definition_statement_repeat1, 2), SHIFT_REPEAT(26), + [69] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_definition_statement_repeat1, 2), SHIFT_REPEAT(23), + [72] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_definition_statement_repeat1, 2), SHIFT_REPEAT(21), + [75] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_definition_statement, 3, .production_id = 4), + [77] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_definition_statement, 4, .production_id = 7), [79] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__statement, 2), [81] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__statement, 2), - [83] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_references_relation, 2, .production_id = 2), - [85] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_references_relation, 2, .production_id = 2), - [87] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_identifier, 1, .production_id = 1), - [89] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_identifier, 1, .production_id = 1), - [91] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_identifier, 1, .production_id = 3), - [93] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_identifier, 1, .production_id = 3), - [95] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type_definition_relation, 2, .production_id = 2), - [97] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_type_definition_relation, 2, .production_id = 2), - [99] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_implementation_relation, 2, .production_id = 2), - [101] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_implementation_relation, 2, .production_id = 2), - [103] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_global_identifier, 3, .production_id = 5), - [105] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_global_identifier, 3, .production_id = 5), - [107] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_defined_by_relation, 2, .production_id = 2), - [109] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_defined_by_relation, 2, .production_id = 2), - [111] = {.entry = {.count = 1, .reusable = false}}, SHIFT(14), - [113] = {.entry = {.count = 1, .reusable = false}}, SHIFT(35), - [115] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31), - [117] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), - [119] = {.entry = {.count = 1, .reusable = true}}, SHIFT(33), - [121] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), - [123] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_docstring, 2), - [125] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_comment, 2), - [127] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_reference_statement, 2, .production_id = 2), - [129] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29), - [131] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), - [133] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), - [135] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32), + [83] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_identifier, 1, .production_id = 3), + [85] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_identifier, 1, .production_id = 3), + [87] = {.entry = {.count = 1, .reusable = false}}, SHIFT(15), + [89] = {.entry = {.count = 1, .reusable = false}}, SHIFT(27), + [91] = {.entry = {.count = 1, .reusable = false}}, SHIFT(31), + [93] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_identifier, 1, .production_id = 1), + [95] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_identifier, 1, .production_id = 1), + [97] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_defined_by_relation, 2, .production_id = 2), + [99] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_defined_by_relation, 2, .production_id = 2), + [101] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_references_relation, 2, .production_id = 2), + [103] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_references_relation, 2, .production_id = 2), + [105] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type_definition_relation, 2, .production_id = 2), + [107] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_type_definition_relation, 2, .production_id = 2), + [109] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_implementation_relation, 2, .production_id = 2), + [111] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_implementation_relation, 2, .production_id = 2), + [113] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_global_identifier, 3, .production_id = 6), + [115] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_global_identifier, 3, .production_id = 6), + [117] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), + [119] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35), + [121] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36), + [123] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29), + [125] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_reference_statement, 3, .production_id = 5), + [127] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_docstring, 2), + [129] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_comment, 2), + [131] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), + [133] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_reference_statement, 2, .production_id = 2), + [135] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), + [137] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [139] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), }; #ifdef __cplusplus diff --git a/cmd/scip/tests/snapshots/input/forward-decl/forward_decl.repro b/cmd/scip/tests/snapshots/input/forward-decl/forward_decl.repro new file mode 100644 index 00000000..fc996395 --- /dev/null +++ b/cmd/scip/tests/snapshots/input/forward-decl/forward_decl.repro @@ -0,0 +1,3 @@ +reference forward_decl abc# +definition abc# +reference abc# diff --git a/cmd/scip/tests/snapshots/output/forward-decl/dump.lsif b/cmd/scip/tests/snapshots/output/forward-decl/dump.lsif new file mode 100755 index 00000000..7d49836e --- /dev/null +++ b/cmd/scip/tests/snapshots/output/forward-decl/dump.lsif @@ -0,0 +1,24 @@ +{"id":1,"version":"0.4.3","projectRoot":"file:/root","positionEncoding":"utf-8","toolInfo":{"name":"reprolang","version":"1.0.0"},"type":"vertex","label":"metaData"} +{"id":2,"type":"vertex","label":"definitionResult"} +{"id":3,"type":"vertex","label":"resultSet"} +{"id":4,"type":"vertex","label":"referenceResult"} +{"id":5,"type":"vertex","label":"hoverResult","result":{"contents":{"kind":"markdown","value":"signature of abc#"}}} +{"id":6,"type":"edge","label":"textDocument/definition","inV":2,"outV":3} +{"id":7,"type":"edge","label":"textDocument/references","inV":4,"outV":3} +{"id":8,"type":"edge","label":"textDocument/hover","inV":5,"outV":3} +{"id":9,"type":"vertex","label":"moniker","identifier":"reprolang repro_manager forward-decl 1.0.0 forward_decl.repro/abc#","kind":"export","scheme":"reprolang"} +{"id":10,"type":"edge","label":"moniker","inV":9,"outV":3} +{"id":11,"name":"forward-decl","version":"1.0.0","manager":"repro_manager","type":"vertex","label":"packageInformation"} +{"id":12,"type":"edge","label":"packageInformation","inV":11,"outV":9} +{"id":13,"type":"vertex","label":"document","uri":"file:/root/forward_decl.repro"} +{"id":14,"type":"vertex","label":"range","start":{"line":0,"character":23},"end":{"line":0,"character":27}} +{"id":15,"type":"edge","label":"next","inV":3,"outV":14} +{"id":16,"type":"edge","label":"item","inVs":[14],"outV":4,"document":13} +{"id":17,"type":"vertex","label":"range","start":{"line":1,"character":11},"end":{"line":1,"character":15}} +{"id":18,"type":"edge","label":"next","inV":3,"outV":17} +{"id":19,"type":"edge","label":"item","inVs":[17],"outV":2,"document":13} +{"id":20,"type":"edge","label":"item","inVs":[17],"outV":4,"document":13} +{"id":21,"type":"vertex","label":"range","start":{"line":2,"character":10},"end":{"line":2,"character":14}} +{"id":22,"type":"edge","label":"next","inV":3,"outV":21} +{"id":23,"type":"edge","label":"item","inVs":[21],"outV":4,"document":13} +{"id":24,"type":"edge","label":"contains","inVs":[14,17,21],"outV":13} diff --git a/cmd/scip/tests/snapshots/output/forward-decl/forward_decl.repro b/cmd/scip/tests/snapshots/output/forward-decl/forward_decl.repro new file mode 100755 index 00000000..fad0ae8c --- /dev/null +++ b/cmd/scip/tests/snapshots/output/forward-decl/forward_decl.repro @@ -0,0 +1,8 @@ + reference forward_decl abc# +# ^^^^ forward_declaration forward_decl.repro/abc# + definition abc# +# ^^^^ definition forward_decl.repro/abc# +# documentation signature of abc# + reference abc# +# ^^^^ reference forward_decl.repro/abc# +