Parse parses the string buffer to construct an ast representation for expansion.
(buf string)
| 42 | // Parse parses the string buffer to construct an ast |
| 43 | // representation for expansion. |
| 44 | func (t *Tree) Parse(buf string) (tree *Tree, err error) { |
| 45 | t.scanner.init(buf) |
| 46 | t.Root, err = t.parseAny() |
| 47 | return t, err |
| 48 | } |
| 49 | |
| 50 | func (t *Tree) parseAny() (Node, error) { |
| 51 | t.scanner.accept = acceptRune |