Skip to content
This repository has been archived by the owner on Feb 3, 2018. It is now read-only.

Commit

Permalink
more work on errors
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-choi committed May 17, 2009
1 parent 80ba7fe commit fc87dd2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/name/choi/joshua/fnparse.clj
Expand Up @@ -6,7 +6,8 @@
; - If the token sequence is valid, it returns a (0) vector containing the (1) consumed
; symbols' products and (2) a state data object, usually a map. The state contains the (3)
; sequence of remaining tokens, usually with the key *remainder-accessor*.
; - If the given token sequence is invalid and the rule fails, it simply returns nil.
; - If the given token sequence is invalid, then the rule Fails, meaning that it either
; simply returns nil or raises an error.

; - (0) is called the rule's result.
; - (1) is called the rule's product.
Expand Down
2 changes: 1 addition & 1 deletion src/name/choi/joshua/fnparse/json.clj
Expand Up @@ -75,7 +75,7 @@

(def hexadecimal-digit
(failpoint (alt decimal-digit (lit-alt-seq "ABCDEF" nb-char-lit))
#(raise parse-error %2 "hexadecimal digit expected where \"%s\" is" [(first %1)])))
(expectation-error-fn "hexadecimal digit")))

(def unescaped-char (except json-char (alt escape-indicator string-delimiter)))

Expand Down

0 comments on commit fc87dd2

Please sign in to comment.