An optional argument has three values: the default (the name is absent), the argument type's :alone value (the name is written alone), and a written value. :alone is declared by the argument type only, never by a klammer's parameter declaration -- a default is what one klammer means by silence, but a bare option name must read the same way in every klammer. The bool type declares :alone true, which is the whole of the convention that a bare boolean option means true; there is no boolean special case in the engine. A type whose pattern matches running text cannot declare :alone, since an option's value runs to the next bar or option name and would swallow the following text. kdesc and `ktext -m` now show [default: X] and [alone: Y] per argument type. In the Standard Klammer Set: @code :number becomes a bool (it was an untyped string tested only for truthiness, so a bare :number was a no-op); decimal_mark declares :alone comma; table_hline and table_vline declare :alone all. The 35 bools that default false gained the bare form for free. Tests: tst/alone_test.sh (21 cases) joins the shipped suite. (from dev 6024f49c2859)
25 lines
982 B
Makefile
25 lines
982 B
Makefile
# Klammertext distribution test suite (subset).
|
|
#
|
|
# Runs the seven shell regression suites:
|
|
# cond_test.sh — @cond argument delimitation
|
|
# deftype_test.sh — the four klammer definition modes + redefinition table
|
|
# escape_test.sh — target character escaping and quoted specials
|
|
# filename_test.sh — filenames with spaces (quoting, " / " lists, rescue)
|
|
# alone_test.sh — an optional argument's three values (default, the
|
|
# argument type's :alone value, a written value)
|
|
# modulepath_test.sh — @eval finds modules beside the file that names them
|
|
# editor_test.sh — editor support (doc/edit): indentation and table
|
|
# alignment; needs python3, uses Emacs when installed
|
|
#
|
|
# Requires KLAMMERTEXT_HOME set and `ktext` on PATH (build it with `make -C com`).
|
|
|
|
.PHONY: test
|
|
test:
|
|
./cond_test.sh
|
|
./deftype_test.sh
|
|
./escape_test.sh
|
|
./filename_test.sh
|
|
./alone_test.sh
|
|
./modulepath_test.sh
|
|
./editor_test.sh
|