refactor for error handling
This commit is contained in:
parent
ad4098e4a4
commit
72397d937e
|
@ -83,11 +83,12 @@
|
||||||
ws < sp / nl
|
ws < sp / nl
|
||||||
")
|
")
|
||||||
|
|
||||||
(let ((match (match-pattern script input)))
|
(let* ((match (match-pattern script input))
|
||||||
|
(tree (peg:tree match)))
|
||||||
(if (not (eq? (string-length input) (peg:end match)))
|
(if (not (eq? (string-length input) (peg:end match)))
|
||||||
(let ((tree (peg:tree match)))
|
(begin
|
||||||
(pretty-print (peg:tree match))
|
(pretty-print tree)
|
||||||
(pretty-print "parse error" (current-error-port))
|
(pretty-print "parse error" (current-error-port))
|
||||||
(pretty-print (peg:end match))
|
(pretty-print (peg:end match))
|
||||||
#f)
|
#f)
|
||||||
(peg:tree match))))
|
tree)))
|
||||||
|
|
Loading…
Reference in New Issue