Parse parses the expression represented by source and returns the result.
(source common.Source)
| 86 | |
| 87 | // Parse parses the expression represented by source and returns the result. |
| 88 | func (p *Parser) Parse(source common.Source) (*ast.AST, *common.Errors) { |
| 89 | if p.enablePrattParser { |
| 90 | return (&prattParser{options: p.options}).Parse(source) |
| 91 | } |
| 92 | return (&antlrParser{options: p.options}).Parse(source) |
| 93 | } |
| 94 | |
| 95 | // reservedIds are not legal to use as variables. We exclude them post-parse, as they *are* valid |
| 96 | // field names for protos, and it would complicate the grammar to distinguish the cases. |