]> ocean-lang.org Git - ocean/commitdiff
oceani: last fixes for UNTESTED for now.
authorNeilBrown <neil@brown.name>
Sat, 18 Dec 2021 11:00:48 +0000 (22:00 +1100)
committerNeilBrown <neil@brown.name>
Sat, 18 Dec 2021 11:00:48 +0000 (22:00 +1100)
I still don't get 100% due to some case labels which gcov think are not
tested, but I don't understand why.

Signed-off-by: NeilBrown <neil@brown.name>
csrc/oceani-tests.mdc
csrc/oceani.mdc

index d2628815b35d190dc8ff70182cb7351a5f2a29ae..fafb78821b76d5d1891cf1a630ad8896ef918a11 100644 (file)
@@ -295,6 +295,19 @@ Now we need to test if/else and some different loops
                else
                        print 'larger'
 
+               // different parsing options
+               for {
+                       x:=1; sum := 0
+               } then {
+                       x = x + 1
+               } while {
+                       use x < 10 
+               } do {
+                       sum = sum + x
+               } case 1 {
+                       print "impossible"
+               }
+
 ###### output: cond_loop
        Success
         1 2 4 8 16 32 64
index cd37f1b8b8766eeb8371bb9ec5171a34cdc70e0a..9d6aec94e566edb0e55de42ad7001aa5715b8d2f 100644 (file)
@@ -1157,7 +1157,7 @@ A separate function encoding these cases will simplify some code later.
        {
                int cmp;
                if (tl != tr)
-                       return tl - tr; // NOTEST
+                       return tl - tr;
                switch (tl->vtype) {
                case Vlabel: cmp = left->label == right->label ? 0 : 1; break;
                case Vnum: cmp = mpq_cmp(left->num, right->num); break;
@@ -4557,20 +4557,17 @@ the common header for all reductions to use.
                }$
        |        IN OptNL Statementlist OUT ${ $0 = $<Sl; }$
 
-       OpenBlock -> OpenScope { IN OptNL Statementlist OUT OptNL } ${ $0 = $<Sl;       // UNTESTED
-               }$
+       OpenBlock -> OpenScope { IN OptNL Statementlist OUT OptNL } ${ $0 = $<Sl; }$
        |        OpenScope { SimpleStatements } ${ $0 = reorder_bilist($<SS); }$
        |        OpenScope SimpleStatements ; ${ $0 = reorder_bilist($<SS); }$
        |        OpenScope SimpleStatements EOL ${ $0 = reorder_bilist($<SS); }$
        |        IN OpenScope OptNL Statementlist OUT ${ $0 = $<Sl; }$
 
-       UseBlock -> { OpenScope IN OptNL Statementlist OUT OptNL } ${ $0 = $<Sl;        // UNTESTED
-               }$
+       UseBlock -> { IN OpenScope OptNL Statementlist OUT OptNL } ${ $0 = $<Sl; }$
        |        { OpenScope SimpleStatements } ${ $0 = reorder_bilist($<SS); }$
        |        IN OpenScope OptNL Statementlist OUT ${ $0 = $<Sl; }$
 
-       ColonBlock -> { IN OptNL Statementlist OUT OptNL } ${ $0 = $<Sl;        // UNTESTED
-               }$
+       ColonBlock -> { IN OptNL Statementlist OUT OptNL } ${ $0 = $<Sl; }$
        |        { SimpleStatements } ${ $0 = reorder_bilist($<SS); }$
        |        : SimpleStatements ; ${ $0 = reorder_bilist($<SS); }$
        |        : SimpleStatements EOL ${ $0 = reorder_bilist($<SS); }$