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)
| 678 | // It is possible to have both non-nil Ast and Issues values returned from this call; however, |
| 679 | // the mere presence of an Ast does not imply that it is valid for use. |
| 680 | func (e *Env) ParseSource(src Source) (*Ast, *Issues) { |
| 681 | parsed, errs := e.prsr.Parse(src) |
| 682 | if len(errs.GetErrors()) > 0 { |
| 683 | return nil, &Issues{errs: errs} |
| 684 | } |
| 685 | return &Ast{source: src, impl: parsed}, nil |
| 686 | } |
| 687 | |
| 688 | // Program generates an evaluable instance of the Ast within the environment (Env). |
| 689 | func (e *Env) Program(ast *Ast, opts ...ProgramOption) (Program, error) { |