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 | |
parent | bdb1fcfc742eb6ccb8e991ee792077ae6504a2de (diff) | |
download | colm-b45f08baf7ac6a1846b7bc80c0fc01d278f2a41b.tar.gz |
more object-semantics improvements
Diffstat (limited to 'test')
-rw-r--r-- | test/accum2.lm | 3 | ||||
-rw-r--r-- | test/accum3.lm | 8 | ||||
-rw-r--r-- | test/accumbt3.lm | 2 | ||||
-rw-r--r-- | test/binary1.lm | 16 | ||||
-rw-r--r-- | test/undofrag1.lm | 2 | ||||
-rw-r--r-- | test/undofrag2.lm | 2 | ||||
-rw-r--r-- | test/undofrag3.lm | 2 |
7 files changed, 22 insertions, 13 deletions
diff --git a/test/accum2.lm b/test/accum2.lm index 749684b8..bf2f56ab 100644 --- a/test/accum2.lm +++ b/test/accum2.lm @@ -26,9 +26,8 @@ def start end # ctx -CTX: ctx = new ctx SP: parser<ctx::start> = new parser<ctx::start> -SP->ctx = deref CTX +SP->ctx = new ctx send SP [stdin] Input: ctx::start = SP->finish() print( Input ) diff --git a/test/accum3.lm b/test/accum3.lm index 76e0d0d9..86225859 100644 --- a/test/accum3.lm +++ b/test/accum3.lm @@ -21,9 +21,11 @@ def args ArgParser: parser<args> = new parser<args> -ArgV: list<str> ArgV = argv -for A: str in ArgV - send ArgParser [A '\0'] +A: argv_el = argv->head +while ( A ) { + send ArgParser [A->value '\0'] + A = A->next +} Args: args = ArgParser->finish() diff --git a/test/accumbt3.lm b/test/accumbt3.lm index b1e1c82f..1c845278 100644 --- a/test/accumbt3.lm +++ b/test/accumbt3.lm @@ -81,7 +81,7 @@ end # accum_bt AccumBt: accum_bt = new accum_bt AccumBt->NestedParser = new parser<nested> -parse Two: accum_bt::two(deref AccumBt)[ stdin ] +parse Two: accum_bt::two(AccumBt)[ stdin ] send AccumBt->NestedParser [] eos Nested: nested = AccumBt->NestedParser->tree 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 ##### diff --git a/test/undofrag1.lm b/test/undofrag1.lm index 8a88a07c..9b013133 100644 --- a/test/undofrag1.lm +++ b/test/undofrag1.lm @@ -50,7 +50,7 @@ CTX: ctx = new ctx CTX->SP = new parser<start2> send CTX->SP "a b{c}" -parse Input: ctx::start1( deref CTX )[stdin] +parse Input: ctx::start1( CTX )[stdin] send CTX->SP "{e}f g" diff --git a/test/undofrag2.lm b/test/undofrag2.lm index 9bfd28d3..23520e1d 100644 --- a/test/undofrag2.lm +++ b/test/undofrag2.lm @@ -40,7 +40,7 @@ end # undo Undo: undo = new undo Undo->Out = new parser<undo::out> -parse Input: undo::start(deref Undo)[ stdin ] +parse Input: undo::start(Undo)[ stdin ] print( Input ) ##### IN ##### diff --git a/test/undofrag3.lm b/test/undofrag3.lm index cc0c25bd..da626cfc 100644 --- a/test/undofrag3.lm +++ b/test/undofrag3.lm @@ -46,7 +46,7 @@ end # undo Undo: undo = new undo Undo->Out = new parser<undo::out> -parse Input: undo::start(deref Undo)[ stdin ] +parse Input: undo::start(Undo)[ stdin ] print( Input ) ##### IN ##### |