]> git.mdlowis.com Git - archive/dlang.git/commitdiff
Disabled support for macros
authorMike D. Lowis <mike@mdlowis.com>
Sun, 26 Feb 2012 19:51:22 +0000 (14:51 -0500)
committerMike D. Lowis <mike@mdlowis.com>
Sun, 26 Feb 2012 19:51:22 +0000 (14:51 -0500)
example.dl
source/dlparser/dlparser.cpp
source/dlparser/macro/param.c

index 785218fe8fdc143f838ba1bea4418f75071fdfea..0b8ff13b0a43db9954e6b74e8cb00974d9005af3 100644 (file)
@@ -5,11 +5,11 @@
 #% if ( cond, branch1:Block ) {
 #    exec_if( cond, branch1 )
 #}
-#
+
 #% ifelse ( cond, branch1:Block, branch2:Block ) {
 #    exec_if( cond, branch1, branch2 )
 #}
-#
+
 #% foreach ( lst, fn:Block ) {
 #    for_each(fn, lst)
 #}
@@ -42,7 +42,7 @@
 #------------------------------------------------------------------------------
 # Collection Access and Iteration Tests
 #------------------------------------------------------------------------------
-# Accessing elements of lists, vectors, and strings
+## Accessing elements of lists, vectors, and strings
 #lst1 = `(4,5,6)
 #print(lst1[0], " Hello, World!")
 #
 #------------------------------------------------------------------------------
 # Delayed Evaluation
 #------------------------------------------------------------------------------
-% delay ( exp ) {
-    make_promise({ exp })
-}
-
-% force ( prom ) {
-    force( prom )
-}
+#% delay ( exp ) {
+#    make_promise({ exp })
+#}
+#
+#% force ( prom ) {
+#    force( prom )
+#}
 
-foo = delay nonexistent_var + 1
-nonexistent_var = 19
-assert( typeof(foo) == Block )
-assert( typeof( force foo ) == Num )
-print( force( foo ), " Hello, World!" )
+#foo = delay nonexistent_var + 1
+#nonexistent_var = 19
+#assert( typeof(foo) == Block )
+#assert( typeof( force foo ) == Num )
+#print( force( foo ), " Hello, World!" )
 
 #------------------------------------------------------------------------------
 # Type Checking Tests
index 7692b8db38a9e64769f5434782860bcb4b663dc0..dd7886ba82de249e4445c2718e42b48f888dd379 100644 (file)
@@ -73,14 +73,14 @@ AST* DLParser::Expression(void)
         match(ASSIGN);
         ret = _new AST( ASSIGN, 2, id_node, Expression());
     }
-    else if( (lookaheadType(1) == MACRO) && (lookaheadType(2) == ID))
-    {
-        ret = MacroDefinition();
-    }
-    else if( isMacro( lookaheadToken(1) ) )
-    {
-        ret = MacroExpansion();
-    }
+    //else if( (lookaheadType(1) == MACRO) && (lookaheadType(2) == ID))
+    //{
+    //    ret = MacroDefinition();
+    //}
+    //else if( isMacro( lookaheadToken(1) ) )
+    //{
+    //    ret = MacroExpansion();
+    //}
     else
     {
         ret = LogicalExpr();
index 16f5164215051fa823e3aedccde125a80b7dfe2f..367c1183692348716a9330f19a987248b6afa392 100644 (file)
@@ -20,7 +20,10 @@ Param::Param(AST* param_def)
 
 Param::~Param()
 {
-    delete param_value;
+    if( param_value != NULL )
+    {
+        delete param_value;
+    }
 }
 
 std::string Param::name(void)