]> ocean-lang.org Git - ocean/blobdiff - csrc/oceani.mdc
oceani: fix parsing of error in struct field.
[ocean] / csrc / oceani.mdc
index 3dbe0b19340f4a73fab60591bedc42768385e2cd..2f3c9731e9ed703ad095a954855bd85cd43c20e7 100644 (file)
@@ -2470,13 +2470,13 @@ with a const size by whether they are prepared at parse time or not.
                        return 0;
                if (have->array.unspec && require->array.unspec &&
                    have->array.size != require->array.size)
-                       return 0;       // UNTESTED
+                       return 0;       // NOTEST
                if (have->array.unspec || require->array.unspec)
                        return 1;
                if (require->array.vsize == NULL && have->array.vsize == NULL)
                        return require->array.size == have->array.size;
 
-               return require->array.vsize == have->array.vsize;       // UNTESTED
+               return require->array.vsize == have->array.vsize;
        }
 
        static void array_print_type(struct type *type, FILE *f)
@@ -2969,10 +2969,17 @@ function will be needed.
        | SimpleFieldList EOL ${ $0 = $<SFL; }$
 
        FieldLines -> SimpleFieldList Newlines ${ $0 = $<SFL; }$
-       | FieldLines SimpleFieldList Newlines ${
-               $SFL->prev = $<FL;
-               $0 = $<SFL;
-       }$
+       | FieldLines SimpleFieldList Newlines ${ {
+               struct fieldlist *f = $<SFL;
+
+               if (f) {
+                       $0 = f;
+                       while (f->prev)
+                               f = f->prev;
+                       f->prev = $<FL;
+               } else
+                       $0 = $<FL;
+       } }$
 
        SimpleFieldList -> Field ${ $0 = $<F; }$
        | SimpleFieldList ; Field ${