public static bool IsOverloaded(Runtime runtime, P5Scalar scalar, out Overloads overloads) { overloads = null; if (!scalar.IsReference(runtime)) return false; var stash = scalar.Dereference(runtime).Blessed(runtime); if (stash == null) return false; overloads = stash.Overloads; return stash.HasOverloading; }
public static IP5Regex CompileRegex(Runtime runtime, P5Scalar value, int flags) { if (value.IsReference(runtime)) { var rx = value.DereferenceRegex(runtime); if (rx != null) return rx; } if (runtime.NativeRegex) return new NetRegex(value.AsString(runtime)); else throw new System.Exception("P5: Needs compiler to recompile string expression"); }