]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix peg equals? method
authorChris Double <chris@bethia.(none)>
Thu, 10 Jul 2008 05:17:36 +0000 (17:17 +1200)
committerChris Double <chris@bethia.(none)>
Thu, 10 Jul 2008 05:17:36 +0000 (17:17 +1200)
extra/peg/peg-tests.factor
extra/peg/peg.factor

index 62e041441f01bf50ce890163622540d8589f8af8..b11b1011c3e1374ceb2855698b1c95f2ab8ba0d7 100644 (file)
@@ -193,3 +193,4 @@ IN: peg.tests
   "B" [ drop t ] satisfy [ 66 >= ] semantic parse
 ] unit-test
 
+{ f } [ \ + T{ parser f f f } equal? ] unit-test
\ No newline at end of file
index 11d36f032c0413c57ec59f6a0e3033658172408f..868072efa5a79315805621e5d0263e81317a03ec 100755 (executable)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel sequences strings fry namespaces math assocs shuffle debugger io
        vectors arrays math.parser math.order vectors combinators combinators.lib
-       sets unicode.categories compiler.units parser
+       combinators.short-circuit classes sets unicode.categories compiler.units parser
        words quotations effects memoize accessors locals effects splitting ;
 IN: peg
 
@@ -12,7 +12,7 @@ TUPLE: parse-result remaining ast ;
 TUPLE: parse-error position messages ; 
 TUPLE: parser peg compiled id ;
 
-M: parser equal?    [ id>> ] bi@ = ;
+M: parser equal?    { [ [ class ] bi@ = ] [ [ id>> ] bi@ = ] } 2&& ;
 M: parser hashcode* id>> hashcode* ;
 
 C: <parse-result> parse-result