From: NeilBrown Date: Sun, 16 Jun 2019 01:37:03 +0000 (+1000) Subject: oceani: re-indent DeclareStruct X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=commitdiff_plain;h=f393f23988d53a2ae8a12043b3981ce8030c4f1e oceani: re-indent DeclareStruct It wasn't indented to easily allow alternate productions. Signed-off-by: NeilBrown --- diff --git a/csrc/oceani.mdc b/csrc/oceani.mdc index af7768d..4f00438 100644 --- a/csrc/oceani.mdc +++ b/csrc/oceani.mdc @@ -2001,24 +2001,24 @@ function will be needed. ###### 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 -> {