diff options
author | David Greene <greened@obbligato.org> | 2011-10-19 13:03:35 +0000 |
---|---|---|
committer | David Greene <greened@obbligato.org> | 2011-10-19 13:03:35 +0000 |
commit | a761f92cd38572dd65cc995c5f59b9c2c0f51068 (patch) | |
tree | 7579642821f2a06f6082eece3a8bc2f94eaec200 /lib/TableGen/TGLexer.h | |
parent | 9c42bcf2ca4844162b427d017fa419bf93f258e3 (diff) | |
download | llvm-a761f92cd38572dd65cc995c5f59b9c2c0f51068.tar.gz llvm-a761f92cd38572dd65cc995c5f59b9c2c0f51068.tar.bz2 llvm-a761f92cd38572dd65cc995c5f59b9c2c0f51068.tar.xz |
Add Peek
Add a peek function to let the Lexer look at a character arbitrarily
far ahead in the stream without consuming anything. We need this to
disambiguate numbers and operands of a paste operation. For example:
def foo#8i
Without lookahead the lexer will treat '8' as a number rather than as
part of a string to be pasted to form an identifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142512 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/TableGen/TGLexer.h')
-rw-r--r-- | lib/TableGen/TGLexer.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/TableGen/TGLexer.h b/lib/TableGen/TGLexer.h index 84d328b12d..24f8ea4ce5 100644 --- a/lib/TableGen/TGLexer.h +++ b/lib/TableGen/TGLexer.h @@ -109,6 +109,7 @@ private: tgtok::TokKind ReturnError(const char *Loc, const Twine &Msg); int getNextChar(); + int peekNextChar(int Index); void SkipBCPLComment(); bool SkipCComment(); tgtok::TokKind LexIdentifier(); |