]> ocean-lang.org Git - ocean/blobdiff - csrc/oceani.mdc
oceani: fix parsing of error in struct field.
[ocean] / csrc / oceani.mdc
index 0778da21115f81acb7018fdd3bae8655e0af7428..2f3c9731e9ed703ad095a954855bd85cd43c20e7 100644 (file)
@@ -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 ${