--- languages/lua/classes/luanumber.pmc 2006-01-13 13:58:04.000000000 +0100 +++ languages/lua/classes/newluanumber.pmc 2006-01-13 14:02:49.000000000 +0100 @@ -67,6 +67,31 @@ return 1; } +/* + +=item C + +Return a LuaNumber PMC created from a string. Implementation +is based on new_from_string() from Integer PMC. + +=cut + +*/ + + PMC* new_from_string(STRING *rep, INTVAL flags) { + INTVAL type; + PMC *res; + + type = SELF->vtable->base_type; + if (flags & PObj_constant_FLAG) + res = constant_pmc_new(INTERP, type); + else + res = pmc_new(INTERP, type); + + PMC_num_val(res) = string_to_num(INTERP, rep); + return res; + } + } /*