예제 #1
0
 public override bool Walk(DelStatement node)
 {
     foreach (var expr in node.Expressions) {
         DefineExpr(expr);
     }
     return false;
 }
예제 #2
0
파일: Parser.cs 프로젝트: borota/JTVS
        // del_stmt: "del" target_list
        //  for error reporting reasons we allow any expression and then report the bad
        //  delete node when it fails.  This is the reason we don't call ParseTargetList.
        private Statement ParseDelStmt()
        {
            var curLookahead = _lookahead;
            NextToken();
            string delWhiteSpace = _tokenWhiteSpace;
            var start = GetStart();
            List<string> itemWhiteSpace;

            DelStatement ret;
            if (PeekToken(TokenKind.NewLine) || PeekToken(TokenKind.EndOfFile)) {
                ReportSyntaxError(curLookahead.Span.Start, curLookahead.Span.End, "expected expression after del");
                ret = new DelStatement(new Expression[0]);
            } else {
                List<Expression> l = ParseExprList(out itemWhiteSpace);
                foreach (Expression e in l) {
                    if (e is ErrorExpression) {
                        continue;
                    }
                    string delError = e.CheckDelete();
                    if (delError != null) {
                        ReportSyntaxError(e.StartIndex, e.EndIndex, delError, ErrorCodes.SyntaxError);
                    }
                }

                ret = new DelStatement(l.ToArray());
                if (itemWhiteSpace != null) {
                    AddListWhiteSpace(ret, itemWhiteSpace.ToArray());
                }
            }

            ret.SetLoc(start, GetEnd());
            if (_verbatim) {
                AddPreceedingWhiteSpace(ret, delWhiteSpace);
            }
            return ret;
        }
예제 #3
0
파일: FlowChecker.cs 프로젝트: borota/JTVS
 // DelStmt
 public override void PostWalk(DelStatement node)
 {
     foreach (Expression e in node.Expressions) {
         e.Walk(_fdel);
     }
 }
예제 #4
0
 public override bool Walk(DelStatement node)
 {
     UpdateChildRanges(node);
     return base.Walk(node);
 }
예제 #5
0
 // DelStatement
 public override bool Walk(DelStatement node)
 {
     return ShouldWalkWorker(node);
 }
예제 #6
0
 public override void PostWalk(DelStatement node)
 {
     PostWalkWorker(node);
 }