dbStatic: Better error reports for bad JSON string chars
This commit is contained in:
@@ -101,10 +101,6 @@ static int yyreset(void)
|
||||
")" return(yytext[0]);
|
||||
"," return(yytext[0]);
|
||||
|
||||
{doublequote}({stringchar}|{escape})*{newline} { /* bad string */
|
||||
yyerrorAbort("Newline in string, closing quote missing");
|
||||
}
|
||||
|
||||
<JSON>"null" return jsonNULL;
|
||||
<JSON>"true" return jsonTRUE;
|
||||
<JSON>"false" return jsonFALSE;
|
||||
@@ -130,6 +126,20 @@ static int yyreset(void)
|
||||
|
||||
<INITIAL,JSON>{whitespace} ;
|
||||
|
||||
|
||||
/* Error patterns */
|
||||
|
||||
{doublequote}({stringchar}|{escape})*{newline} {
|
||||
yyerrorAbort("Newline in string, closing quote missing");
|
||||
}
|
||||
|
||||
<JSON>{doublequote}({stringchar}|{escape})*{doublequote} {
|
||||
yyerrorAbort("Bad character in JSON string");
|
||||
}
|
||||
<JSON>{singlequote}({stringchar}|{escape})*{singlequote} {
|
||||
yyerrorAbort("Bad character in JSON string");
|
||||
}
|
||||
|
||||
<INITIAL,JSON>. {
|
||||
char message[40];
|
||||
YY_BUFFER_STATE *dummy=0;
|
||||
|
||||
@@ -374,7 +374,7 @@ static int yyerror(char *str)
|
||||
else
|
||||
epicsPrintf("Error");
|
||||
if (!yyFailed) { /* Only print this stuff once */
|
||||
epicsPrintf(" at or before \"%s\"", yytext);
|
||||
epicsPrintf(" at or before '%s'", yytext);
|
||||
dbIncludePrint();
|
||||
yyFailed = TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user