From c59b06079005e3019488fda86f63d043be12737e Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Wed, 25 Mar 2009 16:46:19 +0100 Subject: [PATCH] fixed test ok/innerfunction.as --- lib/as3/ok/const.as | 12 +- lib/as3/ok/import2.as | 8 +- lib/as3/ok/innerfunction.as | 22 +- lib/as3/ok/trycatch.as | 8 +- lib/as3/parser.tab.c | 580 ++++++++++++++++++++++--------------------- lib/as3/parser.y | 40 +-- lib/as3/test | 2 +- 7 files changed, 357 insertions(+), 315 deletions(-) diff --git a/lib/as3/ok/const.as b/lib/as3/ok/const.as index 11edd59..2ff88be 100644 --- a/lib/as3/ok/const.as +++ b/lib/as3/ok/const.as @@ -2,14 +2,14 @@ package { import flash.display.MovieClip public class Main extends flash.display.MovieClip { - const ok1:String = "ok 1/4"; - static const ok2:String = "ok 2/4"; + const ok1:String = "ok 1/6"; + static const ok2:String = "ok 2/6"; - const ok3:String = "ok 3/4"; - static const ok4:String = "ok 4/4"; + const ok3:String = "ok 3/6"; + static const ok4:String = "ok 4/6"; - const ok5:String = "ok 3/4"; - static const ok6:String = "ok 4/4"; + const ok5:String = "ok 5/6"; + static const ok6:String = "ok 6/6"; function Main() { trace(ok1); diff --git a/lib/as3/ok/import2.as b/lib/as3/ok/import2.as index 67d35ef..92ae219 100644 --- a/lib/as3/ok/import2.as +++ b/lib/as3/ok/import2.as @@ -10,10 +10,10 @@ package import2 { public class C2 extends C1 implements I2 { } - import import2.II1 - import import2.II2 - import import2.CC1 - import import2.CC2 + import import1.II1 + import import1.II2 + import import1.CC1 + import import1.CC2 public class Main extends flash.display.MovieClip { public function Main() { diff --git a/lib/as3/ok/innerfunction.as b/lib/as3/ok/innerfunction.as index 46572dd..9f26ace 100644 --- a/lib/as3/ok/innerfunction.as +++ b/lib/as3/ok/innerfunction.as @@ -3,7 +3,20 @@ package { import flash.events.Event public class Main extends flash.display.MovieClip { - public function Main() + + public function test1() + { + var y:int = 0; + var a:Array = [null]; + a[0] = function() { + y = y + 1; + } + a[0](); + a[0](); + if(y!=2) trace("error") + else trace("ok 1/2"); + } + public function test2() { var y:uint = 0; var inc_y = function() { @@ -14,7 +27,12 @@ package { inc_y(); if(y!=2) trace("error") - else trace("ok"); + else trace("ok 2/2"); + } + public function Main() + { + this.test1() + this.test2() } } } diff --git a/lib/as3/ok/trycatch.as b/lib/as3/ok/trycatch.as index 3b5fd39..794392c 100644 --- a/lib/as3/ok/trycatch.as +++ b/lib/as3/ok/trycatch.as @@ -36,9 +36,9 @@ package { } public function checkActivation():void { - var y:uint = 0; + var yy:uint = 0; var inc_y = function() { - y = y + 1; + yy = yy + 1; } try { @@ -47,8 +47,8 @@ package { } catch(e:Error) { inc_y(); } - if(y!=2) trace("error") - else trace("ok 8/8"); + if(yy!=2) trace("error ("+yy+")") + else trace("ok 8/8"); } diff --git a/lib/as3/parser.tab.c b/lib/as3/parser.tab.c index 59f5397..a876a95 100644 --- a/lib/as3/parser.tab.c +++ b/lib/as3/parser.tab.c @@ -356,6 +356,7 @@ struct _methodstate { char uses_parent_function; int uses_slots; dict_t*slots; + int activation_var; abc_method_t*abc; int var_index; // for inner methods @@ -779,17 +780,26 @@ static void parsererror(const char*file, int line, const char*f) } -static code_t* add_scope_code(code_t*c, methodstate_t*m) +static code_t* add_scope_code(code_t*c, methodstate_t*m, char init) { - if(m->uses_slots || (m->late_binding && !m->inner)) { + if(m->uses_slots || (m->late_binding && !m->inner)) { //???? especially inner functions need the pushscope c = abc_getlocal_0(c); c = abc_pushscope(c); } if(m->uses_slots) { - /* FIXME: does this need to be the same activation object as - in the function header? */ - c = abc_newactivation(c); - c = abc_pushscope(c); + /* FIXME: this alloc_local() causes variable indexes to be + different in pass2 than in pass1 */ + if(!m->activation_var) + m->activation_var = alloc_local(); + if(init) { + c = abc_newactivation(c); + c = abc_dup(c); + c = abc_pushscope(c); + c = abc_setlocal(c, m->activation_var); + } else { + c = abc_getlocal(c, m->activation_var); + c = abc_pushscope(c); + } } return c; } @@ -798,7 +808,7 @@ static code_t* method_header(methodstate_t*m) { code_t*c = 0; - c = add_scope_code(c, m); + c = add_scope_code(c, m, 1); methodstate_list_t*l = m->innerfunctions; while(l) { @@ -945,11 +955,6 @@ static void function_initvars(methodstate_t*m, params_t*params, int flags, char } } - if(as3_pass==2) { - m->scope_code = add_scope_code(m->scope_code, m); - } - - methodstate_list_t*l = m->innerfunctions; while(l) { methodstate_t*m = l->methodstate; @@ -962,6 +967,10 @@ static void function_initvars(methodstate_t*m, params_t*params, int flags, char l = l->next; } + if(as3_pass==2) { + m->scope_code = add_scope_code(m->scope_code, m, 0); + } + if(as3_pass==2 && m->slots) { /* exchange unresolved identifiers with the actual objects */ DICT_ITERATE_ITEMS(m->slots, char*, name, variable_t*, v) { @@ -2114,7 +2123,7 @@ code_t* insert_finally(code_t*c, code_t*finally, int tempvar) /* Line 273 of skeleton.m4 */ -#line 2118 "parser.tab.c" +#line 2127 "parser.tab.c" #ifdef short # undef short @@ -2527,37 +2536,37 @@ static const yytype_int16 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 2096, 2096, 2098, 2098, 2099, 2100, 2102, 2103, 2104, - 2105, 2106, 2107, 2108, 2109, 2111, 2111, 2112, 2113, 2115, - 2116, 2117, 2118, 2119, 2120, 2121, 2123, 2124, 2126, 2127, - 2130, 2131, 2132, 2133, 2134, 2135, 2136, 2137, 2138, 2139, - 2140, 2141, 2142, 2143, 2146, 2147, 2148, 2149, 2150, 2151, - 2152, 2153, 2157, 2158, 2162, 2169, 2173, 2174, 2178, 2179, - 2181, 2182, 2184, 2245, 2246, 2249, 2249, 2268, 2269, 2270, - 2275, 2279, 2284, 2285, 2287, 2307, 2355, 2355, 2374, 2374, - 2389, 2392, 2395, 2398, 2402, 2403, 2404, 2405, 2406, 2407, - 2409, 2420, 2423, 2423, 2454, 2454, 2479, 2479, 2495, 2496, - 2497, 2498, 2506, 2515, 2515, 2564, 2568, 2579, 2589, 2606, - 2607, 2608, 2610, 2611, 2613, 2613, 2615, 2615, 2618, 2634, - 2651, 2652, 2653, 2654, 2661, 2662, 2663, 2664, 2665, 2666, - 2667, 2668, 2669, 2670, 2674, 2675, 2677, 2678, 2680, 2681, - 2685, 2683, 2691, 2689, 2698, 2699, 2700, 2701, 2702, 2703, - 2704, 2705, 2707, 2713, 2714, 2715, 2716, 2717, 2718, 2721, - 2734, 2734, 2736, 2736, 2738, 2739, 2741, 2816, 2817, 2819, - 2820, 2821, 2822, 2823, 2825, 2826, 2827, 2828, 2840, 2844, - 2850, 2856, 2864, 2869, 2875, 2883, 2891, 2892, 2893, 2896, - 2895, 2912, 2913, 2915, 2914, 2938, 2957, 2971, 2972, 2974, - 2975, 2977, 2978, 2979, 2988, 2989, 2993, 2994, 2996, 2997, - 2998, 3000, 3004, 3005, 3010, 3011, 3047, 3093, 3114, 3135, - 3138, 3145, 3146, 3147, 3153, 3159, 3161, 3163, 3165, 3167, - 3169, 3171, 3188, 3193, 3196, 3199, 3202, 3205, 3208, 3211, - 3214, 3217, 3221, 3224, 3227, 3230, 3233, 3236, 3239, 3242, - 3246, 3257, 3275, 3280, 3285, 3290, 3295, 3300, 3304, 3308, - 3313, 3317, 3321, 3330, 3339, 3349, 3354, 3366, 3372, 3377, - 3383, 3389, 3393, 3395, 3406, 3415, 3422, 3423, 3425, 3431, - 3440, 3447, 3459, 3465, 3471, 3477, 3483, 3489, 3495, 3501, - 3514, 3525, 3532, 3545, 3572, 3586, 3600, 3614, 3629, 3636, - 3643, 3650, 3657, 3668, 3720, 3826, 3833, 3840, 3847, 3862 + 0, 2105, 2105, 2107, 2107, 2108, 2109, 2111, 2112, 2113, + 2114, 2115, 2116, 2117, 2118, 2120, 2120, 2121, 2122, 2124, + 2125, 2126, 2127, 2128, 2129, 2130, 2132, 2133, 2135, 2136, + 2139, 2140, 2141, 2142, 2143, 2144, 2145, 2146, 2147, 2148, + 2149, 2150, 2151, 2152, 2155, 2156, 2157, 2158, 2159, 2160, + 2161, 2162, 2166, 2167, 2171, 2178, 2182, 2183, 2187, 2188, + 2190, 2191, 2193, 2254, 2255, 2258, 2258, 2277, 2278, 2279, + 2284, 2288, 2293, 2294, 2296, 2316, 2364, 2364, 2383, 2383, + 2398, 2401, 2404, 2407, 2411, 2412, 2413, 2414, 2415, 2416, + 2418, 2429, 2432, 2432, 2463, 2463, 2488, 2488, 2504, 2505, + 2506, 2507, 2515, 2524, 2524, 2573, 2577, 2588, 2598, 2615, + 2616, 2617, 2619, 2620, 2622, 2622, 2624, 2624, 2627, 2643, + 2660, 2661, 2662, 2663, 2670, 2671, 2672, 2673, 2674, 2675, + 2676, 2677, 2678, 2679, 2683, 2684, 2686, 2687, 2689, 2690, + 2694, 2692, 2700, 2698, 2707, 2708, 2709, 2710, 2711, 2712, + 2713, 2714, 2716, 2722, 2723, 2724, 2725, 2726, 2727, 2730, + 2743, 2743, 2745, 2745, 2747, 2748, 2750, 2825, 2826, 2828, + 2829, 2830, 2831, 2832, 2834, 2835, 2836, 2837, 2849, 2853, + 2859, 2865, 2873, 2878, 2884, 2892, 2900, 2901, 2902, 2905, + 2904, 2921, 2922, 2924, 2923, 2947, 2966, 2980, 2981, 2983, + 2984, 2986, 2987, 2988, 2997, 2998, 3002, 3003, 3005, 3006, + 3007, 3009, 3013, 3014, 3019, 3020, 3056, 3102, 3123, 3144, + 3147, 3154, 3155, 3156, 3162, 3168, 3170, 3172, 3174, 3176, + 3178, 3180, 3197, 3202, 3205, 3208, 3211, 3214, 3217, 3220, + 3223, 3226, 3230, 3233, 3236, 3239, 3242, 3245, 3248, 3251, + 3255, 3266, 3284, 3289, 3294, 3299, 3304, 3309, 3313, 3317, + 3322, 3326, 3330, 3339, 3348, 3358, 3363, 3375, 3381, 3386, + 3392, 3398, 3402, 3404, 3415, 3424, 3431, 3432, 3434, 3440, + 3449, 3456, 3468, 3474, 3480, 3486, 3492, 3498, 3504, 3510, + 3523, 3534, 3541, 3554, 3581, 3595, 3609, 3623, 3638, 3645, + 3652, 3659, 3666, 3677, 3729, 3838, 3845, 3852, 3859, 3874 }; #endif @@ -4352,7 +4361,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2123 "parser.y" +#line 2132 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; @@ -4363,7 +4372,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2124 "parser.y" +#line 2133 "parser.y" {(yyval.code)=code_new();} } break; @@ -4374,7 +4383,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2126 "parser.y" +#line 2135 "parser.y" {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));} } break; @@ -4385,7 +4394,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2127 "parser.y" +#line 2136 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; @@ -4396,7 +4405,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2142 "parser.y" +#line 2151 "parser.y" {(yyval.code)=(yyvsp[(2) - (3)].code);} } break; @@ -4407,7 +4416,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2143 "parser.y" +#line 2152 "parser.y" {(yyval.code)=0;} } break; @@ -4418,7 +4427,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2146 "parser.y" +#line 2155 "parser.y" {(yyval.code)=0;} } break; @@ -4429,7 +4438,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2153 "parser.y" +#line 2162 "parser.y" {(yyval.code)=(yyvsp[(3) - (4)].code);} } break; @@ -4440,7 +4449,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2157 "parser.y" +#line 2166 "parser.y" {(yyval.code)=(yyvsp[(1) - (2)].code);} } break; @@ -4451,7 +4460,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2158 "parser.y" +#line 2167 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; @@ -4462,7 +4471,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2162 "parser.y" +#line 2171 "parser.y" { code_t**cc = &global->init->method->body->code; *cc = code_append(*cc, (yyvsp[(1) - (1)].code)); @@ -4476,7 +4485,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2173 "parser.y" +#line 2182 "parser.y" {(yyval.value)=(yyvsp[(2) - (2)].value);} } break; @@ -4487,7 +4496,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2174 "parser.y" +#line 2183 "parser.y" {(yyval.value).c=abc_pushundefined(0); (yyval.value).t=TYPE_ANY; } @@ -4500,7 +4509,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2178 "parser.y" +#line 2187 "parser.y" {(yyval.code)=(yyvsp[(2) - (2)].code);} } break; @@ -4511,7 +4520,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2179 "parser.y" +#line 2188 "parser.y" {(yyval.code)=(yyvsp[(2) - (2)].code);} } break; @@ -4522,7 +4531,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2181 "parser.y" +#line 2190 "parser.y" {(yyval.code) = (yyvsp[(1) - (1)].code);} } break; @@ -4533,7 +4542,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2182 "parser.y" +#line 2191 "parser.y" {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));} } break; @@ -4544,7 +4553,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2185 "parser.y" +#line 2194 "parser.y" { PASS12 if(variable_exists((yyvsp[(1) - (3)].id))) @@ -4611,7 +4620,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2245 "parser.y" +#line 2254 "parser.y" {(yyval.code) = code_new();} } break; @@ -4622,7 +4631,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2246 "parser.y" +#line 2255 "parser.y" {(yyval.code)=(yyvsp[(2) - (2)].code);} } break; @@ -4633,7 +4642,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2249 "parser.y" +#line 2258 "parser.y" {PASS12 new_state();} } break; @@ -4644,7 +4653,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2249 "parser.y" +#line 2258 "parser.y" { (yyval.code) = code_new(); @@ -4672,7 +4681,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2268 "parser.y" +#line 2277 "parser.y" {(yyval.code)=code_new();} } break; @@ -4683,7 +4692,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2275 "parser.y" +#line 2284 "parser.y" { PASS1 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),0,1,0); PASS2 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1,0); @@ -4697,7 +4706,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2279 "parser.y" +#line 2288 "parser.y" { PASS12 (yyval.id)=(yyvsp[(1) - (1)].id); @@ -4711,7 +4720,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2284 "parser.y" +#line 2293 "parser.y" {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;} } break; @@ -4722,7 +4731,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2285 "parser.y" +#line 2294 "parser.y" {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;} } break; @@ -4733,7 +4742,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2287 "parser.y" +#line 2296 "parser.y" { if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement"); (yyval.code) = code_new(); @@ -4762,7 +4771,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2307 "parser.y" +#line 2316 "parser.y" { variable_t*var = find_variable(state, (yyvsp[(2) - (6)].id)); if(!var) { @@ -4819,7 +4828,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2355 "parser.y" +#line 2364 "parser.y" {PASS12 new_state();} } break; @@ -4830,7 +4839,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2355 "parser.y" +#line 2364 "parser.y" { (yyval.code) = code_new(); @@ -4858,7 +4867,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2374 "parser.y" +#line 2383 "parser.y" {PASS12 new_state();} } break; @@ -4869,7 +4878,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2374 "parser.y" +#line 2383 "parser.y" { (yyval.code) = code_new(); code_t*loopstart = (yyval.code) = abc_label((yyval.code)); @@ -4893,7 +4902,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2389 "parser.y" +#line 2398 "parser.y" { (yyval.code) = abc___break__(0, ""); } @@ -4906,7 +4915,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2392 "parser.y" +#line 2401 "parser.y" { (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id)); } @@ -4919,7 +4928,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2395 "parser.y" +#line 2404 "parser.y" { (yyval.code) = abc___continue__(0, ""); } @@ -4932,7 +4941,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2398 "parser.y" +#line 2407 "parser.y" { (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id)); } @@ -4945,7 +4954,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2402 "parser.y" +#line 2411 "parser.y" {(yyval.code)=0;} } break; @@ -4956,7 +4965,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2403 "parser.y" +#line 2412 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; @@ -4967,7 +4976,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2404 "parser.y" +#line 2413 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; @@ -4978,7 +4987,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2405 "parser.y" +#line 2414 "parser.y" {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));} } break; @@ -4989,7 +4998,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2406 "parser.y" +#line 2415 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; @@ -5000,7 +5009,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2407 "parser.y" +#line 2416 "parser.y" {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));} } break; @@ -5011,7 +5020,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2409 "parser.y" +#line 2418 "parser.y" { (yyval.code) = abc_getlocal(0, state->switch_var); (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (4)].value).c); @@ -5032,7 +5041,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2420 "parser.y" +#line 2429 "parser.y" { (yyval.code) = (yyvsp[(3) - (3)].code); } @@ -5045,7 +5054,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2423 "parser.y" +#line 2432 "parser.y" {PASS12 new_state();state->switch_var=alloc_local();} } break; @@ -5056,7 +5065,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2423 "parser.y" +#line 2432 "parser.y" { (yyval.code)=(yyvsp[(4) - (8)].value).c; (yyval.code) = abc_setlocal((yyval.code), state->switch_var); @@ -5094,7 +5103,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2454 "parser.y" +#line 2463 "parser.y" {PASS12 new_state(); state->exception_name=(yyvsp[(3) - (5)].id); PASS1 new_variable((yyvsp[(3) - (5)].id), 0, 0, 0); @@ -5109,7 +5118,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2459 "parser.y" +#line 2468 "parser.y" { namespace_t name_ns = {ACCESS_PACKAGE, ""}; multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)}; @@ -5139,7 +5148,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2479 "parser.y" +#line 2488 "parser.y" {PASS12 new_state();state->exception_name=0;} } break; @@ -5150,7 +5159,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2479 "parser.y" +#line 2488 "parser.y" { (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code)); if(!(yyvsp[(4) - (5)].code)) { @@ -5175,7 +5184,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2495 "parser.y" +#line 2504 "parser.y" {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));} } break; @@ -5186,7 +5195,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2496 "parser.y" +#line 2505 "parser.y" {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));} } break; @@ -5197,7 +5206,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2497 "parser.y" +#line 2506 "parser.y" {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);} } break; @@ -5208,7 +5217,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2498 "parser.y" +#line 2507 "parser.y" { (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list); (yyval.catch_list).finally = 0; @@ -5226,7 +5235,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2506 "parser.y" +#line 2515 "parser.y" { (yyval.catch_list).l=list_new(); (yyval.catch_list).finally = 0; @@ -5244,7 +5253,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2515 "parser.y" +#line 2524 "parser.y" {PASS12 new_state(); state->method->has_exceptions=1; state->method->late_binding=1;//for invariant scope_code @@ -5258,7 +5267,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2518 "parser.y" +#line 2527 "parser.y" { code_t*out = abc_nop(0); @@ -5311,7 +5320,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2564 "parser.y" +#line 2573 "parser.y" { (yyval.code)=(yyvsp[(2) - (2)].value).c; (yyval.code)=abc_throw((yyval.code)); @@ -5325,7 +5334,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2568 "parser.y" +#line 2577 "parser.y" { if(!state->exception_name) syntaxerror("re-throw only possible within a catch block"); @@ -5343,7 +5352,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2579 "parser.y" +#line 2588 "parser.y" { new_state(); if(state->method->has_exceptions) { @@ -5363,7 +5372,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2589 "parser.y" +#line 2598 "parser.y" { /* remove getlocal;pushwith from scope code again */ state->method->scope_code = code_cutlast(code_cutlast(state->method->scope_code)); @@ -5387,7 +5396,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2607 "parser.y" +#line 2616 "parser.y" {PASS12 (yyval.id)="package";} } break; @@ -5398,7 +5407,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2608 "parser.y" +#line 2617 "parser.y" {PASS12 (yyval.id)=(yyvsp[(1) - (1)].id);} } break; @@ -5409,7 +5418,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2610 "parser.y" +#line 2619 "parser.y" {PASS12 (yyval.id) = concat3((yyvsp[(1) - (3)].id),".",(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;} } break; @@ -5420,7 +5429,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2611 "parser.y" +#line 2620 "parser.y" {PASS12 (yyval.id)=strdup((yyvsp[(1) - (1)].id));} } break; @@ -5431,7 +5440,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2613 "parser.y" +#line 2622 "parser.y" {PASS12 startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;} } break; @@ -5442,7 +5451,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2614 "parser.y" +#line 2623 "parser.y" {PASS12 endpackage();(yyval.code)=0;} } break; @@ -5453,7 +5462,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2615 "parser.y" +#line 2624 "parser.y" {PASS12 startpackage("");} } break; @@ -5464,7 +5473,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2616 "parser.y" +#line 2625 "parser.y" {PASS12 endpackage();(yyval.code)=0;} } break; @@ -5475,7 +5484,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2618 "parser.y" +#line 2627 "parser.y" { PASS12 slotinfo_t*s = registry_find((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name); @@ -5501,7 +5510,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2634 "parser.y" +#line 2643 "parser.y" { PASS12 if(strncmp("flash.", (yyvsp[(2) - (4)].id), 6) && as3_pass==1) { @@ -5525,7 +5534,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2651 "parser.y" +#line 2660 "parser.y" {PASS12 (yyval.flags).flags=0;(yyval.flags).ns=0;} } break; @@ -5536,7 +5545,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2652 "parser.y" +#line 2661 "parser.y" {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);} } break; @@ -5547,7 +5556,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2653 "parser.y" +#line 2662 "parser.y" {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);} } break; @@ -5558,7 +5567,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2654 "parser.y" +#line 2663 "parser.y" { PASS12 (yyval.flags).flags=(yyvsp[(1) - (2)].flags).flags|(yyvsp[(2) - (2)].flags).flags; @@ -5575,7 +5584,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2661 "parser.y" +#line 2670 "parser.y" {PASS12 (yyval.flags).flags=FLAG_PUBLIC;(yyval.flags).ns=0;} } break; @@ -5586,7 +5595,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2662 "parser.y" +#line 2671 "parser.y" {PASS12 (yyval.flags).flags=FLAG_PRIVATE;(yyval.flags).ns=0;} } break; @@ -5597,7 +5606,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2663 "parser.y" +#line 2672 "parser.y" {PASS12 (yyval.flags).flags=FLAG_PROTECTED;(yyval.flags).ns=0;} } break; @@ -5608,7 +5617,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2664 "parser.y" +#line 2673 "parser.y" {PASS12 (yyval.flags).flags=FLAG_STATIC;(yyval.flags).ns=0;} } break; @@ -5619,7 +5628,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2665 "parser.y" +#line 2674 "parser.y" {PASS12 (yyval.flags).flags=FLAG_DYNAMIC;(yyval.flags).ns=0;} } break; @@ -5630,7 +5639,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2666 "parser.y" +#line 2675 "parser.y" {PASS12 (yyval.flags).flags=FLAG_FINAL;(yyval.flags).ns=0;} } break; @@ -5641,7 +5650,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2667 "parser.y" +#line 2676 "parser.y" {PASS12 (yyval.flags).flags=FLAG_OVERRIDE;(yyval.flags).ns=0;} } break; @@ -5652,7 +5661,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2668 "parser.y" +#line 2677 "parser.y" {PASS12 (yyval.flags).flags=FLAG_NATIVE;(yyval.flags).ns=0;} } break; @@ -5663,7 +5672,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2669 "parser.y" +#line 2678 "parser.y" {PASS12 (yyval.flags).flags=FLAG_PACKAGEINTERNAL;(yyval.flags).ns=0;} } break; @@ -5674,7 +5683,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2670 "parser.y" +#line 2679 "parser.y" {PASS12 (yyval.flags).flags=FLAG_NAMESPACE; (yyval.flags).ns=(yyvsp[(1) - (1)].id); } @@ -5687,7 +5696,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2674 "parser.y" +#line 2683 "parser.y" {PASS12 (yyval.classinfo)=0;} } break; @@ -5698,7 +5707,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2675 "parser.y" +#line 2684 "parser.y" {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);} } break; @@ -5709,7 +5718,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2677 "parser.y" +#line 2686 "parser.y" {PASS12 (yyval.classinfo_list)=list_new();} } break; @@ -5720,7 +5729,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2678 "parser.y" +#line 2687 "parser.y" {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);} } break; @@ -5731,7 +5740,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2680 "parser.y" +#line 2689 "parser.y" {PASS12 (yyval.classinfo_list)=list_new();} } break; @@ -5742,7 +5751,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2681 "parser.y" +#line 2690 "parser.y" {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);} } break; @@ -5753,7 +5762,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2685 "parser.y" +#line 2694 "parser.y" {PASS12 startclass(&(yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list));} } break; @@ -5764,7 +5773,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2687 "parser.y" +#line 2696 "parser.y" {PASS12 endclass();(yyval.code)=0;} } break; @@ -5775,7 +5784,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2691 "parser.y" +#line 2700 "parser.y" {PASS12 (yyvsp[(1) - (5)].flags).flags|=FLAG_INTERFACE; startclass(&(yyvsp[(1) - (5)].flags),(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list));} } @@ -5787,7 +5796,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2694 "parser.y" +#line 2703 "parser.y" {PASS12 endclass();(yyval.code)=0;} } break; @@ -5798,7 +5807,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2707 "parser.y" +#line 2716 "parser.y" { code_t*c = state->cls->static_init->header; c = code_append(c, (yyvsp[(1) - (1)].code)); @@ -5813,7 +5822,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2718 "parser.y" +#line 2727 "parser.y" { syntaxerror("variable declarations not allowed in interfaces"); } @@ -5826,7 +5835,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2721 "parser.y" +#line 2730 "parser.y" { PASS12 (yyvsp[(1) - (8)].flags).flags |= FLAG_PUBLIC; @@ -5846,7 +5855,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2736 "parser.y" +#line 2745 "parser.y" {setslotstate(&(yyvsp[(1) - (2)].flags),(yyvsp[(2) - (2)].token));} } break; @@ -5857,7 +5866,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2736 "parser.y" +#line 2745 "parser.y" {(yyval.code)=(yyvsp[(4) - (4)].code);setslotstate(0, 0);} } break; @@ -5868,7 +5877,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2738 "parser.y" +#line 2747 "parser.y" {(yyval.code) = (yyvsp[(1) - (1)].code);} } break; @@ -5879,7 +5888,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2739 "parser.y" +#line 2748 "parser.y" {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));} } break; @@ -5890,7 +5899,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2742 "parser.y" +#line 2751 "parser.y" { int flags = slotstate_flags->flags; namespace_t ns = modifiers2access(slotstate_flags); @@ -5971,7 +5980,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2816 "parser.y" +#line 2825 "parser.y" {(yyval.constant)=0;} } break; @@ -5982,7 +5991,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2817 "parser.y" +#line 2826 "parser.y" {(yyval.constant)=(yyvsp[(2) - (2)].constant);} } break; @@ -5993,7 +6002,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2819 "parser.y" +#line 2828 "parser.y" {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_uint));} } break; @@ -6004,7 +6013,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2820 "parser.y" +#line 2829 "parser.y" {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));} } break; @@ -6015,7 +6024,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2821 "parser.y" +#line 2830 "parser.y" {(yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint));} } break; @@ -6026,7 +6035,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2822 "parser.y" +#line 2831 "parser.y" {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));} } break; @@ -6037,7 +6046,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2823 "parser.y" +#line 2832 "parser.y" {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);free((char*)(yyvsp[(1) - (1)].str).str);} } break; @@ -6048,7 +6057,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2825 "parser.y" +#line 2834 "parser.y" {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));} } break; @@ -6059,7 +6068,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2826 "parser.y" +#line 2835 "parser.y" {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));} } break; @@ -6070,7 +6079,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2827 "parser.y" +#line 2836 "parser.y" {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));} } break; @@ -6081,7 +6090,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2828 "parser.y" +#line 2837 "parser.y" { if(!strcmp((yyvsp[(1) - (1)].id), "NaN")) { (yyval.constant) = constant_new_float(__builtin_nan("")); @@ -6099,7 +6108,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2840 "parser.y" +#line 2849 "parser.y" { PASS12 memset(&(yyval.params),0,sizeof((yyval.params))); @@ -6113,7 +6122,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2844 "parser.y" +#line 2853 "parser.y" { PASS12 (yyval.params)=(yyvsp[(1) - (1)].params); @@ -6127,7 +6136,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2850 "parser.y" +#line 2859 "parser.y" { PASS12 memset(&(yyval.params),0,sizeof((yyval.params))); @@ -6143,7 +6152,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2856 "parser.y" +#line 2865 "parser.y" { PASS12 (yyval.params) =(yyvsp[(1) - (4)].params); @@ -6159,7 +6168,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2864 "parser.y" +#line 2873 "parser.y" { PASS12 (yyval.params) = (yyvsp[(1) - (3)].params); @@ -6174,7 +6183,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2869 "parser.y" +#line 2878 "parser.y" { PASS12 memset(&(yyval.params),0,sizeof((yyval.params))); @@ -6189,7 +6198,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2875 "parser.y" +#line 2884 "parser.y" { PASS12 (yyval.param) = rfx_calloc(sizeof(param_t)); @@ -6207,7 +6216,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2883 "parser.y" +#line 2892 "parser.y" { PASS12 (yyval.param) = rfx_calloc(sizeof(param_t)); @@ -6225,7 +6234,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2893 "parser.y" +#line 2902 "parser.y" {PASS12 (yyval.token)=0;} } break; @@ -6236,7 +6245,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2896 "parser.y" +#line 2905 "parser.y" {PASS12 startfunction(&(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));} } break; @@ -6247,7 +6256,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2897 "parser.y" +#line 2906 "parser.y" { PASS1 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),0,0); @@ -6271,7 +6280,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2913 "parser.y" +#line 2922 "parser.y" {PASS12 (yyval.id)=0;} } break; @@ -6282,7 +6291,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2915 "parser.y" +#line 2924 "parser.y" {PASS12 innerfunction((yyvsp[(2) - (7)].id),&(yyvsp[(4) - (7)].params),(yyvsp[(6) - (7)].classinfo));} } break; @@ -6293,7 +6302,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2916 "parser.y" +#line 2925 "parser.y" { PASS1 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),0,0); @@ -6321,7 +6330,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2938 "parser.y" +#line 2947 "parser.y" { PASS1 NEW(unresolvedinfo_t,c); memset(c, 0, sizeof(*c)); @@ -6349,7 +6358,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2957 "parser.y" +#line 2966 "parser.y" { PASS1 NEW(unresolvedinfo_t,c); memset(c, 0, sizeof(*c)); @@ -6372,7 +6381,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2974 "parser.y" +#line 2983 "parser.y" {PASS12 (yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));} } break; @@ -6383,7 +6392,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2975 "parser.y" +#line 2984 "parser.y" {PASS12 (yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));} } break; @@ -6394,7 +6403,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2977 "parser.y" +#line 2986 "parser.y" {PASS12 (yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);} } break; @@ -6405,7 +6414,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2978 "parser.y" +#line 2987 "parser.y" {PASS12 (yyval.classinfo)=registry_getanytype();} } break; @@ -6416,7 +6425,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2979 "parser.y" +#line 2988 "parser.y" {PASS12 (yyval.classinfo)=registry_getanytype();} } break; @@ -6427,7 +6436,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2988 "parser.y" +#line 2997 "parser.y" {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);} } break; @@ -6438,7 +6447,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2989 "parser.y" +#line 2998 "parser.y" {PASS12 (yyval.classinfo)=0;} } break; @@ -6449,7 +6458,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2993 "parser.y" +#line 3002 "parser.y" {(yyval.value_list).cc=0;(yyval.value_list).number=0;} } break; @@ -6460,7 +6469,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2994 "parser.y" +#line 3003 "parser.y" {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);} } break; @@ -6471,7 +6480,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2996 "parser.y" +#line 3005 "parser.y" {(yyval.value_list).cc=0;(yyval.value_list).number=0;} } break; @@ -6482,7 +6491,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3000 "parser.y" +#line 3009 "parser.y" {(yyval.value_list).number=1; (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c; } @@ -6495,7 +6504,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3004 "parser.y" +#line 3013 "parser.y" {(yyval.value_list) = (yyvsp[(1) - (2)].value_list);} } break; @@ -6506,7 +6515,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3005 "parser.y" +#line 3014 "parser.y" { (yyval.value_list).number= (yyvsp[(1) - (2)].value_list).number+1; (yyval.value_list).cc = code_append((yyvsp[(1) - (2)].value_list).cc, (yyvsp[(2) - (2)].value).c); @@ -6520,7 +6529,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3011 "parser.y" +#line 3020 "parser.y" { (yyval.value).c = (yyvsp[(2) - (4)].value).c; if((yyval.value).c->opcode == OPCODE_COERCE_A) (yyval.value).c = code_cutlast((yyval.value).c); @@ -6561,7 +6570,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3047 "parser.y" +#line 3056 "parser.y" { (yyval.value).c = (yyvsp[(1) - (4)].value).c; @@ -6616,7 +6625,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3093 "parser.y" +#line 3102 "parser.y" { if(!state->cls) syntaxerror("super() not allowed outside of a class"); if(!state->method) syntaxerror("super() not allowed outside of a function"); @@ -6646,7 +6655,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3114 "parser.y" +#line 3123 "parser.y" { (yyval.value).c = (yyvsp[(2) - (2)].value).c; if((yyval.value).c->opcode == OPCODE_COERCE_A) { @@ -6676,7 +6685,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3135 "parser.y" +#line 3144 "parser.y" { (yyval.code) = abc_returnvoid(0); } @@ -6689,7 +6698,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3138 "parser.y" +#line 3147 "parser.y" { (yyval.code) = (yyvsp[(2) - (2)].value).c; (yyval.code) = abc_returnvalue((yyval.code)); @@ -6703,7 +6712,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3145 "parser.y" +#line 3154 "parser.y" {(yyval.value)=(yyvsp[(1) - (1)].value);} } break; @@ -6714,7 +6723,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3146 "parser.y" +#line 3155 "parser.y" {(yyval.value) = (yyvsp[(1) - (1)].value);} } break; @@ -6725,7 +6734,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3147 "parser.y" +#line 3156 "parser.y" { (yyval.value).c = (yyvsp[(1) - (3)].value).c; (yyval.value).c = cut_last_push((yyval.value).c); @@ -6741,7 +6750,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3153 "parser.y" +#line 3162 "parser.y" { (yyval.code)=cut_last_push((yyvsp[(1) - (1)].value).c); } @@ -6754,7 +6763,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3159 "parser.y" +#line 3168 "parser.y" {(yyval.value) = (yyvsp[(1) - (1)].value);} } break; @@ -6765,7 +6774,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3163 "parser.y" +#line 3172 "parser.y" {(yyval.value) = (yyvsp[(1) - (1)].value);} } break; @@ -6776,7 +6785,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3165 "parser.y" +#line 3174 "parser.y" {(yyval.value) = (yyvsp[(1) - (1)].value);} } break; @@ -6787,7 +6796,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3167 "parser.y" +#line 3176 "parser.y" {(yyval.value) = (yyvsp[(1) - (1)].value);} } break; @@ -6798,7 +6807,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3171 "parser.y" +#line 3180 "parser.y" { (yyval.value).c = 0; namespace_t ns = {ACCESS_PACKAGE, ""}; @@ -6824,7 +6833,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3188 "parser.y" +#line 3197 "parser.y" {(yyval.value).c = abc_pushbyte(0, (yyvsp[(1) - (1)].number_uint)); //MULTINAME(m, registry_getintclass()); //$$.c = abc_coerce2($$.c, &m); // FIXME @@ -6839,7 +6848,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3193 "parser.y" +#line 3202 "parser.y" {(yyval.value).c = abc_pushshort(0, (yyvsp[(1) - (1)].number_uint)); (yyval.value).t = TYPE_INT; } @@ -6852,7 +6861,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3196 "parser.y" +#line 3205 "parser.y" {(yyval.value).c = abc_pushint(0, (yyvsp[(1) - (1)].number_int)); (yyval.value).t = TYPE_INT; } @@ -6865,7 +6874,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3199 "parser.y" +#line 3208 "parser.y" {(yyval.value).c = abc_pushuint(0, (yyvsp[(1) - (1)].number_uint)); (yyval.value).t = TYPE_UINT; } @@ -6878,7 +6887,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3202 "parser.y" +#line 3211 "parser.y" {(yyval.value).c = abc_pushdouble(0, (yyvsp[(1) - (1)].number_float)); (yyval.value).t = TYPE_FLOAT; } @@ -6891,7 +6900,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3205 "parser.y" +#line 3214 "parser.y" {(yyval.value).c = abc_pushstring2(0, &(yyvsp[(1) - (1)].str));free((char*)(yyvsp[(1) - (1)].str).str); (yyval.value).t = TYPE_STRING; } @@ -6904,7 +6913,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3208 "parser.y" +#line 3217 "parser.y" {(yyval.value).c = abc_pushundefined(0); (yyval.value).t = TYPE_ANY; } @@ -6917,7 +6926,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3211 "parser.y" +#line 3220 "parser.y" {(yyval.value).c = abc_pushtrue(0); (yyval.value).t = TYPE_BOOLEAN; } @@ -6930,7 +6939,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3214 "parser.y" +#line 3223 "parser.y" {(yyval.value).c = abc_pushfalse(0); (yyval.value).t = TYPE_BOOLEAN; } @@ -6943,7 +6952,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3217 "parser.y" +#line 3226 "parser.y" {(yyval.value).c = abc_pushnull(0); (yyval.value).t = TYPE_NULL; } @@ -6956,7 +6965,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3221 "parser.y" +#line 3230 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterequals((yyval.value).c);(yyval.value).c=abc_not((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; } @@ -6969,7 +6978,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3224 "parser.y" +#line 3233 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterthan((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; } @@ -6982,7 +6991,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3227 "parser.y" +#line 3236 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterthan((yyval.value).c);(yyval.value).c=abc_not((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; } @@ -6995,7 +7004,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3230 "parser.y" +#line 3239 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterequals((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; } @@ -7008,7 +7017,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3233 "parser.y" +#line 3242 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_equals((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; } @@ -7021,7 +7030,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3236 "parser.y" +#line 3245 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_strictequals((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; } @@ -7034,7 +7043,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3239 "parser.y" +#line 3248 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_strictequals((yyval.value).c);(yyval.value).c = abc_not((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; } @@ -7047,7 +7056,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3242 "parser.y" +#line 3251 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_equals((yyval.value).c);(yyval.value).c = abc_not((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; } @@ -7060,7 +7069,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3246 "parser.y" +#line 3255 "parser.y" {(yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'O'); (yyval.value).c = (yyvsp[(1) - (3)].value).c; (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t); @@ -7081,7 +7090,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3257 "parser.y" +#line 3266 "parser.y" { (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'A'); /*printf("%08x:\n",$1.t); @@ -7108,7 +7117,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3275 "parser.y" +#line 3284 "parser.y" {(yyval.value).c=(yyvsp[(2) - (2)].value).c; (yyval.value).c = abc_not((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; @@ -7122,7 +7131,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3280 "parser.y" +#line 3289 "parser.y" {(yyval.value).c=(yyvsp[(2) - (2)].value).c; (yyval.value).c = abc_bitnot((yyval.value).c); (yyval.value).t = TYPE_INT; @@ -7136,7 +7145,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3285 "parser.y" +#line 3294 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); (yyval.value).c = abc_bitand((yyval.value).c); (yyval.value).t = TYPE_INT; @@ -7150,7 +7159,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3290 "parser.y" +#line 3299 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); (yyval.value).c = abc_bitxor((yyval.value).c); (yyval.value).t = TYPE_INT; @@ -7164,7 +7173,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3295 "parser.y" +#line 3304 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); (yyval.value).c = abc_bitor((yyval.value).c); (yyval.value).t = TYPE_INT; @@ -7178,7 +7187,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3300 "parser.y" +#line 3309 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); (yyval.value).c = abc_rshift((yyval.value).c); (yyval.value).t = TYPE_INT; @@ -7192,7 +7201,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3304 "parser.y" +#line 3313 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); (yyval.value).c = abc_urshift((yyval.value).c); (yyval.value).t = TYPE_INT; @@ -7206,7 +7215,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3308 "parser.y" +#line 3317 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); (yyval.value).c = abc_lshift((yyval.value).c); (yyval.value).t = TYPE_INT; @@ -7220,7 +7229,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3313 "parser.y" +#line 3322 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); (yyval.value).c = abc_divide((yyval.value).c); (yyval.value).t = TYPE_NUMBER; @@ -7234,7 +7243,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3317 "parser.y" +#line 3326 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); (yyval.value).c = abc_modulo((yyval.value).c); (yyval.value).t = TYPE_NUMBER; @@ -7248,7 +7257,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3321 "parser.y" +#line 3330 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); if(BOTH_INT((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t)) { (yyval.value).c = abc_add_i((yyval.value).c); @@ -7267,7 +7276,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3330 "parser.y" +#line 3339 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) { (yyval.value).c = abc_subtract_i((yyval.value).c); @@ -7286,7 +7295,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3339 "parser.y" +#line 3348 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) { (yyval.value).c = abc_multiply_i((yyval.value).c); @@ -7305,7 +7314,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3349 "parser.y" +#line 3358 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); (yyval.value).c = abc_in((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; @@ -7319,7 +7328,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3354 "parser.y" +#line 3363 "parser.y" {char use_astype=0; // flash player's astype works differently than astypelate if(use_astype && TYPE_IS_CLASS((yyvsp[(3) - (3)].value).t) && (yyvsp[(3) - (3)].value).t->data) { MULTINAME(m, (classinfo_t*)((yyvsp[(3) - (3)].value).t->data)); @@ -7340,7 +7349,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3367 "parser.y" +#line 3376 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c); (yyval.value).c = abc_instanceof((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; @@ -7354,7 +7363,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3372 "parser.y" +#line 3381 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c); (yyval.value).c = abc_istypelate((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; @@ -7368,7 +7377,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3377 "parser.y" +#line 3386 "parser.y" { (yyval.value).c = (yyvsp[(3) - (4)].value).c; (yyval.value).c = abc_typeof((yyval.value).c); @@ -7383,7 +7392,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3383 "parser.y" +#line 3392 "parser.y" { (yyval.value).c = cut_last_push((yyvsp[(2) - (2)].value).c); (yyval.value).c = abc_pushundefined((yyval.value).c); @@ -7398,7 +7407,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3389 "parser.y" +#line 3398 "parser.y" { (yyval.value).c = abc_pushundefined(0); (yyval.value).t = TYPE_ANY; } @@ -7411,7 +7420,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3393 "parser.y" +#line 3402 "parser.y" {(yyval.value)=(yyvsp[(2) - (3)].value);} } break; @@ -7422,7 +7431,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3395 "parser.y" +#line 3404 "parser.y" { (yyval.value)=(yyvsp[(2) - (2)].value); if(IS_INT((yyvsp[(2) - (2)].value).t)) { @@ -7442,7 +7451,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3406 "parser.y" +#line 3415 "parser.y" { (yyval.value).c = (yyvsp[(1) - (4)].value).c; (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value).c); @@ -7460,7 +7469,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3415 "parser.y" +#line 3424 "parser.y" { (yyval.value).c = code_new(); (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc); @@ -7476,7 +7485,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3422 "parser.y" +#line 3431 "parser.y" {(yyval.value_list).cc=0;(yyval.value_list).number=0;} } break; @@ -7487,7 +7496,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3423 "parser.y" +#line 3432 "parser.y" {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);} } break; @@ -7498,7 +7507,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3425 "parser.y" +#line 3434 "parser.y" { (yyval.value_list).cc = 0; (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].value).c); @@ -7514,7 +7523,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3431 "parser.y" +#line 3440 "parser.y" { (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc; (yyval.value_list).number = (yyvsp[(1) - (5)].value_list).number+2; @@ -7530,7 +7539,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3440 "parser.y" +#line 3449 "parser.y" { (yyval.value).c = code_new(); (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc); @@ -7546,7 +7555,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3447 "parser.y" +#line 3456 "parser.y" { code_t*c = (yyvsp[(3) - (3)].value).c; if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) { @@ -7567,7 +7576,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3459 "parser.y" +#line 3468 "parser.y" { code_t*c = abc_modulo((yyvsp[(3) - (3)].value).c); c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '%'), (yyvsp[(1) - (3)].value).t); @@ -7583,7 +7592,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3465 "parser.y" +#line 3474 "parser.y" { code_t*c = abc_lshift((yyvsp[(3) - (3)].value).c); c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '<'), (yyvsp[(1) - (3)].value).t); @@ -7599,7 +7608,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3471 "parser.y" +#line 3480 "parser.y" { code_t*c = abc_rshift((yyvsp[(3) - (3)].value).c); c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '>'), (yyvsp[(1) - (3)].value).t); @@ -7615,7 +7624,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3477 "parser.y" +#line 3486 "parser.y" { code_t*c = abc_urshift((yyvsp[(3) - (3)].value).c); c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'U'), (yyvsp[(1) - (3)].value).t); @@ -7631,7 +7640,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3483 "parser.y" +#line 3492 "parser.y" { code_t*c = abc_divide((yyvsp[(3) - (3)].value).c); c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '/'), (yyvsp[(1) - (3)].value).t); @@ -7647,7 +7656,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3489 "parser.y" +#line 3498 "parser.y" { code_t*c = abc_bitor((yyvsp[(3) - (3)].value).c); c=converttype(c, TYPE_INT, (yyvsp[(1) - (3)].value).t); @@ -7663,7 +7672,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3495 "parser.y" +#line 3504 "parser.y" { code_t*c = abc_bitxor((yyvsp[(3) - (3)].value).c); c=converttype(c, TYPE_INT, (yyvsp[(1) - (3)].value).t); @@ -7679,7 +7688,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3501 "parser.y" +#line 3510 "parser.y" { code_t*c = (yyvsp[(3) - (3)].value).c; @@ -7702,7 +7711,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3514 "parser.y" +#line 3523 "parser.y" { code_t*c = (yyvsp[(3) - (3)].value).c; if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) { c=abc_subtract_i(c); @@ -7723,7 +7732,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3525 "parser.y" +#line 3534 "parser.y" { code_t*c = 0; c = code_append(c, (yyvsp[(3) - (3)].value).c); c = converttype(c, (yyvsp[(3) - (3)].value).t, (yyvsp[(1) - (3)].value).t); @@ -7739,7 +7748,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3532 "parser.y" +#line 3541 "parser.y" { (yyval.value).t = join_types((yyvsp[(3) - (5)].value).t,(yyvsp[(5) - (5)].value).t,'?'); (yyval.value).c = (yyvsp[(1) - (5)].value).c; @@ -7761,7 +7770,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3545 "parser.y" +#line 3554 "parser.y" { code_t*c = 0; classinfo_t*type = (yyvsp[(1) - (2)].value).t; if(is_getlocal((yyvsp[(1) - (2)].value).c) && (TYPE_IS_INT((yyvsp[(1) - (2)].value).t) || TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t))) { @@ -7796,7 +7805,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3572 "parser.y" +#line 3581 "parser.y" { code_t*c = 0; classinfo_t*type = (yyvsp[(1) - (2)].value).t; if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) { @@ -7819,7 +7828,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3586 "parser.y" +#line 3595 "parser.y" { code_t*c = 0; classinfo_t*type = (yyvsp[(2) - (2)].value).t; if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) { @@ -7842,7 +7851,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3600 "parser.y" +#line 3609 "parser.y" { code_t*c = 0; classinfo_t*type = (yyvsp[(2) - (2)].value).t; if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) { @@ -7865,7 +7874,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3615 "parser.y" +#line 3624 "parser.y" { if(!state->cls->info) syntaxerror("super keyword not allowed outside a class"); classinfo_t*t = state->cls->info->superclass; @@ -7888,7 +7897,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3629 "parser.y" +#line 3638 "parser.y" { // attribute TODO (yyval.value).c = abc_pushundefined(0); @@ -7904,7 +7913,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3636 "parser.y" +#line 3645 "parser.y" { // child attribute TODO (yyval.value).c = abc_pushundefined(0); @@ -7920,7 +7929,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3643 "parser.y" +#line 3652 "parser.y" { // namespace declaration TODO (yyval.value).c = abc_pushundefined(0); @@ -7936,7 +7945,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3650 "parser.y" +#line 3659 "parser.y" { // descendants TODO (yyval.value).c = abc_pushundefined(0); @@ -7952,7 +7961,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3657 "parser.y" +#line 3666 "parser.y" { // filter TODO (yyval.value).c = abc_pushundefined(0); @@ -7968,7 +7977,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3668 "parser.y" +#line 3677 "parser.y" { (yyval.value).c = (yyvsp[(1) - (3)].value).c; classinfo_t*t = (yyvsp[(1) - (3)].value).t; @@ -8029,7 +8038,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3720 "parser.y" +#line 3729 "parser.y" { PASS1 /* Queue unresolved identifiers for checking against the parent @@ -8071,8 +8080,11 @@ PASS2 int i_am_static = (state->method && state->method->info)?(state->method->info->flags&FLAG_STATIC):FLAG_STATIC; /* look at current class' members */ - if(state->cls && (f = findmember_nsset(state->cls->info, (yyvsp[(1) - (1)].id), 1)) && - (f->flags&FLAG_STATIC) >= i_am_static) { + if(!state->method->inner && + state->cls && + (f = findmember_nsset(state->cls->info, (yyvsp[(1) - (1)].id), 1)) && + (f->flags&FLAG_STATIC) >= i_am_static) + { // $1 is a function in this class int var_is_static = (f->flags&FLAG_STATIC); @@ -8142,7 +8154,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3826 "parser.y" +#line 3838 "parser.y" { PASS12 NEW(namespace_decl_t,n); @@ -8159,7 +8171,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3833 "parser.y" +#line 3845 "parser.y" { PASS12 NEW(namespace_decl_t,n); @@ -8176,7 +8188,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3840 "parser.y" +#line 3852 "parser.y" { PASS12 NEW(namespace_decl_t,n); @@ -8193,7 +8205,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3847 "parser.y" +#line 3859 "parser.y" { PASS12 trie_put(active_namespaces, (yyvsp[(2) - (2)].namespace_decl)->name, (void*)(yyvsp[(2) - (2)].namespace_decl)->url); @@ -8217,7 +8229,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3862 "parser.y" +#line 3874 "parser.y" { const char*url = (yyvsp[(3) - (3)].classinfo)->name; @@ -8239,7 +8251,7 @@ PASS2 /* Line 1464 of skeleton.m4 */ -#line 8243 "parser.tab.c" +#line 8255 "parser.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); diff --git a/lib/as3/parser.y b/lib/as3/parser.y index 3ac1d50..2a8b224 100644 --- a/lib/as3/parser.y +++ b/lib/as3/parser.y @@ -332,6 +332,7 @@ struct _methodstate { char uses_parent_function; int uses_slots; dict_t*slots; + int activation_var; abc_method_t*abc; int var_index; // for inner methods @@ -755,17 +756,26 @@ static void parsererror(const char*file, int line, const char*f) } -static code_t* add_scope_code(code_t*c, methodstate_t*m) +static code_t* add_scope_code(code_t*c, methodstate_t*m, char init) { - if(m->uses_slots || (m->late_binding && !m->inner)) { + if(m->uses_slots || (m->late_binding && !m->inner)) { //???? especially inner functions need the pushscope c = abc_getlocal_0(c); c = abc_pushscope(c); } if(m->uses_slots) { - /* FIXME: does this need to be the same activation object as - in the function header? */ - c = abc_newactivation(c); - c = abc_pushscope(c); + /* FIXME: this alloc_local() causes variable indexes to be + different in pass2 than in pass1 */ + if(!m->activation_var) + m->activation_var = alloc_local(); + if(init) { + c = abc_newactivation(c); + c = abc_dup(c); + c = abc_pushscope(c); + c = abc_setlocal(c, m->activation_var); + } else { + c = abc_getlocal(c, m->activation_var); + c = abc_pushscope(c); + } } return c; } @@ -774,7 +784,7 @@ static code_t* method_header(methodstate_t*m) { code_t*c = 0; - c = add_scope_code(c, m); + c = add_scope_code(c, m, 1); methodstate_list_t*l = m->innerfunctions; while(l) { @@ -921,11 +931,6 @@ static void function_initvars(methodstate_t*m, params_t*params, int flags, char } } - if(as3_pass==2) { - m->scope_code = add_scope_code(m->scope_code, m); - } - - methodstate_list_t*l = m->innerfunctions; while(l) { methodstate_t*m = l->methodstate; @@ -938,6 +943,10 @@ static void function_initvars(methodstate_t*m, params_t*params, int flags, char l = l->next; } + if(as3_pass==2) { + m->scope_code = add_scope_code(m->scope_code, m, 0); + } + if(as3_pass==2 && m->slots) { /* exchange unresolved identifiers with the actual objects */ DICT_ITERATE_ITEMS(m->slots, char*, name, variable_t*, v) { @@ -3758,8 +3767,11 @@ VAR_READ : T_IDENTIFIER { int i_am_static = (state->method && state->method->info)?(state->method->info->flags&FLAG_STATIC):FLAG_STATIC; /* look at current class' members */ - if(state->cls && (f = findmember_nsset(state->cls->info, $1, 1)) && - (f->flags&FLAG_STATIC) >= i_am_static) { + if(!state->method->inner && + state->cls && + (f = findmember_nsset(state->cls->info, $1, 1)) && + (f->flags&FLAG_STATIC) >= i_am_static) + { // $1 is a function in this class int var_is_static = (f->flags&FLAG_STATIC); diff --git a/lib/as3/test b/lib/as3/test index a1856fd..8f96670 100755 --- a/lib/as3/test +++ b/lib/as3/test @@ -106,7 +106,7 @@ class Cache: def parse_args(self): parser = OptionParser() parser.add_option("-d", "--diff", dest="diff", help="Only run tests that failed the last time",action="store_true") - parser.add_option("-a", "--all", dest="all", help="Run all tests (also tests expected fail)",action="store_true") + parser.add_option("-a", "--all", dest="all", help="Run all tests (also tests expected to fail)",action="store_true") parser.add_option("-t", "--tag", dest="tag", help="Mark the current pass/fail statistic as milestone",action="store_true") (options, args) = parser.parse_args() -- 1.7.10.4