| 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 | { |
nothing calls this directly
no test coverage detected