mustNewParser does the work of NewParser and panics if an error occurs. This function is only intended for internal use and is for backwards compatibility in Parse and ParseWithMacros, where we know the options will result in an error.
(opts ...Option)
| 81 | // This function is only intended for internal use and is for backwards compatibility in Parse and |
| 82 | // ParseWithMacros, where we know the options will result in an error. |
| 83 | func mustNewParser(opts ...Option) *Parser { |
| 84 | p, err := NewParser(opts...) |
| 85 | if err != nil { |
| 86 | panic(err) |
| 87 | } |
| 88 | return p |
| 89 | } |
| 90 | |
| 91 | // Parse parses the expression represented by source and returns the result. |
| 92 | func (p *Parser) Parse(source common.Source) (*ast.AST, *common.Errors) { |