baum

changeset 43:c7dca4a1dc37

added test programs; added another example program
author meillo@marmaro.de
date Sat, 01 Mar 2008 21:13:12 +0100
parents 233ac9bea4f1
children bc693c51970d
files baum.1 examples/return.baum examples/tests/test_double_indent.baum examples/tests/test_invalid_node.baum examples/tests/test_no_value.baum examples/tests/test_node_name_too_long.baum
diffstat 6 files changed, 48 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- a/baum.1	Sat Mar 01 20:41:35 2008 +0100
     1.2 +++ b/baum.1	Sat Mar 01 21:13:12 2008 +0100
     1.3 @@ -73,6 +73,8 @@
     1.4  
     1.5  .SH ERRORS
     1.6  
     1.7 +You have to keep in mind, that valid programs that run successful can return exit codes different from zero too! Each program returns the return value of the root node to the shell. If you don't want your program doing this, just set a `number(0)' node as root, and put everything else below.
     1.8 +
     1.9  .TP
    1.10  .BI 1
    1.11  common error
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/examples/return.baum	Sat Mar 01 21:13:12 2008 +0100
     2.3 @@ -0,0 +1,6 @@
     2.4 +# example program for baum
     2.5 +# http://prog.marmaro.de/baum
     2.6 +#
     2.7 +# returns the exit code `4' to the shell
     2.8 +
     2.9 +number(4)
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/examples/tests/test_double_indent.baum	Sat Mar 01 21:13:12 2008 +0100
     3.3 @@ -0,0 +1,10 @@
     3.4 +# example program for baum
     3.5 +# http://prog.marmaro.de/baum
     3.6 +#
     3.7 +# this program fails
     3.8 +# because it indents over two levels
     3.9 +#
    3.10 +# error code is `5'
    3.11 +
    3.12 +print(0)
    3.13 +		number(5)
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/examples/tests/test_invalid_node.baum	Sat Mar 01 21:13:12 2008 +0100
     4.3 @@ -0,0 +1,10 @@
     4.4 +# example program for baum
     4.5 +# http://prog.marmaro.de/baum
     4.6 +#
     4.7 +# this program fails
     4.8 +# because `invalidnode' in no valid node
     4.9 +#
    4.10 +# error code is `4'
    4.11 +
    4.12 +print(0)
    4.13 +	invalidnode(0)
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/examples/tests/test_no_value.baum	Sat Mar 01 21:13:12 2008 +0100
     5.3 @@ -0,0 +1,10 @@
     5.4 +# example program for baum
     5.5 +# http://prog.marmaro.de/baum
     5.6 +#
     5.7 +# this program fails
     5.8 +# because a node has no value
     5.9 +#
    5.10 +# error code is `6'
    5.11 +
    5.12 +print(0)
    5.13 +	number
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/examples/tests/test_node_name_too_long.baum	Sat Mar 01 21:13:12 2008 +0100
     6.3 @@ -0,0 +1,10 @@
     6.4 +# example program for baum
     6.5 +# http://prog.marmaro.de/baum
     6.6 +#
     6.7 +# this program fails
     6.8 +# because a node has no value
     6.9 +#
    6.10 +# error code is `6'
    6.11 +
    6.12 +print(0)
    6.13 +	thisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolong(6)