Skip to content

Commit e4c1e93

Browse files
author
test
committed
Fix Go lang spec: correct stale node types, add func_literal
- func_types: add func_literal (anonymous functions/closures) - branch_types: fix 3 stale names: switch_expression → expression_switch_statement case_clause → expression_case default_clause → default_case - branch_types: add type_switch_statement, type_case, communication_case, defer_statement, go_statement
1 parent 67b6c97 commit e4c1e93

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

internal/cbm/lang_specs.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,18 +167,23 @@ static const char *empty_types[] = {NULL};
167167

168168
// ==================== GO ====================
169169
static const char *go_func_types[] = {"function_declaration", "method_declaration", "method_elem",
170-
NULL};
170+
"func_literal", NULL};
171171
static const char *go_class_types[] = {"type_spec", "type_alias", "type_declaration", NULL};
172172
static const char *go_field_types[] = {"field_declaration", NULL};
173173
static const char *go_module_types[] = {"source_file", NULL};
174174
static const char *go_call_types[] = {"call_expression", NULL};
175175
static const char *go_import_types[] = {"import_declaration", "import", NULL};
176176
static const char *go_branch_types[] = {"if_statement",
177177
"for_statement",
178-
"switch_expression",
178+
"expression_switch_statement",
179+
"type_switch_statement",
179180
"select_statement",
180-
"case_clause",
181-
"default_clause",
181+
"expression_case",
182+
"type_case",
183+
"communication_case",
184+
"default_case",
185+
"defer_statement",
186+
"go_statement",
182187
NULL};
183188
static const char *go_var_types[] = {"var_declaration", "const_declaration", NULL};
184189
static const char *go_assign_types[] = {"assignment_statement", "short_var_declaration", NULL};

0 commit comments

Comments
 (0)