Mercurial > projects > dil
diff trunk/src/dil/ast/Node.d @ 673:64fec49651cf
Renamed VariableDeclaration to VariablesDeclaration.
Removed TryCast and CastTo template functions.
Renamed Node.iS() to Node.Is().
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Fri, 18 Jan 2008 16:44:20 +0100 |
parents | f1325a4506de |
children | c4e3a34e40f1 |
line wrap: on
line diff
--- a/trunk/src/dil/ast/Node.d Fri Jan 18 00:30:14 2008 +0100 +++ b/trunk/src/dil/ast/Node.d Fri Jan 18 16:44:20 2008 +0100 @@ -12,20 +12,6 @@ /// This string is mixed into the constructor of a class that inherits from Node. const string set_kind = `this.kind = mixin("NodeKind." ~ typeof(this).stringof);`; -Class TryCast(Class)(Node n) -{ - assert(n !is null); - if (n.kind == mixin("NodeKind." ~ typeof(Class).stringof)) - return cast(Class)cast(void*)n; - return null; -} - -Class CastTo(Class)(Node n) -{ - assert(n !is null && n.kind == mixin("NodeKind." ~ typeof(Class).stringof)); - return cast(Class)cast(void*)n; -} - class Node { NodeCategory category; @@ -79,7 +65,7 @@ children is null || addChildren(children); } - Class iS(Class)() + Class Is(Class)() { if (kind == mixin("NodeKind." ~ typeof(Class).stringof)) return cast(Class)cast(void*)this;