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.
This commit is contained in:
Arthur Baars 2020-10-29 18:05:24 +01:00
parent 1992734195
commit f07dda692e

View file

@ -424,6 +424,14 @@ pub(crate) fn generate_node_types_json(
aliases
});
}
for extra_symbol in &syntax_grammar.extra_symbols {
if !simple_aliases.contains_key(extra_symbol) {
aliases_by_symbol
.entry(*extra_symbol)
.or_insert(HashSet::new())
.insert(None);
}
}
for variable in &syntax_grammar.variables {
for production in &variable.productions {
for step in &production.steps {