| 140 | } |
| 141 | |
| 142 | SourceRange SourceRangeFromParserRuleContext( |
| 143 | const antlr4::ParserRuleContext* context) { |
| 144 | SourceRange range; |
| 145 | if (context != nullptr) { |
| 146 | if (auto start = context->getStart() != nullptr |
| 147 | ? context->getStart()->getStartIndex() |
| 148 | : INVALID_INDEX; |
| 149 | start != INVALID_INDEX) { |
| 150 | range.begin = static_cast<int32_t>(start); |
| 151 | } |
| 152 | if (auto end = context->getStop() != nullptr |
| 153 | ? context->getStop()->getStopIndex() |
| 154 | : INVALID_INDEX; |
| 155 | end != INVALID_INDEX) { |
| 156 | range.end = static_cast<int32_t>(end + 1); |
| 157 | } |
| 158 | } |
| 159 | return range; |
| 160 | } |
| 161 | |
| 162 | } // namespace |
| 163 |
no outgoing calls
no test coverage detected