Nearly all uses of ebf_error() pass the global token_text as the second argument. (This includes all uses of the wrapper ebf_error_recover() in directs.c.)
This being the case, we could have a separate function ebf_token_error() which omits the second argument and produces more informative error messages. For example:
Global 'foo';
This currently says
Error: Expected new global variable name but found foo
We could instead peek at the token_type global and say
Error: Expected new global variable name but found the single-quoted string 'foo'
Nearly all uses of ebf_error() pass the global
token_text
as the second argument. (This includes all uses of the wrapper ebf_error_recover() in directs.c.)This being the case, we could have a separate function ebf_token_error() which omits the second argument and produces more informative error messages. For example:
This currently says
We could instead peek at the
token_type
global and say