MCPcopy
hub / github.com/uber/aresdb / getLocation

Method getLocation

query/sql/sql_parser.go:1412–1431  ·  view source on GitHub ↗
(input interface{})

Source from the content-addressed store, hash-verified

1410}
1411
1412func (v *ASTBuilder) getLocation(input interface{}) *tree.NodeLocation {
1413 var token antlr.Token
1414 switch i := input.(type) {
1415 case antlr.ParserRuleContext:
1416 util.RequireNonNull(input, "antlrgenRuleContext is null")
1417 token = i.GetStart()
1418 case antlr.TerminalNode:
1419 util.RequireNonNull(input, "terminalNode is null")
1420 token = i.GetSymbol()
1421 case antlr.Token:
1422 token = i
1423 default:
1424 token = nil
1425 }
1426 util.RequireNonNull(token, "token is null")
1427 return &tree.NodeLocation{
1428 Line: token.GetLine(),
1429 CharPosition: token.GetColumn(),
1430 }
1431}
1432
1433// getText extracts string from original input sql
1434func (v *ASTBuilder) getText(ctx antlr.ParserRuleContext) string {

Callers 15

aggregateResultMethod · 0.95
VisitQueryMethod · 0.95
VisitWithMethod · 0.95
VisitNamedQueryMethod · 0.95
VisitQueryNoWithMethod · 0.95
VisitSelectAllMethod · 0.95
VisitSelectSingleMethod · 0.95
VisitGroupByMethod · 0.95
VisitSortItemMethod · 0.95
VisitLogicalBinaryMethod · 0.95

Calls 1

RequireNonNullFunction · 0.92

Tested by

no test coverage detected