[BACK]Return to B.in CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc / regress / roff / esc

File: [cvsweb.bsd.lv] / mandoc / regress / roff / esc / B.in (download)

Revision 1.3, Wed Jun 8 13:24:01 2022 UTC (2 years ago) by schwarze
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +95 -3 lines

Surprisingly, every escape sequence can also be used as an argument
delimiter for an outer escape sequence, in which case the delimiting
escape sequence retains its syntax but usually ignores its argument
and loses its inherent effect.  Add rudimentary support for this
syntax quirk in order to improve parsing compatibility with groff.

.\" $OpenBSD: B.in,v 1.4 2022/06/08 13:08:00 schwarze Exp $
.Dd $Mdocdate: June 8 2022 $
.Dt ESC-B 1
.Os
.Sh NAME
.Nm esc-B
.Nd the roff escape B sequence: validate numerical expression
.Sh DESCRIPTION
empty: \B''
.br
digit: \B'0'
.br
no number: \B'no number'
.br
trailing garbage: \B'1X'
.br
trailing operator: \B'1+'
.br
infix operator: \B'1+1'
.br
infix and trailing operator: \B'1+1+'
.br
chain of operations: \B'1+2+3+4'
.br
trailing para: \B'1+('
.br
unclosed para: \B'(1'
.br
empty pair of parentheses: \B'()'
.br
parentheses containing number: \B'(42)'
.br
complex expression: \B'3+(3*(5==5*2)*4)+(3*5)/2'
.br
other delimiter: \Bx1+1x
.Ss Argument delimiters
unsupported \e!: \B\!42\!u
.br
unsupported \er: \B\r42u
.br
ignored \e%: \B\%42\%u
.br
ignored \e&: \B\&42\&u
.br
ignored \e): \B\)42\)u
.br
ignored \e,: \B\,42\,u
.br
ignored \e/: \B\/42\/u
.br
ignored \e^: \B\^42\^u
.br
ignored \ea: \B\a42\au
.br
ignored \ed: \B\d42\du
.br
ignored \et: \B\t42\tu
.br
ignored \eu: \B\u42\uu
.br
ignored \e{: \B\{42\{u
.br
ignored \e|: \B\|42\|u
.br
ignored \e}: \B\}42\}u
.br
useless \e.: \B\.42.u
.\".br
.\"XXX useless \e\e: \B\\42\\u
.br
invalid \eG: \B\G42Gu
.br
special \e\ : \B\ 42\ u
.br
special \e\(aq: \B\'42\'u
.br
special \e-: \B\-42\-u
.br
special \e0: \B\042\0u
.br
special \e:: \B\:42\:u
.br
special \e_: \B\_42\_u
.br
special \e\(ga: \B\`42\`u
.br
special \ee: \B\e42\eu
.br
special \e~: \B\~42\~u
.br
break \ep: \B\p42\pu
.br
nospace \ec: \B\c42\cu
.\".br
.\"XXX skipchar \ec: \B\z42\zu
.br
.ds mystr x42xu
string expansion: \B\*[mystr]
.br
.nr myreg 23
register expansion: \B\n[myreg]u
.br
ignored \eO: \B\O142\O2u
.br
ignored \eY: \B\Y[mystr]42\Y[mystr]u
.br
ignored \ek: \B\k[myreg]42\k[myreg]u
.br
special character: \B\(hy42\(hyu
.br
ignored \eD: \B\D't 1'42\D't 2'u
.br
ignored \eL: \B\L'2'42u
.br
ignored \eX: \B\X'foo'42\X'bar'u
.br
ignored \eZ: \B\Z'foo'42\Z''u
.br
ignored \eb: \B\b'2'42\b''u
.br
ignored \ev: \B\v'2'42\v'0'u
.br
ignored \ex: \B\x'2'42\v'0'u
.br
horizontal motion: \B\h'1'42\h'3'u
.br
horizontal line: \B\l'4'42\l'2'u
.br
overstrike: \B\o'ab'42\o'cd'u