parse method
Parses raw schema source and returns a SchemaDocument.
Throws SchemaParseException if any parse error is encountered.
Implementation
SchemaDocument parse(String source) {
final result = parseResult(source);
if (result.hasErrors) {
final first = result.errors.first;
throw SchemaParseException(
first.message,
line: first.line,
column: first.column,
);
}
return result.document;
}