private ITreeRange AdjustStatement(ITreeRange range, IJavaScriptStatement statement) { var ifStatementByThen = IfStatementNavigator.GetByThen(statement); if (ifStatementByThen != null) { if (ifStatementByThen.Else == null) { return(new TreeRange(ifStatementByThen, ifStatementByThen)); } if (!_executing) { return(range); } ifStatementByThen.ReplaceBy(ifStatementByThen.Else); return(null); } var ifStatementByElse = IfStatementNavigator.GetByElse(statement); if (ifStatementByElse != null) { if (ifStatementByElse.Then == null) { return(new TreeRange(ifStatementByElse, ifStatementByElse)); } if (!_executing) { return(range); } ifStatementByElse.SetElse(null); return(null); } var doStatement = DoStatementNavigator.GetByStatement(statement); if (doStatement != null) { return(new TreeRange(doStatement, doStatement)); } var whileStatement = WhileStatementNavigator.GetByStatement(statement); if (whileStatement != null) { return(new TreeRange(whileStatement, whileStatement)); } var forStatement = ForStatementNavigator.GetByStatement(statement); if (forStatement != null) { return(new TreeRange(forStatement, forStatement)); } var foreachStatement = ForeachStatementNavigator.GetByStatement(statement); if (foreachStatement != null) { return(new TreeRange(foreachStatement, foreachStatement)); } var withStatement = WithStatementNavigator.GetByStatement(statement); if (withStatement != null) { return(new TreeRange(withStatement, withStatement)); } return(range); }
private ITreeRange AdjustStatement(ITreeRange range, IJavaScriptStatement statement) { var ifStatementByThen = IfStatementNavigator.GetByThen(statement); if (ifStatementByThen != null) { if (ifStatementByThen.Else == null) return new TreeRange(ifStatementByThen, ifStatementByThen); if (!_executing) return range; ifStatementByThen.ReplaceBy(ifStatementByThen.Else); return null; } var ifStatementByElse = IfStatementNavigator.GetByElse(statement); if (ifStatementByElse != null) { if (ifStatementByElse.Then == null) return new TreeRange(ifStatementByElse, ifStatementByElse); if (!_executing) return range; ifStatementByElse.SetElse(null); return null; } var doStatement = DoStatementNavigator.GetByStatement(statement); if (doStatement != null) return new TreeRange(doStatement, doStatement); var whileStatement = WhileStatementNavigator.GetByStatement(statement); if (whileStatement != null) return new TreeRange(whileStatement, whileStatement); var forStatement = ForStatementNavigator.GetByStatement(statement); if (forStatement != null) return new TreeRange(forStatement, forStatement); var foreachStatement = ForeachStatementNavigator.GetByStatement(statement); if (foreachStatement != null) return new TreeRange(foreachStatement, foreachStatement); var withStatement = WithStatementNavigator.GetByStatement(statement); if (withStatement != null) return new TreeRange(withStatement, withStatement); return range; }