mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
safe parsing of "" and ''
This commit is contained in:
@@ -508,6 +508,12 @@ void PgfExprParser::token()
|
|||||||
if (ch == '\'') {
|
if (ch == '\'') {
|
||||||
getc();
|
getc();
|
||||||
token_tag = PGF_TOKEN_IDENT;
|
token_tag = PGF_TOKEN_IDENT;
|
||||||
|
if (token_value == NULL) {
|
||||||
|
token_value = (PgfText*)
|
||||||
|
malloc(sizeof(PgfText)+1);
|
||||||
|
token_value->size = 0;
|
||||||
|
token_value->text[0] = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -521,6 +527,12 @@ void PgfExprParser::token()
|
|||||||
if (ch == '"') {
|
if (ch == '"') {
|
||||||
getc();
|
getc();
|
||||||
token_tag = PGF_TOKEN_STR;
|
token_tag = PGF_TOKEN_STR;
|
||||||
|
if (token_value == NULL) {
|
||||||
|
token_value = (PgfText*)
|
||||||
|
malloc(sizeof(PgfText)+1);
|
||||||
|
token_value->size = 0;
|
||||||
|
token_value->text[0] = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user