]> ocean-lang.org Git - ocean/blobdiff - csrc/indent_test.mdc
parsergen: allow $<1 to be used for structs as well as pointer.
[ocean] / csrc / indent_test.mdc
index 55a0fe65a468a9d7217e28fedc51852c36b401b5..540ecd22584868f832ac6b505b48b8088464ed0d 100644 (file)
@@ -154,7 +154,7 @@ $*statement
                | NEWLINE }
        Block -> Open Statementlist Close ${ $0 = $<2; }$
                | Open SimpleStatements } ${ $0 = $<2; }$
-               | : Statementlist ${ $0 = $2; $2 = NULL; }$
+               | : Statementlist ${ $0 = $<2; }$
 
        SimpleStatements -> SimpleStatements ; SimpleStatement ${
                        {
@@ -224,7 +224,7 @@ $*expression
                                $0->left = $<1;
                                $0->right = $<3;
                        }$
-                   | Term ${ $0 = $1; $1 = NULL; }$
+                   | Term ${ $0 = $<1; }$
        Term -> Term * Factor ${
                                $0 = calloc(1, sizeof(struct expression));
                                $0->op = $2.txt;
@@ -237,7 +237,7 @@ $*expression
                                $0->left = $<1;
                                $0->right = $<3;
                        }$
-             | Factor ${ $0 = $1; $1 = NULL; }$
+             | Factor ${ $0 = $<1; }$
        Factor -> IDENTIFIER ${
                                $0 = calloc(1, sizeof(struct expression));
                                $0->op = $1.txt;