MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / SourceRangeFromToken

Function SourceRangeFromToken

parser/parser.cc:129–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129SourceRange SourceRangeFromToken(const antlr4::Token* token) {
130 SourceRange range;
131 if (token != nullptr) {
132 if (auto start = token->getStartIndex(); start != INVALID_INDEX) {
133 range.begin = static_cast<int32_t>(start);
134 }
135 if (auto end = token->getStopIndex(); end != INVALID_INDEX) {
136 range.end = static_cast<int32_t>(end + 1);
137 }
138 }
139 return range;
140}
141
142SourceRange SourceRangeFromParserRuleContext(
143 const antlr4::ParserRuleContext* context) {

Callers 15

visitExprMethod · 0.85
visitConditionalOrMethod · 0.85
visitConditionalAndMethod · 0.85
visitRelationMethod · 0.85
visitCalcMethod · 0.85
visitLogicalNotMethod · 0.85
visitNegateMethod · 0.85
visitSelectMethod · 0.85
visitMemberCallMethod · 0.85
visitIndexMethod · 0.85
visitCreateMessageMethod · 0.85
visitFieldsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected