From 51def46d917b8a1f8264a1f65f06fc54866cab59 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Mon, 5 Sep 2022 11:35:32 -0400 Subject: [PATCH] Updated other test cases and examples to match --- examples/basic/main.arf | 2 +- examples/full/main.arf | 2 +- parser/enum_test.go | 2 +- parser/func_test.go | 4 ++-- parser/objt_test.go | 2 +- parser/type_test.go | 2 +- tests/parser/enum/main.arf | 2 +- tests/parser/full/main.arf | 44 ++++++++++++++++---------------------- tests/parser/func/main.arf | 4 ++-- tests/parser/objt/main.arf | 2 +- tests/parser/type/main.arf | 2 +- 11 files changed, 31 insertions(+), 37 deletions(-) diff --git a/examples/basic/main.arf b/examples/basic/main.arf index 3a8695e..7084112 100644 --- a/examples/basic/main.arf +++ b/examples/basic/main.arf @@ -3,7 +3,7 @@ require "io" --- func ro main - > arguments:{String} + > arguments:{String ..} < status:Int 0 --- io.println "hello world" diff --git a/examples/full/main.arf b/examples/full/main.arf index 9cfa79a..0817ddd 100644 --- a/examples/full/main.arf +++ b/examples/full/main.arf @@ -13,7 +13,7 @@ objt ro Greeter:Obj # this is a function func ro main - > arguments:{String} + > arguments:{String ..} < status:Int 0 --- = greeter:Greeter:mut diff --git a/parser/enum_test.go b/parser/enum_test.go index 7857387..a695dfc 100644 --- a/parser/enum_test.go +++ b/parser/enum_test.go @@ -6,7 +6,7 @@ func TestEnum (test *testing.T) { checkTree ("../tests/parser/enum", `:arf --- -enum ro AffrontToGod:{Int 4} +enum ro AffrontToGod:Int:4 bird0 28394 9328 diff --git a/parser/func_test.go b/parser/func_test.go index f221b9e..d7137b3 100644 --- a/parser/func_test.go +++ b/parser/func_test.go @@ -25,7 +25,7 @@ func ro cBasicPhrases [fn [gn 329 983 57] 123] func ro dArgumentTypes --- - [bird tree butterfly.wing "hello world" grass:{Int:mut 8}] + [bird tree butterfly.wing "hello world" grass:Int:8:mut] func ro eMath > x:Int > y:Int @@ -103,7 +103,7 @@ func ro hSetPhrase --- [= x:Int 3] [= y:{Int} [loc x]] - [= z:{Int 8}] + [= z:Int:8] 398 9 2309 diff --git a/parser/objt_test.go b/parser/objt_test.go index 4490f38..3a6775a 100644 --- a/parser/objt_test.go +++ b/parser/objt_test.go @@ -13,7 +13,7 @@ objt ro BitFields:Obj ro that:Int & 1 ro this:Int & 24 298 objt ro ComplexInit:Obj - ro whatever:{Int 3} + ro whatever:Int:3 230984 849 394580 diff --git a/parser/type_test.go b/parser/type_test.go index 3221737..44219bc 100644 --- a/parser/type_test.go +++ b/parser/type_test.go @@ -9,7 +9,7 @@ func TestType (test *testing.T) { type ro Basic:Int type ro BasicInit:Int 6 type ro IntArray:{Int ..} -type ro IntArrayInit:{Int 3} +type ro IntArrayInit:Int:3 3298 923 92 diff --git a/tests/parser/enum/main.arf b/tests/parser/enum/main.arf index 0571149..6d2788e 100644 --- a/tests/parser/enum/main.arf +++ b/tests/parser/enum/main.arf @@ -15,7 +15,7 @@ enum ro NamedColor:U32 green 0x00FF00 blue 0x0000FF -enum ro AffrontToGod:{Int 4} +enum ro AffrontToGod:Int:4 bird0 28394 9328 398 9 diff --git a/tests/parser/full/main.arf b/tests/parser/full/main.arf index e64decb..0817ddd 100644 --- a/tests/parser/full/main.arf +++ b/tests/parser/full/main.arf @@ -5,37 +5,31 @@ require "io" --- # this is a global variable -data wn helloText:String "Hello, world!" +data pv helloText:String "Hello, world!" # this is a struct definition -type rr Greeter:Obj - # "Hi." is a string constant. all Greeters will be initialized with a - # pointer to it. I don't know really it depends on what I decide that - # a String type even is. - wr text:String "Hi." - "sdfdsf" "ahh" - "asdf" +objt ro Greeter:Obj + rw text:String "Hi." # this is a function -func rr main - > argc:Int - > argv:{String} - < status:Int 0 - --- - let greeter:Greeter:mut - greeter.setText helloText - greeter.greet +func ro main + > arguments:{String ..} + < status:Int 0 + --- + = greeter:Greeter:mut + greeter.setText helloText + greeter.greet # this is a member function -func rr greet - @ greeter:{Greeter} - --- - io.println greeter.text +func ro greet + @ greeter:{Greeter} + --- + io.println greeter.text # this is mutator member function -func rr setText - @ greeter:{Greeter} - > text:String - --- - greeter.text.set text +func ro setText + @ greeter:{Greeter} + > text:String + --- + greeter.text.set text diff --git a/tests/parser/func/main.arf b/tests/parser/func/main.arf index fcb1671..79ab114 100644 --- a/tests/parser/func/main.arf +++ b/tests/parser/func/main.arf @@ -28,7 +28,7 @@ func ro cBasicPhrases func ro dArgumentTypes --- [bird tree butterfly.wing "hello world" - grass:{Int:mut 8}] + grass:Int:mut:8] func ro eMath > x:Int @@ -127,7 +127,7 @@ func ro hSetPhrase = x:Int 3 # loc is a reference, similar to * in C = y:{Int} [loc x] - = z:{Int 8} + = z:Int:8 398 9 2309 983 -2387 478 555 123 = bird:Bird diff --git a/tests/parser/objt/main.arf b/tests/parser/objt/main.arf index 7bdaf3c..9026d29 100644 --- a/tests/parser/objt/main.arf +++ b/tests/parser/objt/main.arf @@ -13,7 +13,7 @@ objt ro Init:Obj ro this:Int 23 objt ro ComplexInit:Obj - ro whatever:{Int 3} + ro whatever:Int:3 230984 849 394580 ro complex0:Bird diff --git a/tests/parser/type/main.arf b/tests/parser/type/main.arf index d7feb7e..7c84c2a 100644 --- a/tests/parser/type/main.arf +++ b/tests/parser/type/main.arf @@ -6,5 +6,5 @@ type ro BasicInit:Int 6 type ro IntArray:{Int ..} -type ro IntArrayInit:{Int 3} +type ro IntArrayInit:Int:3 3298 923 92