Closed Whiteknight closed 1 year ago
I am simplifying Transform to only operate on result values. The transform callback will not have access to the IParseState<TInput>
or other contextual/state data, and cannot make modifications to the input sequence.
The TransformErrorResult
and TransformResult
parsers are disappearing as part of this work. (We might re-add the former in some capacity, if a real use-case can be found).
The current Transform parser passes the current parse state to the user, which can use it to make any arbitrary change to the parse state or parse result. This causes serious problems because, for example,
Match()
cannot be optimized in any meaningful way, and we cannot reason about the effects and side-effects of.Parse()
without knowing the contents of the user callback.We need to decide: