You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parser.token seems to be a good place to understand what Backtrackable means.
However, I would say there is a conflict in the naming between progress and Backtrackable. Also, why is the decision based on the input str and not on result of findSubString.
Is it to protect user code from empty tokens ?
lettoken(Token(str,expecting)):Parser<'Context,'Problem,unit>=
ParserFunc
<|fun state ->letprogress=not(String.isEmpty str)letresult= findSubString str state.Offset state.Row state.Column state.Source
match result with| SubStringResult.NoMatch _->
ParserStep.Failed
{
Backtrackable =false
Bag = fromState state expecting
}| SubStringResult.Match result ->
ParserStep.Success
{
Backtrackable = progress
Value =()
State ={ state with
Offset = result.Offset
Row = result.Row
Column = result.Column
}}
Backtrackable
doesBacktrackable
stateoneOf
map
map2
andThen
The text was updated successfully, but these errors were encountered: