void local_add(mrb_sym sym) { if (!local_var_p(sym)) { local_add_f(sym); } }
void local_add_f(mrb_sym sym) { if (this.locals != null) { this.locals.push(sym); } }
public string sym2name(mrb_sym sym) { int i = (int)sym - 1; if ((i < 0) || (i >= syms.Length)) { return(((int)sym).ToString()); } return(syms[i]); }
bool local_var_p(mrb_sym sym) { locals_node l = this.locals; while (l != null) { if (l.symList.Contains(sym)) { return(true); } l = l.cdr; } return(false); }
node new_var_node(mrb_sym sym) { var name = sym2name(sym); if (name.StartsWith("$")) { return(new gvar_node(this, sym)); } else if (name.StartsWith("@@")) { return(new cvar_node(this, sym)); } else if (name.StartsWith("@")) { return(new ivar_node(this, sym)); } else { return(new lvar_node(this, sym)); } }