Specify entry point for nested grammar with multiple entry points

Is there a way to specify which entry point to use when embedding a nested grammar. The external parser I want to embed in my template grammar has two entry points “Programm” and “Expression”. In the template grammar I want to embed the “Expression” entry point.

The solution I’ve come up with is really hacky. In the grammar I’m specifying an empty grammar:

@external grammar plutoParser empty

In the generated template parser I load the nested parser and remove the “Program” entry point manually.

templateParser.withNested({ 
  'plutoParser': plutoParser.copy({ 
    topRules: { 'Expression': plutoParser.topRules.Expression } 
  }) 
})

Is there a better way to do this?

Yes, there is. Due to a node_modules dir not being in the state I thought it was in the online website was quite a bit out of date, so 5 minutes ago that option wasn’t listed there yet.

(Parser.copy, by the way, is not public.)

Thanks for the quick reply :slight_smile: