Updated other test cases and examples to match
This commit is contained in:
parent
5127b80630
commit
51def46d91
@ -3,7 +3,7 @@ require "io"
|
|||||||
---
|
---
|
||||||
|
|
||||||
func ro main
|
func ro main
|
||||||
> arguments:{String}
|
> arguments:{String ..}
|
||||||
< status:Int 0
|
< status:Int 0
|
||||||
---
|
---
|
||||||
io.println "hello world"
|
io.println "hello world"
|
||||||
|
@ -13,7 +13,7 @@ objt ro Greeter:Obj
|
|||||||
|
|
||||||
# this is a function
|
# this is a function
|
||||||
func ro main
|
func ro main
|
||||||
> arguments:{String}
|
> arguments:{String ..}
|
||||||
< status:Int 0
|
< status:Int 0
|
||||||
---
|
---
|
||||||
= greeter:Greeter:mut
|
= greeter:Greeter:mut
|
||||||
|
@ -6,7 +6,7 @@ func TestEnum (test *testing.T) {
|
|||||||
checkTree ("../tests/parser/enum",
|
checkTree ("../tests/parser/enum",
|
||||||
`:arf
|
`:arf
|
||||||
---
|
---
|
||||||
enum ro AffrontToGod:{Int 4}
|
enum ro AffrontToGod:Int:4
|
||||||
bird0
|
bird0
|
||||||
28394
|
28394
|
||||||
9328
|
9328
|
||||||
|
@ -25,7 +25,7 @@ func ro cBasicPhrases
|
|||||||
[fn [gn 329 983 57] 123]
|
[fn [gn 329 983 57] 123]
|
||||||
func ro dArgumentTypes
|
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
|
func ro eMath
|
||||||
> x:Int
|
> x:Int
|
||||||
> y:Int
|
> y:Int
|
||||||
@ -103,7 +103,7 @@ func ro hSetPhrase
|
|||||||
---
|
---
|
||||||
[= x:Int 3]
|
[= x:Int 3]
|
||||||
[= y:{Int} [loc x]]
|
[= y:{Int} [loc x]]
|
||||||
[= z:{Int 8}]
|
[= z:Int:8]
|
||||||
398
|
398
|
||||||
9
|
9
|
||||||
2309
|
2309
|
||||||
|
@ -13,7 +13,7 @@ objt ro BitFields:Obj
|
|||||||
ro that:Int & 1
|
ro that:Int & 1
|
||||||
ro this:Int & 24 298
|
ro this:Int & 24 298
|
||||||
objt ro ComplexInit:Obj
|
objt ro ComplexInit:Obj
|
||||||
ro whatever:{Int 3}
|
ro whatever:Int:3
|
||||||
230984
|
230984
|
||||||
849
|
849
|
||||||
394580
|
394580
|
||||||
|
@ -9,7 +9,7 @@ func TestType (test *testing.T) {
|
|||||||
type ro Basic:Int
|
type ro Basic:Int
|
||||||
type ro BasicInit:Int 6
|
type ro BasicInit:Int 6
|
||||||
type ro IntArray:{Int ..}
|
type ro IntArray:{Int ..}
|
||||||
type ro IntArrayInit:{Int 3}
|
type ro IntArrayInit:Int:3
|
||||||
3298
|
3298
|
||||||
923
|
923
|
||||||
92
|
92
|
||||||
|
@ -15,7 +15,7 @@ enum ro NamedColor:U32
|
|||||||
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
|
||||||
|
@ -5,35 +5,29 @@ require "io"
|
|||||||
---
|
---
|
||||||
|
|
||||||
# this is a global variable
|
# this is a global variable
|
||||||
data wn helloText:String "Hello, world!"
|
data pv helloText:String "Hello, world!"
|
||||||
|
|
||||||
# this is a struct definition
|
# this is a struct definition
|
||||||
type rr Greeter:Obj
|
objt ro Greeter:Obj
|
||||||
# "Hi." is a string constant. all Greeters will be initialized with a
|
rw text:String "Hi."
|
||||||
# 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"
|
|
||||||
|
|
||||||
# this is a function
|
# this is a function
|
||||||
func rr main
|
func ro main
|
||||||
> argc:Int
|
> arguments:{String ..}
|
||||||
> argv:{String}
|
|
||||||
< status:Int 0
|
< status:Int 0
|
||||||
---
|
---
|
||||||
let greeter:Greeter:mut
|
= greeter:Greeter:mut
|
||||||
greeter.setText helloText
|
greeter.setText helloText
|
||||||
greeter.greet
|
greeter.greet
|
||||||
|
|
||||||
# this is a member function
|
# this is a member function
|
||||||
func rr greet
|
func ro greet
|
||||||
@ greeter:{Greeter}
|
@ greeter:{Greeter}
|
||||||
---
|
---
|
||||||
io.println greeter.text
|
io.println greeter.text
|
||||||
|
|
||||||
# this is mutator member function
|
# this is mutator member function
|
||||||
func rr setText
|
func ro setText
|
||||||
@ greeter:{Greeter}
|
@ greeter:{Greeter}
|
||||||
> text:String
|
> text:String
|
||||||
---
|
---
|
||||||
|
@ -28,7 +28,7 @@ func ro cBasicPhrases
|
|||||||
func ro dArgumentTypes
|
func ro dArgumentTypes
|
||||||
---
|
---
|
||||||
[bird tree butterfly.wing "hello world"
|
[bird tree butterfly.wing "hello world"
|
||||||
grass:{Int:mut 8}]
|
grass:Int:mut:8]
|
||||||
|
|
||||||
func ro eMath
|
func ro eMath
|
||||||
> x:Int
|
> x:Int
|
||||||
@ -127,7 +127,7 @@ func ro hSetPhrase
|
|||||||
= x:Int 3
|
= x:Int 3
|
||||||
# loc is a reference, similar to * in C
|
# loc is a reference, similar to * in C
|
||||||
= 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
|
||||||
|
@ -13,7 +13,7 @@ objt ro Init:Obj
|
|||||||
ro this:Int 23
|
ro this:Int 23
|
||||||
|
|
||||||
objt ro ComplexInit:Obj
|
objt ro ComplexInit:Obj
|
||||||
ro whatever:{Int 3}
|
ro whatever:Int:3
|
||||||
230984
|
230984
|
||||||
849 394580
|
849 394580
|
||||||
ro complex0:Bird
|
ro complex0:Bird
|
||||||
|
@ -6,5 +6,5 @@ type ro BasicInit:Int 6
|
|||||||
|
|
||||||
type ro IntArray:{Int ..}
|
type ro IntArray:{Int ..}
|
||||||
|
|
||||||
type ro IntArrayInit:{Int 3}
|
type ro IntArrayInit:Int:3
|
||||||
3298 923 92
|
3298 923 92
|
||||||
|
Reference in New Issue
Block a user