Skip to content

Commit 5a3575c

Browse files
committed
Get ~ goal matching syntax working again; Cursor.FAILGOAL is missing yet, so the error sucks, but otherwise it seems to do the right thing.
1 parent 5523be6 commit 5a3575c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/QRegex/P6Regex/Actions.nqp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,19 @@ class QRegex::P6Regex::Actions is HLL::Actions {
201201
make $qast;
202202
}
203203

204+
method metachar:sym<~>($/) {
205+
make QAST::Regex.new(
206+
$<EXPR>.ast,
207+
QAST::Regex.new(
208+
$<GOAL>.ast,
209+
QAST::Regex.new( PAST::Node.new('FAILGOAL', ~$<GOAL>),
210+
:rxtype<subrule>, :subtype<method> ),
211+
:rxtype<altseq>
212+
),
213+
:rxtype<concat>
214+
);
215+
}
216+
204217
method backslash:sym<s>($/) {
205218
make QAST::Regex.new(:rxtype<cclass>, '.CCLASS_WHITESPACE',
206219
:subtype($<sym> eq 'n' ?? 'nl' !! ~$<sym>),

0 commit comments

Comments
 (0)