summaryrefslogtreecommitdiff
path: root/ELF/ScriptLexer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ELF/ScriptLexer.cpp')
-rw-r--r--ELF/ScriptLexer.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/ELF/ScriptLexer.cpp b/ELF/ScriptLexer.cpp
index d4b1f6d99cc1f..9a372c6d1c6f1 100644
--- a/ELF/ScriptLexer.cpp
+++ b/ELF/ScriptLexer.cpp
@@ -244,6 +244,15 @@ StringRef ScriptLexer::peek() {
return Tok;
}
+StringRef ScriptLexer::peek2() {
+ skip();
+ StringRef Tok = next();
+ if (errorCount())
+ return "";
+ Pos = Pos - 2;
+ return Tok;
+}
+
bool ScriptLexer::consume(StringRef Tok) {
if (peek() == Tok) {
skip();