public override void AugmentAssign(AugmentedAssignStatement node, AnalysisUnit unit, INamespaceSet value) { _original.AugmentAssign(node, unit, value); }
// expr_stmt: expression_list // expression_list: expression ( "," expression )* [","] // assignment_stmt: (target_list "=")+ (expression_list | yield_expression) // augmented_assignment_stmt ::= target augop (expression_list | yield_expression) // augop: '+=' | '-=' | '*=' | '/=' | '%=' | '**=' | '>>=' | '<<=' | '&=' | '^=' | '|=' | '//=' private Statement ParseExprStmt() { Expression ret = ParseTestListAsExpr(); if (PeekToken(TokenKind.Assign)) { if (_langVersion >= JLanguageVersion.V30) { SequenceExpression seq = ret as SequenceExpression; bool hasStar = false; if (seq != null) { for (int i = 0; i < seq.Items.Count; i++) { if (seq.Items[i] is StarredExpression) { if (hasStar) { ReportSyntaxError(seq.Items[i].StartIndex, seq.Items[i].EndIndex, "two starred expressions in assignment"); } hasStar = true; } } } } return FinishAssignments(ret); } else { JOperator op = GetAssignOperator(PeekToken()); if (op != JOperator.None) { NextToken(); string whiteSpace = _tokenWhiteSpace; Expression rhs; if (_langVersion >= JLanguageVersion.V71 && MaybeEat(TokenKind.KeywordYield)) { rhs = ParseYieldExpression(); } else { rhs = ParseTestListAsExpr(); } string assignError = ret.CheckAugmentedAssign(); if (assignError != null) { ReportSyntaxError(ret.StartIndex, ret.EndIndex, assignError); } AugmentedAssignStatement aug = new AugmentedAssignStatement(op, ret, rhs); if (_verbatim) { AddPreceedingWhiteSpace(aug, whiteSpace); } aug.SetLoc(ret.StartIndex, GetEnd()); return aug; } else { Statement stmt = new ExpressionStatement(ret); stmt.SetLoc(ret.IndexSpan); return stmt; } } }
public override void AugmentAssign(AugmentedAssignStatement node, AnalysisUnit unit, INamespaceSet value) { foreach (var member in _members) { member.AugmentAssign(node, unit, value); } }
public override void PostWalk(AugmentedAssignStatement node) { node.Left.Walk(_fdef); }
// AugAssignStmt public override bool Walk(AugmentedAssignStatement node) { return true; }
public override bool Walk(AugmentedAssignStatement node) { DefineExpr(node.Left); node.Right.Walk(this); return false; }
public override bool Walk(AugmentedAssignStatement node) { UpdateChildRanges(node); return base.Walk(node); }
// AugmentedAssignStatement public override bool Walk(AugmentedAssignStatement node) { return ShouldWalkWorker(node); }
public override void PostWalk(AugmentedAssignStatement node) { PostWalkWorker(node); }
/// <summary> /// Performs an augmented assignment propagating the value into the object. /// </summary> public static void AugmentAssign(this INamespaceSet self, AugmentedAssignStatement node, AnalysisUnit unit, INamespaceSet value) { foreach (var ns in self) { ns.AugmentAssign(node, unit, value); } }