+typedcode_t push_constant(constant_t*v)
+{
+ typedcode_t t;
+ switch(v->type) {
+ case CONSTANT_INT: t.c = abc_pushint(0, v->i);t.t = TYPE_INT;break;
+ case CONSTANT_UINT: t.c = abc_pushuint(0, v->u);t.t = TYPE_UINT;break;
+ case CONSTANT_FLOAT: t.c = abc_pushdouble(0, v->f);t.t = TYPE_FLOAT;break;
+ case CONSTANT_TRUE: t.c = abc_pushtrue(0);t.t = TYPE_BOOLEAN;break;
+ case CONSTANT_FALSE: t.c = abc_pushfalse(0);t.t = TYPE_BOOLEAN;break;
+ case CONSTANT_STRING: t.c = abc_pushstring2(0, v->s);t.t = TYPE_STRING;break;
+ case CONSTANT_NULL: t.c = abc_pushnull(0);t.t = TYPE_NULL;break;
+ case CONSTANT_UNDEFINED: t.c = abc_pushundefined(0);t.t = TYPE_ANY;break;
+ case CONSTANT_NAMESPACE:
+ case CONSTANT_NAMESPACE_PACKAGE:
+ case CONSTANT_NAMESPACE_PACKAGEINTERNAL:
+ case CONSTANT_NAMESPACE_PROTECTED:
+ case CONSTANT_NAMESPACE_EXPLICIT:
+ case CONSTANT_NAMESPACE_STATICPROTECTED:
+ case CONSTANT_NAMESPACE_PRIVATE:
+ t.c = abc_pushnamespace(0, v->ns);t.t = TYPE_NAMESPACE;break;
+ default:
+ syntaxerror("internal error: bad constant");
+ }
+ return t;
+}
+