[fine] Assignments!
And new error capabilities!
This commit is contained in:
parent
92cf840766
commit
f20f5a5e03
12 changed files with 400 additions and 64 deletions
34
fine/tests/expression/assignment.fine
Normal file
34
fine/tests/expression/assignment.fine
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
fun test() -> f64 {
|
||||
let x = 12;
|
||||
let y = 13;
|
||||
let z = 2;
|
||||
x = y = z;
|
||||
x
|
||||
}
|
||||
|
||||
// @no-errors
|
||||
// @compiles-to:
|
||||
// | function << module >> (0 args, 0 locals):
|
||||
// | strings (0):
|
||||
// | code (2):
|
||||
// | 0: PushNothing
|
||||
// | 1: Return
|
||||
// | function test (0 args, 3 locals):
|
||||
// | strings (0):
|
||||
// | code (14):
|
||||
// | 0: PushFloat(12.0)
|
||||
// | 1: StoreLocal(0)
|
||||
// | 2: PushFloat(13.0)
|
||||
// | 3: StoreLocal(1)
|
||||
// | 4: PushFloat(2.0)
|
||||
// | 5: StoreLocal(2)
|
||||
// | 6: LoadLocal(2)
|
||||
// | 7: Dup
|
||||
// | 8: StoreLocal(1)
|
||||
// | 9: Dup
|
||||
// | 10: StoreLocal(0)
|
||||
// | 11: Discard
|
||||
// | 12: LoadLocal(0)
|
||||
// | 13: Return
|
||||
// |
|
||||
// @eval: Float(2.0)
|
||||
Loading…
Add table
Add a link
Reference in a new issue