PARSE: the new INTO rule
The focus of A86 was to rework the code to make it possible to finish more of the needed changes to the PARSE function. This release should also fix a few bugs, but the focus of this release was not on bug fixing (that will happen soon.)
One change of interest in A86 is that INTO can enter into a sub-parse of a string. For example, this line parses both a block and the string within it:
>> parse [a "test"] ['a into ["te" "st"]]
== true
Of course, most of the time you will want to confirm the datatype before such a match. This can be done with the AND word:
>> parse [a "test"] ['a and string! into ["te" "st"]]
== true
Here AND checks that the input is a string before the sub-parse. (Because AND does not advance the input.)
2 Comments
|