MCPcopy Create free account
hub / github.com/OpenSteam001/OpenSteamTool / expect

Method expect

tools/ipc_codegen/ipc_codegen.cpp:547–555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

545 void advance() { token_ = lexer_.next(); }
546
547 Token expect(Tok kind, const char* description = nullptr) {
548 if (token_.kind != kind) {
549 fail("expected " + std::string(description ? description : tokenName(kind)) +
550 ", got '" + token_.text + "'");
551 }
552 Token result = token_;
553 advance();
554 return result;
555 }
556
557 static const char* tokenName(Tok kind) {
558 switch (kind) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected