(entity *ast.FromEval, args []ast.OpArg, seq sem.Seq)
| 198 | } |
| 199 | |
| 200 | func (t *translator) fromFString(entity *ast.FromEval, args []ast.OpArg, seq sem.Seq) (sem.Seq, string) { |
| 201 | expr, _ := t.fstringExpr(entity.Expr, t.checker.unknown) |
| 202 | val, ok := t.maybeEval(expr) |
| 203 | if ok && !hasError(val) { |
| 204 | if bad := t.hasFromParent(entity, seq); bad != nil { |
| 205 | return bad, "" |
| 206 | } |
| 207 | return t.fromConst(val, entity, args) |
| 208 | } |
| 209 | // This is an expression so set up a robot scanner that pulls values from |
| 210 | // parent to decide what to scan. |
| 211 | return append(seq, &sem.RobotScan{ |
| 212 | Node: entity, |
| 213 | Expr: expr, |
| 214 | Format: t.asFormatArg(args), |
| 215 | }), "" |
| 216 | } |
| 217 | |
| 218 | func hasError(val super.Value) bool { |
| 219 | result := function.HasError{}.Call([]super.Value{val}) |
no test coverage detected