# HG changeset patch # User meillo@marmaro.de # Date 1204402392 -3600 # Node ID c7dca4a1dc3798a1d1eb63b5e3ff741317a3679c # Parent 233ac9bea4f175ffed6be3024f88f8cf7d08f45c added test programs; added another example program diff -r 233ac9bea4f1 -r c7dca4a1dc37 baum.1 --- a/baum.1 Sat Mar 01 20:41:35 2008 +0100 +++ b/baum.1 Sat Mar 01 21:13:12 2008 +0100 @@ -73,6 +73,8 @@ .SH ERRORS +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. + .TP .BI 1 common error diff -r 233ac9bea4f1 -r c7dca4a1dc37 examples/return.baum --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/return.baum Sat Mar 01 21:13:12 2008 +0100 @@ -0,0 +1,6 @@ +# example program for baum +# http://prog.marmaro.de/baum +# +# returns the exit code `4' to the shell + +number(4) diff -r 233ac9bea4f1 -r c7dca4a1dc37 examples/tests/test_double_indent.baum --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/tests/test_double_indent.baum Sat Mar 01 21:13:12 2008 +0100 @@ -0,0 +1,10 @@ +# example program for baum +# http://prog.marmaro.de/baum +# +# this program fails +# because it indents over two levels +# +# error code is `5' + +print(0) + number(5) diff -r 233ac9bea4f1 -r c7dca4a1dc37 examples/tests/test_invalid_node.baum --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/tests/test_invalid_node.baum Sat Mar 01 21:13:12 2008 +0100 @@ -0,0 +1,10 @@ +# example program for baum +# http://prog.marmaro.de/baum +# +# this program fails +# because `invalidnode' in no valid node +# +# error code is `4' + +print(0) + invalidnode(0) diff -r 233ac9bea4f1 -r c7dca4a1dc37 examples/tests/test_no_value.baum --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/tests/test_no_value.baum Sat Mar 01 21:13:12 2008 +0100 @@ -0,0 +1,10 @@ +# example program for baum +# http://prog.marmaro.de/baum +# +# this program fails +# because a node has no value +# +# error code is `6' + +print(0) + number diff -r 233ac9bea4f1 -r c7dca4a1dc37 examples/tests/test_node_name_too_long.baum --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/tests/test_node_name_too_long.baum Sat Mar 01 21:13:12 2008 +0100 @@ -0,0 +1,10 @@ +# example program for baum +# http://prog.marmaro.de/baum +# +# this program fails +# because a node has no value +# +# error code is `6' + +print(0) + thisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolongthisistoolong(6)