diff --git a/src/NQP/Actions.pm b/src/NQP/Actions.pm index 926e336..94614c5 100644 --- a/src/NQP/Actions.pm +++ b/src/NQP/Actions.pm @@ -30,7 +30,17 @@ sub sigiltype($sigil) { method TOP($/) { make $.ast; } method deflongname($/) { - make $ ?? ~$ ~ ':sym<' ~ ~$[0] ~ '>' !! ~$/; + make $ + ?? ~$ ~ ':' ~ $[0].ast.named + ~ '<' ~ colonpair_str($[0].ast) ~ '>' + !! ~$/; + # make $ ?? ~$ ~ ':sym<' ~ ~$[0] ~ '>' !! ~$/; +} + +sub colonpair_str($ast) { + PAST::Op.ACCEPTS($ast) + ?? pir::join(' ', $ast.list) + !! $ast.value; } method comp_unit($/) { @@ -619,6 +629,7 @@ method circumfix:sym<[ ]>($/) { } method circumfix:sym($/) { make $.ast; } +method circumfix:sym<« »>($/) { make $.ast; } method circumfix:sym<{ }>($/) { make +$ > 0 diff --git a/src/NQP/Grammar.pm b/src/NQP/Grammar.pm index 1ce4e8f..564ac4a 100644 --- a/src/NQP/Grammar.pm +++ b/src/NQP/Grammar.pm @@ -18,8 +18,7 @@ token identifier { } token name { ** '::' } token deflongname { - - [ ':sym<' $=[<-[>]>*] '>' | ':sym«' $=[<-[»]>*] '»' ]? + ? } token ENDSTMT { @@ -391,6 +390,7 @@ token quote_escape:sym<{ }> { } token circumfix:sym<( )> { '(' <.ws> ? ')' } token circumfix:sym<[ ]> { '[' <.ws> ? ']' } token circumfix:sym { } +token circumfix:sym<« »> { } token circumfix:sym<{ }> { } token circumfix:sym { '(' ~ ')' }