[
  (
    DsCons
    "toplevel"
    [
      ("Top", [(1, "la", "sublevel"), (1, "lb", "sublevel")]),
      ("Toptuple", [(0, "tup", "subtuple")]),
      ("TopNone", [])
    ]
  ),
  (DsTuple "subtuple" [(1, "tl", "thing"), (0, "tn", "int")]),
  (
    DsCons
    "sublevel"
    [
      ("SubNamed", [(0, "n", "int")]),
      ("SubNamedlist", [(1, "thinglist", "thing")])
    ]
  ),
  (DsCons "thing" [("Thing", [])])
]

VARIABLES:
----
'12'
'12'
'GOOD!'
''
'
''
''
'$' '.' '"'
unknownvariable: 'bla bla bla'
'z y x z y x'
----
Special variables:
dollar: '$'
dot: '.'
double quote: '"'

COMMANDS:
---------

if:
----
if 1 done
----
if 0 not done
----
if "" done
----

insert:
----
var = `ladidah'
---- start of testsub ----
var = ladidah
var = 123
'testsub(5)'
'test.ds'

---- end of testsub ----
var = `123'
----

include:
----
var = `ladidah'
---- start of testsub ----
var = ladidah
var = 123
'testsub(5)'
'test.ds'

---- end of testsub ----
var = `ladidah'
----

copy:
----
var = `ladidah'
---- start of testsub ----
var = $(var)
.set var 123
var = $(var)
'${tplfilename}(${tpllineno})'
'${dsfilename}'
$(blablabla)
---- end of testsub ----
var = `ladidah'
----

error:
----
----

foreach:
----
a
b
c
d
----
----

while:
----
1 2 3 4 5 6 7
2 3 4 5 6 7
3 4 5 6 7
4 5 6 7
5 6 7
6 7
7
----

FUNCTIONS:
----------

Comparison functions:
----
eq : '1' '0' '0'
neq: '0' '1' '1'
strcmp: '0' '-1' '1' '-1'
== : '1' '0' '0' '0'
!= : '0' '1' '1' '1'
<  : '1' '0' '0'
<= : '1' '1' '0'
>  : '0' '0' '1'
>= : '0' '1' '1'
----

Aritmetic functions:
----
+: '15' '3' '0'
-: '4' '-4' ''
*: '120' '3' '1'
/: '4' '3' '4' '0'
%: '0' '2' '1' '3'
max: '5' '3' '0'
min: '-1' '3' '0'
----

Boolean:
----
and: '1' '0' '1'
not: '0' '1' '0' '1'
or:  '0' '1' '0'
----

List manipulation:
----
index:   '1' '0' '0' '0'
shift:   'b c d e f' ''
first:   'a' ''
seplist: 'a, b, c, d, e, f' 'a' ''
prefix:  'pfx_a pfx_b pfx_c pfx_d pfx_e pfx_f' 'pfx_a' ''
suffix:  'a_sfx b_sfx c_sfx d_sfx e_sfx f_sfx' 'a_sfx' ''
len:     '6' '1' '0'
sort:    'a a b b c c d d e e f f' '-1 1 12 2' ''
uniq:    'a b c d e f' '-1 1 12 2' ''
rev:     'f e d c b a' ''

----
Regular expressions:
funtion: subs
foo* 1: [1 fobar 1 bar blabar a b barf 1 barbar ian]
foo* &&: [foobarfoobar fobar foofoo bar blabar a b barf foofoofoofoo barbar ian]
(foo)* &\1: [foobarfoo fobar foofoo bar blabar a b barf foofoofoo barbar ian]
foo(*) &\1: [foobarbar fobar foo bar blabar a b barf foofoofoo barbar ian]
(foo)(*) \2\1: [barfoo fobar foo bar blabar a b barf foofoo barbar ian]
[a-e]* !&: [foobar fobar foo !bar !blabar !a !b !barf foofoo !barbar ian]
(?)(*)(?) \3\2\1: [roobaf robaf oof rab rlabab a b farb ooofof rarbab nai]

funtion: filt
foo* 1: [1 1 1]
foo* &&: [foobarfoobar foofoo foofoofoofoo]
(foo)* &\1: [foobarfoo foofoo foofoofoo]
foo(*) &\1: [foobarbar foo foofoofoo]
(foo)(*) \2\1: [barfoo foo foofoo]
[a-e]* !&: [!bar !blabar !a !b !barf !barbar]
(?)(*)(?) \3\2\1: [roobaf robaf oof rab rlabab farb ooofof rarbab nai]

funtion: rmlist
foo*: [fobar bar blabar a b barf barbar ian]
foo*: [fobar bar blabar a b barf barbar ian]
(foo)*: [fobar bar blabar a b barf barbar ian]
foo(*): [fobar bar blabar a b barf barbar ian]
(foo)(*): [fobar bar blabar a b barf barbar ian]
[a-e]*: [foobar fobar foo foofoo ian]
(?)(*)(?): [a b]

----
Filename access functions:
----
dsfilename: 'test.ds'
tplfilename: 'testin'
tpllineno: '177'
----

Datastructure access functions:
----
typelist: 'toplevel subtuple sublevel thing'
ttypelist: 'subtuple'
ctypelist: 'toplevel sublevel thing'
    conslist toplevel: 'Top Toptuple TopNone'
        celmlist: 'la lb'
            ctypeclass toplevel Top la: 'list'
            ctypename toplevel Top la: 'sublevel'
            ctypeclass toplevel Top lb: 'list'
            ctypename toplevel Top lb: 'sublevel'
        celmlist: 'tup'
            ctypeclass toplevel Toptuple tup: 'single'
            ctypename toplevel Toptuple tup: 'subtuple'
        celmlist: ''
    telmlist toplevel: ''
    conslist subtuple: ''
    telmlist subtuple: 'tl tn'
	ttypeclass subtuple tl: 'list'
	ttypename subtuple tl: 'thing'
	ttypeclass subtuple tn: 'single'
	ttypename subtuple tn: 'int'
    conslist sublevel: 'SubNamed SubNamedlist'
        celmlist: 'n'
            ctypeclass sublevel SubNamed n: 'single'
            ctypename sublevel SubNamed n: 'int'
        celmlist: 'thinglist'
            ctypeclass sublevel SubNamedlist thinglist: 'list'
            ctypename sublevel SubNamedlist thinglist: 'thing'
    telmlist sublevel: ''
    conslist thing: 'Thing'
        celmlist: ''
    telmlist thing: ''
----

Datastructure dependency
----
single types dependent on toplevel:
'toplevel subtuple sublevel thing'
list types dependent on toplevel:
'sublevel thing'
Testing error handling:
''
''
''
----

String manipulation functions:
----
strpad: 'bla   ' 'abc' 'blawowwowwo'
strpad: '00000' ''
strlen: '6' '0' '0'
strindex: '3' '0'
toupper: 'BLA' 'BLA' ''
tolower: 'bla' 'bla' ''
----

Miscellaneous functions:
----
1 0 0
----

verbose flag:
----
verbose = '1'
----

comm:
----
'a e a e'
''
''
''
----

excl:
----
'b c d f b c d f'
''
'a b c d'
''
----


Integer expressions
-------------------

'-12' '12'
'0' '28'
'313' '5040' '1' '3'
<: '1' '0' '1' '0' '0'
<=: '1' '0' '1' '0' '1'
>: '0' '1' '0' '1' '0'
>=: '0' '1' '0' '1' '1'
!=: '1' '1' '1' '1' '0'
==: '0' '0' '0' '0' '1'
 |
-------
0 0 | 0
0 1 | 1
1 0 | 1
1 1 | 1

 &
-------
0 0 | 0
0 1 | 0
1 0 | 0
1 1 | 1

 ==
-------
0 0 | 1
0 1 | 0
1 0 | 0
1 1 | 1

 !=
-------
0 0 | 0
0 1 | 1
1 0 | 1
1 1 | 0

 <
-------
0 0 | 0
0 1 | 1
1 0 | 0
1 1 | 0

 <=
-------
0 0 | 1
0 1 | 1
1 0 | 0
1 1 | 1

 >=
-------
0 0 | 1
0 1 | 0
1 0 | 1
1 1 | 1

 >
-------
0 0 | 0
0 1 | 0
1 0 | 1
1 1 | 0

12
'0' '12' '
'0' '0' '0'

Buffer size test.
Create a list with 4k worth elements.
2
4
8
16
32
64
128
256
512
