Skip to content

Commit

Permalink
[03-optable.t] more workarounds
Browse files Browse the repository at this point in the history
They're all the same as the last one.
  • Loading branch information
Carl Masak committed Apr 12, 2010
1 parent 18bf009 commit 5f369ef
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions t/03-optable.t
Expand Up @@ -115,7 +115,8 @@ $optable .= new;
for ['term:', precedence => '=', :parsed($ident) ],
['postfix:*', looser => 'term:' ],
['infix:', looser => 'postfix:*', :assoc<list> ]
-> @args { my ($name, %opts) = @args; $optable.newtok($name, |%opts) }
# RAKUDO: Can't list-assign to a hash without losing keys. [perl #74302]
-> @args { my $name = @args[0]; my %opts = @args[1..@args-1]; $optable.newtok($name, |%opts) }

optable_output_is( 'x a*y', 'infix:(term:x, postfix:*(term:a), term:y)',
'list assoc redux' );
Expand All @@ -125,7 +126,8 @@ $optable .= new;
for ['term:', precedence => '=', :parsed($ident) ],
['postfix:+', looser => 'term:' ],
['postfix:!', equiv => 'postfix:+' ]
-> @args { my ($name, %opts) = @args; $optable.newtok($name, |%opts) }
# RAKUDO: Can't list-assign to a hash without losing keys. [perl #74302]
-> @args { my $name = @args[0]; my %opts = @args[1..@args-1]; $optable.newtok($name, |%opts) }

optable_output_is( 'a+!', 'postfix:!(postfix:+(term:a))',
'precedence of two postfixes' );
Expand All @@ -135,7 +137,8 @@ $optable .= new;
for ['term:', precedence => '=', :parsed($ident) ],
['term:^', equiv => 'term:' ],
['infix:', looser => 'term:', :assoc<list>, :nows ]
-> @args { my ($name, %opts) = @args; $optable.newtok($name, |%opts) }
# RAKUDO: Can't list-assign to a hash without losing keys. [perl #74302]
-> @args { my $name = @args[0]; my %opts = @args[1..@args-1]; $optable.newtok($name, |%opts) }

optable_output_is( '^ abc', 'infix:(term:^(), term:abc)',
'whitespace and infix:' );
Expand All @@ -146,7 +149,8 @@ for ['term:', precedence => '=', :parsed($ident) ],
['infix:', looser => 'term:', :assoc<list>, :nows ],
['infix:&', looser => 'infix:', :assoc<list>, :nows ],
['prefix:|', looser => 'infix:&', :assoc<list>, :nows ]
-> @args { my ($name, %opts) = @args; $optable.newtok($name, |%opts) }
# RAKUDO: Can't list-assign to a hash without losing keys. [perl #74302]
-> @args { my $name = @args[0]; my %opts = @args[1..@args-1]; $optable.newtok($name, |%opts) }

optable_output_is( 'a&|b', 'infix:&(term:a, prefix:|(term:b))',
'infix, prefix and precedence' );
Expand All @@ -156,7 +160,8 @@ $optable .= new;
for ['term:', precedence => '=', :parsed($ident) ],
['infix:|', looser => 'term:', ],
['circumfix:[ ]', equiv => 'term:', :nows ]
-> @args { my ($name, %opts) = @args; $optable.newtok($name, |%opts) }
# RAKUDO: Can't list-assign to a hash without losing keys. [perl #74302]
-> @args { my $name = @args[0]; my %opts = @args[1..@args-1]; $optable.newtok($name, |%opts) }

optable_output_is( '[a]|b', 'infix:|(circumfix:[ ](term:a), term:b)',
'infix and circumfix' );
Expand All @@ -165,7 +170,8 @@ $optable .= new;

for ['term:', precedence => '=', :parsed($ident) ],
['infix:', looser => 'term:', :assoc<list>, :nows ]
-> @args { my ($name, %opts) = @args; $optable.newtok($name, |%opts) }
# RAKUDO: Can't list-assign to a hash without losing keys. [perl #74302]
-> @args { my $name = @args[0]; my %opts = @args[1..@args-1]; $optable.newtok($name, |%opts) }

optable_output_is( 'a b', 'term:a (pos=1)', ':tighter option',
:tighter<infix:> );
Expand Down

0 comments on commit 5f369ef

Please sign in to comment.