Skip to content

Commit

Permalink
Merge pull request #10 from carocad/more-unicodes
Browse files Browse the repository at this point in the history
More unicodes
  • Loading branch information
carocad committed Oct 9, 2019
2 parents 6072623 + 606e94c commit c149e1c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject carocad/parcera "0.1.2"
(defproject carocad/parcera "0.1.3"
:description "Grammar-based Clojure(script) parser"
:url "https://github.com/carocad/parcera"
:license {:name "LGPLv3"
Expand Down
4 changes: 2 additions & 2 deletions src/parcera/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@
;; EDN reader says otherwise https://github.com/edn-format/edn#symbols
;; nil, true, false are actually symbols with special meaning ... not grammar rules
;; on their own
VALID-CHARACTERS>: #'[\\w.*+\\-!?$%&=<>\\':#]+'
VALID-CHARACTERS>: #'[^\\s\\(\\)\\[\\]{}\"@~]+'
*)
<name>: #'([\\p{L}\\w.*+\\-!?$%&=<>\\':#]+\\/)?(\\/|([\\p{L}\\w.*+\\-!?$%&=<>\\':#]+))(?!\\/)'
<name>: #'([^\\s\\(\\)\\[\\]{}\"@~,\\\\]+\\/)?(\\/|([^\\s\\(\\)\\[\\]{}\"@~,\\\\]+))(?!\\/)'
(* HIDDEN PARSERS ------------------------------------------------------ *)
Expand Down
11 changes: 11 additions & 0 deletions test/parcera/test/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@
"high accuracy\n"
(with-out-str (pprint/pprint result)))))))

(deftest unit-tests
(testing "names"
(as-> "foo" input (is (= input (parcera/code (parcera/clojure input)))))
(as-> "foo-bar" input (is (= input (parcera/code (parcera/clojure input)))))
(as-> "foo->bar" input (is (= input (parcera/code (parcera/clojure input)))))
(as-> "->" input (is (= input (parcera/code (parcera/clojure input)))))
(as-> "->as" input (is (= input (parcera/code (parcera/clojure input)))))
(as-> "föl" input (is (= input (parcera/code (parcera/clojure input)))))
(as-> "Öl" input (is (= input (parcera/code (parcera/clojure input)))))
(as-> "ϕ" input (is (= input (parcera/code (parcera/clojure input)))))
(as-> "❤️" input (is (= input (parcera/code (parcera/clojure input)))))))

(deftest macros
(testing "metadata"
Expand Down

0 comments on commit c149e1c

Please sign in to comment.