Changeset 22541
Legend:
- Unmodified
- Added
- Removed
-
v6/mildew/mildew
r22526 r22541 5 5 use STD; 6 6 use AST; 7 use AST::Helpers; 7 8 use DumpMatch; 8 9 use utf8; … … 32 33 confess 'unimplemented' 33 34 } 34 sub integer {35 sub integer_ { 35 36 my $m = shift; 36 37 #XXX non-base 10 37 AST::IntegerConstant->new(value=>$m->text);38 integer $m->text; 38 39 } 39 40 sub scope_declarator { … … 43 44 if (my $var_decl = $decl->{variable_declarator}) { 44 45 AST::Call->new( 45 identifier => AST::StringConstant->new(value=>'STORE'),46 identifier => string 'STORE', 46 47 capture => AST::Capture->new( 47 48 invocant => AST::Call->new( 48 identifier => AST::StringConstant->new(value=>'postcircumfix:{ }'),49 capture => AST::Capture->new(invocant=> AST::Reg->new(name=>'scope'),positional=>[AST::StringConstant->new(value=>$m->text)],named=>[])49 identifier => string 'postcircumfix:{ }', 50 capture => AST::Capture->new(invocant=>reg 'scope',positional=>[string $m->text],named=>[]) 50 51 ), 51 52 positional => [ 52 53 AST::Call->new( 53 identifier => AST::StringConstant->new(value=>'new'),54 invocant => AST::Reg->new(name=>'$Scalar'),54 identifier => string 'new', 55 invocant => reg '$Scalar', 55 56 ) 56 57 ] … … 87 88 if ($m->{identifier} && $m->{args}) { 88 89 my $func = AST::Call->new( 89 identifier=> AST::StringConstant->new(value=>'lookup'),90 capture=>AST::Capture->new(invocant=> AST::Reg->new(name=>'scope'),positional=>[AST::StringConstant->new(value=>'&'.$m->{identifier}->text)],named=>[]),90 identifier=>string 'lookup', 91 capture=>AST::Capture->new(invocant=>reg 'scope',positional=>[string '&'.$m->{identifier}->text],named=>[]), 91 92 ); 92 AST::Call->new(identifier=> AST::StringConstant->new(value=>'postcircumfix:( )'),capture=>AST::Capture->new(invocant=>$func,positional=>args($m->{args})));93 AST::Call->new(identifier=>string 'postcircumfix:( )',capture=>AST::Capture->new(invocant=>$func,positional=>args($m->{args}))); 93 94 } 94 95 } … … 99 100 sub routine_def { 100 101 my $m = shift; 101 AST::Call->new(identifier=> AST::StringConstant->new(value => 'new'),102 AST::Call->new(identifier=>string 'new', 102 103 capture => AST::Capture->new( 103 invocant => AST::Reg->new(name=>'Code'),104 invocant => reg 'Code', 104 105 positional => [], 105 106 named => [ 106 AST::StringConstant->new(value=>'mold')=> block($m->{block}),107 AST::StringConstant->new(value=>'outer') => AST::Reg->new(name=>'$scope')107 string 'mold' => block($m->{block}), 108 string 'outer' => reg '$scope' 108 109 ] 109 110 ), … … 130 131 #XXX 131 132 my $text = $m->{nibble}->text; 132 AST::StringConstant->new(value=>$text);133 string $text; 133 134 } 134 135 sub number { 135 136 my $m = shift; 136 137 if ($m->{integer}) { 137 integer ($m->{integer});138 integer_($m->{integer}); 138 139 } else { 139 140 XXX; … … 143 144 my $m = shift; 144 145 AST::Call->new( 145 identifier=> AST::StringConstant->new(value=>'lookup'),146 capture=>AST::Capture->new(invocant=> AST::Reg->new(name=>'scope'),positional=>[AST::StringConstant->new(value=>$m->text)],named=>[]),146 identifier=>string 'lookup', 147 capture=>AST::Capture->new(invocant=>reg 'scope',positional=>[string $m->text],named=>[]), 147 148 ); 148 149 } … … 166 167 sub FETCH { 167 168 my $arg = shift; 168 AST::Call->new(capture=>AST::Capture->new(invocant=>$arg),identifier=> AST::StringConstant->new(value=>'FETCH'));169 AST::Call->new(capture=>AST::Capture->new(invocant=>$arg),identifier=>string 'FETCH'); 169 170 } 170 171 sub methodop { … … 173 174 my $pos0 = $m->{in}[0]{semilist}{statement}[0]; 174 175 AST::Call->new( 175 identifier=> AST::StringConstant->new(value=>$m->{longname}->text),176 identifier=>string $m->{longname}->text, 176 177 capture=>AST::Capture->new(invocant=>FETCH($noun),positional=>[FETCH(EXPR($pos0->{EXPR}))],named=>[]), 177 178
