MCPcopy Create free account
hub / github.com/brimdata/super / dottedName

Function dottedName

compiler/semantic/expr.go:1050–1067  ·  view source on GitHub ↗
(e *ast.BinaryExpr)

Source from the content-addressed store, hash-verified

1048}
1049
1050func dottedName(e *ast.BinaryExpr) (string, bool) {
1051 if e.Op != "." {
1052 return "", false
1053 }
1054 rhs, ok := idString(e.RHS)
1055 if !ok {
1056 return "", false
1057 }
1058 if _, ok := idString(e.LHS); ok {
1059 return rhs, true
1060 }
1061 if lhs, ok := e.LHS.(*ast.BinaryExpr); ok {
1062 if _, ok := dottedName(lhs); ok {
1063 return rhs, true
1064 }
1065 }
1066 return "", false
1067}
1068
1069func idString(e ast.Expr) (string, bool) {
1070 switch e := e.(type) {

Callers 1

deriveNameFromExprFunction · 0.85

Calls 1

idStringFunction · 0.85

Tested by

no test coverage detected