diff options
author | Adrian Thurston <thurston@complang.org> | 2015-01-10 14:30:40 -0500 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2015-01-10 14:30:52 -0500 |
commit | b45f08baf7ac6a1846b7bc80c0fc01d278f2a41b (patch) | |
tree | 98be31b601df7076807966fa0ce2374aa432fca1 /test/binary1.lm | |
parent | bdb1fcfc742eb6ccb8e991ee792077ae6504a2de (diff) | |
download | colm-b45f08baf7ac6a1846b7bc80c0fc01d278f2a41b.tar.gz |
more object-semantics improvements
Diffstat (limited to 'test/binary1.lm')
-rw-r--r-- | test/binary1.lm | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/test/binary1.lm b/test/binary1.lm index a38d930f..bdf9ac85 100644 --- a/test/binary1.lm +++ b/test/binary1.lm @@ -116,11 +116,19 @@ def count # end # -CL: list<int> +struct int_el + Int: int + + list_el el +end + +CL: list<int_el> int start_list( count: int ) { - CL->push( count ) + IntEl: int_el = new int_el + IntEl->Int = count + CL->push( IntEl ) } def count_inc @@ -485,9 +493,9 @@ int print_all_names( s: start ) end # binary Binary: binary = new binary -Binary->CL = new list<int> +Binary->CL = new list<int_el> -parse S: binary::start(deref Binary) [ stdin ] +parse S: binary::start(Binary) [ stdin ] print_all_names( S ) print( '*** SUCCESS ***\n' ) ##### EXP ##### |