Rewrote parser test case input files

This commit is contained in:
Sasha Koshka 2022-09-27 14:17:15 -04:00
parent c4101dcd33
commit 873d6c89b1
6 changed files with 75 additions and 88 deletions

View File

@ -1,9 +1,9 @@
:arf :arf
--- ---
data ro aInteger:Int:<3202> data ro aInteger:Int: 3202
data ro bMutInteger:Int:mut:<3202> data ro bMutInteger:Int:mut: 3202
data ro cIntegerPointer:{Int} data ro cIntegerPointer:{Int}
@ -13,33 +13,24 @@ data ro eIntegerArray16:Int:16
data ro fIntegerArrayVariable:{Int ..} data ro fIntegerArrayVariable:{Int ..}
data ro gIntegerArrayInitialized:Int:16:< data ro gIntegerArrayInitialized:Int:16
3948 293 293049 948 912 (3948 293 293049 948 912
340 0 2304 0 4785 92 340 0 2304 0 4785 92)
>
data rw hIntegerPointerInit:{Int}:<[& integer]> data rw hIntegerPointerInit:{Int} [& integer]
data rw iMutIntegerPointerInit:{Int}:mut:<[& integer]> data rw iMutIntegerPointerInit:{Int}:mut
[& integer]
data ro jObject:Obj:( data ro jObject:Obj
.this:<324> (324
.that:<324>) 438)
data ro kNestedObject:Obj:(
.this:(
.bird0:<324>
.bird1:<"hello world">)
.ro newMember:Int:<9023>
.that:(
.bird2:<123.8439>
.bird3:<9328.21348239>))
data ro lMutIntegerArray16:Int:16:mut data ro lMutIntegerArray16:Int:16:mut
data ro mExternalData:Int:8 data ro mExternalData:Int:8
external external
data ro nIntegerArrayInitialized:Int:16:mut: data ro nIntegerArrayInitialized:Int:16:mut
<3948 293 293049 948 912 (3948 293 293049 948 912
340 0 2304 0 4785 92> 340 0 2304 0 4785 92)

View File

@ -11,26 +11,26 @@ enum ro Weekday:Int
- saturday - saturday
enum ro NamedColor:U32 enum ro NamedColor:U32
- red: <0xFF0000> - red 0xFF0000
- green: <0x00FF00> - green 0x00FF00
- blue: <0x0000FF> - blue 0x0000FF
enum ro AffrontToGod:Int:4 enum ro AffrontToGod:Int:4
- bird0: - bird0
<28394 9328 (28394 9328
398 9> 398 9)
- bird1: - bird1
<23 932832 (23 932832
398 398
2349> 2349)
- bird2: - bird2
<1 (1
2 2
3 3
4> 4)
enum ro ThisIsTerrible:Obj:(.rw x:Int .rw y:Int) enum ro ThisIsTerrible:Vector
- up: (.x:< 0> .y:<-1>) - up ( 0 -1)
- down: (.x:< 0> .y:< 1>) - down ( 0 1)
- left: (.x:<-1> .y:< 0>) - left (-1 0)
- right: (.x:< 1> .y:< 0>) - right ( 1 0)

View File

@ -13,3 +13,5 @@ face ro ReadWriter:Face
face ro Destroyer:Face face ro Destroyer:Face
destroy destroy
# TODO: add test case for func interface

View File

@ -2,14 +2,14 @@
--- ---
func ro aBasicExternal func ro aBasicExternal
> someInput:Int:mut > someInput:Int:mut
< someOutput:Int:<4> < someOutput:Int 4
--- ---
external external
func ro bMethod func ro bMethod
@ bird:{Bird} @ bird:{Bird}
> someInput:Int:mut > someInput:Int:mut
< someOutput:Int:<4> < someOutput:Int 4
--- ---
external external
@ -126,10 +126,9 @@ func ro hSetPhrase
--- ---
let x:Int:<3> let x:Int:<3>
# loc is a reference, similar to * in C # loc is a reference, similar to * in C
let y:{Int}:<[loc x]> let y:{Int} [loc x]
let z:Int:8: let z:Int:8 (398 9 2309 983 -2387
<398 9 2309 983 -2387 478 555 123)
478 555 123> let bird:Bird (
let bird:Bird:( (99999)
.that:(.whenYou:<99999>) 324)
.this:<324>)

View File

@ -6,37 +6,31 @@ data ro aExternalData:Int
data ro bSingleValue:Int 342 data ro bSingleValue:Int 342
data ro cNestedObject:Obj data ro cNestedObject:Obj (
-- this (324 "hello world")
-- bird0 324 (123.8439 9328.21348239)
-- bird1 "hello world" )
-- that
-- bird2 123.8439
-- bird3 9328.21348239
data ro dUninitialized:Int:16:mut data ro dUninitialized:Int:16:mut
data ro eIntegerArrayInitialized:Int:16:mut data ro eIntegerArrayInitialized:Int:16:mut
3948 293 293049 948 912 (3948 293 293049 948 912
340 0 2304 0 4785 92 340 0 2304 0 4785 92)
func ro fComplexFunction func ro fComplexFunction
--- ---
= x:Int 3 = x:Int 3
= y:{Int} [loc x] = y:{Int} [loc x]
= z:Int:8 = z:Int:8 (
398 9 2309 983 -2387 398 9 2309 983 -2387
478 555 123 478 555 123)
= bird:Bird = bird:Bird ((99999) 324)
-- that
-- whenYou 99999
-- this 324
func ro gExternalFunction func ro gExternalFunction
> x:Int > x:Int
< arr:Int 5 < arr:Int 5
34908 (34908
39 3498 39 3498
38 219 38 219)
--- ---
external external

View File

@ -1,35 +1,36 @@
:arf :arf
--- ---
type ro aBasic:Obj:( type ro aBasic:Obj
.ro that:Int ro that:Int
.ro this:Int) ro this:Int
type ro bBitFields:Obj:( type ro bBitFields:Obj
.ro that:Int & 1 ro that:Int & 1
.ro this:Int:<298> & 24) ro this:Int 298 & 24
type ro cInit:Obj:( type ro cInit:Obj:(
.ro that:String:<"hello world"> ro that:String "hello world"
.ro this:Int:<23>) ro this:Int 23
type ro dInitInherit:aBasic:( # the semantic analyzer should let these sections restrict the permissions of
.that:<9384> # inherited members, but it should not let the sections lessen the permissions.
.this:<389>) type ro dInitInherit:aBasic
ro that 9384
ro this 389
type ro eInitAndDefine:aBasic:( type ro eInitAndDefine:aBasic
.this:<389> ro this 389
.ro these:aBasic:( ro that 9384
.ro born:Int:<4> ro born:Int 4
.ro in:Int ro in:Int
.ro the:Int:3:<9348 92384 92834> ro the:Int:3 (9348 92384 92834)
.this:<98>) ro walls:String "live in the walls, die in the walls."
.that:<9384>)
type ro fBasic:Int type ro fBasic:Int
type ro gBasicInit:Int:<6> type ro gBasicInit:Int 6
type ro hIntArray:{Int ..} type ro hIntArray:{Int ..}
type ro iIntArrayInit:Int:3: type ro iIntArrayInit:Int:3
<3298 923 92> (3298 923 92)