Пример #1
0
        public void Visit(Ast.Expr.FuncCall f)
        {
            foreach (var e in f.Item.ExprList)
            {
                Visit(e);
            }
            if (f.Item.Decl == null)
            {
                return;
            }
            Ast.Stmt.Funcdef fd = (Ast.Stmt.Funcdef)f.Item.Decl.Value;
            // Compare param types to decl types
            var formalList      = SeqModule.ToList(fd.Item.FormalList);
            var actualList      = SeqModule.ToList(f.Item.ExprList);
            var actualAndFormal = ListModule.Zip(actualList, formalList);

            foreach (var af in actualAndFormal)
            {
                if (af.Item1.ActualType != af.Item2.Formal.Type)
                {
                    m_errorList.Add("Type Error: Cannot use actual paramater of type " + af.Item1.ActualType +
                                    " for formal paramater of type " + af.Item2.Formal.Type);
                }
            }
            f.ActualType = fd.Item.Formal.Type;
        }
Пример #2
0
 IEnumerator <KeyValuePair <K, V> > IEnumerable <KeyValuePair <K, V> > .GetEnumerator()
 {
     return(((IEnumerable <KeyValuePair <K, V> >)SeqModule.Map <Tuple <K, V>, KeyValuePair <K, V> >((FSharpFunc <M0, M1>) new SeriesExtensions.System\u002DCollections\u002DGeneric\u002DIEnumerable\u002DGetEnumerator <K, V>(), (IEnumerable <M0>)ListModule.Reverse <Tuple <K, V> >((FSharpList <M0>)ListModule.Zip <K, V>((FSharpList <M0>) this.keys, (FSharpList <M1>) this.values)))).GetEnumerator());
 }
Пример #3
0
        bool IDictionary <K, V> .Remove(K key)
        {
            FSharpList <Tuple <K, V> > fsharpList = (FSharpList <Tuple <K, V> >)ListModule.Filter <Tuple <K, V> >((FSharpFunc <M0, bool>) new SeriesExtensions.newPairs <K, V>(key), (FSharpList <M0>)ListModule.Zip <K, V>((FSharpList <M0>) this.keys, (FSharpList <M1>) this.values));
            bool flag = fsharpList.get_Length() < this.keys.get_Length();

            this.keys   = (FSharpList <K>)ListModule.Map <Tuple <K, V>, K>((FSharpFunc <M0, M1>) new SeriesExtensions.System\u002DCollections\u002DGeneric\u002DIDictionary\u002DRemove <K, V>(), (FSharpList <M0>)fsharpList);
            this.values = (FSharpList <V>)ListModule.Map <Tuple <K, V>, V>((FSharpFunc <M0, M1>) new SeriesExtensions.System\u002DCollections\u002DGeneric\u002DIDictionary\u002DRemove <K, V>(), (FSharpList <M0>)fsharpList);
            return(flag);
        }
Пример #4
0
        public static FSharpOption <Tuple <FSharpOption <Bitmap>, string, FSharpList <Tuple <string, string> > > > EtiketParse(string path)
        {
            string txt    = File.ReadAllText(path, enc);
            Match  match  = regBar.Match(txt);
            Match  match2 = match;
            Match  match3 = match2;
            Match  n      = match3;

            if (n.Success)
            {
                Match  m      = match3;
                string barc   = m.Groups[1].Value;
                Match  match4 = regEtik.Match(txt);
                Match  match5 = match4;
                Match  match6 = match5;
                Match  l      = match6;
                if (l.Success)
                {
                    Match k = match6;
                    return(FSharpOption <Tuple <FSharpOption <Bitmap>, string, FSharpList <Tuple <string, string> > > > .Some(new Tuple <FSharpOption <Bitmap>, string, FSharpList <Tuple <string, string> > >(null, barc, ListModule.Zip(FSharpList <string> .Cons("mark", FSharpList <string> .Cons("sht", FSharpList <string> .Cons("pp", FSharpList <string> .Cons("fn", FSharpList <string> .Cons("rh", FSharpList <string> .Cons("posgr", FSharpList <string> .Cons("sideAndSize", FSharpList <string> .Cons("strSteelCart", FSharpList <string> .Cons("car", FSharpList <string> .Cons("sp", FSharpList <string> .Cons("customername", FSharpList <string> .Cons("orderitemname", FSharpList <string> .Cons("mon_comm", FSharpList <string> .Empty))))))))))))), ListModule.Tail(SeqModule.ToList(new EtiketParse_71(k, null, null, 0, null)))))));
                }
                Match match7 = regImp.Match(txt);
                Match match8 = match7;
                Match match9 = match8;
                Match j      = match9;
                if (j.Success)
                {
                    Match    i    = match9;
                    Bitmap   bmp  = new Bitmap(170, 170);
                    Graphics gr   = Graphics.FromImage(bmp);
                    Pen      pen  = new Pen(Color.Black, 2f);
                    Pen      penB = new Pen(Color.Black, 4f);
                    ListModule.Iterate(new EtiketParse_82_4(gr, pen, penB), SeqModule.ToList(new EtiketParse_81_5(txt, null, null, 0, null)));
                    ListModule.Iterate(new EtiketParse_99_9(gr), ListModule.Filter(new EtiketParse_98_10(), SeqModule.ToList(new EtiketParse_97_11(txt, null, null, 0, null))));
                    return(FSharpOption <Tuple <FSharpOption <Bitmap>, string, FSharpList <Tuple <string, string> > > > .Some(new Tuple <FSharpOption <Bitmap>, string, FSharpList <Tuple <string, string> > >(FSharpOption <Bitmap> .Some(bmp), barc, ListModule.Zip(FSharpList <string> .Cons("mark", FSharpList <string> .Cons("MarkBalka", FSharpList <string> .Cons("ColorCode", FSharpList <string> .Cons("SideBalka", FSharpList <string> .Cons("car", FSharpList <string> .Cons("strSteelCart", FSharpList <string> .Cons("PosGroup", FSharpList <string> .Cons("pp", FSharpList <string> .Cons("IsShtulp", FSharpList <string> .Cons("IsFalsh", FSharpList <string> .Empty)))))))))), ListModule.Tail(SeqModule.ToList(new EtiketParse_109_15(i, null, null, 0, null)))))));
                }
                return(null);
            }
            return(null);
        }