- Timestamp:
- 09/27/08 04:06:40 (3 months ago)
- Location:
- misc/elf
- Files:
-
- 7 modified
-
elf_h (modified) (25 diffs)
-
elf_h_src/EmitSimpleP5.pm (modified) (7 diffs)
-
elf_h_src/IRx1_FromAST.pm (modified) (7 diffs)
-
elf_h_src/IRx1_FromAST_create.pl (modified) (7 diffs)
-
elf_h_src/IRx1_Nodes.pm (modified) (1 diff)
-
elf_h_src/IRx1_nodes_create.pl (modified) (1 diff)
-
elf_h_src/Match.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
misc/elf/elf_h
r22374 r22421 35 35 eval q{package autobox::universal; sub type { autobox->type($_[0]) }}; 36 36 } 37 {package UNDEF; sub WHAT {"Undef"}}38 37 {package UNIVERSAL; sub ref {CORE::ref($_[0]) || autobox::universal::type($_[0]) } } # For IRx1_FromAST.pm. 39 38 {package UNIVERSAL; sub WHAT {CORE::ref($_[0]) || autobox::universal::type($_[0]) } } 40 41 { package UNDEF;42 sub perl { "undef" }43 }44 39 45 40 { package Any; … … 55 50 { package Array; our $_tell_use_base_i_am_not_empty_; } 56 51 { package Hash; our $_tell_use_base_i_am_not_empty_; } 52 { package Undef; our $_tell_use_base_i_am_not_empty_; } 57 53 { package Code; our $_tell_use_base_i_am_not_empty_; } 58 54 55 {package UNDEF; 56 use base "Undef"; 57 sub WHAT {"Undef"} 58 sub perl { "undef" } 59 } 59 60 no warnings qw(redefine prototype); 60 61 { package STRING; … … 67 68 @g ? \@g : undef; 68 69 } 70 71 sub re_gsub_inline ($$$) { # slower, but needed for $1 in replacement. 72 eval "\$_[0] =~ s/$_[1]/$_[2]/g"; 73 Carp::confess($@) if $@; 74 $_[0] 75 } 76 sub re_gsub ($$$) { 77 $_[0] =~ s/$_[1]/$_[2]/g; $_[0] 78 } 79 80 # unused 81 sub re_sub { 82 my $expr = "\$_[0] =~ s/$_[1]/$_[2]/".($_[3]||""); 83 eval $expr; 84 Carp::confess($@) if $@; 85 $_[0] 86 } 87 69 88 70 89 # randomness taken from autobox::Core … … 299 318 } 300 319 301 { package STRING;302 sub re_sub {303 my $expr = "\$_[0] =~ s/$_[1]/$_[2]/".($_[3]||"");304 eval $expr;305 Carp::confess($@) if $@;306 $_[0]307 }308 sub re_sub_g ($$$) {309 eval "\$_[0] =~ s/$_[1]/$_[2]/g";310 Carp::confess($@) if $@;311 $_[0]312 }313 # legacy314 sub re_gsub ($$$) {$_[0] =~ s/$_[1]/$_[2]/g; $_[0]}315 }316 317 320 { package GLOBAL; 318 321 … … 390 393 { package GLOBAL; 391 394 sub fastundump {my($dump)=@_; eval("package Fastundump; ".$dump);} 395 sub mangle_name {my($name)=@_; 396 $name =~ s/([^\w])/"_".CORE::ord($1)/eg; 397 $name; 398 } 392 399 } 393 400 … … 780 787 ; 781 788 782 { package A RRAY;789 { package Array; 783 790 use base "Any";(do{sub match_describe{my $self=CORE::shift;(do{((("\[\ 784 791 " . Match->indent($self->map(sub {my($e)=@_; … … 789 796 ; 790 797 791 { package H ASH;798 { package Hash; 792 799 use base "Any";(do{sub match_describe{my $self=CORE::shift;(do{my $s = "\{"; 793 800 for(($self->keys())->flatten){ … … 809 816 ; 810 817 811 { package S TRING;818 { package Str; 812 819 use base "Any";(do{sub match_describe{my $self=CORE::shift;(do{(("\'" . $self) . "\'")})}}) 813 820 } 814 821 ; 815 822 816 { package I NTEGER;823 { package Int; 817 824 use base "Any";(do{sub match_describe{my $self=CORE::shift;(do{(("\'" . $self) . "\'")})}}) 818 825 } 819 826 ; 820 827 821 { package FLOAT;828 { package Num; 822 829 use base "Any";(do{sub match_describe{my $self=CORE::shift;(do{(("\'" . $self) . "\'")})}}) 823 830 } … … 828 835 package Main; 829 836 830 { package A RRAY;837 { package Array; 831 838 use base "Any";(do{sub irx1_describe{my $self=CORE::shift;(do{(("\[" . $self->map(sub {my($e)=@_; 832 839 (do{$e->irx1_describe()})})->join("\,")) . "\]")})}}) … … 834 841 ; 835 842 836 { package S TRING;843 { package Str; 837 844 use base "Any";(do{sub irx1_describe{my $self=CORE::shift;(do{($self . "")})}}) 838 845 } 839 846 ; 840 847 841 { package I NTEGER;848 { package Int; 842 849 use base "Any";(do{sub irx1_describe{my $self=CORE::shift;(do{($self . "")})}}) 843 850 } 844 851 ; 845 852 846 { package FLOAT;853 { package Num; 847 854 use base "Any";(do{sub irx1_describe{my $self=CORE::shift;(do{($self . "")})}}) 848 855 } 849 856 ; 850 857 851 { package U NDEF;858 { package Undef; 852 859 use base "Any";(do{sub irx1_describe{my $self=CORE::shift;(do{"undef"})}}) 853 860 } … … 1937 1944 ; 1938 1945 1939 { package A RRAY;1946 { package Array; 1940 1947 use base "Any";(do{sub make_ir_from_Match_tree{my $self=CORE::shift;(do{$self->map(sub {my($e)=@_; 1941 1948 (do{$e->make_ir_from_Match_tree()})})})}}) … … 1943 1950 ; 1944 1951 1945 { package S TRING;1952 { package Str; 1946 1953 use base "Any";(do{sub make_ir_from_Match_tree{my $self=CORE::shift;(do{$self})}}) 1947 1954 } 1948 1955 ; 1949 1956 1950 { package I NTEGER;1957 { package Int; 1951 1958 use base "Any";(do{sub make_ir_from_Match_tree{my $self=CORE::shift;(do{$self})}}) 1952 1959 } 1953 1960 ; 1954 1961 1955 { package FLOAT;1962 { package Num; 1956 1963 use base "Any";(do{sub make_ir_from_Match_tree{my $self=CORE::shift;(do{$self})}}) 1957 1964 } 1958 1965 ; 1959 1966 1960 { package U NDEF;1967 { package Undef; 1961 1968 use base "Any";(do{sub make_ir_from_Match_tree{my $self=CORE::shift;(do{$self})}}) 1962 1969 } … … 2046 2053 my $ident = ("postcircumfix\:" . $name); 2047 2054 my $args = irbuild_ir($m->{"hash"}->{"kludge_name"}); 2048 if(($args && (($args-> ref() ne "ARRAY")))) {2055 if(($args && (($args->WHAT() ne "Array")))) { 2049 2056 (do{($args = [$args])}) 2050 2057 }; … … 2055 2062 my $ident = ("postcircumfix\:" . $name); 2056 2063 my $args = irbuild_ir($m->{"hash"}->{"kludge_name"}); 2057 if(($args && (($args-> ref() ne "ARRAY")))) {2064 if(($args && (($args->WHAT() ne "Array")))) { 2058 2065 (do{($args = [$args])}) 2059 2066 }; … … 2119 2126 $self->add_constructor("quote\:q", sub {my($m)=@_; 2120 2127 (do{my $s = irbuild_ir($m->{"hash"}->{"text"}); 2121 $s->re_ sub_g("\\\\\(\[\\\\\'\]\)", "\$1");2128 $s->re_gsub_inline("\\\\\(\[\\\\\'\]\)", "\$1"); 2122 2129 IRx1::Buf->newp($m, $s)})}); 2123 2130 $self->add_constructor("quote\:qq", sub {my($m)=@_; … … 2126 2133 "); 2127 2134 $s->re_gsub("\(\?\<\!\\\\\)\\\\t", "\ "); 2128 $s->re_ sub_g("\\\\\(\.\)", "\$1");2135 $s->re_gsub_inline("\\\\\(\.\)", "\$1"); 2129 2136 IRx1::Buf->newp($m, $s)})}); 2130 2137 $self->add_constructor("quote\:regex", sub {my($m)=@_; … … 2158 2165 (do{my $slf = IRx1::Apply->newp($m, "self", IRx1::Capture->newp($m, [])); 2159 2166 my $args = irbuild_ir($m->{"hash"}->{"postcircumfix"}->{"hash"}->{"kludge_name"}); 2160 if(($args && (($args-> ref() ne "ARRAY")))) {2167 if(($args && (($args->WHAT() ne "Array")))) { 2161 2168 (do{($args = [$args])}) 2162 2169 }; … … 2183 2190 my $name = ((GLOBAL::substr($s, 0, 1) . "\ ") . GLOBAL::substr($s, (-1), 1)); 2184 2191 my $args = irbuild_ir($m->{"hash"}->{"kludge_name"}); 2185 if(($args && (($args-> ref() ne "ARRAY")))) {2192 if(($args && (($args->WHAT() ne "Array")))) { 2186 2193 (do{($args = [$args])}) 2187 2194 }; … … 2807 2814 \ \ eval\ q\{package\ autobox\:\:universal\;\ sub\ type\ \{\ autobox\-\>type\(\$_\[0\]\)\ \}\}\;\ 2808 2815 \}\ 2809 \{package\ UNDEF\;\ sub\ WHAT\ \{\"Undef\"\}\}\2810 2816 \{package\ UNIVERSAL\;\ sub\ ref\ \{CORE\:\:ref\(\$_\[0\]\)\ \|\|\ autobox\:\:universal\:\:type\(\$_\[0\]\)\ \}\ \}\ \#\ For\ IRx1_FromAST\.pm\.\ 2811 2817 \{package\ UNIVERSAL\;\ sub\ WHAT\ \{CORE\:\:ref\(\$_\[0\]\)\ \|\|\ autobox\:\:universal\:\:type\(\$_\[0\]\)\ \}\ \}\ 2812 \2813 \{\ package\ UNDEF\;\2814 \ \ sub\ perl\ \{\ \"undef\"\ \}\2815 \}\2816 2818 \ 2817 2819 \{\ package\ Any\;\ … … 2827 2829 \{\ package\ Array\;\ our\ \$_tell_use_base_i_am_not_empty_\;\ \}\ 2828 2830 \{\ package\ Hash\;\ our\ \$_tell_use_base_i_am_not_empty_\;\ \}\ 2831 \{\ package\ Undef\;\ our\ \$_tell_use_base_i_am_not_empty_\;\ \}\ 2829 2832 \{\ package\ Code\;\ our\ \$_tell_use_base_i_am_not_empty_\;\ \}\ 2830 2833 \ 2834 \{package\ UNDEF\;\ 2835 \ use\ base\ \"Undef\"\;\ 2836 \ sub\ WHAT\ \{\"Undef\"\}\ 2837 \ sub\ perl\ \{\ \"undef\"\ \}\ 2838 \}\ 2831 2839 no\ warnings\ qw\(redefine\ prototype\)\;\ 2832 2840 \{\ package\ STRING\;\ … … 2839 2847 \ \ \ \ \@g\ \?\ \\\@g\ \:\ undef\;\ 2840 2848 \ \ \}\ 2849 \ 2850 \ \ sub\ re_gsub_inline\ \(\$\$\$\)\ \{\ \#\ slower\,\ but\ needed\ for\ \$1\ in\ replacement\.\ 2851 \ \ \ \ eval\ \"\\\$_\[0\]\ \=\~\ s\/\$_\[1\]\/\$_\[2\]\/g\"\;\ 2852 \ \ \ \ Carp\:\:confess\(\$\@\)\ if\ \$\@\;\ 2853 \ \ \ \ \$_\[0\]\ 2854 \ \ \}\ 2855 \ \ sub\ re_gsub\ \(\$\$\$\)\ \{\ 2856 \ \ \ \ \$_\[0\]\ \=\~\ s\/\$_\[1\]\/\$_\[2\]\/g\;\ \$_\[0\]\ 2857 \ \ \}\ 2858 \ 2859 \ \ \#\ unused\ 2860 \ \ sub\ re_sub\ \ \ \ \ \ \ \ \ \{\ 2861 \ \ \ \ my\ \$expr\ \=\ \"\\\$_\[0\]\ \=\~\ s\/\$_\[1\]\/\$_\[2\]\/\"\.\(\$_\[3\]\|\|\"\"\)\;\ 2862 \ \ \ \ eval\ \$expr\;\ 2863 \ \ \ \ Carp\:\:confess\(\$\@\)\ if\ \$\@\;\ 2864 \ \ \ \ \$_\[0\]\ 2865 \ \ \}\ 2866 \ 2841 2867 \ 2842 2868 \ \ \#\ randomness\ taken\ from\ autobox\:\:Core\ … … 3071 3097 \}\ 3072 3098 \ 3073 \{\ package\ STRING\;\3074 \ \ sub\ re_sub\ \ \ \ \ \ \ \ \ \{\3075 \ \ \ \ my\ \$expr\ \=\ \"\\\$_\[0\]\ \=\~\ s\/\$_\[1\]\/\$_\[2\]\/\"\.\(\$_\[3\]\|\|\"\"\)\;\3076 \ \ \ \ eval\ \$expr\;\3077 \ \ \ \ Carp\:\:confess\(\$\@\)\ if\ \$\@\;\3078 \ \ \ \ \$_\[0\]\3079 \ \ \}\3080 \ \ sub\ re_sub_g\ \(\$\$\$\)\ \{\3081 \ \ \ \ eval\ \"\\\$_\[0\]\ \=\~\ s\/\$_\[1\]\/\$_\[2\]\/g\"\;\3082 \ \ \ \ Carp\:\:confess\(\$\@\)\ if\ \$\@\;\3083 \ \ \ \ \$_\[0\]\3084 \ \ \}\3085 \ \ \#\ legacy\3086 \ \ sub\ re_gsub\ \(\$\$\$\)\ \{\$_\[0\]\ \=\~\ s\/\$_\[1\]\/\$_\[2\]\/g\;\ \$_\[0\]\}\3087 \}\3088 \3089 3099 \{\ package\ GLOBAL\;\ 3090 3100 \ … … 3162 3172 \{\ package\ GLOBAL\;\ 3163 3173 \ \ sub\ fastundump\ \{my\(\$dump\)\=\@_\;\ eval\(\"package\ Fastundump\;\ \"\.\$dump\)\;\}\ 3174 \ \ sub\ mangle_name\ \{my\(\$name\)\=\@_\;\ 3175 \ \ \ \ \$name\ \=\~\ s\/\(\[\^\\w\]\)\/\"_\"\.CORE\:\:ord\(\$1\)\/eg\;\ 3176 \ \ \ \ \$name\;\ 3177 \ \ \}\ 3164 3178 \}\ 3165 3179 \ … … 3334 3348 if(($n->is_context())) { 3335 3349 (do{my $name = $self->e($n->var()); 3336 $name->re_ sub_g("\^\(\.\)\:\:", "\$1");3350 $name->re_gsub("\^\(\.\)\:\:", "\$1"); 3337 3351 ((((((("\{package\ main\;\ use\ vars\ \'" . $name) . "\'\}\;") . "local") . "\ ") . $self->e($n->var())) . $default))}) 3338 3352 }elsif(($n->is_temp())) { … … 3501 3515 }})}; 3502 3516 sub mangle_function_name{my $self=CORE::shift;my($name)=@_; 3503 (do{$name->re_ sub("\^\(\\w\+\)\:\(\?\!\:\)", "\$\{1\}_");3504 $name->re_sub("\(\[\^\\w\]\)", "\"_\"\.CORE\:\:ord\(\$1\)", "eg");3517 (do{$name->re_gsub_inline("\^\(\\w\+\)\:\(\?\!\:\)", "\$\{1\}_"); 3518 ($name = GLOBAL::mangle_name($name)); 3505 3519 $name})}; 3506 3520 sub cb__Apply{my $self=CORE::shift;my($n)=@_; -
misc/elf/elf_h_src/EmitSimpleP5.pm
r22374 r22421 68 68 eval q{package autobox::universal; sub type { autobox->type($_[0]) }}; 69 69 } 70 {package UNDEF; sub WHAT {"Undef"}}71 70 {package UNIVERSAL; sub ref {CORE::ref($_[0]) || autobox::universal::type($_[0]) } } # For IRx1_FromAST.pm. 72 71 {package UNIVERSAL; sub WHAT {CORE::ref($_[0]) || autobox::universal::type($_[0]) } } 73 74 { package UNDEF;75 sub perl { "undef" }76 }77 72 78 73 { package Any; … … 88 83 { package Array; our $_tell_use_base_i_am_not_empty_; } 89 84 { package Hash; our $_tell_use_base_i_am_not_empty_; } 85 { package Undef; our $_tell_use_base_i_am_not_empty_; } 90 86 { package Code; our $_tell_use_base_i_am_not_empty_; } 91 87 88 {package UNDEF; 89 use base "Undef"; 90 sub WHAT {"Undef"} 91 sub perl { "undef" } 92 } 92 93 no warnings qw(redefine prototype); 93 94 { package STRING; … … 100 101 @g ? \@g : undef; 101 102 } 103 104 sub re_gsub_inline ($$$) { # slower, but needed for $1 in replacement. 105 eval "\$_[0] =~ s/$_[1]/$_[2]/g"; 106 Carp::confess($@) if $@; 107 $_[0] 108 } 109 sub re_gsub ($$$) { 110 $_[0] =~ s/$_[1]/$_[2]/g; $_[0] 111 } 112 113 # unused 114 sub re_sub { 115 my $expr = "\$_[0] =~ s/$_[1]/$_[2]/".($_[3]||""); 116 eval $expr; 117 Carp::confess($@) if $@; 118 $_[0] 119 } 120 102 121 103 122 # randomness taken from autobox::Core … … 332 351 } 333 352 334 { package STRING;335 sub re_sub {336 my $expr = "\$_[0] =~ s/$_[1]/$_[2]/".($_[3]||"");337 eval $expr;338 Carp::confess($@) if $@;339 $_[0]340 }341 sub re_sub_g ($$$) {342 eval "\$_[0] =~ s/$_[1]/$_[2]/g";343 Carp::confess($@) if $@;344 $_[0]345 }346 # legacy347 sub re_gsub ($$$) {$_[0] =~ s/$_[1]/$_[2]/g; $_[0]}348 }349 350 353 { package GLOBAL; 351 354 … … 423 426 { package GLOBAL; 424 427 sub fastundump {my($dump)=@_; eval("package Fastundump; ".$dump);} 428 sub mangle_name {my($name)=@_; 429 $name =~ s/([^\w])/"_".CORE::ord($1)/eg; 430 $name; 431 } 425 432 } 426 433 … … 566 573 if ($n.is_context) { # BOGUS 567 574 my $name = $.e($n.var); 568 $name.re_ sub_g('^(.)::','$1');575 $name.re_gsub('^(.)::','$1'); 569 576 ("{package main; use vars '"~$name~"'};"~ 570 577 'local'~' '~$.e($n.var)~$default) … … 738 745 }; 739 746 method mangle_function_name($name) { 740 $name.re_ sub('^(\w+):(?!:)','${1}_');741 $name .re_sub('([^\w])','"_".CORE::ord($1)','eg');747 $name.re_gsub_inline('^(\w+):(?!:)','${1}_'); 748 $name = mangle_name($name); 742 749 $name; 743 750 } -
misc/elf/elf_h_src/IRx1_FromAST.pm
r22374 r22421 25 25 } 26 26 }; 27 class A RRAY{27 class Array { 28 28 method make_ir_from_Match_tree() { 29 29 self.map(sub($e){$e.make_ir_from_Match_tree()}) 30 30 } 31 31 }; 32 class S TRING{32 class Str { 33 33 method make_ir_from_Match_tree() { 34 34 self 35 35 } 36 36 }; 37 class I NTEGER{37 class Int { 38 38 method make_ir_from_Match_tree() { 39 39 self 40 40 } 41 41 }; 42 class FLOAT{42 class Num { 43 43 method make_ir_from_Match_tree() { 44 44 self 45 45 } 46 46 }; 47 class U NDEF{47 class Undef { 48 48 method make_ir_from_Match_tree() { 49 49 self … … 153 153 my $ident = "postcircumfix:"~$name; 154 154 my $args = irbuild_ir($m.{'hash'}{'kludge_name'}); 155 if $args && ($args. ref ne 'ARRAY') { $args = [$args] }155 if $args && ($args.WHAT ne 'Array') { $args = [$args] } 156 156 IRx1::Call.newp($m,$blackboard::expect_term_base,$ident,IRx1::Capture.newp($m,$args||[])); 157 157 }); … … 162 162 my $ident = "postcircumfix:"~$name; 163 163 my $args = irbuild_ir($m.{'hash'}{'kludge_name'}); 164 if $args && ($args. ref ne 'ARRAY') { $args = [$args] }164 if $args && ($args.WHAT ne 'Array') { $args = [$args] } 165 165 IRx1::Call.newp($m,$blackboard::expect_term_base,$ident,IRx1::Capture.newp($m,$args||[])); 166 166 }); … … 251 251 $.add_constructor('quote:q', sub ($m) { 252 252 my $s = irbuild_ir($m.{'hash'}{'text'}); 253 $s.re_ sub_g('\\\\([\\\\\'])','$1');253 $s.re_gsub_inline('\\\\([\\\\\'])','$1'); 254 254 IRx1::Buf.newp($m,$s); 255 255 }); … … 259 259 $s.re_gsub('(?<!\\\\)\\\\n',"\n"); 260 260 $s.re_gsub('(?<!\\\\)\\\\t',"\t"); 261 $s.re_ sub_g('\\\\(.)','$1');261 $s.re_gsub_inline('\\\\(.)','$1'); 262 262 IRx1::Buf.newp($m,$s); 263 263 }); … … 305 305 my $slf = IRx1::Apply.newp($m,'self',IRx1::Capture.newp($m,[])); 306 306 my $args = irbuild_ir($m.{'hash'}{'postcircumfix'}.{'hash'}{'kludge_name'}); 307 if $args && ($args. ref ne 'ARRAY') { $args = [$args] }307 if $args && ($args.WHAT ne 'Array') { $args = [$args] } 308 308 IRx1::Call.newp($m,$slf,irbuild_ir($m.{'hash'}{'desigilname'}),IRx1::Capture.newp($m,$args||[])) 309 309 } else { … … 336 336 my $name = substr($s,0,1)~' '~substr($s,-1,1); 337 337 my $args = irbuild_ir($m.{'hash'}{'kludge_name'}); 338 if $args && ($args. ref ne 'ARRAY') { $args = [$args] }338 if $args && ($args.WHAT ne 'Array') { $args = [$args] } 339 339 IRx1::Apply.newp($m,"circumfix:"~$name,IRx1::Capture.newp($m,$args||[])); 340 340 }); -
misc/elf/elf_h_src/IRx1_FromAST_create.pl
r22374 r22421 85 85 my $ident = "postcircumfix:"~$name; 86 86 my $args = $m<kludge_name>; 87 if $args && ($args. ref ne 'ARRAY') { $args = [$args] }87 if $args && ($args.WHAT ne 'Array') { $args = [$args] } 88 88 Call.newp($blackboard::expect_term_base,$ident,Capture.newp($args||[])) 89 89 … … 93 93 my $ident = "postcircumfix:"~$name; 94 94 my $args = $m<kludge_name>; 95 if $args && ($args. ref ne 'ARRAY') { $args = [$args] }95 if $args && ($args.WHAT ne 'Array') { $args = [$args] } 96 96 Call.newp($blackboard::expect_term_base,$ident,Capture.newp($args||[])) 97 97 … … 170 170 quote:q 171 171 my $s = $m<text>; 172 $s.re_ sub_g('\\\\([\\\\\'])','$1');172 $s.re_gsub_inline('\\\\([\\\\\'])','$1'); 173 173 Buf.newp($s) 174 174 … … 177 177 $s.re_gsub('(?<!\\\\)\\\\n',"\n"); 178 178 $s.re_gsub('(?<!\\\\)\\\\t',"\t"); 179 $s.re_ sub_g('\\\\(.)','$1');179 $s.re_gsub_inline('\\\\(.)','$1'); 180 180 Buf.newp($s) 181 181 … … 217 217 my $slf = Apply.newp('self',Capture.newp([])); 218 218 my $args = $m<postcircumfix><kludge_name>; 219 if $args && ($args. ref ne 'ARRAY') { $args = [$args] }219 if $args && ($args.WHAT ne 'Array') { $args = [$args] } 220 220 Call.newp($slf,$m<desigilname>,Capture.newp($args||[])) 221 221 } else { … … 244 244 my $name = substr($s,0,1)~' '~substr($s,-1,1); # XXX :( 245 245 my $args = $m<kludge_name>; 246 if $args && ($args. ref ne 'ARRAY') { $args = [$args] }246 if $args && ($args.WHAT ne 'Array') { $args = [$args] } 247 247 Apply.newp("circumfix:"~$name,Capture.newp($args||[])) 248 248 … … 588 588 } 589 589 }; 590 class A RRAY{590 class Array { 591 591 method make_ir_from_Match_tree() { 592 592 self.map(sub($e){$e.make_ir_from_Match_tree()}) 593 593 } 594 594 }; 595 class S TRING{595 class Str { 596 596 method make_ir_from_Match_tree() { 597 597 self 598 598 } 599 599 }; 600 class I NTEGER{600 class Int { 601 601 method make_ir_from_Match_tree() { 602 602 self 603 603 } 604 604 }; 605 class FLOAT{605 class Num { 606 606 method make_ir_from_Match_tree() { 607 607 self 608 608 } 609 609 }; 610 class U NDEF{610 class Undef { 611 611 method make_ir_from_Match_tree() { 612 612 self -
misc/elf/elf_h_src/IRx1_Nodes.pm
r20473 r22421 1 1 # Warning: This file is mechanically written. Your changes will be overwritten. 2 package A RRAY{2 package Array { 3 3 method irx1_describe() { 4 4 '[' ~ self.map(sub($e){$e.irx1_describe}).join(",") ~ ']' 5 5 }; 6 6 }; 7 package S TRING{7 package Str { 8 8 method irx1_describe() { 9 9 self ~ "" 10 10 }; 11 11 }; 12 package I NTEGER{12 package Int { 13 13 method irx1_describe() { 14 14 self ~ "" 15 15 }; 16 16 }; 17 package FLOAT{17 package Num { 18 18 method irx1_describe() { 19 19 self ~ "" 20 20 }; 21 21 }; 22 package U NDEF{22 package Undef { 23 23 method irx1_describe() { 24 24 'undef' -
misc/elf/elf_h_src/IRx1_nodes_create.pl
r20727 r22421 172 172 my $code = "".unindent(<<' END'); 173 173 # Warning: This file is mechanically written. Your changes will be overwritten. 174 package A RRAY{174 package Array { 175 175 method irx1_describe() { 176 176 '[' ~ self.map(sub($e){$e.irx1_describe}).join(",") ~ ']' 177 177 }; 178 178 }; 179 package S TRING{179 package Str { 180 180 method irx1_describe() { 181 181 self ~ "" 182 182 }; 183 183 }; 184 package I NTEGER{184 package Int { 185 185 method irx1_describe() { 186 186 self ~ "" 187 187 }; 188 188 }; 189 package FLOAT{189 package Num { 190 190 method irx1_describe() { 191 191 self ~ "" 192 192 }; 193 193 }; 194 package U NDEF{194 package Undef { 195 195 method irx1_describe() { 196 196 'undef' -
misc/elf/elf_h_src/Match.pm
r22374 r22421 37 37 } 38 38 }; 39 class A RRAY{39 class Array { 40 40 method match_describe() { 41 41 ("[\n" ~ … … 44 44 } 45 45 }; 46 class H ASH{46 class Hash { 47 47 method match_describe() { 48 48 my $s = "{"; … … 60 60 }; 61 61 };
