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

Method parseMethod

tools/ipc_codegen/ipc_codegen.cpp:378–397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376 }
377
378 Method parseMethod() {
379 Method method;
380 method.line = token_.line;
381 method.retType = expect(Tok::Ident, "return type").text;
382 method.name = expect(Tok::Ident, "method name").text;
383 expect(Tok::LParen);
384 std::unordered_set<std::string> names;
385 if (token_.kind != Tok::RParen) {
386 for (;;) {
387 Field field = parseField(true);
388 ensureUnique(names, field.name, "method parameter", field.line);
389 method.params.push_back(std::move(field));
390 if (token_.kind != Tok::Comma) break;
391 advance();
392 }
393 }
394 expect(Tok::RParen);
395 expect(Tok::Semi);
396 return method;
397 }
398
399 Field parseField(bool allowDirection) {
400 Field field;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected