From c149917d5ddbdc64113f429a6c9c531fdc47c450 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Sat, 18 Dec 2021 21:36:41 +1100 Subject: [PATCH] oceani: test UNTESTED parsing of structures Signed-off-by: NeilBrown --- csrc/oceani-tests.mdc | 7 +++++++ csrc/oceani.mdc | 6 ++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/csrc/oceani-tests.mdc b/csrc/oceani-tests.mdc index fdf5503..0b7c76a 100644 --- a/csrc/oceani-tests.mdc +++ b/csrc/oceani-tests.mdc @@ -609,6 +609,11 @@ Time to test if structure declarations and accesses work correctly. active:Boolean = True struct baz { a:number; b:Boolean; } + struct bat { + a:string + b:Boolean + } + struct bat2 a:string; b:Boolean func main do @@ -629,6 +634,8 @@ Time to test if structure declarations and accesses work correctly. for i:=0; then i=i+1; while i < 4: print info[i].name, info[i].active, info[i].size[0] info[0].thing.b = True + x:bat + x.a = "Hello" ###### output: structs diff --git a/csrc/oceani.mdc b/csrc/oceani.mdc index f5e2b6e..6723b14 100644 --- a/csrc/oceani.mdc +++ b/csrc/oceani.mdc @@ -2963,12 +2963,10 @@ function will be needed. } }$ $*fieldlist - FieldBlock -> { IN OptNL FieldLines OUT OptNL } ${ $0 = $ { IN OptNL FieldLines OUT OptNL } ${ $0 = $ SimpleFieldList Newlines ${ $0 = $