예제 #1
0
 private TypeCtorSig(ParsingContext ctx, string name, string[] pList, LexLocation lexLocation)
 {
     Name                  = name;
     ParamList             = pList;
     Loc                   = lexLocation;
     _definingTypeAsTyExpr = TyQName.Create(Name, Loc, ctx);
     if (ParamList.Length > 0)
     {
         ListTypeExpr pLst = new ListTypeExpr();
         foreach (var pNm in ParamList)
         {
             //TODO improve location of parameter
             pLst.AddLast(TyQName.Create(pNm, Loc, ctx));
         }
         _definingTypeAsTyExpr = new TyApp(_definingTypeAsTyExpr, pLst, Loc, ctx);
     }
 }
        private TypeExpr DefiningCtorAsShape()
        {
            var bTy = TyQName.Create(_definingCtor.Name, _definingCtor.Loc, this);

            if (_definingCtor.ParamList.Length <= 0)
            {
                return(bTy);
            }
            var pLst = new ListTypeExpr();

            foreach (var pNm in _definingCtor.ParamList)
            {
                pLst.AddLast(new MetaTypVar(this));
            }
            bTy = new TyApp(bTy, pLst, _definingCtor.Loc, this);
            return(bTy);
        }