fixed keywords with question marks
This commit is contained in:
parent
78b8308da1
commit
e58ece8ef7
14
parser.c
14
parser.c
|
@ -2897,6 +2897,13 @@ StmtNode *parseIfThenElseStmtNode(Token ***tokenp)
|
|||
goto parseIfThenElseStmtNodeAbort;
|
||||
}
|
||||
|
||||
/* Remove the question mark from the token stream */
|
||||
status = acceptToken(&tokens, TT_QUESTION);
|
||||
if (!status) {
|
||||
parser_error_expected_token(TT_QUESTION, tokens);
|
||||
goto parseIfThenElseStmtNodeAbort;
|
||||
}
|
||||
|
||||
/* The if keyword must appear on its own line */
|
||||
if (!acceptToken(&tokens, TT_NEWLINE)) {
|
||||
parser_error(PR_EXPECTED_END_OF_EXPRESSION, tokens);
|
||||
|
@ -3050,6 +3057,13 @@ StmtNode *parseSwitchStmtNode(Token ***tokenp)
|
|||
goto parseSwitchStmtNodeAbort;
|
||||
}
|
||||
|
||||
/* Remove the question mark from the token stream */
|
||||
status = acceptToken(&tokens, TT_QUESTION);
|
||||
if (!status) {
|
||||
parser_error_expected_token(TT_QUESTION, tokens);
|
||||
goto parseSwitchStmtNodeAbort;
|
||||
}
|
||||
|
||||
/* The switch keyword must appear on its own line */
|
||||
status = acceptToken(&tokens, TT_NEWLINE);
|
||||
if (!status) {
|
||||
|
|
|
@ -158,12 +158,12 @@ static const char *keywords[] = {
|
|||
"SMOOSH", /* TT_SMOOSH */
|
||||
"!", /* TT_BANG */
|
||||
"GIMMEH", /* TT_GIMMEH */
|
||||
"O RLY?", /* TT_ORLY */
|
||||
"O RLY", /* TT_ORLY */
|
||||
"YA RLY", /* TT_YARLY */
|
||||
"MEBBE", /* TT_MEBBE */
|
||||
"NO WAI", /* TT_NOWAI */
|
||||
"OIC", /* TT_OIC */
|
||||
"WTF?", /* TT_WTF */
|
||||
"WTF", /* TT_WTF */
|
||||
"OMG", /* TT_OMG */
|
||||
"OMGWTF", /* TT_OMGWTF */
|
||||
"GTFO", /* TT_GTFO */
|
||||
|
|
Loading…
Reference in New Issue