static KMETHOD TypeCheck_RegExp(KonohaContext *kctx, KonohaStack *sfp) { VAR_TypeCheck(stmt, expr, gma, reqty); kToken *tk = expr->termToken; kRegExp *r = new_(RegExp, NULL, OnGcStack); DBG_ASSERT(kArray_size(tk->subTokenList) == 2); RegExp_set(kctx, r, tk->subTokenList->stringItems[0], tk->subTokenList->stringItems[1]); KReturn(SUGAR kExpr_setConstValue(kctx, expr, TY_RegExp, UPCAST(r))); }
static KMETHOD RegExp_new2(KonohaContext *kctx, KonohaStack *sfp) { RegExp_set(kctx, sfp[0].asRegExp, sfp[1].asString, sfp[2].asString); KReturn(sfp[0].asObject); }