diff options
author | Jeffrey H. Kingston <jeff@it.usyd.edu.au> | 2010-09-14 20:41:31 +0000 |
---|---|---|
committer | Jeffrey H. Kingston <jeff@it.usyd.edu.au> | 2010-09-14 20:41:31 +0000 |
commit | 3c59753b94d0425e7ddcc4b57b11dfb283d0c144 (patch) | |
tree | d405802ec35c185908c71f0fbedc3a237758b665 /include/bsf | |
parent | f7f41daa27e7ccff0aa184cc81e80b9c96e3d761 (diff) | |
download | lout-3c59753b94d0425e7ddcc4b57b11dfb283d0c144.tar.gz |
Lout 3.36.
git-svn-id: http://svn.savannah.nongnu.org/svn/lout/trunk@41 9365b830-b601-4143-9ba8-b4a8e2c3339c
Diffstat (limited to 'include/bsf')
-rw-r--r-- | include/bsf | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/include/bsf b/include/bsf index 2c472a2..b2ca24a 100644 --- a/include/bsf +++ b/include/bsf @@ -295,6 +295,26 @@ def @BasicSetup ########################################################################### # # + # x @Dft y # + # # + # This returns x unless its value is "dft", in which case it returns y. # + # Useful for defaulting the value of one parameter to another. # + # # + ########################################################################### + + def @Dft + left x + right y + { + x @Case { + dft @Yield y + else @Yield x + } + } + + + ########################################################################### + # # # @Pipe, @PipeVerbatim, and @PipeRawVerbatim # # # ########################################################################### @@ -1349,10 +1369,11 @@ def @BasicSetup # # ########################################################################### - export @Tag val + export @Tag val display_val def @NumDispCounterMarker named @Tag {} named val {} + named display_val {} { @Null } @@ -1363,16 +1384,24 @@ def @BasicSetup } def @NumDispCounterIncrement + named @BypassNumber { "dft" } right tag { - @NumDispCounterMarker&&preceding @Tagged tag - @NumDispCounterMarker val { @NumDispNum tag } - @NumberMarker @Tag { tag } @Value { @NumDispNum tag } + def @DisplayNumber + { + @BypassNumber @Dft { @NumDispNum tag } + } + + @NumDispCounterMarker&&preceding @Tagged tag + # @NumDispCounterMarker val { @NumDispNum tag } + # @NumberMarker @Tag { tag } @Value { @NumDispNum tag } + @NumDispCounterMarker val { @NumDispNum tag } display_val { @DisplayNumber } + @NumberMarker @Tag { tag } @Value { @DisplayNumber } } def @NN { - @NumDispCounterMarker&&preceding @Open { @DisplayNumStyle val } + @NumDispCounterMarker&&preceding @Open { @DisplayNumStyle display_val } } def @Do @@ -1409,10 +1438,12 @@ def @BasicSetup def @NDisp into { @DispPlace&&preceding } named @Tag {} + named @BypassNumber { "dft" } right x { @OneRow { - @NumDispCounterIncrement @Tag + # @NumDispCounterIncrement @Tag + @NumDispCounterIncrement @BypassNumber { @BypassNumber } @Tag @PageMark @Tag ^// @OneRow x @@ -1427,10 +1458,12 @@ def @BasicSetup def @ANDisp into { @AlignedPlace&&preceding } named @Tag {} + named @BypassNumber { "dft" } right x { @OneRow { - @NumDispCounterIncrement @Tag + # @NumDispCounterIncrement @Tag + @NumDispCounterIncrement @BypassNumber { @BypassNumber } @Tag @PageMark @Tag ^/ @OneRow x |