parse method
Parses the whole input.
Implementation
ParseResult parse() {
_clock.start();
if (!options.globalGroup) _macros.beginGroup();
RowNode root;
try {
final (row, _) = _parseRow(const _Stops());
root = row;
} finally {
if (!options.globalGroup) _macros.endGroup();
_clock.stop();
}
final result = ParseResult(
source: source,
root: root,
diagnostics: List.unmodifiable(_diagnostics),
tag: _tag,
label: _label,
noNumber: _noNumber,
incomplete: _sawIncomplete || _x.hitEndOfInput,
tagForm: _tagForm,
);
if (options.throwOnError) {
for (final d in _diagnostics) {
if (d.severity == Severity.error) throw LatexParseException(d);
}
}
return result;
}