From 9b7246555a8107262dc7e674d845ff3ac0d48300 Mon Sep 17 00:00:00 2001 From: Chris Double Date: Wed, 26 Mar 2008 15:26:54 +1300 Subject: [PATCH] Fix just parser in pegs --- extra/peg/parsers/parsers-tests.factor | 4 ++++ extra/peg/parsers/parsers.factor | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/extra/peg/parsers/parsers-tests.factor b/extra/peg/parsers/parsers-tests.factor index 08bde98419..e80baf3c4f 100644 --- a/extra/peg/parsers/parsers-tests.factor +++ b/extra/peg/parsers/parsers-tests.factor @@ -48,3 +48,7 @@ IN: peg.parsers.tests [ V{ } ] [ "" epsilon parse parse-result-ast ] unit-test + +{ "a" } [ + "a" "a" token just parse parse-result-ast +] unit-test \ No newline at end of file diff --git a/extra/peg/parsers/parsers.factor b/extra/peg/parsers/parsers.factor index 4bba60bb09..13509e81f7 100755 --- a/extra/peg/parsers/parsers.factor +++ b/extra/peg/parsers/parsers.factor @@ -3,14 +3,14 @@ USING: kernel sequences strings namespaces math assocs shuffle vectors arrays combinators.lib math.parser match unicode.categories sequences.deep peg peg.private - peg.search math.ranges ; + peg.search math.ranges words ; IN: peg.parsers TUPLE: just-parser p1 ; : just-pattern [ - dup [ + execute dup [ dup parse-result-remaining empty? [ drop f ] unless ] when ] ;