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_field_operations.nyash
Normal file
19
test_field_operations.nyash
Normal file
@ -0,0 +1,19 @@
|
||||
box Counter {
|
||||
init { count }
|
||||
|
||||
pack() {
|
||||
me.count = 0
|
||||
}
|
||||
|
||||
increment() {
|
||||
me.count = me.count + 1
|
||||
return me.count
|
||||
}
|
||||
}
|
||||
|
||||
static box Main {
|
||||
main() {
|
||||
local c = new Counter()
|
||||
return c.increment()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user