NewParser returns a new instance of Parser.
(r io.Reader)
| 35 | |
| 36 | // NewParser returns a new instance of Parser. |
| 37 | func NewParser(r io.Reader) *Parser { |
| 38 | return &Parser{s: newBufScanner(r)} |
| 39 | } |
| 40 | |
| 41 | // ParseExpr parses an expression string and returns its AST representation. |
| 42 | func ParseExpr(s string) (Expr, error) { return NewParser(strings.NewReader(s)).ParseExpr(0) } |