MCPcopy Index your code
hub / github.com/sql-machine-learning/sqlflow / String

Method String

go/parser/ast/expr.go:175–196  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

173}
174
175func (e *Expr) String() string {
176 if !e.IsLiteral() { /* a compound expression */
177 switch {
178 case e.IsBinary():
179 return fmt.Sprintf("%s %s %s", e.sexp[1], e.sexp[0].value, e.sexp[2])
180 case e.IsUnary():
181 return fmt.Sprintf("%s %s", e.sexp[0], e.sexp[1])
182 case e.IsVariadic():
183 switch t := e.sexp[0].token; t {
184 case '[':
185 return "[" + strings.Join(e.cdr(), ", ") + "]"
186 case '(':
187 return "(" + strings.Join(e.cdr(), ", ") + ")"
188 default:
189 panic(fmt.Errorf("Stringize compound expression with unknown token %d", t))
190 }
191 case e.IsFuncall(): /* function call */
192 return e.sexp[0].value + "(" + strings.Join(e.cdr(), ", ") + ")"
193 }
194 }
195 return fmt.Sprintf("%s", e.value)
196}
197
198/* Like Lisp's builtin function cdr. */
199func (e *Expr) cdr() (r []string) {

Callers 15

buildAndPushImageFunction · 0.45
TestSQLFSWriteNothingFunction · 0.45
MakeSessionFromEnvFunction · 0.45
DecodePODTypeFunction · 0.45
GenerateTrainStmtFunction · 0.45
GeneratePredictStmtFunction · 0.45
GenerateExplainStmtFunction · 0.45
GenerateEvaluateStmtFunction · 0.45
GenerateOptimizeStmtFunction · 0.45
GenerateRunStmtFunction · 0.45

Calls 7

IsLiteralMethod · 0.95
IsBinaryMethod · 0.95
IsUnaryMethod · 0.95
IsVariadicMethod · 0.95
cdrMethod · 0.95
IsFuncallMethod · 0.95
ErrorfMethod · 0.80