diff --git a/compilers/pct/src/PAST/NewCompiler.pir b/compilers/pct/src/PAST/NewCompiler.pir index 8f9fa10420..efb146a2bb 100644 --- a/compilers/pct/src/PAST/NewCompiler.pir +++ b/compilers/pct/src/PAST/NewCompiler.pir @@ -1,9 +1,9 @@ .namespace [] -.sub "_block1000" :anon :subid("10_1313083121.99053") +.sub "_block1000" :anon :subid("10_1313083702.99732") .annotate 'file', '' .annotate 'line', 0 - .const 'Sub' $P1003 = "11_1313083121.99053" + .const 'Sub' $P1003 = "11_1313083702.99732" capture_lex $P1003 .annotate 'line', 1 $P0 = find_dynamic_lex "$*CTXSAVE" @@ -13,51 +13,51 @@ $P0."ctxsave"() ctxsave_done: .annotate 'line', 14 - .const 'Sub' $P1003 = "11_1313083121.99053" + .const 'Sub' $P1003 = "11_1313083702.99732" capture_lex $P1003 $P102 = $P1003() .annotate 'line', 1 .return ($P102) - .const 'Sub' $P1072 = "21_1313083121.99053" - .return ($P1072) + .const 'Sub' $P1075 = "21_1313083702.99732" + .return ($P1075) .end .namespace [] -.sub "" :load :init :subid("post22") :outer("10_1313083121.99053") +.sub "" :load :init :subid("post22") :outer("10_1313083702.99732") .annotate 'file', '' .annotate 'line', 0 - .const 'Sub' $P1001 = "10_1313083121.99053" + .const 'Sub' $P1001 = "10_1313083702.99732" .local pmc block set block, $P1001 - $P1074 = get_root_global ["parrot"], "P6metaclass" + $P1077 = get_root_global ["parrot"], "P6metaclass" new $P103, "ResizablePMCArray" push $P103, "$!file" - $P1074."new_class"("PAST::NewCompiler", "PAST::Compiler" :named("parent"), $P103 :named("attr")) + $P1077."new_class"("PAST::NewCompiler", "PAST::Compiler" :named("parent"), $P103 :named("attr")) .end .namespace ["PAST";"NewCompiler"] -.sub "_block1002" :subid("11_1313083121.99053") :outer("10_1313083121.99053") +.sub "_block1002" :subid("11_1313083702.99732") :outer("10_1313083702.99732") .annotate 'file', '' .annotate 'line', 14 - .const 'Sub' $P1052 = "19_1313083121.99053" - capture_lex $P1052 - .const 'Sub' $P1042 = "18_1313083121.99053" - capture_lex $P1042 - .const 'Sub' $P1034 = "17_1313083121.99053" - capture_lex $P1034 - .const 'Sub' $P1028 = "16_1313083121.99053" - capture_lex $P1028 - .const 'Sub' $P1022 = "15_1313083121.99053" - capture_lex $P1022 - .const 'Sub' $P1017 = "14_1313083121.99053" - capture_lex $P1017 - .const 'Sub' $P1011 = "13_1313083121.99053" + .const 'Sub' $P1055 = "19_1313083702.99732" + capture_lex $P1055 + .const 'Sub' $P1045 = "18_1313083702.99732" + capture_lex $P1045 + .const 'Sub' $P1037 = "17_1313083702.99732" + capture_lex $P1037 + .const 'Sub' $P1031 = "16_1313083702.99732" + capture_lex $P1031 + .const 'Sub' $P1025 = "15_1313083702.99732" + capture_lex $P1025 + .const 'Sub' $P1020 = "14_1313083702.99732" + capture_lex $P1020 + .const 'Sub' $P1011 = "13_1313083702.99732" capture_lex $P1011 - .const 'Sub' $P1005 = "12_1313083121.99053" + .const 'Sub' $P1005 = "12_1313083702.99732" capture_lex $P1005 -.annotate 'line', 84 +.annotate 'line', 88 get_global $P1004, "%valtypes" unless_null $P1004, vivify_27 $P1004 = root_new ['parrot';'Hash'] @@ -71,56 +71,56 @@ $P0."ctxsave"() ctxsave_done: get_global $P101, "%valtypes" -.annotate 'line', 91 - .const 'Sub' $P1052 = "19_1313083121.99053" - newclosure $P1064, $P1052 +.annotate 'line', 95 + .const 'Sub' $P1055 = "19_1313083702.99732" + newclosure $P1067, $P1055 .annotate 'line', 14 - .return ($P1064) - .const 'Sub' $P1066 = "20_1313083121.99053" - .return ($P1066) + .return ($P1067) + .const 'Sub' $P1069 = "20_1313083702.99732" + .return ($P1069) .end .namespace ["PAST";"NewCompiler"] -.sub "" :load :init :subid("post23") :outer("11_1313083121.99053") +.sub "" :load :init :subid("post23") :outer("11_1313083702.99732") .annotate 'file', '' .annotate 'line', 14 - .const 'Sub' $P1003 = "11_1313083121.99053" + .const 'Sub' $P1003 = "11_1313083702.99732" .local pmc block set block, $P1003 -.annotate 'line', 86 +.annotate 'line', 90 new $P102, "String" assign $P102, "sc" - get_global $P1068, "%valtypes" - unless_null $P1068, vivify_24 - $P1068 = root_new ['parrot';'Hash'] - set_global "%valtypes", $P1068 + get_global $P1071, "%valtypes" + unless_null $P1071, vivify_24 + $P1071 = root_new ['parrot';'Hash'] + set_global "%valtypes", $P1071 vivify_24: - set $P1068["String"], $P102 -.annotate 'line', 87 + set $P1071["String"], $P102 +.annotate 'line', 91 new $P102, "String" assign $P102, "ic" - get_global $P1069, "%valtypes" - unless_null $P1069, vivify_25 - $P1069 = root_new ['parrot';'Hash'] - set_global "%valtypes", $P1069 + get_global $P1072, "%valtypes" + unless_null $P1072, vivify_25 + $P1072 = root_new ['parrot';'Hash'] + set_global "%valtypes", $P1072 vivify_25: - set $P1069["Integer"], $P102 -.annotate 'line', 88 + set $P1072["Integer"], $P102 +.annotate 'line', 92 new $P102, "String" assign $P102, "nc" - get_global $P1070, "%valtypes" - unless_null $P1070, vivify_26 - $P1070 = root_new ['parrot';'Hash'] - set_global "%valtypes", $P1070 + get_global $P1073, "%valtypes" + unless_null $P1073, vivify_26 + $P1073 = root_new ['parrot';'Hash'] + set_global "%valtypes", $P1073 vivify_26: - set $P1070["Float"], $P102 + set $P1073["Float"], $P102 .end .namespace ["PAST";"NewCompiler"] .include "except_types.pasm" -.sub "super" :subid("12_1313083121.99053") :method :outer("11_1313083121.99053") +.sub "super" :subid("12_1313083702.99732") :method :outer("11_1313083702.99732") .param pmc param_1008 .param pmc param_1009 :slurpy .param pmc param_1010 :slurpy :named @@ -154,7 +154,7 @@ .namespace ["PAST";"NewCompiler"] .include "except_types.pasm" -.sub "to_post" :subid("13_1313083121.99053") :method :outer("11_1313083121.99053") +.sub "to_post" :subid("13_1313083702.99732") :method :outer("11_1313083702.99732") .param pmc param_1014 .param pmc param_1015 :slurpy :named .annotate 'file', '' @@ -165,65 +165,91 @@ .lex "self", self .lex "$past", param_1014 .lex "%options", param_1015 +.annotate 'line', 29 + new $P101, "Undef" + set $P1016, $P101 + .lex "$anon", $P1016 .annotate 'line', 28 - find_lex $P101, "self" - getattribute $P102, $P101, "$!file" - unless_null $P102, vivify_28 - new $P102, "Undef" + find_lex $P102, "self" + getattribute $P103, $P102, "$!file" + unless_null $P103, vivify_28 + new $P103, "Undef" vivify_28: - if $P102, unless_1016_end - get_hll_global $P103, ["POST"], "File" - $P104 = $P103."new"() - find_lex $P105, "self" - setattribute $P105, "$!file", $P104 - unless_1016_end: + if $P103, unless_1017_end + get_hll_global $P104, ["POST"], "File" + $P105 = $P104."new"() + find_lex $P106, "self" + setattribute $P106, "$!file", $P105 + unless_1017_end: .annotate 'line', 29 - find_lex $P101, "self" - getattribute $P102, $P101, "$!file" - unless_null $P102, vivify_29 - new $P102, "Undef" + find_lex $P102, "self" + find_lex $P103, "$past" + find_lex $P104, "%options" + $P105 = $P102."super"("to_post", $P103, $P104 :flat) + store_lex "$anon", $P105 +.annotate 'line', 30 + get_hll_global $P103, ["POST"], "Ops" + find_lex $P104, "$anon" + $P105 = $P103."ACCEPTS"($P104) + if $P105, if_1019 + set $P102, $P105 + goto if_1019_end + if_1019: + find_lex $P106, "$anon" + elements $I101, $P106 + set $N101, $I101 + iseq $I102, $N101, 0.0 + new $P102, 'Integer' + set $P102, $I102 + if_1019_end: + if $P102, unless_1018_end +.annotate 'line', 32 + find_lex $P107, "self" + getattribute $P108, $P107, "$!file" + unless_null $P108, vivify_29 + new $P108, "Undef" vivify_29: - find_lex $P103, "self" - find_lex $P104, "$past" - find_lex $P105, "%options" - $P106 = $P103."super"("to_post", $P104, $P105 :flat) - $P102."push"($P106) + get_hll_global $P109, ["POST"], "Sub" + find_lex $P110, "$anon" + $P111 = $P109."new"($P110, "anon" :named("name")) + $P108."push"($P111) + unless_1018_end: .annotate 'line', 27 - find_lex $P101, "self" - getattribute $P102, $P101, "$!file" - unless_null $P102, vivify_30 - new $P102, "Undef" + find_lex $P102, "self" + getattribute $P103, $P102, "$!file" + unless_null $P103, vivify_30 + new $P103, "Undef" vivify_30: - .return ($P102) + .return ($P103) control_1012: .local pmc exception .get_results (exception) - getattribute $P101, exception, "payload" - .return ($P101) + getattribute $P102, exception, "payload" + .return ($P102) .end .namespace ["PAST";"NewCompiler"] .include "except_types.pasm" -.sub "as_post" :subid("14_1313083121.99053") :method :outer("11_1313083121.99053") :multi(_,_) - .param pmc param_1020 - .param pmc param_1021 :slurpy :named +.sub "as_post" :subid("14_1313083702.99732") :method :outer("11_1313083702.99732") :multi(_,_) + .param pmc param_1023 + .param pmc param_1024 :slurpy :named .annotate 'file', '' -.annotate 'line', 36 - new $P1019, ['ExceptionHandler'], .CONTROL_RETURN - set_label $P1019, control_1018 - push_eh $P1019 +.annotate 'line', 40 + new $P1022, ['ExceptionHandler'], .CONTROL_RETURN + set_label $P1022, control_1021 + push_eh $P1022 .lex "self", self - .lex "$node", param_1020 - .lex "%options", param_1021 -.annotate 'line', 37 + .lex "$node", param_1023 + .lex "%options", param_1024 +.annotate 'line', 41 find_lex $P101, "self" find_lex $P102, "$node" find_lex $P103, "%options" $P104 = $P101."super"("as_post", $P102, $P103 :flat) -.annotate 'line', 36 +.annotate 'line', 40 .return ($P104) - control_1018: + control_1021: .local pmc exception .get_results (exception) getattribute $P101, exception, "payload" @@ -233,34 +259,34 @@ .namespace ["PAST";"NewCompiler"] .include "except_types.pasm" -.sub "as_post" :subid("15_1313083121.99053") :method :outer("11_1313083121.99053") :multi(_,["Integer"]) - .param pmc param_1025 - .param pmc param_1026 :slurpy :named +.sub "as_post" :subid("15_1313083702.99732") :method :outer("11_1313083702.99732") :multi(_,["Integer"]) + .param pmc param_1028 + .param pmc param_1029 :slurpy :named .annotate 'file', '' -.annotate 'line', 46 - new $P1024, ['ExceptionHandler'], .CONTROL_RETURN - set_label $P1024, control_1023 - push_eh $P1024 +.annotate 'line', 50 + new $P1027, ['ExceptionHandler'], .CONTROL_RETURN + set_label $P1027, control_1026 + push_eh $P1027 .lex "self", self - .lex "$node", param_1025 - .lex "%options", param_1026 -.annotate 'line', 47 + .lex "$node", param_1028 + .lex "%options", param_1029 +.annotate 'line', 51 find_lex $P101, "self" get_hll_global $P102, ["POST"], "Constant" find_lex $P103, "$node" $P104 = $P102."new"("ic" :named("type"), $P103 :named("value")) - find_lex $P1027, "%options" - unless_null $P1027, vivify_31 - $P1027 = root_new ['parrot';'Hash'] + find_lex $P1030, "%options" + unless_null $P1030, vivify_31 + $P1030 = root_new ['parrot';'Hash'] vivify_31: - set $P105, $P1027["rtype"] + set $P105, $P1030["rtype"] unless_null $P105, vivify_32 new $P105, "Undef" vivify_32: $P106 = $P101."coerce"($P104, $P105) -.annotate 'line', 46 +.annotate 'line', 50 .return ($P106) - control_1023: + control_1026: .local pmc exception .get_results (exception) getattribute $P101, exception, "payload" @@ -270,34 +296,34 @@ .namespace ["PAST";"NewCompiler"] .include "except_types.pasm" -.sub "as_post" :subid("16_1313083121.99053") :method :outer("11_1313083121.99053") :multi(_,["Float"]) - .param pmc param_1031 - .param pmc param_1032 :slurpy :named +.sub "as_post" :subid("16_1313083702.99732") :method :outer("11_1313083702.99732") :multi(_,["Float"]) + .param pmc param_1034 + .param pmc param_1035 :slurpy :named .annotate 'file', '' -.annotate 'line', 51 - new $P1030, ['ExceptionHandler'], .CONTROL_RETURN - set_label $P1030, control_1029 - push_eh $P1030 +.annotate 'line', 55 + new $P1033, ['ExceptionHandler'], .CONTROL_RETURN + set_label $P1033, control_1032 + push_eh $P1033 .lex "self", self - .lex "$node", param_1031 - .lex "%options", param_1032 -.annotate 'line', 52 + .lex "$node", param_1034 + .lex "%options", param_1035 +.annotate 'line', 56 find_lex $P101, "self" get_hll_global $P102, ["POST"], "Constant" find_lex $P103, "$node" $P104 = $P102."new"("nc" :named("type"), $P103 :named("value")) - find_lex $P1033, "%options" - unless_null $P1033, vivify_33 - $P1033 = root_new ['parrot';'Hash'] + find_lex $P1036, "%options" + unless_null $P1036, vivify_33 + $P1036 = root_new ['parrot';'Hash'] vivify_33: - set $P105, $P1033["rtype"] + set $P105, $P1036["rtype"] unless_null $P105, vivify_34 new $P105, "Undef" vivify_34: $P106 = $P101."coerce"($P104, $P105) -.annotate 'line', 51 +.annotate 'line', 55 .return ($P106) - control_1029: + control_1032: .local pmc exception .get_results (exception) getattribute $P101, exception, "payload" @@ -307,33 +333,33 @@ .namespace ["PAST";"NewCompiler"] .include "except_types.pasm" -.sub "as_post" :subid("17_1313083121.99053") :method :outer("11_1313083121.99053") :multi(_,["String"]) - .param pmc param_1037 - .param pmc param_1038 :slurpy :named +.sub "as_post" :subid("17_1313083702.99732") :method :outer("11_1313083702.99732") :multi(_,["String"]) + .param pmc param_1040 + .param pmc param_1041 :slurpy :named .annotate 'file', '' -.annotate 'line', 56 - new $P1036, ['ExceptionHandler'], .CONTROL_RETURN - set_label $P1036, control_1035 - push_eh $P1036 +.annotate 'line', 60 + new $P1039, ['ExceptionHandler'], .CONTROL_RETURN + set_label $P1039, control_1038 + push_eh $P1039 .lex "self", self - .lex "$node", param_1037 - .lex "%options", param_1038 -.annotate 'line', 57 + .lex "$node", param_1040 + .lex "%options", param_1041 +.annotate 'line', 61 new $P101, "Undef" - set $P1039, $P101 - .lex "$escaped", $P1039 -.annotate 'line', 58 + set $P1042, $P101 + .lex "$escaped", $P1042 +.annotate 'line', 62 new $P102, "Undef" - set $P1040, $P102 - .lex "$encoding", $P1040 -.annotate 'line', 57 + set $P1043, $P102 + .lex "$encoding", $P1043 +.annotate 'line', 61 find_lex $P103, "$node" set $S101, $P103 escape $S102, $S101 new $P104, 'String' set $P104, $S102 store_lex "$escaped", $P104 -.annotate 'line', 58 +.annotate 'line', 62 find_lex $P103, "$node" set $S101, $P103 encoding $I101, $S101 @@ -341,24 +367,24 @@ new $P104, 'String' set $P104, $S102 store_lex "$encoding", $P104 -.annotate 'line', 59 +.annotate 'line', 63 find_lex $P103, "self" get_hll_global $P104, ["POST"], "String" find_lex $P105, "$escaped" find_lex $P106, "$encoding" $P107 = $P104."new"("sc" :named("type"), $P105 :named("value"), $P106 :named("encoding"), "ascii" :named("charset")) - find_lex $P1041, "%options" - unless_null $P1041, vivify_35 - $P1041 = root_new ['parrot';'Hash'] + find_lex $P1044, "%options" + unless_null $P1044, vivify_35 + $P1044 = root_new ['parrot';'Hash'] vivify_35: - set $P108, $P1041["rtype"] + set $P108, $P1044["rtype"] unless_null $P108, vivify_36 new $P108, "Undef" vivify_36: $P109 = $P103."coerce"($P107, $P108) -.annotate 'line', 56 +.annotate 'line', 60 .return ($P109) - control_1035: + control_1038: .local pmc exception .get_results (exception) getattribute $P103, exception, "payload" @@ -368,66 +394,66 @@ .namespace ["PAST";"NewCompiler"] .include "except_types.pasm" -.sub "as_post" :subid("18_1313083121.99053") :method :outer("11_1313083121.99053") :multi(_,["PAST";"Block"]) - .param pmc param_1045 - .param pmc param_1046 :slurpy :named +.sub "as_post" :subid("18_1313083702.99732") :method :outer("11_1313083702.99732") :multi(_,["PAST";"Block"]) + .param pmc param_1048 + .param pmc param_1049 :slurpy :named .annotate 'file', '' -.annotate 'line', 68 - new $P1044, ['ExceptionHandler'], .CONTROL_RETURN - set_label $P1044, control_1043 - push_eh $P1044 +.annotate 'line', 72 + new $P1047, ['ExceptionHandler'], .CONTROL_RETURN + set_label $P1047, control_1046 + push_eh $P1047 .lex "self", self - .lex "$node", param_1045 - .lex "%options", param_1046 -.annotate 'line', 69 + .lex "$node", param_1048 + .lex "%options", param_1049 +.annotate 'line', 73 new $P101, "Undef" - set $P1047, $P101 - .lex "$post", $P1047 -.annotate 'line', 70 + set $P1050, $P101 + .lex "$post", $P1050 +.annotate 'line', 74 new $P102, "Undef" - set $P1048, $P102 - .lex "$flags", $P1048 -.annotate 'line', 69 + set $P1051, $P102 + .lex "$flags", $P1051 +.annotate 'line', 73 find_lex $P103, "self" find_lex $P104, "$node" find_lex $P105, "%options" $P106 = $P103."super"("as_post", $P104, $P105 :flat) store_lex "$post", $P106 -.annotate 'line', 70 +.annotate 'line', 74 find_lex $P103, "$node" $P104 = $P103."pirflags"() store_lex "$flags", $P104 -.annotate 'line', 71 +.annotate 'line', 75 find_lex $P103, "$flags" set $S101, $P103 index $I101, $S101, ":main" set $N101, $I101 isge $I102, $N101, 0.0 - unless $I102, if_1049_end + unless $I102, if_1052_end find_lex $P104, "$post" $P104."main"(1) - if_1049_end: -.annotate 'line', 72 + if_1052_end: +.annotate 'line', 76 find_lex $P103, "$flags" set $S101, $P103 index $I101, $S101, ":init" set $N101, $I101 isge $I102, $N101, 0.0 - unless $I102, if_1050_end + unless $I102, if_1053_end find_lex $P104, "$post" $P104."init"(1) - if_1050_end: -.annotate 'line', 73 + if_1053_end: +.annotate 'line', 77 find_lex $P103, "$flags" set $S101, $P103 index $I101, $S101, ":load" set $N101, $I101 isge $I102, $N101, 0.0 - unless $I102, if_1051_end + unless $I102, if_1054_end find_lex $P104, "$post" $P104."load"(1) - if_1051_end: -.annotate 'line', 74 + if_1054_end: +.annotate 'line', 78 find_lex $P103, "self" getattribute $P104, $P103, "$!file" unless_null $P104, vivify_37 @@ -435,16 +461,16 @@ vivify_37: find_lex $P105, "$post" $P104."push"($P105) -.annotate 'line', 76 +.annotate 'line', 80 new $P103, "Exception" set $P103['type'], .CONTROL_RETURN get_hll_global $P104, ["POST"], "Ops" $P105 = $P104."new"() setattribute $P103, 'payload', $P105 throw $P103 -.annotate 'line', 68 +.annotate 'line', 72 .return () - control_1043: + control_1046: .local pmc exception .get_results (exception) getattribute $P103, exception, "payload" @@ -454,47 +480,47 @@ .namespace ["PAST";"NewCompiler"] .include "except_types.pasm" -.sub "as_post" :subid("19_1313083121.99053") :method :outer("11_1313083121.99053") :multi(_,["PAST";"Val"]) - .param pmc param_1055 - .param pmc param_1056 :slurpy :named +.sub "as_post" :subid("19_1313083702.99732") :method :outer("11_1313083702.99732") :multi(_,["PAST";"Val"]) + .param pmc param_1058 + .param pmc param_1059 :slurpy :named .annotate 'file', '' -.annotate 'line', 91 - new $P1054, ['ExceptionHandler'], .CONTROL_RETURN - set_label $P1054, control_1053 - push_eh $P1054 +.annotate 'line', 95 + new $P1057, ['ExceptionHandler'], .CONTROL_RETURN + set_label $P1057, control_1056 + push_eh $P1057 .lex "self", self - .lex "$node", param_1055 - .lex "%options", param_1056 -.annotate 'line', 92 + .lex "$node", param_1058 + .lex "%options", param_1059 +.annotate 'line', 96 new $P101, "Undef" - set $P1057, $P101 - .lex "$returns", $P1057 -.annotate 'line', 93 + set $P1060, $P101 + .lex "$returns", $P1060 +.annotate 'line', 97 new $P102, "Undef" - set $P1058, $P102 - .lex "$type", $P1058 -.annotate 'line', 102 + set $P1061, $P102 + .lex "$type", $P1061 +.annotate 'line', 106 new $P103, "Undef" - set $P1059, $P103 - .lex "$const", $P1059 -.annotate 'line', 92 + set $P1062, $P103 + .lex "$const", $P1062 +.annotate 'line', 96 find_lex $P104, "$node" $P105 = $P104."returns"() store_lex "$returns", $P105 -.annotate 'line', 93 +.annotate 'line', 97 find_lex $P104, "$returns" - get_global $P1060, "%valtypes" - unless_null $P1060, vivify_38 - $P1060 = root_new ['parrot';'Hash'] + get_global $P1063, "%valtypes" + unless_null $P1063, vivify_38 + $P1063 = root_new ['parrot';'Hash'] vivify_38: - set $P105, $P1060[$P104] + set $P105, $P1063[$P104] unless_null $P105, vivify_39 new $P105, "Undef" vivify_39: store_lex "$type", $P105 -.annotate 'line', 96 +.annotate 'line', 100 find_lex $P104, "$type" - if $P104, unless_1061_end + if $P104, unless_1064_end new $P105, "Exception" set $P105['type'], .CONTROL_RETURN find_lex $P106, "self" @@ -503,12 +529,12 @@ $P109 = $P106."super"("as_post", $P107, $P108 :flat) setattribute $P105, 'payload', $P109 throw $P105 - unless_1061_end: -.annotate 'line', 99 + unless_1064_end: +.annotate 'line', 103 find_lex $P104, "$type" set $S101, $P104 iseq $I101, $S101, "sc" - unless $I101, if_1062_end + unless $I101, if_1065_end new $P105, "Exception" set $P105['type'], .CONTROL_RETURN find_lex $P106, "self" @@ -519,33 +545,33 @@ $P110 = $P106."as_post"($S102, $P109 :flat) setattribute $P105, 'payload', $P110 throw $P105 - if_1062_end: -.annotate 'line', 102 + if_1065_end: +.annotate 'line', 106 get_hll_global $P104, ["POST"], "Constant" find_lex $P105, "$type" find_lex $P106, "$node" $P107 = $P106."value"() $P108 = $P104."new"($P105 :named("type"), $P107 :named("value")) store_lex "$const", $P108 -.annotate 'line', 103 +.annotate 'line', 107 new $P104, "Exception" set $P104['type'], .CONTROL_RETURN find_lex $P105, "self" find_lex $P106, "$const" - find_lex $P1063, "%options" - unless_null $P1063, vivify_40 - $P1063 = root_new ['parrot';'Hash'] + find_lex $P1066, "%options" + unless_null $P1066, vivify_40 + $P1066 = root_new ['parrot';'Hash'] vivify_40: - set $P107, $P1063["rtype"] + set $P107, $P1066["rtype"] unless_null $P107, vivify_41 new $P107, "Undef" vivify_41: $P108 = $P105."coerce"($P106, $P107) setattribute $P104, 'payload', $P108 throw $P104 -.annotate 'line', 91 +.annotate 'line', 95 .return () - control_1053: + control_1056: .local pmc exception .get_results (exception) getattribute $P104, exception, "payload" @@ -554,21 +580,21 @@ .namespace ["PAST";"NewCompiler"] -.sub "_block1065" :load :anon :subid("20_1313083121.99053") +.sub "_block1068" :load :anon :subid("20_1313083702.99732") .annotate 'file', '' .annotate 'line', 14 - .const 'Sub' $P1067 = "11_1313083121.99053" - $P101 = $P1067() + .const 'Sub' $P1070 = "11_1313083702.99732" + $P101 = $P1070() .return ($P101) .end .namespace [] -.sub "_block1071" :load :anon :subid("21_1313083121.99053") +.sub "_block1074" :load :anon :subid("21_1313083702.99732") .annotate 'file', '' .annotate 'line', 1 - .const 'Sub' $P1073 = "10_1313083121.99053" - $P101 = $P1073() + .const 'Sub' $P1076 = "10_1313083702.99732" + $P101 = $P1076() .return ($P101) .end diff --git a/compilers/pct/src/PAST/NewCompiler.pm b/compilers/pct/src/PAST/NewCompiler.pm index eb67c1d838..5734fa02dd 100644 --- a/compilers/pct/src/PAST/NewCompiler.pm +++ b/compilers/pct/src/PAST/NewCompiler.pm @@ -26,7 +26,11 @@ Compile the abstract syntax tree given by C into POST. method to_post($past, *%options) { $!file := POST::File.new unless $!file; - $!file.push(self.super('to_post', $past, |%options)); + my $anon := self.super('to_post', $past, |%options); + unless $anon ~~ POST::Ops && pir::elements($anon) == 0 { + # Don't push the no-op returned by as_post(PAST::Block) + $!file.push(POST::Sub.new($anon, :name)); + } $!file; }