示例#1
0
 // ExecStatement
 public override bool Walk(ExecStatement node)
 {
     if (node.Locals == null && node.Globals == null)
     {
         Debug.Assert(_currentScope != null);
         _currentScope.ContainsUnqualifiedExec = true;
     }
     return(true);
 }
示例#2
0
        public override void PostWalk(ExecStatement node)
        {
            if (node.NeedsLocalsDictionary())
            {
                _currentScope.NeedsLocalsDictionary = true;
            }

            if (node.Locals == null)
            {
                _currentScope.HasLateBoundVariableSets = true;
            }
        }
示例#3
0
 public override bool Walk(ExecStatement node) {
     CanComplete = IsActualExpression(node.Code);
     CommitByDefault = true;
     return base.Walk(node);
 }
示例#4
0
        public override void PostWalk(ExecStatement node) {
            if (node.NeedsLocalsDictionary()) {
                _currentScope.NeedsLocalsDictionary = true;
            }

            if (node.Locals == null) {
                _currentScope.HasLateBoundVariableSets = true;
            }
        }
示例#5
0
文件: Parser.cs 项目: omnimark/PTVS
 //exec_stmt: 'exec' expr ['in' expression [',' expression]]
 private ExecStatement ParseExecStmt() {
     Eat(TokenKind.KeywordExec);
     string execWhiteSpace = _tokenWhiteSpace;
     var start = GetStart();
     Expression code, locals = null, globals = null;
     code = ParseExpr();
     string inWhiteSpace = null, commaWhiteSpace = null;
     if (MaybeEat(TokenKind.KeywordIn)) {
         inWhiteSpace = _tokenWhiteSpace;
         globals = ParseExpression();
         if (MaybeEat(TokenKind.Comma)) {
             commaWhiteSpace = _tokenWhiteSpace;
             locals = ParseExpression();
         }
     }
     var codeTuple = code as TupleExpression;
     if (_langVersion.Is2x() && codeTuple != null) {
         if (codeTuple.Items != null) {
             if (codeTuple.Items.Count >= 3) {
                 locals = codeTuple.Items[2];
             }
             if (codeTuple.Items.Count >= 2) {
                 globals = codeTuple.Items[1];
             }
             if (codeTuple.Items.Count >= 1) {
                 code = codeTuple.Items[0];
             }
         }
     }
     ExecStatement ret = new ExecStatement(code, locals, globals);
     if (_verbatim) {
         AddPreceedingWhiteSpace(ret, execWhiteSpace);
         AddSecondPreceedingWhiteSpace(ret, inWhiteSpace);
         AddThirdPreceedingWhiteSpace(ret, commaWhiteSpace);
     }
     ret.SetLoc(start, GetEnd());
     return ret;
 }
示例#6
0
 // ExecStatement
 public override bool Walk(ExecStatement node) {
     if (node.Locals == null && node.Globals == null) {
         Debug.Assert(_currentScope != null);
         _currentScope.ContainsUnqualifiedExec = true;
     }
     return true;
 }
示例#7
0
        public override bool Walk(ExecStatement node) {
            UpdateLineInfo(node);

            return base.Walk(node);
        }
示例#8
0
 public override bool Walk(ExecStatement node) {
     UpdateChildRanges(node);
     return base.Walk(node);
 }
示例#9
0
 public override void PostWalk(ExecStatement node) { PostWalkWorker(node); }
示例#10
0
 // ExecStatement
 public override bool Walk(ExecStatement node) { return ShouldWalkWorker(node); }