Create an input stream to represent a pre-tokenized input file. TODO(tfoley): pre-tokenizing files isn't going to work in the long run.
| 191 | // Create an input stream to represent a pre-tokenized input file. |
| 192 | // TODO(tfoley): pre-tokenizing files isn't going to work in the long run. |
| 193 | static PreprocessorInputStream* CreateInputStreamForSource(Preprocessor* preprocessor, CoreLib::String const& source, CoreLib::String const& fileName) |
| 194 | { |
| 195 | SourceTextInputStream* inputStream = new SourceTextInputStream(); |
| 196 | InitializeInputStream(preprocessor, inputStream); |
| 197 | |
| 198 | // Use existing `Lexer` to generate a token stream. |
| 199 | Lexer lexer; |
| 200 | inputStream->lexedTokens = lexer.Parse(fileName, source, GetSink(preprocessor)); |
| 201 | inputStream->tokenReader = TokenReader(inputStream->lexedTokens); |
| 202 | |
| 203 | return inputStream; |
| 204 | } |
| 205 | |
| 206 | |
| 207 |
no test coverage detected