private static void check_case(YVALUE v) { if (v.IsType(YDEF.sx_case_clause)) { // ok! なんでもOKとする。 #if obs var expr = v.list_at(1); if (expr.IsType(YDEF.QSTR) || expr.IsType(YDEF.NUM)) { ;//ok } else { _error("unexpected case sentence"); } #endif } else if (v.IsType(YDEF.sx_default_clause)) { ; //ok } else if (v.IsType(YDEF.sx_sentence)) { ;//ok } else { _error("unexpected switch senetence"); } }
internal static YVALUE ChangeIfType(YVALUE v, List <string> prefixlist) { if (v.IsType(YDEF.NAME)) { var vname = v.FindValueByTravarse(YDEF.NAME); var n = vname.GetString(); Type type = GetPrimitiveType(n); if (type == null) { type = Check(vname.GetString(), prefixlist); } if (type != null) { vname.type = YDEF.RUNTYPE; vname.o = type; vname.s = type.ToString(); } } return(v); }