A specialized implementation that matches single characters
Advances the marker until the given movement can be applied, optionally skipping parts of the input.
Advances the marker until the given movement can be applied, optionally skipping parts of the input.
Note that the movement specified by skipping is applied after mvnt. This matters if there is input that might be matched by both movements. Here is an example:
val src = SimpleMovement("0123456789".toCharArray) src.moveMarker(until('5', skipping = digit))
will move the marker to 5, because 5 is matched before digit. However doing
src.moveMarker(until('5', skipping = digit.zeroOrMore))
will leave the marker at 0, since digit.zeroOrMore will consume the entire string, after matching 5 against 0 has failed.
Various movements related to Scala code
Take a look at the Scala Language Specification if you wonder about terms like plainid, idrest or varid.