Permalink
Browse files

Name change

	modified:   README
  • Loading branch information...
1 parent a737845 commit 027c7c35612ccc561a9324c8ba0f7b204c371dd4 joshua-choi committed Apr 25, 2009
Showing with 15 additions and 8 deletions.
  1. +7 −7 README
  2. +8 −1 test/test_parse.clj
View
@@ -1,20 +1,20 @@
-fnparse is a library for creating functional parsers in the Clojure programming
+FnParse is a library for creating functional parsers in the Clojure programming
language. It presents an easy, functional way to create parsers from EBNF rules and
was inspired by the paper Using Functional Parsing to Achieve Quality in Software
Maintenance (http://citeseer.ist.psu.edu/148293.html).
-fnparse's distribution has src and test folders. To use fnparse, download this
+FnParse's distribution has src and test folders. To use FnParse, download this
distribution and include its src folder in your program's classpath—for instance,
- java -cp $CLOJURE_PATH:path-to-fnparse/fnparse/src/ ...
+ java -cp $CLOJURE_PATH:path-to-FnParse/FnParse/src/ ...
-fnparse's namespace is name.choi.joshua.fnparse.
+FnParse's namespace is name.choi.joshua.FnParse.
-fnparse's unit tests are stored in the tests folder and require the test-is library
+FnParse's unit tests are stored in the tests folder and require the test-is library
from clojure-contrib, the Clojure standard library.
-For documentation, go to: http://github.com/joshua-choi/fnparse/wikis
+For documentation, go to: http://github.com/joshua-choi/FnParse/wikis
- * fnparse
+ * FnParse
* Copyright (c) 2009 Joshua Choi. All rights reserved.
* The use and distribution terms for this software are covered by the
* Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
View
@@ -333,7 +333,9 @@
rule (p/product-invisible-context [n digit, m digit]
(receiving-rule-maker (+ n m)))]
(is (= (rule (seq "31aaaa") {})
- [[3 1 [\3 \1 \a \a]] (seq "aa") {}]))))
+ [[3 1 [\3 \1 \a \a]] (seq "aa") {}]))
+ (is (= ((p/conc digit rule) (seq "531aaaa") {})
+ [[5 [3 1 [\3 \1 \a \a]]] (seq "aa") {}]))))
(deftest test-match-remainder
(is (= ((p/match-remainder (p/lit "hi") (p/lit "THEN")) ["hi" "THEN"] {})
@@ -345,5 +347,10 @@
(is (= ((p/match-remainder (p/lit "hi") (p/lit "THEN")) ["hi" "WELL"] {})
nil)
"created remainder-matching rule fails when given matching fails"))
+
+(deftest test-check-product
+ (is (= ((p/check-product (p/lit "hi") #(= % "hi")) ["hi" "THEN"] {})
+ [["hi"] (list "THEN") {}]))
+ (is (nil? ((p/check-product (p/lit "hi") #(not= % "hi")) ["hi" "THEN"] {}))))
(time (run-tests))

0 comments on commit 027c7c3

Please sign in to comment.