Your LetLhs rule can match either an identifier, or an identifier followed by a param list. That means that after an identifier, the parser must accept both a left paren and whatever can come after LetLhs (which is just the end of input, in this case). Because the paren is, for some reason, in a local token group, that’s not allowed.
Are you sure you need local token groups for the things you’re applying them to? Because a left paren sounds like something that should probably not be a local token.
Are you sure you need local token groups for the things you’re applying them to? Because a left paren sounds like something that should probably not be a local token.
Actually I’m working on typst grammar. You can have a glimpse of its syntax at Syntax – Typst Documentation . It’s basically markdown but can have math, code expressions inside(not just raw block). I think it’s better to handle these tokens independently. By using the local tokens group, grammar code is not much concise (e.g. I need to handle whitespace tokens carefully, not just putting it inside skip), but I think it’s worthwhile. Currently it’s the best option in my view from my limited parser experience and lezer knowledge. If you know what’s the appropriate/better way to handle it, please let me know. Thank you! <3