示例#1
0
 public override SyntaxNode Visit(WhileSyntax pNode)
 {
     using (new MetadataCache.LocalScope())
     {
         return(base.Visit(pNode));
     }
 }
示例#2
0
 protected override void VisitWhileSyntax(WhileSyntax pNode)
 {
     if (!CanCast(pNode.Condition.Type, SmallTypeCache.Boolean))
     {
         CompilerErrors.TypeCastError(pNode.Condition.Type, SmallTypeCache.Boolean, pNode.Condition.Span);
     }
     base.VisitWhileSyntax(pNode);
 }
 protected override void VisitWhileSyntax(WhileSyntax pNode)
 {
     _locals.AddScope();
     Visit(pNode.Condition);
     using (var iw = Store.AddValue("CanBreak", true))
     {
         _breakCount++;
         Visit(pNode.Body);
         _breakCount--;
     }
     _locals.RemoveScope();
 }
示例#4
0
        public override void Visit(WhileSyntax pNode)
        {
            if (pNode.Condition.Type == SmallType.Undefined)
            {
                Compiler.ReportError(CompilerErrorType.UndefinedType, pNode);
            }
            else
            {
                if (!SmallType.Boolean.IsAssignableFrom(pNode.Condition.Type))
                {
                    Compiler.ReportError(CompilerErrorType.TypeMismatch, pNode, SmallType.Boolean.ToString(), pNode.Condition.Type.ToString());
                }
            }

            base.Visit(pNode);
        }
示例#5
0
 protected virtual void VisitWhileSyntax(WhileSyntax pNode)
 {
     Visit(pNode.Condition);
     Visit(pNode.Body);
 }
 protected override void VisitWhileSyntax(WhileSyntax pNode)
 {
     TrySetImplicitCastType(pNode.Condition, SmallTypeCache.Boolean);
     base.VisitWhileSyntax(pNode);
 }
示例#7
0
 protected virtual SyntaxNode VisitWhileSyntax(WhileSyntax pNode)
 {
     return(SyntaxFactory.While(Visit(pNode.Condition), (BlockSyntax)Visit(pNode.Body)));
 }