示例#1
0
文件: EcArray.cs 项目: Myvar/Eclang
        public EcArray(string src)
        {
            string trimedbrackets = src.Trim().TrimStart('[').TrimEnd(']');

            string[] arrayitems = trimedbrackets.Split(',');

            List <object> FinalList = new List <object>();

            foreach (var arrayitem in arrayitems)
            {
                var val = PrimitivesManager.HandlePrimitive(arrayitem.Trim());
                if (val is EcString)
                {
                    FinalList.Add(new EcString((val as EcString).Value.ToString().Replace("NOMATH ", ""), false));
                }
                else
                {
                    FinalList.Add(val);
                }
            }
            this.data = FinalList.ToArray();

            this.Name = "array";
            //this.Value = src;
        }
示例#2
0
 public static Primitive HandleVar(string value, string name = "")
 {
     if (name != "")
     {
         return(PrimitivesManager.HandlePrimitive(value));
     }
     return(PrimitivesManager.HandlePrimitive(value, name));
 }