Changeset 22521

Show
Ignore:
Timestamp:
10/07/08 05:14:46 (6 weeks ago)
Author:
putter
Message:

[elf_h] Startup (main) refactored to make Elf derivatives easier. Fixed elf code bugs: missing required arguments; object fields accessed as hash. Added list argument recognition (for on_sbcl).

Location:
misc/elf
Files:
8 modified
1 copied

Legend:

Unmodified
Added
Removed
  • misc/elf/elf_h

    r22517 r22521  
    406406use autobox ARRAY => 'ARRAY', HASH => 'HASH', CODE => 'CODE', INTEGER => 'INTEGER', FLOAT => 'FLOAT', STRING => 'STRING', UNDEF => 'UNDEF';  use encoding 'utf8'; 
    407407      package Main; 
     408; 
     409; 
     410; 
     411; 
     412; 
     413; 
     414; 
     415; 
     416; 
     417; 
     418 
     419; 
     420use autobox ARRAY => 'ARRAY', HASH => 'HASH', CODE => 'CODE', INTEGER => 'INTEGER', FLOAT => 'FLOAT', STRING => 'STRING', UNDEF => 'UNDEF';  use encoding 'utf8'; 
     421      package Main; 
    408422 
    409423{ package Bit; 
     
    732746{ package Hash; 
    733747use base "Any";(do{sub Str{my $self=CORE::shift;(do{$self->keys()->map(sub {my($k)=@_; 
    734 (do{(($k . "\   ") . $self->{'$k'})})})->join("\ 
     748(do{(($k . "\   ") . $self->{$k})})})->join("\ 
    735749")})}}) 
    736750} 
     
    748762 
    749763{ package Any; 
    750 (do{sub true{my $self=CORE::shift;(do{GLOBAL::defined($self)})}}) 
     764(do{sub true{my $self=CORE::shift;(do{GLOBAL::defined($self)})}; 
     765sub defined{my $self=CORE::shift;(do{GLOBAL::defined($self)})}}) 
    751766} 
    752767; 
     
    22252240(do{($els = $els->[0])}) 
    22262241}; 
    2227 IRx1::Cond->newp($m, [[irbuild_ir($m->hash()->{"if_expr"}), irbuild_ir($m->hash()->{"if_block"})]]->push(irbuild_ir($m->hash()->{"elsif"})->flatten()), $els)})}; 
     2242IRx1::Cond->newp($m, [[irbuild_ir($m->hash()->{"if_expr"}), irbuild_ir($m->hash()->{"if_block"})]]->push(irbuild_ir($m->hash()->{"elsif"})->flatten()), $els, GLOBAL::undef())})}; 
    22282243my $construct_elsif = sub {my($m)=@_; 
    22292244(do{[irbuild_ir($m->hash()->{"elsif_expr"}), irbuild_ir($m->hash()->{"elsif_block"})]})}; 
     
    22422257$one})}; 
    22432258my $construct_statement_mod_cond_58if = sub {my($m)=@_; 
    2244 (do{IRx1::Cond->newp($m, [[irbuild_ir($m->hash()->{"modifier_expr"}), $blackboard::statement_expr]], GLOBAL::undef())})}; 
     2259(do{IRx1::Cond->newp($m, [[irbuild_ir($m->hash()->{"modifier_expr"}), $blackboard::statement_expr]], GLOBAL::undef(), GLOBAL::undef())})}; 
    22452260my $construct_statement_control_58unless = sub {my($m)=@_; 
    22462261(do{IRx1::Cond->newp($m, [[irbuild_ir($m->hash()->{"expr"}), irbuild_ir($m->hash()->{"block"})]], GLOBAL::undef(), 1)})}; 
     
    23252340(do{IRx1::Signature->newp($m, irbuild_ir($m->hash()->{"parsep"}), GLOBAL::undef())})}; 
    23262341my $construct_parameter = sub {my($m)=@_; 
    2327 (do{IRx1::Parameter->newp($m, irbuild_ir($m->hash()->{"type_constraint"}), irbuild_ir($m->hash()->{"quantchar"}), irbuild_ir($m->hash()->{"param_var"}))})}; 
     2342(do{IRx1::Parameter->newp($m, irbuild_ir($m->hash()->{"type_constraint"}), irbuild_ir($m->hash()->{"quantchar"}), irbuild_ir($m->hash()->{"param_var"}), GLOBAL::undef(), GLOBAL::undef(), GLOBAL::undef(), GLOBAL::undef())})}; 
    23282343my $construct_param_var = sub {my($m)=@_; 
    23292344(do{IRx1::ParamVar->newp($m, irbuild_ir($m->hash()->{"sigil"}), irbuild_ir($m->hash()->{"twigil"}), irbuild_ir($m->hash()->{"ident"}))})}; 
     
    27012716}}) 
    27022717}; 
    2703 if(((($self->{'var'}->{'twigil'} || "")) eq "\+")) { 
     2718if(((($self->var()->twigil() || "")) eq "\+")) { 
    27042719(do{($self->notes->{'is'}->{'context'} = 1)}) 
    27052720}; 
     
    28052820 
    28062821{ package IRx1::Var; 
    2807 use base "Any";(do{sub note_environment{my $self=CORE::shift;(do{my $key = ($self->{'sigil'} . $self->{'name'}); 
     2822use base "Any";(do{sub note_environment{my $self=CORE::shift;(do{my $key = ($self->sigil() . $self->name()); 
    28082823($self->notes->{'decl'} = $whiteboard::lexical_bindings->{$key}); 
    28092824if($self->notes->{'decl'}) { 
     
    28432858sub is_context{my $self=CORE::shift;(do{$self->notes->{'is'}->{'context'}})}; 
    28442859sub is_temp{my $self=CORE::shift;(do{$self->notes->{'is'}->{'temp'}})}; 
    2845 sub name{my $self=CORE::shift;(do{$self->{'var'}->{'name'}})}; 
     2860sub name{my $self=CORE::shift;(do{$self->var()->name()})}; 
    28462861sub bare_name{my $self=CORE::shift;(do{$self->var()->bare_name()})}; 
    28472862sub package{my $self=CORE::shift;(do{$self->var()->package()})}; 
    28482863sub crnt_package{my $self=CORE::shift;(do{$self->var()->crnt_package()})}; 
    2849 sub sigil{my $self=CORE::shift;(do{$self->{'var'}->{'sigil'}})}; 
    2850 sub twigil{my $self=CORE::shift;(do{$self->{'var'}->{'twigil'}})}; 
    2851 sub is_scalar{my $self=CORE::shift;(do{($self->{'var'}->{'sigil'} eq "\$")})}; 
    2852 sub is_array{my $self=CORE::shift;(do{($self->{'var'}->{'sigil'} eq "\@")})}; 
    2853 sub is_hash{my $self=CORE::shift;(do{($self->{'var'}->{'sigil'} eq "\%")})}}) 
     2864sub sigil{my $self=CORE::shift;(do{$self->var()->sigil()})}; 
     2865sub twigil{my $self=CORE::shift;(do{$self->var()->twigil()})}; 
     2866sub is_scalar{my $self=CORE::shift;(do{($self->var()->sigil() eq "\$")})}; 
     2867sub is_array{my $self=CORE::shift;(do{($self->var()->sigil() eq "\@")})}; 
     2868sub is_hash{my $self=CORE::shift;(do{($self->var()->sigil() eq "\%")})}}) 
    28542869} 
    28552870; 
     
    28692884sub package{my $self=CORE::shift;(do{$self->notes()->{'package'}})}; 
    28702885sub crnt_package{my $self=CORE::shift;(do{$self->notes()->{'crnt_package'}})}; 
    2871 sub is_context{my $self=CORE::shift;(do{(((($self->{'twigil'} || "")) eq "\+") || $self->notes->{'is'}->{'context'})})}; 
     2886sub is_context{my $self=CORE::shift;(do{(((($self->twigil() || "")) eq "\+") || $self->notes->{'is'}->{'context'})})}; 
    28722887sub is_temp{my $self=CORE::shift;(do{$self->notes->{'is'}->{'temp'}})}}) 
    28732888} 
     
    28762891{ package IRx1::PackageDecl; 
    28772892use base "Any";(do{sub path_is_absolute{my $self=CORE::shift;(do{($self->name() && $self->name()->re_matchp("\^GLOBAL\\b"))})}}) 
     2893} 
     2894; 
     2895 
     2896{ package IRx1::Base; 
     2897use base "Any";(do{sub provides_a_list{my $self=CORE::shift;(do{GLOBAL::undef()})}}) 
     2898} 
     2899; 
     2900 
     2901{ package IRx1::Call; 
     2902use base "Any";(do{sub provides_a_list{my $self=CORE::shift;(do{($self->method() eq "flatten")})}}) 
     2903} 
     2904; 
     2905 
     2906{ package IRx1::Capture; 
     2907use base "Any";(do{sub contains_a_list{my $self=CORE::shift;(do{my $found; 
     2908$self->arguments->map(sub {my($e)=@_; 
     2909(do{if((($e->isa("IRx1\:\:Base") && $e->provides_a_list()))) { 
     2910(do{($found = 1)}) 
     2911}})}); 
     2912$found})}}) 
    28782913} 
    28792914; 
     
    40554090; 
    40564091 
     4092{ package GLOBAL; 
     4093use base "Any";(do{sub elf_main{(do{Program->new()->main($GLOBAL::a_ARGS)})}}) 
     4094} 
     4095; 
     4096 
    40574097; 
    40584098use autobox ARRAY => 'ARRAY', HASH => 'HASH', CODE => 'CODE', INTEGER => 'INTEGER', FLOAT => 'FLOAT', STRING => 'STRING', UNDEF => 'UNDEF';  use encoding 'utf8'; 
     
    43254365} 
    43264366; 
    4327 Program->new()->main($GLOBAL::a_ARGS); 
    43284367 
    43294368; 
     
    43314370      package Main; 
    43324371; 
    4333 ; 
    4334 ; 
    4335 ; 
    4336 ; 
    4337 ; 
    4338 ; 
    4339 ; 
    4340 ; 
    4341 ; 
    4342  
    4343 ; 
     4372GLOBAL::elf_main(); 
     4373 
     4374; 
  • misc/elf/elf_h_src/CommandLine.pm

    r22465 r22521  
    119119}; 
    120120 
    121 Program.new().main(@*ARGS); 
  • misc/elf/elf_h_src/Elf.pm

    r20726 r22521  
    1 use Prelude; 
    2 use Match; 
    3 use IRx1_Nodes; 
    4 use IRx1_FromAST; 
    5 use IRx1_Analysis; 
    6 use EmitSimpleP5; 
    7 use PrimitivesP5; 
    8 use Parser; 
    9 use Compiler; 
    10 use CommandLine; 
     1use Elf_wo_main; 
     2elf_main(); 
  • misc/elf/elf_h_src/IRx1_Analysis.pm

    r22341 r22521  
    8282      } 
    8383    } 
    84     if (self.<var><twigil>||'') eq '+' {$.notes<is><context> = 1} 
     84    if (self.var.twigil||'') eq '+' {$.notes<is><context> = 1} 
    8585    if self.scope eq 'temp' {$.notes<is><temp> = 1} 
    8686 
     
    169169class IRx1::Var { 
    170170  method note_environment() { 
    171     my $key = self<sigil> ~ self<name>; 
     171    my $key = self.sigil ~ self.name; 
    172172    $.notes<decl> = $whiteboard::lexical_bindings{$key}; 
    173173    if $.notes<decl> { 
     
    204204  method is_context() { $.notes<is><context> } 
    205205  method is_temp() { $.notes<is><temp> } 
    206   method name () { self.<var><name> } 
     206  method name () { self.var.name } 
    207207  method bare_name() { self.var.bare_name } 
    208208  method package() { self.var.package } 
    209209  method crnt_package() { self.var.crnt_package } 
    210   method sigil() { self.<var><sigil> } 
    211   method twigil() { self.<var><twigil> } 
    212   method is_scalar() { self.<var><sigil> eq '$' } 
    213   method is_array() { self.<var><sigil> eq '@' } 
    214   method is_hash() { self.<var><sigil> eq '%' } 
     210  method sigil() { self.var.sigil } 
     211  method twigil() { self.var.twigil } 
     212  method is_scalar() { self.var.sigil eq '$' } 
     213  method is_array() { self.var.sigil eq '@' } 
     214  method is_hash() { self.var.sigil eq '%' } 
    215215} 
    216216class IRx1::SubDecl { 
     
    226226  method package() { self.notes<package> } 
    227227  method crnt_package() { self.notes<crnt_package> } 
    228   method is_context() { (self.<twigil>||'') eq '+' || $.notes<is><context> } 
     228  method is_context() { (self.twigil||'') eq '+' || $.notes<is><context> } 
    229229  method is_temp() { $.notes<is><temp> } 
    230230} 
     
    232232  method path_is_absolute() { self.name && self.name.re_matchp('^GLOBAL\b') } 
    233233} 
     234 
     235class IRx1::Base { 
     236  method provides_a_list { undef } 
     237} 
     238class IRx1::Call { 
     239  method provides_a_list { self.method eq "flatten" } 
     240} 
     241class IRx1::Capture { 
     242  method contains_a_list { 
     243    my $found; 
     244    $.arguments.map(sub($e){ 
     245      if ($e.isa('IRx1::Base') && $e.provides_a_list) { $found = 1 }}); 
     246    $found; 
     247  } 
     248} 
  • misc/elf/elf_h_src/IRx1_FromAST.pm

    r22517 r22521  
    372372      my $els = irbuild_ir($m.hash{'else'}); 
    373373if $els { $els = $els[0] } 
    374 IRx1::Cond.newp($m,[[irbuild_ir($m.hash{'if_expr'}),irbuild_ir($m.hash{'if_block'})]].push(irbuild_ir($m.hash{'elsif'}).flatten),$els); 
     374IRx1::Cond.newp($m,[[irbuild_ir($m.hash{'if_expr'}),irbuild_ir($m.hash{'if_block'})]].push(irbuild_ir($m.hash{'elsif'}).flatten),$els,undef); 
    375375    }; 
    376376 
     
    394394 
    395395    my $construct_statement_mod_cond_58if = sub ($m) { 
    396       IRx1::Cond.newp($m,[[irbuild_ir($m.hash{'modifier_expr'}),$blackboard::statement_expr]],undef); 
     396      IRx1::Cond.newp($m,[[irbuild_ir($m.hash{'modifier_expr'}),$blackboard::statement_expr]],undef,undef); 
    397397    }; 
    398398 
     
    500500 
    501501    my $construct_parameter = sub ($m) { 
    502       IRx1::Parameter.newp($m,irbuild_ir($m.hash{'type_constraint'}),irbuild_ir($m.hash{'quantchar'}),irbuild_ir($m.hash{'param_var'})); 
     502      IRx1::Parameter.newp($m,irbuild_ir($m.hash{'type_constraint'}),irbuild_ir($m.hash{'quantchar'}),irbuild_ir($m.hash{'param_var'}),undef,undef,undef,undef); 
    503503    }; 
    504504 
     
    753753method init { 
    754754 
    755  
    756     $.add_constructor('comp_unit', $construct_comp_unit); 
    757  
     755$.add_constructor('comp_unit', $construct_comp_unit); 
    758756    $.add_constructor('statement', $construct_statement); 
    759  
    760757    $.add_constructor('expect_infix', $construct_expect_infix); 
    761  
    762758    $.add_constructor('fatarrow', $construct_fatarrow); 
    763  
    764759    $.add_constructor('expect_term', $construct_expect_term); 
    765  
    766760    $.add_constructor('term:expect_term', $construct_term_58expect_term); 
    767  
    768761    $.add_constructor('post', $construct_post); 
    769  
    770762    $.add_constructor('pre', $construct_pre); 
    771  
    772763    $.add_constructor('dotty:methodop', $construct_dotty_58methodop); 
    773  
    774764    $.add_constructor('dotty:.^!', $construct_dotty_58_46_94_33); 
    775  
    776765    $.add_constructor('dotty:postcircumfix', $construct_dotty_58postcircumfix); 
    777  
    778766    $.add_constructor('postcircumfix', $construct_postcircumfix); 
    779  
    780767    $.add_constructor('postfix', $construct_postfix); 
    781  
    782768    $.add_constructor('prefix', $construct_prefix); 
    783  
    784769    $.add_constructor('infix', $construct_infix); 
    785  
    786770    $.add_constructor('term', $construct_term); 
    787  
    788771    $.add_constructor('integer', $construct_integer); 
    789  
    790772    $.add_constructor('subcall', $construct_subcall); 
    791  
    792773    $.add_constructor('name', $construct_name); 
    793  
    794774    $.add_constructor('subshortname', $construct_subshortname); 
    795  
    796775    $.add_constructor('statement_control:use', $construct_statement_control_58use); 
    797  
    798776    $.add_constructor('module_name:depreciated', $construct_module_name_58depreciated); 
    799  
    800777    $.add_constructor('module_name:normal', $construct_module_name_58normal); 
    801  
    802778    $.add_constructor('role_name', $construct_role_name); 
    803  
    804779    $.add_constructor('statement_control:BEGIN', $construct_statement_control_58BEGIN); 
    805  
    806780    $.add_constructor('term:listop', $construct_term_58listop); 
    807  
    808781    $.add_constructor('quote:q', $construct_quote_58q); 
    809  
    810782    $.add_constructor('quote:qq', $construct_quote_58qq); 
    811  
    812783    $.add_constructor('quote:regex', $construct_quote_58regex); 
    813  
    814784    $.add_constructor('scope_declarator:my', $construct_scope_declarator_58my); 
    815  
    816785    $.add_constructor('scope_declarator:has', $construct_scope_declarator_58has); 
    817  
    818786    $.add_constructor('scope_declarator:our', $construct_scope_declarator_58our); 
    819  
    820787    $.add_constructor('scope_declarator:temp', $construct_scope_declarator_58temp); 
    821  
    822788    $.add_constructor('scoped', $construct_scoped); 
    823  
    824789    $.add_constructor('variable_decl', $construct_variable_decl); 
    825  
    826790    $.add_constructor('variable', $construct_variable); 
    827  
    828791    $.add_constructor('sigil', $construct_sigil); 
    829  
    830792    $.add_constructor('twigil', $construct_twigil); 
    831  
    832793    $.add_constructor('special_variable', $construct_special_variable); 
    833  
    834794    $.add_constructor('circumfix', $construct_circumfix); 
    835  
    836795    $.add_constructor('statement_control:for', $construct_statement_control_58for); 
    837  
    838796    $.add_constructor('statement_mod_loop:for', $construct_statement_mod_loop_58for); 
    839  
    840797    $.add_constructor('statement_control:while', $construct_statement_control_58while); 
    841  
    842798    $.add_constructor('statement_mod_loop:while', $construct_statement_mod_loop_58while); 
    843  
    844799    $.add_constructor('statement_control:until', $construct_statement_control_58until); 
    845  
    846800    $.add_constructor('statement_mod_loop:until', $construct_statement_mod_loop_58until); 
    847  
    848801    $.add_constructor('statement_control:loop', $construct_statement_control_58loop); 
    849  
    850802    $.add_constructor('statement_control:if', $construct_statement_control_58if); 
    851  
    852803    $.add_constructor('elsif', $construct_elsif); 
    853  
    854804    $.add_constructor('if__else', $construct_if__else); 
    855  
    856805    $.add_constructor('statement_mod_cond:if', $construct_statement_mod_cond_58if); 
    857  
    858806    $.add_constructor('statement_control:unless', $construct_statement_control_58unless); 
    859  
    860807    $.add_constructor('statement_mod_cond:unless', $construct_statement_mod_cond_58unless); 
    861  
    862808    $.add_constructor('statement_control:given', $construct_statement_control_58given); 
    863  
    864809    $.add_constructor('statement_mod_loop:given', $construct_statement_mod_loop_58given); 
    865  
    866810    $.add_constructor('statement_control:when', $construct_statement_control_58when); 
    867  
    868811    $.add_constructor('statement_mod_cond:when', $construct_statement_mod_cond_58when); 
    869  
    870812    $.add_constructor('statement_control:default', $construct_statement_control_58default); 
    871  
    872813    $.add_constructor('statement_prefix:do', $construct_statement_prefix_58do); 
    873  
    874814    $.add_constructor('statement_prefix:try', $construct_statement_prefix_58try); 
    875  
    876815    $.add_constructor('statement_prefix:gather', $construct_statement_prefix_58gather); 
    877  
    878816    $.add_constructor('statement_prefix:contend', $construct_statement_prefix_58contend); 
    879  
    880817    $.add_constructor('statement_prefix:async', $construct_statement_prefix_58async); 
    881  
    882818    $.add_constructor('statement_prefix:lazy', $construct_statement_prefix_58lazy); 
    883  
    884819    $.add_constructor('pblock', $construct_pblock); 
    885  
    886820    $.add_constructor('block', $construct_block); 
    887  
    888821    $.add_constructor('plurality_declarator:multi', $construct_plurality_declarator_58multi); 
    889  
    890822    $.add_constructor('routine_declarator:routine_def', $construct_routine_declarator_58routine_def); 
    891  
    892823    $.add_constructor('routine_def', $construct_routine_def); 
    893  
    894824    $.add_constructor('routine_declarator:method_def', $construct_routine_declarator_58method_def); 
    895  
    896825    $.add_constructor('signature', $construct_signature); 
    897  
    898826    $.add_constructor('parameter', $construct_parameter); 
    899  
    900827    $.add_constructor('param_var', $construct_param_var); 
    901  
    902828    $.add_constructor('capture', $construct_capture); 
    903  
    904829    $.add_constructor('colonpair', $construct_colonpair); 
    905  
    906830    $.add_constructor('colonpair__false', $construct_colonpair__false); 
    907  
    908831    $.add_constructor('colonpair__value', $construct_colonpair__value); 
    909  
    910832    $.add_constructor('quotepair', $construct_quotepair); 
    911  
    912833    $.add_constructor('quotepair__false', $construct_quotepair__false); 
    913  
    914834    $.add_constructor('quotepair__value', $construct_quotepair__value); 
    915  
    916835    $.add_constructor('quotepair__nth', $construct_quotepair__nth); 
    917  
    918836    $.add_constructor('package_declarator:role', $construct_package_declarator_58role); 
    919  
    920837    $.add_constructor('package_declarator:class', $construct_package_declarator_58class); 
    921  
    922838    $.add_constructor('package_declarator:module', $construct_package_declarator_58module); 
    923  
    924839    $.add_constructor('package_declarator:package', $construct_package_declarator_58package); 
    925  
    926840    $.add_constructor('package_declarator:grammar', $construct_package_declarator_58grammar); 
    927  
    928841    $.add_constructor('package_def', $construct_package_def); 
    929  
    930842    $.add_constructor('fulltypename', $construct_fulltypename); 
    931  
    932843    $.add_constructor('typename', $construct_typename); 
    933  
    934844    $.add_constructor('trait_verb:is', $construct_trait_verb_58is); 
    935  
    936845    $.add_constructor('trait_verb:does', $construct_trait_verb_58does); 
    937  
    938846    $.add_constructor('circumfix:pblock', $construct_circumfix_58pblock); 
    939  
    940847    $.add_constructor('regex_declarator:regex_def', $construct_regex_declarator_58regex_def); 
    941  
    942848    $.add_constructor('regex_block', $construct_regex_block); 
    943  
    944849    $.add_constructor('regex', $construct_regex); 
    945  
    946850    $.add_constructor('regex_first', $construct_regex_first); 
    947  
    948851    $.add_constructor('regex_every', $construct_regex_every); 
    949  
    950852    $.add_constructor('regex_submatch', $construct_regex_submatch); 
    951  
    952853    $.add_constructor('regex_any', $construct_regex_any); 
    953  
    954854    $.add_constructor('regex_all', $construct_regex_all); 
    955  
    956855    $.add_constructor('regex_sequence', $construct_regex_sequence); 
    957  
    958856    $.add_constructor('regex_quantified_atom', $construct_regex_quantified_atom); 
    959  
    960857    $.add_constructor('regex_quantifier', $construct_regex_quantifier); 
    961  
    962858    $.add_constructor('regex_atom', $construct_regex_atom); 
    963  
    964859    $.add_constructor('regex_metachar:regex_backslash', $construct_regex_metachar_58regex_backslash); 
    965  
    966860    $.add_constructor('regex_metachar:regex_mod_internal', $construct_regex_metachar_58regex_mod_internal); 
    967  
    968861    $.add_constructor('regex_assertion:ident', $construct_regex_assertion_58ident); 
    969  
    970862    $.add_constructor('regex_metachar:capture', $construct_regex_metachar_58capture); 
    971  
    972863    $.add_constructor('regex_metachar:group', $construct_regex_metachar_58group); 
    973  
    974864    $.add_constructor('regex_metachar:block', $construct_regex_metachar_58block); 
    975  
    976865    $.add_constructor('regex_metachar:var', $construct_regex_metachar_58var); 
    977  
    978866    $.add_constructor('regex_metachar:q', $construct_regex_metachar_58q); 
    979  
    980867    $.add_constructor('regex_metachar:qq', $construct_regex_metachar_58qq); 
    981  
    982868    $.add_constructor('regex_metachar', $construct_regex_metachar); 
    983869 
    984 self; 
     870      self; 
    985871    }; # end init 
    986872  }; 
  • misc/elf/elf_h_src/IRx1_FromAST_create.pl

    r22517 r22521  
    279279my $els = $m<else>; 
    280280if $els { $els = $els[0] } 
    281 Cond.newp([[$m<if_expr>,$m<if_block>]].push($m<elsif>.flatten),$els) 
     281Cond.newp([[$m<if_expr>,$m<if_block>]].push($m<elsif>.flatten),$els,undef) 
    282282 
    283283elsif 
     
    288288 
    289289statement_mod_cond:if 
    290 Cond.newp([[$m<modifier_expr>,$blackboard::statement_expr]],undef) 
     290Cond.newp([[$m<modifier_expr>,$blackboard::statement_expr]],undef,undef) 
    291291 
    292292statement_control:unless 
     
    378378 
    379379parameter 
    380 Parameter.newp($m<type_constraint>,$m<quantchar>,$m<param_var>) 
     380Parameter.newp($m<type_constraint>,$m<quantchar>,$m<param_var>,undef,undef,undef,undef) 
    381381 
    382382param_var 
     
    673673      }; 
    674674    END 
    675     $init .= "\n".unindent(<<"    END","    "); 
     675    $init .= "".unindent(<<"    END","    "); 
    676676      \$.add_constructor('$name', \$construct_$fname); 
    677677    END 
  • misc/elf/elf_h_src/Prelude.pm

    r22307 r22521  
    124124class Str   { method Str () { self } } 
    125125class Array { method Str () { self.join('') } } 
    126 class Hash  { method Str () { self.keys.map(sub($k){$k~"\t"~self<$k>}).join("\n") } } 
     126class Hash  { method Str () { self.keys.map(sub($k){$k~"\t"~self{$k}}).join("\n") } } 
    127127class Pair  { method Str () { $.key~"\t"~$.value } } 
    128128 
     
    135135class Any { 
    136136  method true() { defined(self) } 
     137  method defined { defined(self) } 
    137138} 
    138139 
  • misc/elf/elf_h_src/PrimitivesP5.pm

    r22273 r22521  
    135135   
    136136} 
     137 
     138# Elf 
     139package GLOBAL { 
     140  sub elf_main () { Program.new().main(@*ARGS); } 
     141}