diff parser/Action.d @ 49:c7cde6af0095 new_gen

Seperated the AST from LLVM * Changed SmallArray sligthly * Added a NullAction that doesn't do anything
author Anders Halager <halager@gmail.com>
date Sat, 26 Apr 2008 13:15:37 +0200
parents b6c1dc30ca4b
children c96cdcbdb9d6
line wrap: on
line diff
--- a/parser/Action.d	Thu Apr 24 19:42:53 2008 +0200
+++ b/parser/Action.d	Sat Apr 26 13:15:37 2008 +0200
@@ -244,6 +244,13 @@
 }
 
 /**
+  Doesn't do anything at all - can be used for benchmarking the parser.
+ */
+class NullAction : Action
+{
+}
+
+/**
   This class implements the default actions for Dang, by building up an AST
   with the data needed in a compiler.
  */
@@ -277,9 +284,8 @@
     // -- Statements --
     override StmtT actOnCompoundStmt(ref Token l, ref Token r, StmtT[] stmts)
     {
-        StmtT[] array = stmts.dup;
-        Stmt[] statements = cast(Stmt[])array;
-        return new CompoundStatement(statements);
+        Stmt[] statements = cast(Stmt[])stmts;
+        return new CompoundStatement(statements.dup);
     }
 
     override StmtT actOnExprStmt(ExprT exp)