--- linuxsampler/trunk/src/scriptvm/editor/nksp.l 2017/05/31 21:07:44 3260 +++ linuxsampler/trunk/src/scriptvm/editor/nksp.l 2017/07/24 18:51:21 3332 @@ -47,6 +47,12 @@ # define register #endif +// Since this parser is solely used by script code editors, thus not used in a +// real-time context, always throw an exception instead of exiting on fatal +// lexer errors (so the debugger may pause with the appropriate back trace) +#include +#define YY_FATAL_ERROR(msg) throw std::runtime_error(msg) + %} /* generate a reentrant safe scanner */ @@ -65,6 +71,7 @@ DIGIT [0-9] ID [a-zA-Z0-9_]+ +END_ID on|while|if|select|function|synchronized %% @@ -219,7 +226,7 @@ return yyextra->token.baseType; } -[ \t]*{ID} { +[ \t]*{END_ID}? { yy_pop_state(yyscanner); yyextra->token = KeywordToken(yytext); return yyextra->token.baseType;