internal VccMatchCase MakeCopyFor(VccMatchStatement stmt) { if (stmt == this.containingMatchStatement) { return(this); } return(new VccMatchCase(stmt, this)); }
public void SetContainingMatchStatement(VccMatchStatement stmt) { this.containingMatchStatement = stmt; if (this.pattern != null) { this.pattern.SetContainingExpression(new DummyExpression(stmt.Block, SourceDummy.SourceLocation)); } Body.SetContainingBlock(stmt.Block); }
private VccMatchCase(VccMatchStatement stmt, VccMatchCase template) : base(template.sourceLocation) { this.containingMatchStatement = stmt; this._body = (BlockStatement)template.Body.MakeCopyFor(stmt.Block); if (template.pattern != null) { this.pattern = template.pattern.MakeCopyFor(stmt.Block); } }
private VccMatchStatement(BlockStatement containingBlock, VccMatchStatement template) : base(containingBlock, template) { var cases = new List <VccMatchCase>(); foreach (var cs in template.cases) { cases.Add(cs.MakeCopyFor(this)); } cases.TrimExcess(); this.cases = cases; this.expression = template.expression.MakeCopyFor(containingBlock); }
private VccMatchStatement(BlockStatement containingBlock, VccMatchStatement template) : base(containingBlock, template) { var cases = new List<VccMatchCase>(); foreach (var cs in template.cases) cases.Add(cs.MakeCopyFor(this)); cases.TrimExcess(); this.cases = cases; this.expression = template.expression.MakeCopyFor(containingBlock); }
internal VccMatchCase MakeCopyFor(VccMatchStatement stmt) { if (stmt == this.containingMatchStatement) return this; return new VccMatchCase(stmt, this); }
private VccMatchCase(VccMatchStatement stmt, VccMatchCase template) : base(template.sourceLocation) { this.containingMatchStatement = stmt; this._body = (BlockStatement)template.Body.MakeCopyFor(stmt.Block); if (template.pattern != null) this.pattern = template.pattern.MakeCopyFor(stmt.Block); }