nikodemus / esrap

OLD REPOSITORY: Please go to:
https://github.com/scymtym/esrap
81 stars 25 forks source link

Add conditions ESRAP-ERROR, [SIMPLE-]ESRAP-PARSE-ERROR, LEFT-RECURSION #12

Closed scymtym closed 12 years ago

scymtym commented 12 years ago
> Could not parse subexpression #1=(OR (& #\,) (! CHARACTER)) when parsing
>
>   Expression INTEGER
>     Subexpression (AND #2=(? WHITESPACE) DIGITS #3=(AND #2# #1#))
>     Subexpression #3#
>     Subexpression #1#
>
>   Encountered at:
>         v (Line 1, Column 4, Position 3)
>     "123foo"
>    [Condition of type SIMPLE-ESRAP-PARSE-ERROR]
nikodemus commented 12 years ago

Many thanks! I've merged something based on this.

Main alterations (aside from missing include/ prefixes these are really just stylistic nits):

whitespace style

use plain ^ for marking the error position instead of V and >< (I find additional markers make things harder for me to read, not easier, and strongly prefer to have the actual error text both pristine and before any markers.)

esrap-parse-error -> esrap-error

use print-object for error reporting instead of a format function

don't expose the simple-esrap-error

manual fixes

scymtym commented 12 years ago

Thanks.