ParseSource parses the input source to an Ast and/or set of Issues. Parsing has failed if the returned Issues value and its Issues.Err() value is non-nil. Issues should be inspected if they are non-nil, but may not represent a fatal error. It is possible to have both non-nil Ast and Issues values
(src Source)
| 712 | // It is possible to have both non-nil Ast and Issues values returned from this call; however, |
| 713 | // the mere presence of an Ast does not imply that it is valid for use. |
| 714 | func (e *Env) ParseSource(src Source) (*Ast, *Issues) { |
| 715 | parsed, errs := e.prsr.Parse(src) |
| 716 | if len(errs.GetErrors()) > 0 { |
| 717 | return nil, &Issues{errs: errs} |
| 718 | } |
| 719 | return &Ast{source: src, impl: parsed}, nil |
| 720 | } |
| 721 | |
| 722 | // Program generates an evaluable instance of the Ast within the environment (Env). |
| 723 | func (e *Env) Program(ast *Ast, opts ...ProgramOption) (Program, error) { |