Browse Source

Fixed error caused by Root role.

Ok now I know why it needs to be there :)
newNRvisualizers
mike 14 years ago
parent
commit
4465839e98
  1. 7
      ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs
  2. 4
      ICSharpCode.NRefactory.CSharp/Ast/Roles.cs
  3. 2
      ICSharpCode.NRefactory/Role.cs

7
ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs

@ -35,6 +35,11 @@ namespace ICSharpCode.NRefactory.CSharp @@ -35,6 +35,11 @@ namespace ICSharpCode.NRefactory.CSharp
{
public abstract class AstNode : AbstractAnnotatable, PatternMatching.INode
{
/// <summary>
/// Root of an abstract syntax tree.
/// </summary>
public static readonly Role<AstNode> Root = new Role<AstNode> ("Root");
#region Null
public static readonly AstNode Null = new NullAstNode ();
@ -124,7 +129,7 @@ namespace ICSharpCode.NRefactory.CSharp @@ -124,7 +129,7 @@ namespace ICSharpCode.NRefactory.CSharp
AstNode nextSibling;
AstNode firstChild;
AstNode lastChild;
Role role = Roles.Root;
Role role = Root;
public abstract NodeType NodeType {
get;

4
ICSharpCode.NRefactory.CSharp/Ast/Roles.cs

@ -30,10 +30,6 @@ namespace ICSharpCode.NRefactory.CSharp @@ -30,10 +30,6 @@ namespace ICSharpCode.NRefactory.CSharp
{
public static class Roles
{
/// <summary>
/// Root of an abstract syntax tree.
/// </summary>
public static readonly Role<AstNode> Root = new Role<AstNode> ("Root");
// some pre defined constants for common roles
public static readonly Role<Identifier> Identifier = new Role<Identifier> ("Identifier", CSharp.Identifier.Null);

2
ICSharpCode.NRefactory/Role.cs

@ -70,6 +70,8 @@ namespace ICSharpCode.NRefactory @@ -70,6 +70,8 @@ namespace ICSharpCode.NRefactory
{
if (name == null)
throw new ArgumentNullException("name");
if (nullObject == null)
throw new ArgumentNullException ("nullObject");
this.nullObject = nullObject;
this.name = name;
}

Loading…
Cancel
Save