-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
While testing the https://meimporta.eu/lalr-playground/ I introduced a grammar for https://github.com/jplevyak/dparser but forgot to add a %whitespace
directive but lalr
didn't flagged that as an error.
Maybe this can fix it:
int GrammarParser::parse( const char* start, const char* finish, ErrorPolicy* error_policy, Grammar* grammar )
{
LALR_ASSERT( start );
LALR_ASSERT( finish );
LALR_ASSERT( grammar );
error_policy_ = error_policy;
grammar_ = grammar;
position_ = start;
end_ = finish;
line_ = 1;
errors_ = 0;
if ( !match_grammar() )
{
error( 1, LALR_ERROR_SYNTAX, "parsing grammar failed" );
}
if( grammar_->whitespace_tokens().empty() )
{
error( 1, PARSER_ERROR_UNDEFINED_SYMBOL, "no '%%whitespace' directive defined" );
}
return errors_;
}
Metadata
Metadata
Assignees
Labels
No labels