summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Lexer.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* When in keep whitespace mode, make sure to return block comments that areChris Lattner2008-10-121-2/+22
| | | | | | unterminated. llvm-svn: 57403
* Change SkipBlockComment and SkipBCPLComment to return true when inChris Lattner2008-10-121-18/+22
| | | | | | keep comment mode, instead of returning false. This matches SkipWhitespace. llvm-svn: 57402
* Add a new mode to the lexer which enables it to return all characters,Chris Lattner2008-10-121-15/+49
| | | | | | | | | | | | | | | | | | | | | | | | even whitespace, as tokens from the file. This is enabled with L->SetKeepWhitespaceMode(true) on a raw lexer. In this mode, you too can use clang as a really complex version of 'cat' with code like this: Lexer RawLex(SourceLocation::getFileLoc(SM.getMainFileID(), 0), PP.getLangOptions(), File.first, File.second); RawLex.SetKeepWhitespaceMode(true); Token RawTok; RawLex.LexFromRawLexer(RawTok); while (RawTok.isNot(tok::eof)) { std::cout << PP.getSpelling(RawTok); RawLex.LexFromRawLexer(RawTok); } This will emit exactly the input file, with no canonicalization or other translation. Realistic clients actually do something with the tokens of course :) llvm-svn: 57401
* Fix a couple more places that poke KeepCommentMode unnecesarily. Chris Lattner2008-10-121-3/+4
| | | | llvm-svn: 57398
* add a new inKeepCommentMode() accessor to abstract the KeepCommentModeChris Lattner2008-10-121-4/+4
| | | | | | ivar. llvm-svn: 57397
* fix misleading comment.Chris Lattner2008-10-121-1/+1
| | | | llvm-svn: 57396
* Simplify raw mode lexing by treating an unterminate /**/ comment theChris Lattner2008-10-121-3/+4
| | | | | | | | same we we do an unterminated string or character literal. This makes it so we can guarantee that the lexer never calls into the preprocessor (which would be suicide for a raw lexer). llvm-svn: 57395
* add a comment.Chris Lattner2008-10-121-0/+2
| | | | llvm-svn: 57394
* Change how raw lexers are handled: instead of creating them and thenChris Lattner2008-10-121-5/+6
| | | | | | | | | | | using LexRawToken, create one and use LexFromRawLexer. This avoids twiddling the RawLexer flag around and simplifies some code (even speeding raw lexing up a tiny bit). This change also improves the token paster to use a Lexer on the stack instead of new/deleting it. llvm-svn: 57393
* silence some release-assert warnings.Chris Lattner2008-10-121-2/+1
| | | | llvm-svn: 57391
* improve a comment.Chris Lattner2008-10-121-1/+2
| | | | llvm-svn: 57389
* Change Parser & Sema to use interned "super" for comparions.Daniel Dunbar2008-08-141-6/+0
| | | | | | | | | | | | | | - Added as private members for each because it is not clear where to put the common definition. Perhaps the IdentifierInfos all of these "pseudo-keywords" should be collected into one place (this would KnownFunctionIDs and Objective-C property IDs, for example). Remove Token::isNamedIdentifier. - There isn't a good reason to use strcmp when we have interned strings, and there isn't a good reason to encourage clients to do so. llvm-svn: 54794
* Fix typoNate Begeman2008-04-141-1/+1
| | | | llvm-svn: 49632
* don't diagnose empty source files, thanks Neil!Chris Lattner2008-04-121-2/+3
| | | | llvm-svn: 49575
* don't read off the front of the buffer. Thanks to Sam for pointing this out.Chris Lattner2008-04-111-1/+1
| | | | llvm-svn: 49535
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+1661
lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402
OpenPOWER on IntegriCloud