Changeset 33651 in project


Ignore:
Timestamp:
09/13/16 20:36:04 (5 years ago)
Author:
sjamaan
Message:

Update prcc notes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/uri-generic/trunk/alternatives/README

    r33643 r33651  
    165165
    166166I used the comparse library as a basis, which was easy enough to
    167 convert to prcc.  There are unfortunately a few bugs regarding stack
    168 underflows (raised by the "stack" egg) and reading the empty string at
    169 eof resulted in a parse error, which means edge case parsing is
    170 tricky.  That means the current implementation does **not** pass the
    171 test suite.
     167convert to prcc.  Found a couple of bugs, which were fixed within
     168hours by the very responsive maintainer, even though the egg was from
     1692012 and had only one release!
    172170
    173 Another disadvantage is that parse errors will always be written to
    174 the current output port.  There seems to be no way to supply custom
    175 error handling.  The error handling itself is pretty decent in that it
    176 keeps track of input position and it knows what was expected when the
    177 error occurred.  Unfortunately, for more complex parsers this doesn't
    178 work perfectly: (parse-string "qux" (sel (str "foo") (str "bar")))
    179 results in an error that says "bar was expected".  On the other hand,
    180 this is easier to customize by using "act" with a custom failure
     171A real disadvantage is that parse errors will always be written to the
     172current output port.  There seems to be no way to supply custom error
     173handling.  The error handling itself is pretty decent in that it keeps
     174track of input position and it knows what was expected when the error
     175occurred.  Unfortunately, for more complex parsers this doesn't work
     176perfectly: (parse-string "qux" (sel (str "foo") (str "bar"))) results
     177in an error that says "bar was expected".  On the other hand, this
     178would be easy to customize by using "act" with a custom failure
    181179handler.
    182180
    183181It's obviously too slow for real-world use, probably because it uses
    184182srfi-41 which is not known to be efficient at all.  It could probably
    185 be converted to lazy-seq.
     183be converted to lazy-seq, which should speed things up, but I haven't
     184done any serious performance comparisons.
    186185
    187186=========================================================================
Note: See TracChangeset for help on using the changeset viewer.