Skip to content

Commit

Permalink
Merge pull request #48 from carocad/unicode
Browse files Browse the repository at this point in the history
fix: wrong range used for unicode
  • Loading branch information
carocad committed Dec 5, 2019
2 parents 1a4a3ad + 0dd8521 commit 8ad1f4c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion project.clj
@@ -1,4 +1,4 @@
(defproject carocad/parcera "0.5.4"
(defproject carocad/parcera "0.5.5"
:description "Grammar-based Clojure parser"
:url "https://github.com/carocad/parcera"
:license {:name "LGPLv3"
Expand Down
2 changes: 1 addition & 1 deletion src/Clojure.g4
Expand Up @@ -139,7 +139,7 @@ fragment UNICODE_CHAR: ~[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF];

fragment NAMED_CHAR: 'newline' | 'return' | 'space' | 'tab' | 'formfeed' | 'backspace';

fragment UNICODE: 'u' [0-9d-fD-F] [0-9d-fD-F] [0-9d-fD-F] [0-9d-fD-F];
fragment UNICODE: 'u' [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F];

// symbols can contain : # ' as part of their names
fragment NAME_BODY: NAME_HEAD | [#':0-9];
Expand Down
6 changes: 6 additions & 0 deletions test/parcera/test/core.cljc
Expand Up @@ -111,6 +111,12 @@
(is (roundtrip input)))
;(is (clear input))))
(let [input "\\ϕ"]
(is (valid? input))
(is (roundtrip input)))
(let [input "\ua000"]
(is (valid? input))
(is (roundtrip input)))
(let [input "\u000a"]
(is (valid? input))
(is (roundtrip input)))))

Expand Down

0 comments on commit 8ad1f4c

Please sign in to comment.