2022-08-24 05:22:24 +00:00
|
|
|
package parser
|
|
|
|
|
|
|
|
import "testing"
|
|
|
|
|
|
|
|
func TestType (test *testing.T) {
|
2022-09-05 18:52:37 +00:00
|
|
|
checkTree ("../tests/parser/type", false,
|
2022-08-24 05:22:24 +00:00
|
|
|
`:arf
|
|
|
|
---
|
2022-09-28 14:36:29 +00:00
|
|
|
type ro aBasic:Obj
|
|
|
|
ro that:Int
|
|
|
|
ro this:Int
|
|
|
|
type ro bBitFields:Obj
|
|
|
|
ro that:Int & 1
|
2022-09-29 06:13:22 +00:00
|
|
|
ro this:Int 298 & 24
|
2022-09-28 14:36:29 +00:00
|
|
|
type ro cInit:Obj
|
2022-10-04 21:13:08 +00:00
|
|
|
ro that:String 'hello world'
|
2022-09-29 06:13:22 +00:00
|
|
|
ro this:Int 23
|
2022-09-28 14:36:29 +00:00
|
|
|
type ro dInitInherit:aBasic
|
2022-09-29 06:13:22 +00:00
|
|
|
ro that 9384
|
|
|
|
ro this 389
|
2022-09-28 14:36:29 +00:00
|
|
|
type ro eInitAndDefine:aBasic
|
2022-09-29 06:13:22 +00:00
|
|
|
ro this 389
|
|
|
|
ro that 9384
|
|
|
|
ro born:Int 4
|
2022-09-28 14:36:29 +00:00
|
|
|
ro in:Int
|
2022-09-29 06:13:22 +00:00
|
|
|
ro the:Int:3 (9348 92384 92834)
|
2022-10-04 21:13:08 +00:00
|
|
|
ro walls:String 'live in the walls, die in the walls.'
|
2022-09-11 19:35:07 +00:00
|
|
|
type ro fBasic:Int
|
2022-09-28 14:36:29 +00:00
|
|
|
type ro gBasicInit:Int
|
|
|
|
6
|
2022-09-11 19:35:07 +00:00
|
|
|
type ro hIntArray:{Int ..}
|
2022-09-28 14:36:29 +00:00
|
|
|
type ro iIntArrayInit:Int:3
|
2022-09-29 06:13:22 +00:00
|
|
|
(
|
|
|
|
3298
|
|
|
|
923
|
|
|
|
92
|
|
|
|
)
|
2022-10-12 18:21:19 +00:00
|
|
|
type ro jAtEnd:Int
|
2022-08-24 05:22:24 +00:00
|
|
|
`, test)
|
|
|
|
}
|