Fixed all generator tests
This commit is contained in:
parent
94a25f0aac
commit
74e84c7da4
|
@ -151,11 +151,11 @@ declare %Index @puts(ptr %string)
|
|||
`
|
||||
[puts string: *Byte]: Index
|
||||
|
||||
Greeter: (message: String)
|
||||
Greeter: (. message: String)
|
||||
Greeter.[greet] = [puts [@[.this.message 0]]]
|
||||
|
||||
[main] = {
|
||||
greeter: Greeter = (
|
||||
greeter: Greeter = (.
|
||||
message: 'hello\0'
|
||||
)
|
||||
greeter.[greet]
|
||||
|
|
|
@ -29,13 +29,13 @@ define void @T.do(ptr %this) {
|
|||
}
|
||||
`,
|
||||
`
|
||||
Doer: ([do])
|
||||
Doer: (~ [do])
|
||||
T: Int
|
||||
T.[do] = { }
|
||||
|
||||
[main] = {
|
||||
if:Doer = x:T
|
||||
if.[do]
|
||||
ifa:Doer = x:T
|
||||
ifa.[do]
|
||||
}
|
||||
`)
|
||||
}
|
||||
|
@ -70,14 +70,14 @@ define i64 @Number.number(ptr %this) {
|
|||
}
|
||||
`,
|
||||
`
|
||||
Numbered: ([number]: Int)
|
||||
Numbered: (~ [number]: Int)
|
||||
Number: Int
|
||||
Number.[number]: Int = [.this]
|
||||
|
||||
[main]: Int = {
|
||||
num:Number = 5
|
||||
if:Numbered = num
|
||||
if.[number]
|
||||
ifa:Numbered = num
|
||||
ifa.[number]
|
||||
}
|
||||
`)
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ declare %Index @write(%File %fd, ptr %buffer, %Index %count)
|
|||
`
|
||||
[write fd:File buffer:*Byte count:Index]: Index
|
||||
|
||||
Writer: ([write buffer:*:Byte]: Index)
|
||||
Writer: (~ [write buffer:*:Byte]: Index)
|
||||
File: I32
|
||||
File.[write buffer:*:Byte]:Index = [write [.this] [~*Byte buffer] [#buffer]]
|
||||
|
||||
|
@ -208,13 +208,13 @@ define void @main() {
|
|||
declare %Index @File.write(ptr %this, { ptr, %Index } %buffer)
|
||||
`,
|
||||
`
|
||||
Writer: ([write buffer:*:Byte]: Index)
|
||||
A: (output: Writer)
|
||||
Writer: (~ [write buffer:*:Byte]: Index)
|
||||
A: (. output: Writer)
|
||||
File: I32
|
||||
File.[write buffer:*:Byte]:Index
|
||||
|
||||
[main] 'main' = {
|
||||
a:A = (output: [~File 0])
|
||||
a:A = (. output: [~File 0])
|
||||
}
|
||||
`)
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ define i64 @Impl.x(ptr %this) {
|
|||
}
|
||||
`,
|
||||
`
|
||||
Face: ([x]:Int)
|
||||
Face: (~ [x]:Int)
|
||||
Impl: Int
|
||||
Impl.[x]:Int = 5
|
||||
[main] 'main' = {
|
||||
|
|
|
@ -284,7 +284,7 @@ testString (test,
|
|||
`,
|
||||
`
|
||||
[main] 'main' = {
|
||||
ta:(x:Int y:(z:Int a:Int)) = (x: 1 y: (z: 2 a: 3))
|
||||
ta:(.x:Int y:(.z:Int a:Int)) = (.x: 1 y: (.z: 2 a: 3))
|
||||
}
|
||||
`)
|
||||
}
|
||||
|
@ -301,9 +301,9 @@ define void @main() {
|
|||
}
|
||||
`,
|
||||
`
|
||||
A: (x:Int)
|
||||
A: (.x:Int)
|
||||
[main] 'main' = {
|
||||
a:A = (x: 5)
|
||||
a:A = (.x: 5)
|
||||
}
|
||||
`)
|
||||
}
|
||||
|
|
|
@ -172,7 +172,7 @@ declare %Index @write(i32 %file, ptr %buffer, %Index %count)
|
|||
[print string: String] = loop {
|
||||
if [< [#string] 1] then [break]
|
||||
[write 1 [~*Byte string] 1]
|
||||
string = [\string 1:]
|
||||
string = [\string 1/]
|
||||
}
|
||||
`)
|
||||
}
|
||||
|
|
|
@ -20,16 +20,16 @@ testString (test,
|
|||
declare %AllTypes @x()
|
||||
`,
|
||||
`
|
||||
Point: (x:Int y:Int)
|
||||
Pegasus: (
|
||||
Point: (.x:Int y:Int)
|
||||
Pegasus: (~
|
||||
[clear clouds:*:Point]
|
||||
[fly rings:*:Point]
|
||||
[fall distance:Int]
|
||||
[complete]:Bool)
|
||||
Rectangle: (
|
||||
Rectangle: (.
|
||||
min:Point
|
||||
max:Point)
|
||||
AllInts: (
|
||||
AllInts: (.
|
||||
bool:Bool
|
||||
byte:Byte
|
||||
index:Index
|
||||
|
@ -44,12 +44,12 @@ AllInts: (
|
|||
u16:U16
|
||||
u32:U32
|
||||
u64:U64)
|
||||
AllFloats: (
|
||||
AllFloats: (.
|
||||
f32:F32
|
||||
f64:F64)
|
||||
Path: *:Point
|
||||
Quadrangle: 4:Point
|
||||
AllTypes: (
|
||||
AllTypes: (.
|
||||
string:String
|
||||
pegasus:Pegasus
|
||||
rectangle:Rectangle
|
||||
|
@ -121,7 +121,7 @@ define void @main() {
|
|||
}
|
||||
`,
|
||||
`
|
||||
A: (x:Int)
|
||||
A: (.x:Int)
|
||||
B: A
|
||||
[main] = {
|
||||
b:B
|
||||
|
|
Loading…
Reference in New Issue