]> ocean-lang.org Git - ocean/commitdiff
oceani: test UNTESTED parsing of structures
authorNeilBrown <neil@brown.name>
Sat, 18 Dec 2021 10:36:41 +0000 (21:36 +1100)
committerNeilBrown <neil@brown.name>
Sat, 18 Dec 2021 10:36:41 +0000 (21:36 +1100)
Signed-off-by: NeilBrown <neil@brown.name>
csrc/oceani-tests.mdc
csrc/oceani.mdc

index fdf55038638216831a5ab2161cb57d13044fbe37..0b7c76a726ca8ecc66ee4d68efb9f6f09dc43728 100644 (file)
@@ -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
 
index f5e2b6ea9707c19c0638ecb8962373de2a443723..6723b1416fec85197661345e7ab985387e9bf59a 100644 (file)
@@ -2963,12 +2963,10 @@ function will be needed.
        } }$
 
        $*fieldlist
-       FieldBlock -> { IN OptNL FieldLines OUT OptNL } ${ $0 = $<FL;   // UNTESTED
-               }$
+       FieldBlock -> { IN OptNL FieldLines OUT OptNL } ${ $0 = $<FL; }$
        | { SimpleFieldList } ${ $0 = $<SFL; }$
        | IN OptNL FieldLines OUT ${ $0 = $<FL; }$
-       | SimpleFieldList EOL ${ $0 = $<SFL;    // UNTESTED
-               }$
+       | SimpleFieldList EOL ${ $0 = $<SFL; }$
 
        FieldLines -> SimpleFieldList Newlines ${ $0 = $<SFL; }$
        | FieldLines SimpleFieldList Newlines ${ {