MCPcopy Create free account
hub / github.com/dfranx/ShaderDebugger / Finalize

Method Finalize

libs/wgtcc/cpp.cc:244–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242
243
244 void Preprocessor::Finalize(TokenSequence os) {
245 while (!os.Empty()) {
246 auto tok = os.Next();
247 if (tok->tag_ == Token::INVALID) {
248 Error(tok, "stray token in program");
249 }
250 else if (tok->tag_ == Token::IDENTIFIER) {
251 auto tag = Token::KeyWordTag(tok->str_);
252 if (Token::IsKeyWord(tag)) {
253 const_cast<Token*>(tok)->tag_ = tag;
254 }
255 else {
256 const_cast<Token*>(tok)->str_ = Scanner(tok).ScanIdentifier();
257 }
258 }
259 if (!tok->loc_.filename_) {
260 assert(false);
261 }
262 }
263 }
264
265
266 // TODO(wgtdkp): add predefined macros

Callers 1

ParseStructUnionDeclMethod · 0.45

Calls 5

ErrorFunction · 0.85
ScanIdentifierMethod · 0.80
ScannerClass · 0.70
EmptyMethod · 0.45
NextMethod · 0.45

Tested by

no test coverage detected