]> ocean-lang.org Git - ocean/blobdiff - csrc/indent_test.mdc
indent_test: reduce stack usage for preceding NEWLINEs
[ocean] / csrc / indent_test.mdc
index 7e4f95627a57096a6c1982a960330916a9171145..7b5fe5ccc5769281242cf53b4d98a0b54b4674bb 100644 (file)
@@ -138,8 +138,10 @@ with complete bracketing and indenting.
 Program -> Statementlist ${ print_statement($1, 0); }$
 
 $*statement
+       Newlines -> NEWLINE
+               | Newlines NEWLINE
        Statementlist ->  Statements ${ $0 = $<1; }$
-               | NEWLINE Statementlist ${ $0 = $<2; }$
+               | Newlines Statements ${ $0 = $<2; }$
 
        Statements -> Statements Statement ${
                                {
@@ -155,9 +157,9 @@ $*statement
                        | ERROR ${ printf("statement ERROR\n"); $0 = NULL; }$
 
        Open -> {
-               | NEWLINE Open
+               | Newlines {
        Close -> }
-               | NEWLINE Close
+               | Newlines }
        Block -> Open Statementlist Close ${ $0 = $<2; }$
                | Open SimpleStatements } ${ $0 = $<2; }$
                | : SimpleStatements ${ $0 = $<2; }$