+static void innerfunction(char*name, params_t*params, classinfo_t*return_type)
+{
+ parserassert(state->method && state->method->info);
+ memberinfo_t*parent_method = state->method->info;
+
+ if(as3_pass==1) {
+ // not valid yet
+ params = 0;
+ return_type = 0;
+ }
+
+ new_state();
+ state->method = rfx_calloc(sizeof(methodstate_t));
+ state->method->inner = 1;
+ state->method->variable_count = 0;
+
+ memberinfo_t*minfo = 0;
+
+ /* TODO: we need some better way to pass things from pass1 to pass2 */
+ char myname[200];
+ sprintf(myname, "as3-innerfunction-%d-%d", current_line, current_column);
+
+ if(as3_pass == 1) {
+ minfo = rfx_calloc(sizeof(memberinfo_t));
+ minfo->name = name;
+ if(!parent_method->subfunctions)
+ parent_method->subfunctions = dict_new();
+ if(name)
+ dict_put(parent_method->subfunctions, name, minfo);
+ dict_put(parent_method->subfunctions, myname, minfo);
+ }
+
+ if(as3_pass == 2) {
+ minfo = dict_lookup(parent_method->subfunctions, myname);
+ parserassert(minfo);
+
+ minfo->return_type = return_type;
+
+ new_variable("FIXME", 0, 0); //FIXME: is local_0 "this"?
+ param_list_t*p=0;
+ for(p=params->list;p;p=p->next) {
+ new_variable(p->param->name, p->param->type, 0);
+ }
+ }
+ state->method->info = minfo;
+}
+