Browse Source

Change "catch if" to "catch when"

pull/728/head
Daniel Grunwald 11 years ago
parent
commit
b6efbcba49
  1. 8
      NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/TryCatchStatement.cs
  2. 2
      NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpOutputVisitor.cs

8
NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/TryCatchStatement.cs

@ -90,8 +90,8 @@ namespace ICSharpCode.NRefactory.CSharp
public class CatchClause : AstNode public class CatchClause : AstNode
{ {
public static readonly TokenRole CatchKeywordRole = new TokenRole ("catch"); public static readonly TokenRole CatchKeywordRole = new TokenRole ("catch");
public static readonly TokenRole IfKeywordRole = IfElseStatement.IfKeywordRole; public static readonly TokenRole WhenKeywordRole = new TokenRole ("when");
public static readonly Role<Expression> ConditionRole = IfElseStatement.ConditionRole; public static readonly Role<Expression> ConditionRole = Roles.Condition;
#region Null #region Null
public new static readonly CatchClause Null = new NullCatchClause (); public new static readonly CatchClause Null = new NullCatchClause ();
@ -214,8 +214,8 @@ namespace ICSharpCode.NRefactory.CSharp
get { return GetChildByRole (Roles.RPar); } get { return GetChildByRole (Roles.RPar); }
} }
public CSharpTokenNode IfToken { public CSharpTokenNode WhenToken {
get { return GetChildByRole (IfKeywordRole); } get { return GetChildByRole (WhenKeywordRole); }
} }
public Expression Condition { public Expression Condition {

2
NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpOutputVisitor.cs

@ -1677,7 +1677,7 @@ namespace ICSharpCode.NRefactory.CSharp
} }
if (!catchClause.Condition.IsNull) { if (!catchClause.Condition.IsNull) {
Space(); Space();
WriteKeyword(CatchClause.IfKeywordRole); WriteKeyword(CatchClause.WhenKeywordRole);
Space(policy.SpaceBeforeIfParentheses); Space(policy.SpaceBeforeIfParentheses);
LPar(); LPar();
Space(policy.SpacesWithinIfParentheses); Space(policy.SpacesWithinIfParentheses);

Loading…
Cancel
Save