Phase 8.4: Complete AST→MIR Lowering - Basic object operations implemented
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
This commit is contained in:
19
test_wasm_box_integration.nyash
Normal file
19
test_wasm_box_integration.nyash
Normal file
@ -0,0 +1,19 @@
|
||||
box SimpleData {
|
||||
init { x, y }
|
||||
|
||||
pack(a, b) {
|
||||
me.x = a
|
||||
me.y = b
|
||||
}
|
||||
|
||||
sum() {
|
||||
return me.x + me.y
|
||||
}
|
||||
}
|
||||
|
||||
static box Main {
|
||||
main() {
|
||||
local data = new SimpleData(10, 20)
|
||||
return data.sum()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user