nikodemus/esrap — pull request #12 by scymtym (2012-05-18 22:45:59+00:00)
Title: This patch adds conditions ESRAP-ERROR, [SIMPLE-]ESRAP-PARSE-ERROR, LEFT-RECURSION

* New condition classes
`ESRAP-ERROR` is the superclass for esrap conditions
`ESRAP-PARSE-ERROR` is the superclass for parse errors
`SIMPLE-ESRAP-PARSE-ERROR` is a `SIMPLE-ERROR` and `ESRAP-PARSE-ERROR`
`LEFT-RECURSION` is a `ESRAP-PARSE-ERROR` that is signaled when left
recursion is detected

* `PARSE` signals these errors
failed parse -> `SIMPLE-ESRAP-PARSE-ERROR`
rule not active -> `SIMPLE-ESRAP-PARSE-ERROR`
incomplete parse -> `SIMPLE-ESRAP-PARSE-ERROR`
left recursion -> `LEFT-RECURSION`

* Position indication in condition reports is also slightly better:
```
> 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]
```