MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / parseSetStatement

Method parseSetStatement

plugins/dm.gui/gui/GuiScript.cpp:64–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64void GuiScript::parseSetStatement(parser::DefTokeniser& tokeniser)
65{
66 // Prototype: set [window::]<variable> <value>
67 StatementPtr st(new Statement(Statement::ST_SET));
68
69 st->args.push_back(_owner.parseString(tokeniser)); // variable
70
71 // Add all tokens up to the semicolon as arguments
72 while (true)
73 {
74 std::string token = tokeniser.peek();
75
76 // Sometimes the semicolon is missing
77 if (token == ";" || token == "}") break;
78
79 st->args.push_back(ConstantExpression<std::string>::Create(tokeniser.nextToken())); // argument
80 }
81
82 pushStatement(st);
83}
84
85void GuiScript::parseTransitionStatement(parser::DefTokeniser& tokeniser)
86{

Callers

nothing calls this directly

Calls 4

parseStringMethod · 0.80
push_backMethod · 0.45
peekMethod · 0.45
nextTokenMethod · 0.45

Tested by

no test coverage detected