public override bool Walk(DelStatement node) { foreach (var expr in node.Expressions) { DefineExpr(expr); } return false; }
// 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; }
// DelStmt public override void PostWalk(DelStatement node) { foreach (Expression e in node.Expressions) { e.Walk(_fdel); } }
public override bool Walk(DelStatement node) { UpdateChildRanges(node); return base.Walk(node); }
// DelStatement public override bool Walk(DelStatement node) { return ShouldWalkWorker(node); }
public override void PostWalk(DelStatement node) { PostWalkWorker(node); }