void ITreeWalker.Visit(MatchStatement statement) { statement.Validate(this); InsertMatch(() => statement.Reference.Accept(this), () => { _loops.Push(true); statement.Cases.Accept(this); _loops.Pop(); }); }
void ITreeWalker.Visit(MatchStatement statement) { var name = "^~#" + _loops.Count; statement.Validate(this); statement.Reference.Accept(this); _operations.Add(new SetsOperation(name)); InsertJump(_operations.Count + 1); var jumpToEnd = InsertMarker(); _loops.Push(new LoopInfo { Break = jumpToEnd, Continue = jumpToEnd }); statement.Cases.Accept(this); _loops.Pop(); var end = _operations.Count; _operations.Add(new DelVarOperation(name)); _operations.Add(PopOperation.Instance); InsertJump(jumpToEnd, end - 1); }
void ITreeWalker.Visit(MatchStatement statement) { statement.Validate(this); statement.Reference.Accept(this); statement.Cases.Accept(this); }