icerpc / slicec

The Slice compiler library
Apache License 2.0
13 stars 5 forks source link

Fix Parser Panicing when Emitting a Syntax Error Message with No Expected Tokens #677

Closed InsertCreativityHere closed 9 months ago

InsertCreativityHere commented 9 months ago

Each parser has a 'clean_message' function that's responsible for taking a LALRPOP error and making it readable before passing it off to the user, but these functions do not handle the case where the parser expected no tokens.

For example:

#else Hello

It's invalid for tokens to appear after else.