void ScriptParser::readOutputArch() {
// Error checking only for now.
expect("(");
- next();
+ skip();
expect(")");
}
void ScriptParser::readOutputFormat() {
// Error checking only for now.
expect("(");
- next();
+ skip();
StringRef Tok = next();
if (Tok == ")")
return;
setError("unexpected token: " + Tok);
return;
}
- next();
+ skip();
expect(",");
- next();
+ skip();
expect(")");
}
return readTernary(Lhs);
if (precedence(Op1) < MinPrec)
break;
- next();
+ skip();
Expr Rhs = readPrimary();
// Evaluate the remaining part of the expression first if the
}
if (Tok == "SEGMENT_START") {
expect("(");
- next();
+ skip();
expect(",");
Expr E = readExpr();
expect(")");
}
Expr ScriptParser::readTernary(Expr Cond) {
- next();
+ skip();
Expr L = readExpr();
expect(":");
Expr R = readExpr();
// version hierarchy is, probably against your instinct, purely for human; the
// runtime doesn't care about them at all. In LLD, we simply skip the token.
if (!VerStr.empty() && peek() != ";")
- next();
+ skip();
expect(";");
}
StringRef Cur = peek();
if (Cur == "}" || Cur == "local:" || Error)
return;
- next();
+ skip();
Globals->push_back({unquote(Cur), false, hasWildcard(Cur)});
expect(";");
}