Skip to content

Commit f07dda6

Browse files
committed
Ensure "extras" symbols are included in the node-types.json file
The symbols marked as "extras" are the start symbols of secondary languages. These should be included in the aliases map just as done for start symbol of the main language to ensure their node type and field information is included in the node-types.json file.
1 parent 1992734 commit f07dda6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cli/src/generate/node_types.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,14 @@ pub(crate) fn generate_node_types_json(
424424
aliases
425425
});
426426
}
427+
for extra_symbol in &syntax_grammar.extra_symbols {
428+
if !simple_aliases.contains_key(extra_symbol) {
429+
aliases_by_symbol
430+
.entry(*extra_symbol)
431+
.or_insert(HashSet::new())
432+
.insert(None);
433+
}
434+
}
427435
for variable in &syntax_grammar.variables {
428436
for production in &variable.productions {
429437
for step in &production.steps {

0 commit comments

Comments
 (0)