當前位置: 首頁>>代碼示例>>C#>>正文


C# Analyzer.putProblem方法代碼示例

本文整理匯總了C#中Analyzer.putProblem方法的典型用法代碼示例。如果您正苦於以下問題:C# Analyzer.putProblem方法的具體用法?C# Analyzer.putProblem怎麽用?C# Analyzer.putProblem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Analyzer的用法示例。


在下文中一共展示了Analyzer.putProblem方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: setAttrType

 private static void setAttrType(Analyzer analyzer, AttributeAccess attr, DataType targetType, DataType attrType)
 {
     if (targetType.isUnknownType())
     {
         analyzer.putProblem(attr, "Can't set attribute for UnknownType");
         return;
     }
     ISet<Binding> bs = targetType.Table.LookupAttribute(attr.FieldName.Name);
     if (bs != null)
     {
         analyzer.addRef(attr, targetType, bs);
     }
     targetType.Table.Insert(analyzer, attr.FieldName.Name, attr, attrType, BindingKind.ATTRIBUTE);
 }
開發者ID:uxmal,項目名稱:pytocs,代碼行數:14,代碼來源:State.cs

示例2: ReportUnpackMismatch

 private static void ReportUnpackMismatch(Analyzer analyzer, List<Exp> xs, int vsize)
 {
     int xsize = xs.Count;
     int beg = xs[0].Start;
     int end = xs[xs.Count - 1].End;
     int diff = xsize - vsize;
     string msg;
     if (diff > 0)
     {
         msg = "ValueError: need more than " + vsize + " values to unpack";
     }
     else
     {
         msg = "ValueError: too many values to unpack";
     }
     analyzer.putProblem(xs[0].Filename, beg, end, msg);
 }
開發者ID:uxmal,項目名稱:pytocs,代碼行數:17,代碼來源:State.cs

示例3: Bind

 public void Bind(Analyzer analyzer, List<Exp> xs, DataType rvalue, BindingKind kind)
 {
     if (rvalue is TupleType)
     {
         List<DataType> vs = ((TupleType) rvalue).eltTypes;
         if (xs.Count != vs.Count)
         {
             ReportUnpackMismatch(analyzer, xs, vs.Count);
         }
         else
         {
             for (int i = 0; i < xs.Count; i++)
             {
                 this.Bind(analyzer, xs[i], vs[i], kind);
             }
         }
     }
     else
     {
         if (rvalue is ListType)
         {
             Bind(analyzer, xs, ((ListType) rvalue).toTupleType(xs.Count), kind);
         }
         else if (rvalue is DictType)
         {
             Bind(analyzer, xs, ((DictType) rvalue).toTupleType(xs.Count), kind);
         }
         else if (rvalue.isUnknownType())
         {
             foreach (Exp x in xs)
             {
                 this.Bind(analyzer, x, DataType.Unknown, kind);
             }
         }
         else if (xs.Count > 0)
         {
             analyzer.putProblem(xs[0].Filename,
                     xs[0].Start,
                     xs[xs.Count - 1].End,
                     "unpacking non-iterable: " + rvalue);
         }
     }
 }
開發者ID:uxmal,項目名稱:pytocs,代碼行數:43,代碼來源:State.cs

示例4: BindIterator

 // iterator
 public void BindIterator(Analyzer analyzer, Exp target, Exp iter, DataType iterType, BindingKind kind)
 {
     if (iterType is ListType)
     {
         this.Bind(analyzer, target, ((ListType) iterType).eltType, kind);
     }
     else if (iterType is TupleType)
     {
         this.Bind(analyzer, target, ((TupleType) iterType).toListType().eltType, kind);
     }
     else
     {
         ISet<Binding> ents = iterType.Table.LookupAttribute("__iter__");
         if (ents != null)
         {
             foreach (Binding ent in ents)
             {
                 if (ent == null || !(ent.type is FunType))
                 {
                     if (!iterType.isUnknownType())
                     {
                         analyzer.putProblem(iter, "not an iterable type: " + iterType);
                     }
                     this.Bind(analyzer, target, DataType.Unknown, kind);
                 }
                 else
                 {
                     this.Bind(analyzer, target, ((FunType) ent.type).getReturnType(), kind);
                 }
             }
         }
         else
         {
             this.Bind(analyzer, target, DataType.Unknown, kind);
         }
     }
 }
開發者ID:uxmal,項目名稱:pytocs,代碼行數:38,代碼來源:State.cs


注:本文中的Analyzer.putProblem方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。