Closed tgockel closed 4 years ago
Change parse_error
into something that ASTs can utilize. A huge amount of time is wasted in detail::parse_context::next
tracking lines and columns (~15%), even though this is barely used. Beyond that, having multiple problem
s is more of an error with serialization than parsing (parsing can go awry quickly).
The current
parse_options
(and the associatedparse_error
) has a few things that are no longer relevant.failure_mode
: A parse error should not have a failure mode of any significance. Skipping over a token is dangerous at best. However, an extraction error can logically haveon_error::fail_immediately
andon_error::collect_all
options (on_error::ignore
seems deeply misguided)max_failures
: No longer relevant.string_encoding
: Removeencoding::cesu8
number_encoding
: Remove entirely -- allowing leading zeros is confusing in the first placecomma_policy
: Remove entirely -- treating trailing commas as whitespace is dangerous and slows the parser downmax_structure_depth
: Keep.require_document
: Keep.complete_parse
: Keep, but without atokenizer
, things get hairy.comments
: Keep.