return [=](uint64_t Dot) { return getConstant(Name); };
}
if (Tok == "DEFINED") {
- expect("(");
- StringRef Tok = next();
- expect(")");
- return [=](uint64_t Dot) { return ScriptBase->isDefined(Tok) ? 1 : 0; };
+ StringRef Name = readParenLiteral();
+ return [=](uint64_t Dot) { return ScriptBase->isDefined(Name) ? 1 : 0; };
}
if (Tok == "SEGMENT_START") {
expect("(");
if (consume("extern"))
readVersionExtern(&V);
- StringRef Cur = peek();
- if (Cur == "}" || Cur == "local:" || Error)
+ if (peek() == "}" || peek() == "local:" || Error)
return;
- skip();
- V.push_back({unquote(Cur), false, hasWildcard(Cur)});
+ StringRef Tok = next();
+ V.push_back({unquote(Tok), false, hasWildcard(Tok)});
expect(";");
}
}
expect("\"C++\"");
expect("{");
- for (;;) {
- if (peek() == "}" || Error)
- break;
- bool HasWildcard = !peek().startswith("\"") && hasWildcard(peek());
- V->push_back({unquote(next()), true, HasWildcard});
+ while (!Error && peek() != "}") {
+ StringRef Tok = next();
+ bool HasWildcard = !Tok.startswith("\"") && hasWildcard(Tok);
+ V->push_back({unquote(Tok), true, HasWildcard});
expect(";");
}