From 56d4bd0b3bc18de54ce0439b4005aff602225dad Mon Sep 17 00:00:00 2001 From: Christoph Otto Date: Sat, 26 Jun 2010 02:36:12 -0700 Subject: [PATCH] add support and a test for ... --- src/NQP/Actions.pm | 4 ++++ src/NQP/Grammar.pm | 1 + t/nqp/52-yadda.t | 7 +++++++ 3 files changed, 12 insertions(+) create mode 100644 t/nqp/52-yadda.t diff --git a/src/NQP/Actions.pm b/src/NQP/Actions.pm index 3f31be0..e164f4c 100644 --- a/src/NQP/Actions.pm +++ b/src/NQP/Actions.pm @@ -311,6 +311,10 @@ method term:sym($/) { make $.ast; } method term:sym($/) { make $.ast; } method term:sym($/) { make $.ast; } +method term:sym<...>($/) { + make PAST::Op.new( :pirop('die'), 'Stub code executed', :node($/) ); +} + method fatarrow($/) { my $past := $.ast; $past.named( $.Str ); diff --git a/src/NQP/Grammar.pm b/src/NQP/Grammar.pm index 3007cb3..9d0d2f5 100644 --- a/src/NQP/Grammar.pm +++ b/src/NQP/Grammar.pm @@ -232,6 +232,7 @@ token term:sym { { } token term:sym { } token term:sym { } +token term:sym<...> { ? } token fatarrow { \h* '=>' <.ws> diff --git a/t/nqp/52-yadda.t b/t/nqp/52-yadda.t new file mode 100644 index 0000000..75a1263 --- /dev/null +++ b/t/nqp/52-yadda.t @@ -0,0 +1,7 @@ +# nqp +# check that ... works + +say("1..1"); + +for <> { ... } +ok(1, 'yadda-yadda-yadda parses');