Error returns an error if there are any errors in the Parser's errors slice
()
| 146 | |
| 147 | // Error returns an error if there are any errors in the Parser's errors slice |
| 148 | func (p *Parser) Error() error { |
| 149 | // if there are no errors, return nil |
| 150 | if len(p.errors) == 0 { |
| 151 | return nil |
| 152 | } |
| 153 | // if there are errors, return the first error message in the errors slice as an error type |
| 154 | return errors.New(p.errors[0]) |
| 155 | } |
| 156 | |
| 157 | // Parse reads and parses the input string and returns an AST representation of the schema, along with any errors encountered during parsing |
| 158 | func (p *Parser) Parse() (*ast.Schema, error) { |
no outgoing calls