Changeset 22421 for misc

Show
Ignore:
Timestamp:
09/27/08 04:06:40 (3 months ago)
Author:
putter
Message:

[elf] More backend neutrality.

Location:
misc/elf
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • misc/elf/elf_h

    r22374 r22421  
    3535  eval q{package autobox::universal; sub type { autobox->type($_[0]) }}; 
    3636} 
    37 {package UNDEF; sub WHAT {"Undef"}} 
    3837{package UNIVERSAL; sub ref {CORE::ref($_[0]) || autobox::universal::type($_[0]) } } # For IRx1_FromAST.pm. 
    3938{package UNIVERSAL; sub WHAT {CORE::ref($_[0]) || autobox::universal::type($_[0]) } } 
    40  
    41 { package UNDEF; 
    42   sub perl { "undef" } 
    43 } 
    4439 
    4540{ package Any; 
     
    5550{ package Array; our $_tell_use_base_i_am_not_empty_; } 
    5651{ package Hash; our $_tell_use_base_i_am_not_empty_; } 
     52{ package Undef; our $_tell_use_base_i_am_not_empty_; } 
    5753{ package Code; our $_tell_use_base_i_am_not_empty_; } 
    5854 
     55{package UNDEF; 
     56 use base "Undef"; 
     57 sub WHAT {"Undef"} 
     58 sub perl { "undef" } 
     59} 
    5960no warnings qw(redefine prototype); 
    6061{ package STRING; 
     
    6768    @g ? \@g : undef; 
    6869  } 
     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 
    6988 
    7089  # randomness taken from autobox::Core 
     
    299318} 
    300319 
    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   # legacy 
    314   sub re_gsub ($$$) {$_[0] =~ s/$_[1]/$_[2]/g; $_[0]} 
    315 } 
    316  
    317320{ package GLOBAL; 
    318321 
     
    390393{ package GLOBAL; 
    391394  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  } 
    392399} 
    393400 
     
    780787; 
    781788 
    782 { package ARRAY; 
     789{ package Array; 
    783790use base "Any";(do{sub match_describe{my $self=CORE::shift;(do{((("\[\ 
    784791" . Match->indent($self->map(sub {my($e)=@_; 
     
    789796; 
    790797 
    791 { package HASH; 
     798{ package Hash; 
    792799use base "Any";(do{sub match_describe{my $self=CORE::shift;(do{my $s = "\{"; 
    793800for(($self->keys())->flatten){ 
     
    809816; 
    810817 
    811 { package STRING; 
     818{ package Str; 
    812819use base "Any";(do{sub match_describe{my $self=CORE::shift;(do{(("\'" . $self) . "\'")})}}) 
    813820} 
    814821; 
    815822 
    816 { package INTEGER; 
     823{ package Int; 
    817824use base "Any";(do{sub match_describe{my $self=CORE::shift;(do{(("\'" . $self) . "\'")})}}) 
    818825} 
    819826; 
    820827 
    821 { package FLOAT; 
     828{ package Num; 
    822829use base "Any";(do{sub match_describe{my $self=CORE::shift;(do{(("\'" . $self) . "\'")})}}) 
    823830} 
     
    828835      package Main; 
    829836 
    830 { package ARRAY; 
     837{ package Array; 
    831838use base "Any";(do{sub irx1_describe{my $self=CORE::shift;(do{(("\[" . $self->map(sub {my($e)=@_; 
    832839(do{$e->irx1_describe()})})->join("\,")) . "\]")})}}) 
     
    834841; 
    835842 
    836 { package STRING; 
     843{ package Str; 
    837844use base "Any";(do{sub irx1_describe{my $self=CORE::shift;(do{($self . "")})}}) 
    838845} 
    839846; 
    840847 
    841 { package INTEGER; 
     848{ package Int; 
    842849use base "Any";(do{sub irx1_describe{my $self=CORE::shift;(do{($self . "")})}}) 
    843850} 
    844851; 
    845852 
    846 { package FLOAT; 
     853{ package Num; 
    847854use base "Any";(do{sub irx1_describe{my $self=CORE::shift;(do{($self . "")})}}) 
    848855} 
    849856; 
    850857 
    851 { package UNDEF; 
     858{ package Undef; 
    852859use base "Any";(do{sub irx1_describe{my $self=CORE::shift;(do{"undef"})}}) 
    853860} 
     
    19371944; 
    19381945 
    1939 { package ARRAY; 
     1946{ package Array; 
    19401947use base "Any";(do{sub make_ir_from_Match_tree{my $self=CORE::shift;(do{$self->map(sub {my($e)=@_; 
    19411948(do{$e->make_ir_from_Match_tree()})})})}}) 
     
    19431950; 
    19441951 
    1945 { package STRING; 
     1952{ package Str; 
    19461953use base "Any";(do{sub make_ir_from_Match_tree{my $self=CORE::shift;(do{$self})}}) 
    19471954} 
    19481955; 
    19491956 
    1950 { package INTEGER; 
     1957{ package Int; 
    19511958use base "Any";(do{sub make_ir_from_Match_tree{my $self=CORE::shift;(do{$self})}}) 
    19521959} 
    19531960; 
    19541961 
    1955 { package FLOAT; 
     1962{ package Num; 
    19561963use base "Any";(do{sub make_ir_from_Match_tree{my $self=CORE::shift;(do{$self})}}) 
    19571964} 
    19581965; 
    19591966 
    1960 { package UNDEF; 
     1967{ package Undef; 
    19611968use base "Any";(do{sub make_ir_from_Match_tree{my $self=CORE::shift;(do{$self})}}) 
    19621969} 
     
    20462053my $ident = ("postcircumfix\:" . $name); 
    20472054my $args = irbuild_ir($m->{"hash"}->{"kludge_name"}); 
    2048 if(($args && (($args->ref() ne "ARRAY")))) { 
     2055if(($args && (($args->WHAT() ne "Array")))) { 
    20492056(do{($args = [$args])}) 
    20502057}; 
     
    20552062my $ident = ("postcircumfix\:" . $name); 
    20562063my $args = irbuild_ir($m->{"hash"}->{"kludge_name"}); 
    2057 if(($args && (($args->ref() ne "ARRAY")))) { 
     2064if(($args && (($args->WHAT() ne "Array")))) { 
    20582065(do{($args = [$args])}) 
    20592066}; 
     
    21192126$self->add_constructor("quote\:q", sub {my($m)=@_; 
    21202127(do{my $s = irbuild_ir($m->{"hash"}->{"text"}); 
    2121 $s->re_sub_g("\\\\\(\[\\\\\'\]\)", "\$1"); 
     2128$s->re_gsub_inline("\\\\\(\[\\\\\'\]\)", "\$1"); 
    21222129IRx1::Buf->newp($m, $s)})}); 
    21232130$self->add_constructor("quote\:qq", sub {my($m)=@_; 
     
    21262133"); 
    21272134$s->re_gsub("\(\?\<\!\\\\\)\\\\t", "\   "); 
    2128 $s->re_sub_g("\\\\\(\.\)", "\$1"); 
     2135$s->re_gsub_inline("\\\\\(\.\)", "\$1"); 
    21292136IRx1::Buf->newp($m, $s)})}); 
    21302137$self->add_constructor("quote\:regex", sub {my($m)=@_; 
     
    21582165(do{my $slf = IRx1::Apply->newp($m, "self", IRx1::Capture->newp($m, [])); 
    21592166my $args = irbuild_ir($m->{"hash"}->{"postcircumfix"}->{"hash"}->{"kludge_name"}); 
    2160 if(($args && (($args->ref() ne "ARRAY")))) { 
     2167if(($args && (($args->WHAT() ne "Array")))) { 
    21612168(do{($args = [$args])}) 
    21622169}; 
     
    21832190my $name = ((GLOBAL::substr($s, 0, 1) . "\ ") . GLOBAL::substr($s, (-1), 1)); 
    21842191my $args = irbuild_ir($m->{"hash"}->{"kludge_name"}); 
    2185 if(($args && (($args->ref() ne "ARRAY")))) { 
     2192if(($args && (($args->WHAT() ne "Array")))) { 
    21862193(do{($args = [$args])}) 
    21872194}; 
     
    28072814\ \ eval\ q\{package\ autobox\:\:universal\;\ sub\ type\ \{\ autobox\-\>type\(\$_\[0\]\)\ \}\}\;\ 
    28082815\}\ 
    2809 \{package\ UNDEF\;\ sub\ WHAT\ \{\"Undef\"\}\}\ 
    28102816\{package\ UNIVERSAL\;\ sub\ ref\ \{CORE\:\:ref\(\$_\[0\]\)\ \|\|\ autobox\:\:universal\:\:type\(\$_\[0\]\)\ \}\ \}\ \#\ For\ IRx1_FromAST\.pm\.\ 
    28112817\{package\ UNIVERSAL\;\ sub\ WHAT\ \{CORE\:\:ref\(\$_\[0\]\)\ \|\|\ autobox\:\:universal\:\:type\(\$_\[0\]\)\ \}\ \}\ 
    2812 \ 
    2813 \{\ package\ UNDEF\;\ 
    2814 \ \ sub\ perl\ \{\ \"undef\"\ \}\ 
    2815 \}\ 
    28162818\ 
    28172819\{\ package\ Any\;\ 
     
    28272829\{\ package\ Array\;\ our\ \$_tell_use_base_i_am_not_empty_\;\ \}\ 
    28282830\{\ package\ Hash\;\ our\ \$_tell_use_base_i_am_not_empty_\;\ \}\ 
     2831\{\ package\ Undef\;\ our\ \$_tell_use_base_i_am_not_empty_\;\ \}\ 
    28292832\{\ package\ Code\;\ our\ \$_tell_use_base_i_am_not_empty_\;\ \}\ 
    28302833\ 
     2834\{package\ UNDEF\;\ 
     2835\ use\ base\ \"Undef\"\;\ 
     2836\ sub\ WHAT\ \{\"Undef\"\}\ 
     2837\ sub\ perl\ \{\ \"undef\"\ \}\ 
     2838\}\ 
    28312839no\ warnings\ qw\(redefine\ prototype\)\;\ 
    28322840\{\ package\ STRING\;\ 
     
    28392847\ \ \ \ \@g\ \?\ \\\@g\ \:\ undef\;\ 
    28402848\ \ \}\ 
     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\ 
    28412867\ 
    28422868\ \ \#\ randomness\ taken\ from\ autobox\:\:Core\ 
     
    30713097\}\ 
    30723098\ 
    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 \ 
    30893099\{\ package\ GLOBAL\;\ 
    30903100\ 
     
    31623172\{\ package\ GLOBAL\;\ 
    31633173\ \ 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\ \ \}\ 
    31643178\}\ 
    31653179\ 
     
    33343348if(($n->is_context())) { 
    33353349(do{my $name = $self->e($n->var()); 
    3336 $name->re_sub_g("\^\(\.\)\:\:", "\$1"); 
     3350$name->re_gsub("\^\(\.\)\:\:", "\$1"); 
    33373351((((((("\{package\ main\;\ use\ vars\ \'" . $name) . "\'\}\;") . "local") . "\ ") . $self->e($n->var())) . $default))}) 
    33383352}elsif(($n->is_temp())) { 
     
    35013515}})}; 
    35023516sub 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)); 
    35053519$name})}; 
    35063520sub cb__Apply{my $self=CORE::shift;my($n)=@_; 
  • misc/elf/elf_h_src/EmitSimpleP5.pm

    r22374 r22421  
    6868  eval q{package autobox::universal; sub type { autobox->type($_[0]) }}; 
    6969} 
    70 {package UNDEF; sub WHAT {"Undef"}} 
    7170{package UNIVERSAL; sub ref {CORE::ref($_[0]) || autobox::universal::type($_[0]) } } # For IRx1_FromAST.pm. 
    7271{package UNIVERSAL; sub WHAT {CORE::ref($_[0]) || autobox::universal::type($_[0]) } } 
    73  
    74 { package UNDEF; 
    75   sub perl { "undef" } 
    76 } 
    7772 
    7873{ package Any; 
     
    8883{ package Array; our $_tell_use_base_i_am_not_empty_; } 
    8984{ package Hash; our $_tell_use_base_i_am_not_empty_; } 
     85{ package Undef; our $_tell_use_base_i_am_not_empty_; } 
    9086{ package Code; our $_tell_use_base_i_am_not_empty_; } 
    9187 
     88{package UNDEF; 
     89 use base "Undef"; 
     90 sub WHAT {"Undef"} 
     91 sub perl { "undef" } 
     92} 
    9293no warnings qw(redefine prototype); 
    9394{ package STRING; 
     
    100101    @g ? \@g : undef; 
    101102  } 
     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 
    102121 
    103122  # randomness taken from autobox::Core 
     
    332351} 
    333352 
    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   # legacy 
    347   sub re_gsub ($$$) {$_[0] =~ s/$_[1]/$_[2]/g; $_[0]} 
    348 } 
    349  
    350353{ package GLOBAL; 
    351354 
     
    423426{ package GLOBAL; 
    424427  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  } 
    425432} 
    426433 
     
    566573      if ($n.is_context) { # BOGUS 
    567574        my $name = $.e($n.var); 
    568         $name.re_sub_g('^(.)::','$1'); 
     575        $name.re_gsub('^(.)::','$1'); 
    569576        ("{package main; use vars '"~$name~"'};"~ 
    570577         'local'~' '~$.e($n.var)~$default) 
     
    738745  }; 
    739746  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); 
    742749     $name; 
    743750  } 
  • misc/elf/elf_h_src/IRx1_FromAST.pm

    r22374 r22421  
    2525  } 
    2626}; 
    27 class ARRAY { 
     27class Array { 
    2828  method make_ir_from_Match_tree() { 
    2929    self.map(sub($e){$e.make_ir_from_Match_tree()}) 
    3030  } 
    3131}; 
    32 class STRING { 
     32class Str { 
    3333  method make_ir_from_Match_tree() { 
    3434    self 
    3535  } 
    3636}; 
    37 class INTEGER { 
     37class Int { 
    3838  method make_ir_from_Match_tree() { 
    3939    self 
    4040  } 
    4141}; 
    42 class FLOAT { 
     42class Num { 
    4343  method make_ir_from_Match_tree() { 
    4444    self 
    4545  } 
    4646}; 
    47 class UNDEF { 
     47class Undef { 
    4848  method make_ir_from_Match_tree() { 
    4949    self 
     
    153153my $ident = "postcircumfix:"~$name; 
    154154my $args = irbuild_ir($m.{'hash'}{'kludge_name'}); 
    155 if $args && ($args.ref ne 'ARRAY')  { $args = [$args] } 
     155if $args && ($args.WHAT ne 'Array')  { $args = [$args] } 
    156156IRx1::Call.newp($m,$blackboard::expect_term_base,$ident,IRx1::Capture.newp($m,$args||[])); 
    157157    }); 
     
    162162my $ident = "postcircumfix:"~$name; 
    163163my $args = irbuild_ir($m.{'hash'}{'kludge_name'}); 
    164 if $args && ($args.ref ne 'ARRAY')  { $args = [$args] } 
     164if $args && ($args.WHAT ne 'Array')  { $args = [$args] } 
    165165IRx1::Call.newp($m,$blackboard::expect_term_base,$ident,IRx1::Capture.newp($m,$args||[])); 
    166166    }); 
     
    251251    $.add_constructor('quote:q', sub ($m) { 
    252252      my $s = irbuild_ir($m.{'hash'}{'text'}); 
    253 $s.re_sub_g('\\\\([\\\\\'])','$1'); 
     253$s.re_gsub_inline('\\\\([\\\\\'])','$1'); 
    254254IRx1::Buf.newp($m,$s); 
    255255    }); 
     
    259259$s.re_gsub('(?<!\\\\)\\\\n',"\n"); 
    260260$s.re_gsub('(?<!\\\\)\\\\t',"\t"); 
    261 $s.re_sub_g('\\\\(.)','$1'); 
     261$s.re_gsub_inline('\\\\(.)','$1'); 
    262262IRx1::Buf.newp($m,$s); 
    263263    }); 
     
    305305  my $slf = IRx1::Apply.newp($m,'self',IRx1::Capture.newp($m,[])); 
    306306  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] } 
    308308  IRx1::Call.newp($m,$slf,irbuild_ir($m.{'hash'}{'desigilname'}),IRx1::Capture.newp($m,$args||[])) 
    309309} else { 
     
    336336my $name = substr($s,0,1)~' '~substr($s,-1,1); 
    337337my $args = irbuild_ir($m.{'hash'}{'kludge_name'}); 
    338 if $args && ($args.ref ne 'ARRAY')  { $args = [$args] } 
     338if $args && ($args.WHAT ne 'Array')  { $args = [$args] } 
    339339IRx1::Apply.newp($m,"circumfix:"~$name,IRx1::Capture.newp($m,$args||[])); 
    340340    }); 
  • misc/elf/elf_h_src/IRx1_FromAST_create.pl

    r22374 r22421  
    8585my $ident = "postcircumfix:"~$name; 
    8686my $args = $m<kludge_name>; 
    87 if $args && ($args.ref ne 'ARRAY')  { $args = [$args] } 
     87if $args && ($args.WHAT ne 'Array')  { $args = [$args] } 
    8888Call.newp($blackboard::expect_term_base,$ident,Capture.newp($args||[])) 
    8989 
     
    9393my $ident = "postcircumfix:"~$name; 
    9494my $args = $m<kludge_name>; 
    95 if $args && ($args.ref ne 'ARRAY')  { $args = [$args] } 
     95if $args && ($args.WHAT ne 'Array')  { $args = [$args] } 
    9696Call.newp($blackboard::expect_term_base,$ident,Capture.newp($args||[])) 
    9797 
     
    170170quote:q 
    171171my $s = $m<text>; 
    172 $s.re_sub_g('\\\\([\\\\\'])','$1'); 
     172$s.re_gsub_inline('\\\\([\\\\\'])','$1'); 
    173173Buf.newp($s) 
    174174 
     
    177177$s.re_gsub('(?<!\\\\)\\\\n',"\n"); 
    178178$s.re_gsub('(?<!\\\\)\\\\t',"\t"); 
    179 $s.re_sub_g('\\\\(.)','$1'); 
     179$s.re_gsub_inline('\\\\(.)','$1'); 
    180180Buf.newp($s) 
    181181 
     
    217217    my $slf = Apply.newp('self',Capture.newp([])); 
    218218    my $args = $m<postcircumfix><kludge_name>; 
    219     if $args && ($args.ref ne 'ARRAY')  { $args = [$args] } 
     219    if $args && ($args.WHAT ne 'Array')  { $args = [$args] } 
    220220    Call.newp($slf,$m<desigilname>,Capture.newp($args||[])) 
    221221  } else { 
     
    244244my $name = substr($s,0,1)~' '~substr($s,-1,1); # XXX :( 
    245245my $args = $m<kludge_name>; 
    246 if $args && ($args.ref ne 'ARRAY')  { $args = [$args] } 
     246if $args && ($args.WHAT ne 'Array')  { $args = [$args] } 
    247247Apply.newp("circumfix:"~$name,Capture.newp($args||[])) 
    248248 
     
    588588  } 
    589589}; 
    590 class ARRAY { 
     590class Array { 
    591591  method make_ir_from_Match_tree() { 
    592592    self.map(sub($e){$e.make_ir_from_Match_tree()}) 
    593593  } 
    594594}; 
    595 class STRING { 
     595class Str { 
    596596  method make_ir_from_Match_tree() { 
    597597    self 
    598598  } 
    599599}; 
    600 class INTEGER { 
     600class Int { 
    601601  method make_ir_from_Match_tree() { 
    602602    self 
    603603  } 
    604604}; 
    605 class FLOAT { 
     605class Num { 
    606606  method make_ir_from_Match_tree() { 
    607607    self 
    608608  } 
    609609}; 
    610 class UNDEF { 
     610class Undef { 
    611611  method make_ir_from_Match_tree() { 
    612612    self 
  • misc/elf/elf_h_src/IRx1_Nodes.pm

    r20473 r22421  
    11# Warning: This file is mechanically written.  Your changes will be overwritten. 
    2 package ARRAY { 
     2package Array { 
    33  method irx1_describe() { 
    44    '[' ~ self.map(sub($e){$e.irx1_describe}).join(",") ~ ']' 
    55  }; 
    66}; 
    7 package STRING { 
     7package Str { 
    88  method irx1_describe() { 
    99    self ~ "" 
    1010  }; 
    1111}; 
    12 package INTEGER { 
     12package Int { 
    1313  method irx1_describe() { 
    1414    self ~ "" 
    1515  }; 
    1616}; 
    17 package FLOAT { 
     17package Num { 
    1818  method irx1_describe() { 
    1919    self ~ "" 
    2020  }; 
    2121}; 
    22 package UNDEF { 
     22package Undef { 
    2323  method irx1_describe() { 
    2424    'undef' 
  • misc/elf/elf_h_src/IRx1_nodes_create.pl

    r20727 r22421  
    172172  my $code = "".unindent(<<'  END'); 
    173173    # Warning: This file is mechanically written.  Your changes will be overwritten. 
    174     package ARRAY { 
     174    package Array { 
    175175      method irx1_describe() { 
    176176        '[' ~ self.map(sub($e){$e.irx1_describe}).join(",") ~ ']' 
    177177      }; 
    178178    }; 
    179     package STRING { 
     179    package Str { 
    180180      method irx1_describe() { 
    181181        self ~ "" 
    182182      }; 
    183183    }; 
    184     package INTEGER { 
     184    package Int { 
    185185      method irx1_describe() { 
    186186        self ~ "" 
    187187      }; 
    188188    }; 
    189     package FLOAT { 
     189    package Num { 
    190190      method irx1_describe() { 
    191191        self ~ "" 
    192192      }; 
    193193    }; 
    194     package UNDEF { 
     194    package Undef { 
    195195      method irx1_describe() { 
    196196        'undef' 
  • misc/elf/elf_h_src/Match.pm

    r22374 r22421  
    3737  } 
    3838}; 
    39 class ARRAY { 
     39class Array { 
    4040  method match_describe() { 
    4141    ("[\n" ~ 
     
    4444  } 
    4545}; 
    46 class HASH { 
     46class Hash { 
    4747  method match_describe() { 
    4848    my $s = "{"; 
     
    6060  }; 
    6161};