Skip to content

Commit

Permalink
Switch postcircumfix angles over.
Browse files Browse the repository at this point in the history
Following STD more closely here seems to get us passing a few TODO'd
tests also.
  • Loading branch information
jnthn committed Oct 28, 2012
1 parent 2f83583 commit 7226b0a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/Perl6/Actions.pm
Expand Up @@ -4539,8 +4539,10 @@ class Perl6::Actions is HLL::Actions does STDActions {

method postcircumfix:sym<ang>($/) {
my $past := QAST::Op.new( :name('postcircumfix:<{ }>'), :op('callmethod'), :node($/) );
$past.push( $<quote_EXPR>.ast )
if +$<quote_EXPR><quote_delimited><quote_atom> > 0;
my $nib := $<nibble>.ast;
$past.push($nib)
unless nqp::istype($nib, QAST::Stmts) && nqp::istype($nib[0], QAST::Op) &&
$nib[0].name eq '&infix:<,>' && +@($nib[0]) == 0;
make $past;
}

Expand Down
8 changes: 7 additions & 1 deletion src/Perl6/Grammar.pm
Expand Up @@ -2822,7 +2822,13 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
}

token postcircumfix:sym<ang> {
<?[<]> <quote_EXPR: ':q', ':w'>
'<'
[
|| <nibble(self.quote_lang(%*LANG<Q>, "<", ">", ['q', 'w']))> '>'
|| <?before \h* [ \d | <sigil> | ':' ] >
{ $/.CURSOR.panic("Whitespace required before < operator") }
|| { $/.CURSOR.panic("Unable to parse quote-words subscript; couldn't find right angle quote") }
]
<O('%methodcall')>
}

Expand Down

0 comments on commit 7226b0a

Please sign in to comment.