()
| 106 | } |
| 107 | |
| 108 | func (a *AST) parseNumber() NumberExprAST { |
| 109 | f64, err := strconv.ParseFloat(a.currTok.Tok, 64) |
| 110 | if err != nil { |
| 111 | a.Err = errors.New( |
| 112 | fmt.Sprintf("%v\nwant '(' or '0-9' but get '%s'\n%s", |
| 113 | err.Error(), |
| 114 | a.currTok.Tok, |
| 115 | ErrPos(a.source, a.currTok.Offset))) |
| 116 | return NumberExprAST{} |
| 117 | } |
| 118 | n := NumberExprAST{ |
| 119 | Val: f64, |
| 120 | Str: a.currTok.Tok, |
| 121 | } |
| 122 | a.getNextToken() |
| 123 | return n |
| 124 | } |
| 125 | |
| 126 | func (a *AST) parseFunCallerOrConst() ExprAST { |
| 127 | name := a.currTok.Tok |
no test coverage detected