From 3bc2083f7ee493642602f9dcee0f82ecbcca4c85 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sun, 30 May 2010 22:56:02 +0000 Subject: Migrate `Bl -column' phrases to be MDOC_BODY instead of MDOC_HEAD. This will make it easy for re-entrant parsing of `Ta' macros to fit in with standard closure rules. Added some more regressions for `Bl -column'. Note that one should fail, as documented in the TODO file. Recorded change of AST BNF in mdoc.3. --- mdoc.3 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mdoc.3') diff --git a/mdoc.3 b/mdoc.3 index 654013c5..ea7bedb4 100644 --- a/mdoc.3 +++ b/mdoc.3 @@ -221,9 +221,7 @@ where capitalised non-terminals represent nodes. .It mnode \(<- BLOCK | ELEMENT | TEXT .It BLOCK -\(<- (HEAD [TEXT])+ [BODY [TEXT]] [TAIL [TEXT]] -.It BLOCK -\(<- BODY [TEXT] [TAIL [TEXT]] +\(<- HEAD [TEXT] (BODY [TEXT])+ [TAIL [TEXT]] .It ELEMENT \(<- TEXT* .It HEAD @@ -237,12 +235,14 @@ where capitalised non-terminals represent nodes. .El .Pp Of note are the TEXT nodes following the HEAD, BODY and TAIL nodes of -the BLOCK production. -These refer to punctuation marks. +the BLOCK production: these refer to punctuation marks. Furthermore, although a TEXT node will generally have a non-zero-length string, in the specific case of .Sq \&.Bd \-literal , an empty line will produce a zero-length string. +Multiple body parts are only found in invocations of +.Sq \&Bl \-column , +where a new body introduces a new phrase. .Sh EXAMPLES The following example reads lines from stdin and parses them, operating on the finished parse tree with -- cgit