Changeset 10025
- Timestamp:
- 04/18/06 18:42:09 (3 years ago)
- Location:
- misc/pX/Common
- Files:
-
- 6 modified
-
Pugs-Compiler-Precedence/lib/Pugs/Grammar/Precedence.pm (modified) (2 diffs)
-
Pugs-Grammar-Perl6/lib/Pugs/Grammar/Expression.pm (modified) (1 diff)
-
Pugs-Grammar-Perl6/lib/Pugs/Grammar/Infix.pm (modified) (1 diff)
-
Pugs-Grammar-Perl6/lib/Pugs/Grammar/Operator.pm (modified) (1 diff)
-
Pugs-Grammar-Perl6/lib/Pugs/Grammar/Prefix.pm (modified) (1 diff)
-
Pugs-Grammar-Perl6/test.pl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
misc/pX/Common/Pugs-Compiler-Precedence/lib/Pugs/Grammar/Precedence.pm
r9967 r10025 35 35 postfix_non => 36 36 "exp 'name' \n" . 37 "\t{ \$_[0]->{out}= {op1 => 'name', exp1 => \$_[1],} }",37 "\t{ \$_[0]->{out}= {op1 => \$_[2], exp1 => \$_[1],} }", 38 38 postcircumfix_non => 39 39 "exp 'name' exp 'name2' \n" . … … 41 41 infix_left => 42 42 "exp 'name' exp \n" . 43 "\t{ \$_[0]->{out}= {op1 => 'name', exp1 => \$_[1], exp2 => \$_[3],} }",43 "\t{ \$_[0]->{out}= {op1 => \$_[2], exp1 => \$_[1], exp2 => \$_[3],} }", 44 44 infix_non => 45 45 "exp 'name' exp \n" . 46 "\t{ \$_[0]->{out}= {op1 => 'name', exp1 => \$_[1], exp2 => \$_[3],} }",46 "\t{ \$_[0]->{out}= {op1 => \$_[2], exp1 => \$_[1], exp2 => \$_[3],} }", 47 47 ternary_non => 48 48 "exp 'name' exp 'name2' exp \n" . -
misc/pX/Common/Pugs-Grammar-Perl6/lib/Pugs/Grammar/Expression.pm
r10017 r10025 117 117 my $t; 118 118 if ( exists $ast->{stmt} ) { 119 $t = [ $ast->{stmt} => $ast ] 119 120 if ( $ast->{stmt} eq 'if' or $ast->{stmt} eq 'unless' ) { 121 $t = [ 'IF' => $ast ] 122 } 123 else { 124 $t = [ $ast->{stmt} => $ast ] 125 } 120 126 } 121 127 elsif ( exists $ast->{op} ) { -
misc/pX/Common/Pugs-Grammar-Perl6/lib/Pugs/Grammar/Infix.pm
r10018 r10025 191 191 ); 192 192 193 __PACKAGE__->add_rule( 194 name => 'if', 193 # experimental 194 __PACKAGE__->add_rule( 195 name => 'IF', 195 196 assoc => 'non', 196 197 precedence => 'tighter', -
misc/pX/Common/Pugs-Grammar-Perl6/lib/Pugs/Grammar/Operator.pm
r10018 r10025 31 31 32 32 stmt: 33 'if' exp '{' exp '}' 34 { $_[0]->{out}= { 'if' => { exp => $_[2], then => $_[4] } } } 35 | 'if' exp '{' exp '}' else '{' exp '}' 36 { $_[0]->{out}= { 'if' => { exp => $_[2], then => $_[4], else => $_[8] } } } 37 38 | exp 'if' exp 39 { $_[0]->{out}= { 'if' => { exp => $_[3], then => $_[1], } } } 33 IF exp '{' exp '}' 34 { $_[0]->{out}= { op1 => $_[1], exp1 => $_[2], exp2 => $_[4] } } 35 | IF exp '{' exp '}' 'else' '{' exp '}' 36 { $_[0]->{out}= { op1 => $_[1], exp1 => $_[2], exp2 => $_[4], exp3 => $_[8] } } 40 37 41 | 'unless' exp '{' exp '}'42 { $_[0]->{out}= { 'unless' => { exp => $_[2], then => $_[4] } } }43 | 'unless' exp '{' exp '}' else '{' exp '}'44 { $_[0]->{out}= { 'unless' => { exp => $_[2], then => $_[4], else => $_[8] } } }45 46 38 | 'for' exp '{' exp '}' 47 { $_[0]->{out}= { 'for' => { exp => $_[2], block => $_[4], }} }39 { $_[0]->{out}= { op1 => $_[1], exp1 => $_[2], exp2 => $_[4], } } 48 40 49 41 | 'sub' BAREWORD attr '{' exp '}' -
misc/pX/Common/Pugs-Grammar-Perl6/lib/Pugs/Grammar/Prefix.pm
r10018 r10025 111 111 assoc => 'non', 112 112 precedence => 'equal', 113 other => 'infix:< if>',113 other => 'infix:<IF>', 114 114 ); 115 115 -
misc/pX/Common/Pugs-Grammar-Perl6/test.pl
r10018 r10025 84 84 my $x = do 1 if 2; 85 85 86 say(3 if 4); # wrong? 87 (4 if 5) + (6 if 7); # wrong? 88 89 #1 if 2 if 3; 90 86 91 1; 87 92 PERL6
