diff --git a/extra/peg/peg-tests.factor b/extra/peg/peg-tests.factor index 62e041441f..b11b1011c3 100644 --- a/extra/peg/peg-tests.factor +++ b/extra/peg/peg-tests.factor @@ -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 diff --git a/extra/peg/peg.factor b/extra/peg/peg.factor index 11d36f032c..868072efa5 100755 --- a/extra/peg/peg.factor +++ b/extra/peg/peg.factor @@ -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