Commits

gabriele renzi  committed b859cee

goto works

  • Participants
  • Parent commits 1d88f29

Comments (0)

Files changed (11)

File .t.z.swp

Binary file removed.

File src/builtins/say.pir

 .end
 
 
+.namespace []
+
+.sub 'say2'
+    print "hello\n"
+    .return ()
+.end
+
+.namespace []
+.sub 'min'
+    print "min\n"
+    .return ()
+.end
+.namespace []
+.sub 'dup'
+    print "dup\n"
+    .return ()
+.end
+.namespace []
+.sub 'add'
+    print "add\n"
+    .return ()
+.end
 # Local Variables:
 #   mode: pir
 #   fill-column: 100

File src/gen_actions.pir

 
 
 .namespace ["z2";"Grammar";"Actions"]
-.sub "_block13" :init :load :subid("25")
-    .const 'Sub' $P173 = "23" 
-    capture_lex $P173
-    .const 'Sub' $P156 = "22" 
-    capture_lex $P156
-    .const 'Sub' $P144 = "21" 
-    capture_lex $P144
-    .const 'Sub' $P119 = "19" 
-    capture_lex $P119
-    .const 'Sub' $P107 = "18" 
-    capture_lex $P107
-    .const 'Sub' $P95 = "17" 
-    capture_lex $P95
-    .const 'Sub' $P69 = "15" 
-    capture_lex $P69
+.sub "_block13" :init :load :subid("27")
+    .const 'Sub' $P220 = "25" 
+    capture_lex $P220
+    .const 'Sub' $P203 = "24" 
+    capture_lex $P203
+    .const 'Sub' $P191 = "23" 
+    capture_lex $P191
+    .const 'Sub' $P166 = "21" 
+    capture_lex $P166
+    .const 'Sub' $P154 = "20" 
+    capture_lex $P154
+    .const 'Sub' $P139 = "19" 
+    capture_lex $P139
+    .const 'Sub' $P113 = "17" 
+    capture_lex $P113
+    .const 'Sub' $P98 = "16" 
+    capture_lex $P98
+    .const 'Sub' $P79 = "15" 
+    capture_lex $P79
     .const 'Sub' $P41 = "13" 
     capture_lex $P41
     .const 'Sub' $P15 = "11" 
         $P2 = $P0.'new_class'($P1)
       subclass_done:
         pop_eh
-    .const 'Sub' $P173 = "23" 
-    capture_lex $P173
-    .return ($P173)
+    .const 'Sub' $P220 = "25" 
+    capture_lex $P220
+    .return ($P220)
 .end
 
 
 .namespace ["z2";"Grammar";"Actions"]
-.sub "TOP"  :subid("11") :method :outer("25")
+.sub "TOP"  :subid("11") :method :outer("27")
     .param pmc param_18
     new $P17, 'ExceptionHandler'
     set_addr $P17, control_16
     .lex "$/", param_18
     get_hll_global $P19, ["PAST"], "Block"
     find_lex $P20, "$/"
-    unless_null $P20, vivify_26
+    unless_null $P20, vivify_28
     new $P20, "Undef"
-  vivify_26:
+  vivify_28:
     $P21 = $P19."new"($P20 :named("node"))
     .lex "$past", $P21
     find_lex $P23, "$/"
     set $P24, $P23["scene"]
-    unless_null $P24, vivify_27
+    unless_null $P24, vivify_29
     new $P24, "Undef"
-  vivify_27:
+  vivify_29:
     defined $I25, $P24
-    unless $I25, for_undef_28
+    unless $I25, for_undef_30
     iter $P22, $P24
     new $P35, 'ExceptionHandler'
     set_addr $P35, loop34_handler
     eq $P36, 66, loop34_redo
   loop34_done:
     pop_eh 
-  for_undef_28:
+  for_undef_30:
     find_lex $P37, "$/"
     find_lex $P38, "$past"
-    unless_null $P38, vivify_31
+    unless_null $P38, vivify_33
     new $P38, "Undef"
-  vivify_31:
+  vivify_33:
     $P39 = $P37."result_object"($P38)
     .return ($P39)
   control_16:
     .param pmc param_29
     .lex "$_", param_29
     find_lex $P30, "$past"
-    unless_null $P30, vivify_29
+    unless_null $P30, vivify_31
     new $P30, "Undef"
-  vivify_29:
+  vivify_31:
     find_lex $P31, "$_"
-    unless_null $P31, vivify_30
+    unless_null $P31, vivify_32
     new $P31, "Undef"
-  vivify_30:
+  vivify_32:
     $P32 = $P31."item"()
     $P33 = $P30."push"($P32)
     .return ($P33)
 
 
 .namespace ["z2";"Grammar";"Actions"]
-.sub "scene"  :subid("13") :method :outer("25")
+.sub "scene"  :subid("13") :method :outer("27")
     .param pmc param_44
     new $P43, 'ExceptionHandler'
     set_addr $P43, control_42
     $P43."handle_types"(58)
     push_eh $P43
     .lex "$/", param_44
-    get_hll_global $P45, ["PAST"], "Block"
+    get_hll_global $P45, ["PAST"], "Stmts"
     find_lex $P46, "$/"
     set $P47, $P46["roman"]
-    unless_null $P47, vivify_32
+    unless_null $P47, vivify_34
     new $P47, "Undef"
-  vivify_32:
+  vivify_34:
     find_lex $P48, "$/"
-    unless_null $P48, vivify_33
+    unless_null $P48, vivify_35
     new $P48, "Undef"
-  vivify_33:
+  vivify_35:
     $P49 = $P45."new"($P47 :named("name"), $P48 :named("node"))
     .lex "$past", $P49
-    find_lex $P51, "$/"
-    set $P52, $P51["line"]
-    unless_null $P52, vivify_34
-    new $P52, "Undef"
-  vivify_34:
-    defined $I53, $P52
-    unless $I53, for_undef_35
-    iter $P50, $P52
-    new $P63, 'ExceptionHandler'
-    set_addr $P63, loop62_handler
-    $P63."handle_types"(64, 66, 65)
-    push_eh $P63
-  loop62_test:
-    unless $P50, loop62_done
-    shift $P54, $P50
-  loop62_redo:
-    .const 'Sub' $P56 = "14" 
-    capture_lex $P56
-    $P56($P54)
-  loop62_next:
-    goto loop62_test
-  loop62_handler:
+    get_hll_global $P50, ["PAST"], "Op"
+    new $P51, "String"
+    assign $P51, ""
+    find_lex $P52, "$/"
+    set $P53, $P52["roman"]
+    unless_null $P53, vivify_36
+    new $P53, "Undef"
+  vivify_36:
+    concat $P54, $P51, $P53
+    concat $P55, $P54, ":"
+    find_lex $P56, "$/"
+    unless_null $P56, vivify_37
+    new $P56, "Undef"
+  vivify_37:
+    $P57 = $P50."new"($P55 :named("inline"), $P56 :named("node"))
+    .lex "$lbl", $P57
+    find_lex $P58, "$past"
+    unless_null $P58, vivify_38
+    new $P58, "Undef"
+  vivify_38:
+    find_lex $P59, "$lbl"
+    unless_null $P59, vivify_39
+    new $P59, "Undef"
+  vivify_39:
+    $P58."push"($P59)
+    find_lex $P61, "$/"
+    set $P62, $P61["line"]
+    unless_null $P62, vivify_40
+    new $P62, "Undef"
+  vivify_40:
+    defined $I63, $P62
+    unless $I63, for_undef_41
+    iter $P60, $P62
+    new $P73, 'ExceptionHandler'
+    set_addr $P73, loop72_handler
+    $P73."handle_types"(64, 66, 65)
+    push_eh $P73
+  loop72_test:
+    unless $P60, loop72_done
+    shift $P64, $P60
+  loop72_redo:
+    .const 'Sub' $P66 = "14" 
+    capture_lex $P66
+    $P66($P64)
+  loop72_next:
+    goto loop72_test
+  loop72_handler:
     .local pmc exception 
     .get_results (exception) 
-    getattribute $P64, exception, 'type'
-    eq $P64, 64, loop62_next
-    eq $P64, 66, loop62_redo
-  loop62_done:
+    getattribute $P74, exception, 'type'
+    eq $P74, 64, loop72_next
+    eq $P74, 66, loop72_redo
+  loop72_done:
     pop_eh 
-  for_undef_35:
-    find_lex $P65, "$/"
-    find_lex $P66, "$past"
-    unless_null $P66, vivify_38
-    new $P66, "Undef"
-  vivify_38:
-    $P67 = $P65."result_object"($P66)
-    .return ($P67)
+  for_undef_41:
+    find_lex $P75, "$/"
+    find_lex $P76, "$past"
+    unless_null $P76, vivify_44
+    new $P76, "Undef"
+  vivify_44:
+    $P77 = $P75."result_object"($P76)
+    .return ($P77)
   control_42:
     .local pmc exception 
     .get_results (exception) 
-    getattribute $P68, exception, "payload"
-    .return ($P68)
+    getattribute $P78, exception, "payload"
+    .return ($P78)
     rethrow exception
 .end
 
 
 .namespace ["z2";"Grammar";"Actions"]
-.sub "_block55"  :anon :subid("14") :outer("13")
-    .param pmc param_57
-    .lex "$_", param_57
-    find_lex $P58, "$past"
-    unless_null $P58, vivify_36
-    new $P58, "Undef"
-  vivify_36:
-    find_lex $P59, "$_"
-    unless_null $P59, vivify_37
-    new $P59, "Undef"
-  vivify_37:
-    $P60 = $P59."item"()
-    $P61 = $P58."push"($P60)
-    .return ($P61)
+.sub "_block65"  :anon :subid("14") :outer("13")
+    .param pmc param_67
+    .lex "$_", param_67
+    find_lex $P68, "$past"
+    unless_null $P68, vivify_42
+    new $P68, "Undef"
+  vivify_42:
+    find_lex $P69, "$_"
+    unless_null $P69, vivify_43
+    new $P69, "Undef"
+  vivify_43:
+    $P70 = $P69."item"()
+    $P71 = $P68."push"($P70)
+    .return ($P71)
 .end
 
 
 .namespace ["z2";"Grammar";"Actions"]
-.sub "line"  :subid("15") :method :outer("25")
-    .param pmc param_72
-    new $P71, 'ExceptionHandler'
-    set_addr $P71, control_70
-    $P71."handle_types"(58)
-    push_eh $P71
-    .lex "$/", param_72
-    get_hll_global $P73, ["PAST"], "Stmts"
-    find_lex $P74, "$/"
-    unless_null $P74, vivify_39
-    new $P74, "Undef"
-  vivify_39:
-    $P75 = $P73."new"($P74 :named("node"))
-    .lex "$past", $P75
-    find_lex $P77, "$/"
-    set $P78, $P77["sentence"]
-    unless_null $P78, vivify_40
-    new $P78, "Undef"
-  vivify_40:
-    defined $I79, $P78
-    unless $I79, for_undef_41
-    iter $P76, $P78
-    new $P89, 'ExceptionHandler'
-    set_addr $P89, loop88_handler
-    $P89."handle_types"(64, 66, 65)
-    push_eh $P89
-  loop88_test:
-    unless $P76, loop88_done
-    shift $P80, $P76
-  loop88_redo:
-    .const 'Sub' $P82 = "16" 
-    capture_lex $P82
-    $P82($P80)
-  loop88_next:
-    goto loop88_test
-  loop88_handler:
+.sub "branch"  :subid("15") :method :outer("27")
+    .param pmc param_82
+    new $P81, 'ExceptionHandler'
+    set_addr $P81, control_80
+    $P81."handle_types"(58)
+    push_eh $P81
+    .lex "$/", param_82
+    new $P83, "String"
+    assign $P83, "branch:"
+    find_lex $P84, "$/"
+    set $P85, $P84["roman"]
+    unless_null $P85, vivify_45
+    new $P85, "Undef"
+  vivify_45:
+    concat $P86, $P83, $P85
+    "say"($P86)
+    get_hll_global $P87, ["PAST"], "Op"
+    new $P88, "String"
+    assign $P88, "goto "
+    find_lex $P89, "$/"
+    set $P90, $P89["roman"]
+    unless_null $P90, vivify_46
+    new $P90, "Undef"
+  vivify_46:
+    concat $P91, $P88, $P90
+    find_lex $P92, "$/"
+    unless_null $P92, vivify_47
+    new $P92, "Undef"
+  vivify_47:
+    $P93 = $P87."new"($P91 :named("inline"), $P92 :named("node"))
+    .lex "$res", $P93
+    find_lex $P94, "$/"
+    find_lex $P95, "$res"
+    unless_null $P95, vivify_48
+    new $P95, "Undef"
+  vivify_48:
+    $P96 = $P94."result_object"($P95)
+    .return ($P96)
+  control_80:
     .local pmc exception 
     .get_results (exception) 
-    getattribute $P90, exception, 'type'
-    eq $P90, 64, loop88_next
-    eq $P90, 66, loop88_redo
-  loop88_done:
-    pop_eh 
-  for_undef_41:
-    find_lex $P91, "$/"
-    find_lex $P92, "$past"
-    unless_null $P92, vivify_44
-    new $P92, "Undef"
-  vivify_44:
-    $P93 = $P91."result_object"($P92)
-    .return ($P93)
-  control_70:
-    .local pmc exception 
-    .get_results (exception) 
-    getattribute $P94, exception, "payload"
-    .return ($P94)
+    getattribute $P97, exception, "payload"
+    .return ($P97)
     rethrow exception
 .end
 
 
 .namespace ["z2";"Grammar";"Actions"]
-.sub "_block81"  :anon :subid("16") :outer("15")
-    .param pmc param_83
-    .lex "$_", param_83
-    find_lex $P84, "$past"
-    unless_null $P84, vivify_42
-    new $P84, "Undef"
-  vivify_42:
-    find_lex $P85, "$_"
-    unless_null $P85, vivify_43
-    new $P85, "Undef"
-  vivify_43:
-    $P86 = $P85."item"()
-    $P87 = $P84."push"($P86)
-    .return ($P87)
-.end
-
-
-.namespace ["z2";"Grammar";"Actions"]
-.sub "sentence"  :subid("17") :method :outer("25")
-    .param pmc param_98
-    .param pmc param_99
-    new $P97, 'ExceptionHandler'
-    set_addr $P97, control_96
-    $P97."handle_types"(58)
-    push_eh $P97
-    .lex "$/", param_98
-    .lex "$key", param_99
-    find_lex $P100, "$/"
-    find_lex $P101, "$key"
-    unless_null $P101, vivify_45
-    new $P101, "Undef"
-  vivify_45:
-    find_lex $P102, "$/"
-    unless_null $P102, vivify_46
-    new $P102, "Hash"
-  vivify_46:
-    set $P103, $P102[$P101]
-    unless_null $P103, vivify_47
-    new $P103, "Undef"
-  vivify_47:
-    $P104 = $P103."item"()
-    $P105 = $P100."result_object"($P104)
-    .return ($P105)
-  control_96:
+.sub "io"  :subid("16") :method :outer("27")
+    .param pmc param_101
+    .param pmc param_102
+    new $P100, 'ExceptionHandler'
+    set_addr $P100, control_99
+    $P100."handle_types"(58)
+    push_eh $P100
+    .lex "$/", param_101
+    .lex "$key", param_102
+    new $P103, "String"
+    assign $P103, "io:"
+    find_lex $P104, "$key"
+    unless_null $P104, vivify_49
+    new $P104, "Undef"
+  vivify_49:
+    concat $P105, $P103, $P104
+    "say"($P105)
+    get_hll_global $P106, ["PAST"], "Op"
+    find_lex $P107, "$/"
+    unless_null $P107, vivify_50
+    new $P107, "Undef"
+  vivify_50:
+    $P108 = $P106."new"("say2" :named("name"), "call" :named("pasttype"), $P107 :named("node"))
+    .lex "$res", $P108
+    "say"("ok")
+    find_lex $P109, "$/"
+    find_lex $P110, "$res"
+    unless_null $P110, vivify_51
+    new $P110, "Undef"
+  vivify_51:
+    $P111 = $P109."result_object"($P110)
+    .return ($P111)
+  control_99:
     .local pmc exception 
     .get_results (exception) 
-    getattribute $P106, exception, "payload"
-    .return ($P106)
+    getattribute $P112, exception, "payload"
+    .return ($P112)
     rethrow exception
 .end
 
 
 .namespace ["z2";"Grammar";"Actions"]
-.sub "value"  :subid("18") :method :outer("25")
-    .param pmc param_110
-    .param pmc param_111
-    new $P109, 'ExceptionHandler'
-    set_addr $P109, control_108
-    $P109."handle_types"(58)
-    push_eh $P109
-    .lex "$/", param_110
-    .lex "$key", param_111
-    find_lex $P112, "$/"
-    find_lex $P113, "$key"
-    unless_null $P113, vivify_48
-    new $P113, "Undef"
-  vivify_48:
-    find_lex $P114, "$/"
-    unless_null $P114, vivify_49
-    new $P114, "Hash"
-  vivify_49:
-    set $P115, $P114[$P113]
-    unless_null $P115, vivify_50
-    new $P115, "Undef"
-  vivify_50:
-    $P116 = $P115."item"()
-    $P117 = $P112."result_object"($P116)
-    .return ($P117)
-  control_108:
+.sub "line"  :subid("17") :method :outer("27")
+    .param pmc param_116
+    new $P115, 'ExceptionHandler'
+    set_addr $P115, control_114
+    $P115."handle_types"(58)
+    push_eh $P115
+    .lex "$/", param_116
+    get_hll_global $P117, ["PAST"], "Stmts"
+    find_lex $P118, "$/"
+    unless_null $P118, vivify_52
+    new $P118, "Undef"
+  vivify_52:
+    $P119 = $P117."new"($P118 :named("node"))
+    .lex "$past", $P119
+    find_lex $P121, "$/"
+    set $P122, $P121["sentence"]
+    unless_null $P122, vivify_53
+    new $P122, "Undef"
+  vivify_53:
+    defined $I123, $P122
+    unless $I123, for_undef_54
+    iter $P120, $P122
+    new $P133, 'ExceptionHandler'
+    set_addr $P133, loop132_handler
+    $P133."handle_types"(64, 66, 65)
+    push_eh $P133
+  loop132_test:
+    unless $P120, loop132_done
+    shift $P124, $P120
+  loop132_redo:
+    .const 'Sub' $P126 = "18" 
+    capture_lex $P126
+    $P126($P124)
+  loop132_next:
+    goto loop132_test
+  loop132_handler:
     .local pmc exception 
     .get_results (exception) 
-    getattribute $P118, exception, "payload"
-    .return ($P118)
+    getattribute $P134, exception, 'type'
+    eq $P134, 64, loop132_next
+    eq $P134, 66, loop132_redo
+  loop132_done:
+    pop_eh 
+  for_undef_54:
+    find_lex $P135, "$/"
+    find_lex $P136, "$past"
+    unless_null $P136, vivify_57
+    new $P136, "Undef"
+  vivify_57:
+    $P137 = $P135."result_object"($P136)
+    .return ($P137)
+  control_114:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P138, exception, "payload"
+    .return ($P138)
     rethrow exception
 .end
 
 
 .namespace ["z2";"Grammar";"Actions"]
-.sub "immediate"  :subid("19") :method :outer("25")
-    .param pmc param_122
-    new $P121, 'ExceptionHandler'
-    set_addr $P121, control_120
-    $P121."handle_types"(58)
-    push_eh $P121
-    .lex "$/", param_122
-    new $P123, "Integer"
-    assign $P123, 1
-    .lex "$value", $P123
-    find_lex $P125, "$/"
-    set $P126, $P125["adjective"]
-    unless_null $P126, vivify_51
-    new $P126, "Undef"
-  vivify_51:
-    defined $I127, $P126
-    unless $I127, for_undef_52
-    iter $P124, $P126
-    new $P135, 'ExceptionHandler'
-    set_addr $P135, loop134_handler
-    $P135."handle_types"(64, 66, 65)
-    push_eh $P135
-  loop134_test:
-    unless $P124, loop134_done
-    shift $P128, $P124
-  loop134_redo:
-    .const 'Sub' $P130 = "20" 
-    capture_lex $P130
-    $P130($P128)
-  loop134_next:
-    goto loop134_test
-  loop134_handler:
+.sub "_block125"  :anon :subid("18") :outer("17")
+    .param pmc param_127
+    .lex "$_", param_127
+    find_lex $P128, "$past"
+    unless_null $P128, vivify_55
+    new $P128, "Undef"
+  vivify_55:
+    find_lex $P129, "$_"
+    unless_null $P129, vivify_56
+    new $P129, "Undef"
+  vivify_56:
+    $P130 = $P129."item"()
+    $P131 = $P128."push"($P130)
+    .return ($P131)
+.end
+
+
+.namespace ["z2";"Grammar";"Actions"]
+.sub "sentence"  :subid("19") :method :outer("27")
+    .param pmc param_142
+    .param pmc param_143
+    new $P141, 'ExceptionHandler'
+    set_addr $P141, control_140
+    $P141."handle_types"(58)
+    push_eh $P141
+    .lex "$/", param_142
+    .lex "$key", param_143
+    new $P144, "String"
+    assign $P144, "sentence:"
+    find_lex $P145, "$key"
+    unless_null $P145, vivify_58
+    new $P145, "Undef"
+  vivify_58:
+    concat $P146, $P144, $P145
+    "say"($P146)
+    find_lex $P147, "$/"
+    find_lex $P148, "$key"
+    unless_null $P148, vivify_59
+    new $P148, "Undef"
+  vivify_59:
+    find_lex $P149, "$/"
+    unless_null $P149, vivify_60
+    new $P149, "Hash"
+  vivify_60:
+    set $P150, $P149[$P148]
+    unless_null $P150, vivify_61
+    new $P150, "Undef"
+  vivify_61:
+    $P151 = $P150."item"()
+    $P152 = $P147."result_object"($P151)
+    .return ($P152)
+  control_140:
     .local pmc exception 
     .get_results (exception) 
-    getattribute $P136, exception, 'type'
-    eq $P136, 64, loop134_next
-    eq $P136, 66, loop134_redo
-  loop134_done:
-    pop_eh 
-  for_undef_52:
-    find_lex $P137, "$/"
-    get_hll_global $P138, ["PAST"], "Val"
-    find_lex $P139, "$value"
-    unless_null $P139, vivify_54
-    new $P139, "Undef"
-  vivify_54:
-    find_lex $P140, "$/"
-    unless_null $P140, vivify_55
-    new $P140, "Undef"
-  vivify_55:
-    $P141 = $P138."new"($P139 :named("value"), "Integer" :named("returns"), $P140 :named("node"))
-    $P142 = $P137."result_object"($P141)
-    .return ($P142)
-  control_120:
-    .local pmc exception 
-    .get_results (exception) 
-    getattribute $P143, exception, "payload"
-    .return ($P143)
+    getattribute $P153, exception, "payload"
+    .return ($P153)
     rethrow exception
 .end
 
 
 .namespace ["z2";"Grammar";"Actions"]
-.sub "_block129"  :anon :subid("20") :outer("19")
-    .param pmc param_131
-    .lex "$_", param_131
-    find_lex $P132, "$value"
-    unless_null $P132, vivify_53
-    new $P132, "Undef"
-  vivify_53:
-    mul $P133, $P132, 2
-    store_lex "$value", $P133
-    .return ($P133)
-.end
-
-
-.namespace ["z2";"Grammar";"Actions"]
-.sub "computation"  :subid("21") :method :outer("25")
-    .param pmc param_147
-    .param pmc param_148
-    new $P146, 'ExceptionHandler'
-    set_addr $P146, control_145
-    $P146."handle_types"(58)
-    push_eh $P146
-    .lex "$/", param_147
-    .lex "$key", param_148
-    find_lex $P149, "$/"
-    find_lex $P150, "$key"
-    unless_null $P150, vivify_56
-    new $P150, "Undef"
-  vivify_56:
-    find_lex $P151, "$/"
-    unless_null $P151, vivify_57
-    new $P151, "Hash"
-  vivify_57:
-    set $P152, $P151[$P150]
-    unless_null $P152, vivify_58
-    new $P152, "Undef"
-  vivify_58:
-    $P153 = $P152."item"()
-    $P154 = $P149."result_object"($P153)
-    .return ($P154)
-  control_145:
+.sub "value"  :subid("20") :method :outer("27")
+    .param pmc param_157
+    .param pmc param_158
+    new $P156, 'ExceptionHandler'
+    set_addr $P156, control_155
+    $P156."handle_types"(58)
+    push_eh $P156
+    .lex "$/", param_157
+    .lex "$key", param_158
+    find_lex $P159, "$/"
+    find_lex $P160, "$key"
+    unless_null $P160, vivify_62
+    new $P160, "Undef"
+  vivify_62:
+    find_lex $P161, "$/"
+    unless_null $P161, vivify_63
+    new $P161, "Hash"
+  vivify_63:
+    set $P162, $P161[$P160]
+    unless_null $P162, vivify_64
+    new $P162, "Undef"
+  vivify_64:
+    $P163 = $P162."item"()
+    $P164 = $P159."result_object"($P163)
+    .return ($P164)
+  control_155:
     .local pmc exception 
     .get_results (exception) 
-    getattribute $P155, exception, "payload"
-    .return ($P155)
+    getattribute $P165, exception, "payload"
+    .return ($P165)
     rethrow exception
 .end
 
 
 .namespace ["z2";"Grammar";"Actions"]
-.sub "unary"  :subid("22") :method :outer("25")
-    .param pmc param_159
-    .param pmc param_160
-    new $P158, 'ExceptionHandler'
-    set_addr $P158, control_157
-    $P158."handle_types"(58)
-    push_eh $P158
-    .lex "$/", param_159
-    .lex "$key", param_160
-    get_hll_global $P161, ["PAST"], "Op"
-    find_lex $P162, "$key"
-    unless_null $P162, vivify_59
-    new $P162, "Undef"
-  vivify_59:
-    find_lex $P163, "$/"
-    unless_null $P163, vivify_60
-    new $P163, "Undef"
-  vivify_60:
-    $P164 = $P161."new"($P162 :named("name"), "call" :named("pasttype"), $P163 :named("node"))
-    .lex "$res", $P164
-    find_lex $P165, "$res"
-    unless_null $P165, vivify_61
-    new $P165, "Undef"
-  vivify_61:
-    find_lex $P166, "$/"
-    set $P167, $P166["value"]
-    unless_null $P167, vivify_62
-    new $P167, "Undef"
-  vivify_62:
-    $P168 = $P167."item"()
-    $P165."push"($P168)
-    find_lex $P169, "$/"
-    find_lex $P170, "$res"
-    unless_null $P170, vivify_63
-    new $P170, "Undef"
-  vivify_63:
-    $P171 = $P169."result_object"($P170)
-    .return ($P171)
-  control_157:
+.sub "immediate"  :subid("21") :method :outer("27")
+    .param pmc param_169
+    new $P168, 'ExceptionHandler'
+    set_addr $P168, control_167
+    $P168."handle_types"(58)
+    push_eh $P168
+    .lex "$/", param_169
+    new $P170, "Integer"
+    assign $P170, 1
+    .lex "$value", $P170
+    find_lex $P172, "$/"
+    set $P173, $P172["adjective"]
+    unless_null $P173, vivify_65
+    new $P173, "Undef"
+  vivify_65:
+    defined $I174, $P173
+    unless $I174, for_undef_66
+    iter $P171, $P173
+    new $P182, 'ExceptionHandler'
+    set_addr $P182, loop181_handler
+    $P182."handle_types"(64, 66, 65)
+    push_eh $P182
+  loop181_test:
+    unless $P171, loop181_done
+    shift $P175, $P171
+  loop181_redo:
+    .const 'Sub' $P177 = "22" 
+    capture_lex $P177
+    $P177($P175)
+  loop181_next:
+    goto loop181_test
+  loop181_handler:
     .local pmc exception 
     .get_results (exception) 
-    getattribute $P172, exception, "payload"
-    .return ($P172)
+    getattribute $P183, exception, 'type'
+    eq $P183, 64, loop181_next
+    eq $P183, 66, loop181_redo
+  loop181_done:
+    pop_eh 
+  for_undef_66:
+    find_lex $P184, "$/"
+    get_hll_global $P185, ["PAST"], "Val"
+    find_lex $P186, "$value"
+    unless_null $P186, vivify_68
+    new $P186, "Undef"
+  vivify_68:
+    find_lex $P187, "$/"
+    unless_null $P187, vivify_69
+    new $P187, "Undef"
+  vivify_69:
+    $P188 = $P185."new"($P186 :named("value"), "Integer" :named("returns"), $P187 :named("node"))
+    $P189 = $P184."result_object"($P188)
+    .return ($P189)
+  control_167:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P190, exception, "payload"
+    .return ($P190)
     rethrow exception
 .end
 
 
 .namespace ["z2";"Grammar";"Actions"]
-.sub "binary"  :subid("23") :method :outer("25")
-    .param pmc param_176
-    .param pmc param_177
-    new $P175, 'ExceptionHandler'
-    set_addr $P175, control_174
-    $P175."handle_types"(58)
-    push_eh $P175
-    .lex "$/", param_176
-    .lex "$key", param_177
-    get_hll_global $P178, ["PAST"], "Op"
-    find_lex $P179, "$key"
-    unless_null $P179, vivify_64
+.sub "_block176"  :anon :subid("22") :outer("21")
+    .param pmc param_178
+    .lex "$_", param_178
+    find_lex $P179, "$value"
+    unless_null $P179, vivify_67
     new $P179, "Undef"
-  vivify_64:
-    find_lex $P180, "$/"
-    unless_null $P180, vivify_65
-    new $P180, "Undef"
-  vivify_65:
-    $P181 = $P178."new"($P179 :named("name"), "call" :named("pasttype"), $P180 :named("node"))
-    .lex "$res", $P181
-    find_lex $P183, "$/"
-    set $P184, $P183["value"]
-    unless_null $P184, vivify_66
-    new $P184, "Undef"
-  vivify_66:
-    defined $I185, $P184
-    unless $I185, for_undef_67
-    iter $P182, $P184
-    new $P195, 'ExceptionHandler'
-    set_addr $P195, loop194_handler
-    $P195."handle_types"(64, 66, 65)
-    push_eh $P195
-  loop194_test:
-    unless $P182, loop194_done
-    shift $P186, $P182
-  loop194_redo:
-    .const 'Sub' $P188 = "24" 
-    capture_lex $P188
-    $P188($P186)
-  loop194_next:
-    goto loop194_test
-  loop194_handler:
+  vivify_67:
+    mul $P180, $P179, 2
+    store_lex "$value", $P180
+    .return ($P180)
+.end
+
+
+.namespace ["z2";"Grammar";"Actions"]
+.sub "computation"  :subid("23") :method :outer("27")
+    .param pmc param_194
+    .param pmc param_195
+    new $P193, 'ExceptionHandler'
+    set_addr $P193, control_192
+    $P193."handle_types"(58)
+    push_eh $P193
+    .lex "$/", param_194
+    .lex "$key", param_195
+    find_lex $P196, "$/"
+    find_lex $P197, "$key"
+    unless_null $P197, vivify_70
+    new $P197, "Undef"
+  vivify_70:
+    find_lex $P198, "$/"
+    unless_null $P198, vivify_71
+    new $P198, "Hash"
+  vivify_71:
+    set $P199, $P198[$P197]
+    unless_null $P199, vivify_72
+    new $P199, "Undef"
+  vivify_72:
+    $P200 = $P199."item"()
+    $P201 = $P196."result_object"($P200)
+    .return ($P201)
+  control_192:
     .local pmc exception 
     .get_results (exception) 
-    getattribute $P196, exception, 'type'
-    eq $P196, 64, loop194_next
-    eq $P196, 66, loop194_redo
-  loop194_done:
-    pop_eh 
-  for_undef_67:
-    find_lex $P197, "$/"
-    find_lex $P198, "$res"
-    unless_null $P198, vivify_70
-    new $P198, "Undef"
-  vivify_70:
-    $P199 = $P197."result_object"($P198)
-    .return ($P199)
-  control_174:
-    .local pmc exception 
-    .get_results (exception) 
-    getattribute $P200, exception, "payload"
-    .return ($P200)
+    getattribute $P202, exception, "payload"
+    .return ($P202)
     rethrow exception
 .end
 
 
 .namespace ["z2";"Grammar";"Actions"]
-.sub "_block187"  :anon :subid("24") :outer("23")
-    .param pmc param_189
-    .lex "$_", param_189
-    find_lex $P190, "$res"
-    unless_null $P190, vivify_68
-    new $P190, "Undef"
-  vivify_68:
-    find_lex $P191, "$_"
-    unless_null $P191, vivify_69
-    new $P191, "Undef"
-  vivify_69:
-    $P192 = $P191."item"()
-    $P193 = $P190."push"($P192)
-    .return ($P193)
+.sub "unary"  :subid("24") :method :outer("27")
+    .param pmc param_206
+    .param pmc param_207
+    new $P205, 'ExceptionHandler'
+    set_addr $P205, control_204
+    $P205."handle_types"(58)
+    push_eh $P205
+    .lex "$/", param_206
+    .lex "$key", param_207
+    get_hll_global $P208, ["PAST"], "Op"
+    find_lex $P209, "$key"
+    unless_null $P209, vivify_73
+    new $P209, "Undef"
+  vivify_73:
+    find_lex $P210, "$/"
+    unless_null $P210, vivify_74
+    new $P210, "Undef"
+  vivify_74:
+    $P211 = $P208."new"($P209 :named("name"), "call" :named("pasttype"), $P210 :named("node"))
+    .lex "$res", $P211
+    find_lex $P212, "$res"
+    unless_null $P212, vivify_75
+    new $P212, "Undef"
+  vivify_75:
+    find_lex $P213, "$/"
+    set $P214, $P213["value"]
+    unless_null $P214, vivify_76
+    new $P214, "Undef"
+  vivify_76:
+    $P215 = $P214."item"()
+    $P212."push"($P215)
+    find_lex $P216, "$/"
+    find_lex $P217, "$res"
+    unless_null $P217, vivify_77
+    new $P217, "Undef"
+  vivify_77:
+    $P218 = $P216."result_object"($P217)
+    .return ($P218)
+  control_204:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P219, exception, "payload"
+    .return ($P219)
+    rethrow exception
 .end
 
+
+.namespace ["z2";"Grammar";"Actions"]
+.sub "binary"  :subid("25") :method :outer("27")
+    .param pmc param_223
+    .param pmc param_224
+    new $P222, 'ExceptionHandler'
+    set_addr $P222, control_221
+    $P222."handle_types"(58)
+    push_eh $P222
+    .lex "$/", param_223
+    .lex "$key", param_224
+    get_hll_global $P225, ["PAST"], "Op"
+    find_lex $P226, "$key"
+    unless_null $P226, vivify_78
+    new $P226, "Undef"
+  vivify_78:
+    find_lex $P227, "$/"
+    unless_null $P227, vivify_79
+    new $P227, "Undef"
+  vivify_79:
+    $P228 = $P225."new"($P226 :named("name"), "call" :named("pasttype"), $P227 :named("node"))
+    .lex "$res", $P228
+    find_lex $P230, "$/"
+    set $P231, $P230["value"]
+    unless_null $P231, vivify_80
+    new $P231, "Undef"
+  vivify_80:
+    defined $I232, $P231
+    unless $I232, for_undef_81
+    iter $P229, $P231
+    new $P242, 'ExceptionHandler'
+    set_addr $P242, loop241_handler
+    $P242."handle_types"(64, 66, 65)
+    push_eh $P242
+  loop241_test:
+    unless $P229, loop241_done
+    shift $P233, $P229
+  loop241_redo:
+    .const 'Sub' $P235 = "26" 
+    capture_lex $P235
+    $P235($P233)
+  loop241_next:
+    goto loop241_test
+  loop241_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P243, exception, 'type'
+    eq $P243, 64, loop241_next
+    eq $P243, 66, loop241_redo
+  loop241_done:
+    pop_eh 
+  for_undef_81:
+    find_lex $P244, "$/"
+    find_lex $P245, "$res"
+    unless_null $P245, vivify_84
+    new $P245, "Undef"
+  vivify_84:
+    $P246 = $P244."result_object"($P245)
+    .return ($P246)
+  control_221:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P247, exception, "payload"
+    .return ($P247)
+    rethrow exception
+.end
+
+
+.namespace ["z2";"Grammar";"Actions"]
+.sub "_block234"  :anon :subid("26") :outer("25")
+    .param pmc param_236
+    .lex "$_", param_236
+    find_lex $P237, "$res"
+    unless_null $P237, vivify_82
+    new $P237, "Undef"
+  vivify_82:
+    find_lex $P238, "$_"
+    unless_null $P238, vivify_83
+    new $P238, "Undef"
+  vivify_83:
+    $P239 = $P238."item"()
+    $P240 = $P237."push"($P239)
+    .return ($P240)
+.end
+

File src/gen_builtins.pir

 .end
 
 
+.namespace []
+
+.sub 'say2'
+    print "hello\n"
+    .return ()
+.end
+
+.namespace []
+.sub 'min'
+    print "min\n"
+    .return ()
+.end
+.namespace []
+.sub 'dup'
+    print "dup\n"
+    .return ()
+.end
+.namespace []
+.sub 'add'
+    print "add\n"
+    .return ()
+.end
 # Local Variables:
 #   mode: pir
 #   fill-column: 100