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

Method ParseVersion

libs/wgtcc/cpp.cc:445–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

443
444
445 void Preprocessor::ParseVersion(TokenSequence ls) {
446 auto directive = ls.Next(); // Skip directive 'version'
447 TokenSequence ts;
448 Expand(ts, ls);
449 auto tok = ts.Expect(Token::I_CONSTANT);
450
451 int ver = 0;
452 size_t end = 0;
453 try {
454 ver = stoi(tok->str_, &end, 10);
455 } catch (const std::out_of_range & oor) {
456 Error(tok, "version number out of range");
457 }
458
459 if (ts.Empty())
460 return;
461
462 tok = ts.Expect(Token::LITERAL);
463 // tok = "es", "core", etc...
464 }
465
466
467 void Preprocessor::ParseLine(TokenSequence ls) {

Callers

nothing calls this directly

Calls 4

ErrorFunction · 0.85
ExpectMethod · 0.80
NextMethod · 0.45
EmptyMethod · 0.45

Tested by

no test coverage detected