File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -1182,10 +1182,8 @@ SymbolAssignment *ScriptParser::readSymbolAssignment(StringRef name) {
1182
1182
Expr ScriptParser::readExpr () {
1183
1183
// Our lexer is context-aware. Set the in-expression bit so that
1184
1184
// they apply different tokenization rules.
1185
- bool orig = inExpr;
1186
- inExpr = true ;
1185
+ SaveAndRestore saved (inExpr, true );
1187
1186
Expr e = readExpr1 (readPrimary (), 0 );
1188
- inExpr = orig;
1189
1187
return e;
1190
1188
}
1191
1189
@@ -1251,9 +1249,9 @@ Expr ScriptParser::readExpr1(Expr lhs, int minPrec) {
1251
1249
StringRef op1 = peek ();
1252
1250
if (precedence (op1) < minPrec)
1253
1251
break ;
1254
- if (consume (" ?" ))
1255
- return readTernary (lhs);
1256
1252
skip ();
1253
+ if (op1 == " ?" )
1254
+ return readTernary (lhs);
1257
1255
Expr rhs = readPrimary ();
1258
1256
1259
1257
// Evaluate the remaining part of the expression first if the
You can’t perform that action at this time.
0 commit comments