If there is an error - we violated our segments.
Signed-off-by: NeilBrown <neil@brown.name>
struct foo
a: number
- b:string = "hello"
+ b:string = "hello"; d:Boolean
func main()
c := "hello"
b:string
struct foo
c:number
+ x:[5]:string
###### output: type_err5
.tmp.code:8:7: error: type already declared: foo
.tmp.code:2:7: info: this is location of declartion: foo
+ .tmp.code:10:13: Syntax error in struct field: :
.tmp.code:5:7: error: type has recursive definition: baz
.tmp.code:2:7: error: type has recursive definition: foo
| 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 ${