mirror of
https://github.com/intel/llvm.git
synced 2026-01-17 23:45:25 +08:00
ELF: Add a skip() overload to ignore any token
Most functions that return StringRef should check their return values, so I'm planning on marking StringRef [[nodiscard]]. This requires splitting up functions like next() that are sometimes just used for side effects. llvm-svn: 284363
This commit is contained in:
@@ -150,6 +150,16 @@ bool ScriptParserBase::skip(StringRef Tok) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScriptParserBase::skip() {
|
||||
if (Error)
|
||||
return;
|
||||
if (atEOF()) {
|
||||
setError("unexpected EOF");
|
||||
return;
|
||||
}
|
||||
++Pos;
|
||||
}
|
||||
|
||||
void ScriptParserBase::expect(StringRef Expect) {
|
||||
if (Error)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user