| 98 | } |
| 99 | |
| 100 | void LuaSyntaxTree::EatInlineComment(LuaParser &p) { |
| 101 | auto &tokens = p.GetTokens(); |
| 102 | if (_tokenIndex > 0 && _tokenIndex < tokens.size()) { |
| 103 | auto index = _tokenIndex; |
| 104 | switch (tokens[index].TokenType) { |
| 105 | case TK_SHORT_COMMENT: |
| 106 | case TK_LONG_COMMENT: |
| 107 | case TK_SHEBANG: { |
| 108 | auto prevToken = tokens[index - 1]; |
| 109 | if (_source->GetLine(prevToken.Range.GetEndOffset()) == _source->GetLine(tokens[index].Range.StartOffset)) { |
| 110 | EatToken(p); |
| 111 | } |
| 112 | break; |
| 113 | } |
| 114 | default: { |
| 115 | return; |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | void LuaSyntaxTree::EatToken(LuaParser &p) { |
| 122 | auto &token = p.GetTokens()[_tokenIndex]; |
nothing calls this directly
no test coverage detected