From f07dda692e3a6f4f2229c3a064fa19b8be7bc225 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Thu, 29 Oct 2020 18:05:24 +0100 Subject: [PATCH] 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. --- cli/src/generate/node_types.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cli/src/generate/node_types.rs b/cli/src/generate/node_types.rs index 7962c7f3..a575d197 100644 --- a/cli/src/generate/node_types.rs +++ b/cli/src/generate/node_types.rs @@ -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 {