From c441ffc653572efd82b80e9c0fa4be3aa96dbbd8 Mon Sep 17 00:00:00 2001 From: Jonathan Scott Duff Date: Wed, 10 Mar 2010 01:02:35 -0600 Subject: [PATCH] Make NQP understand single quoted strings on the LHS of => --- src/NQP/Actions.pm | 7 +++++++ src/NQP/Grammar.pm | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/src/NQP/Actions.pm b/src/NQP/Actions.pm index 3b4d578..53b72bc 100644 --- a/src/NQP/Actions.pm +++ b/src/NQP/Actions.pm @@ -269,6 +269,7 @@ method statement_mod_loop:sym($/) { make $.ast; } ## Terms method term:sym($/) { make $.ast; } +method term:sym($/) { make $.ast; } method term:sym($/) { make $.ast; } method term:sym($/) { make $.ast; } method term:sym($/) { make $.ast; } @@ -284,6 +285,12 @@ method fatarrow($/) { make $past; } +method fatarrow2($/) { + my $past := $.ast; + $past.named( $.ast ); + make $past; +} + method colonpair($/) { my $past := $ ?? $[0].ast diff --git a/src/NQP/Grammar.pm b/src/NQP/Grammar.pm index 92def32..e64ae6c 100644 --- a/src/NQP/Grammar.pm +++ b/src/NQP/Grammar.pm @@ -214,6 +214,7 @@ token statement_mod_loop:sym { :s } ## Terms token term:sym { } +token term:sym { } token term:sym { } token term:sym { } token term:sym { } @@ -227,6 +228,10 @@ token fatarrow { \h* '=>' <.ws> } +token fatarrow2 { + \h* '=>' <.ws> +} + token colonpair { ':' [