]> ocean-lang.org Git - ocean/commitdiff
oceani: re-indent DeclareStruct
authorNeilBrown <neil@brown.name>
Sun, 16 Jun 2019 01:37:03 +0000 (11:37 +1000)
committerNeilBrown <neil@brown.name>
Sun, 16 Jun 2019 02:06:06 +0000 (12:06 +1000)
It wasn't indented to easily allow alternate productions.

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

index af7768dd1d763638d5142987c895d108d2a9f0a1..4f00438c08bf3d844377e89da5cd2f8d4ef79696 100644 (file)
@@ -2001,24 +2001,24 @@ function will be needed.
 
 ###### top level grammar
        DeclareStruct -> struct IDENTIFIER FieldBlock ${ {
 
 ###### top level grammar
        DeclareStruct -> struct IDENTIFIER FieldBlock ${ {
-               struct type *t =
-                       add_type(c, $2.txt, &structure_prototype);
-               int cnt = 0;
-               struct fieldlist *f;
-
-               for (f = $3; f; f=f->prev)
-                       cnt += 1;
-
-               t->structure.nfields = cnt;
-               t->structure.fields = calloc(cnt, sizeof(struct field));
-               f = $3;
-               while (cnt > 0) {
-                       cnt -= 1;
-                       t->structure.fields[cnt] = f->f;
-                       f->f.init = val_prepare(Tnone);
-                       f = f->prev;
-               }
-       } }$
+                       struct type *t =
+                               add_type(c, $2.txt, &structure_prototype);
+                       int cnt = 0;
+                       struct fieldlist *f;
+
+                       for (f = $3; f; f=f->prev)
+                               cnt += 1;
+
+                       t->structure.nfields = cnt;
+                       t->structure.fields = calloc(cnt, sizeof(struct field));
+                       f = $3;
+                       while (cnt > 0) {
+                               cnt -= 1;
+                               t->structure.fields[cnt] = f->f;
+                               f->f.init = val_prepare(Tnone);
+                               f = f->prev;
+                       }
+               } }$
 
        $void
        Open -> {
 
        $void
        Open -> {