Escape non-printables in "unrecognized character" parser error messages

This commit is contained in:
Jon Siwek 2021-04-08 20:13:50 -07:00
parent 25dcf210b1
commit 4ae056b1a3

View file

@ -565,7 +565,7 @@ F RET_CONST(zeek::val_mgr->False()->Ref())
<RE>[\\\n] return yytext[0]; // should cause a parse error <RE>[\\\n] return yytext[0]; // should cause a parse error
<*>. zeek::reporter->Error("unrecognized character - %s", yytext); <*>. zeek::reporter->Error("unrecognized character: '%s'", zeek::util::get_escaped_string(yytext, false).data());
<<EOF>> last_tok[0] = '\0'; return EOF; <<EOF>> last_tok[0] = '\0'; return EOF;