« first day (3775 days earlier)      last day (5 days later) » 

3:50 AM
posted on March 02, 2021 by hostilefork

The combinator-based approach to parsing breaks each parse keyword or datatype behavior out into a "parser function". This is a simple implementation of COLLECT and KEEP combinators that collaborate with the BLOCK! combinator to do rollback. It would be preferable to have some kind of "generic rollback facility", but this is more or less what the C code was doing to implement the feature.

 
 
4 hours later…
8:18 AM
posted on March 02, 2021 by hostilefork

One thing's for sure about UPARSE, you can really try new ideas out fast. Here's one... what if it were easier to make objects via PARSE? Here's GATHER and EMIT...which feature rollback (just like COLLECT and KEEP) but are tailored for making objects: >> uparse [* * * 1 <foo> * * *] [ some '* g: gather [ emit i: integer!, emit t: text! | emit i:

 
 
12 hours later…
8:24 PM
posted on March 02, 2021 by hostilefork

Early on, I wondered why we couldn't invoke an ordinary function in PARSE, where its arguments were gathered by rules. For instance: What if you want to call SPLIT on part of the input. Here's a particularly laborious way of doing it: parse "(((1|2|3)))" [ some "(" let start: here to ")" let limit: here let items: do [split/part start "|" limit] ; v-- see No

 

« first day (3775 days earlier)      last day (5 days later) »