MCPcopy Create free account
hub / github.com/OpenMW/openmw / parseKeyword

Method parseKeyword

components/compiler/scriptparser.cpp:32–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30 }
31
32 bool ScriptParser::parseKeyword(int keyword, const TokenLoc& loc, Scanner& scanner)
33 {
34 if (keyword == Scanner::K_while || keyword == Scanner::K_if || keyword == Scanner::K_elseif)
35 {
36 mControlParser.reset();
37 if (mControlParser.parseKeyword(keyword, loc, scanner))
38 scanner.scan(mControlParser);
39
40 mControlParser.appendCode(mOutput.getCode());
41
42 return true;
43 }
44
45 /// \todo add an option to disable this nonsense
46 if (keyword == Scanner::K_endif)
47 {
48 // surplus endif
49 getErrorHandler().warning("endif without matching if/elseif", loc);
50
51 SkipParser skip(getErrorHandler(), getContext());
52 scanner.scan(skip);
53 return true;
54 }
55
56 if (keyword == Scanner::K_end && mEnd)
57 {
58 return false;
59 }
60
61 mLineParser.reset();
62 if (mLineParser.parseKeyword(keyword, loc, scanner))
63 scanner.scan(mLineParser);
64
65 return true;
66 }
67
68 bool ScriptParser::parseSpecial(int code, const TokenLoc& loc, Scanner& scanner)
69 {

Callers

nothing calls this directly

Calls 4

scanMethod · 0.80
appendCodeMethod · 0.80
warningMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected