Updated other test cases and examples to match

This commit is contained in:
2022-09-05 11:35:32 -04:00
parent 5127b80630
commit 51def46d91
11 changed files with 31 additions and 37 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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