From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout.scc.kit.edu (mailout.scc.kit.edu [129.13.185.202]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id sAK2LZ7w007701 for ; Wed, 19 Nov 2014 21:21:35 -0500 (EST) Received: from hekate.usta.de (asta-nat.asta.uni-karlsruhe.de [172.22.63.82]) by scc-mailout-02.scc.kit.edu with esmtp (Exim 4.72 #1) id 1XrHNH-0003Wh-0y; Thu, 20 Nov 2014 03:21:35 +0100 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.77) (envelope-from ) id 1XrHNG-0007Mt-Ut; Thu, 20 Nov 2014 03:21:34 +0100 Received: from iris.usta.de ([172.24.96.5] helo=usta.de) by donnerwolke.usta.de with esmtp (Exim 4.72) (envelope-from ) id 1XrHNG-0004wG-TX; Thu, 20 Nov 2014 03:21:34 +0100 Received: from schwarze by usta.de with local (Exim 4.77) (envelope-from ) id 1XrHNG-0001Dw-SL; Thu, 20 Nov 2014 03:21:34 +0100 Date: Thu, 20 Nov 2014 03:21:34 +0100 From: Ingo Schwarze To: Steffen Nurpmeso Cc: tech@mdocml.bsd.lv Subject: Re: Corner case: mandoc doesn't require \& where it should Message-ID: <20141120022134.GM28366@iris.usta.de> References: <20141111215516.zZzO7O4M%sdaoden@yandex.com> X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141111215516.zZzO7O4M%sdaoden@yandex.com> User-Agent: Mutt/1.5.21 (2010-09-15) Hi Steffen, Steffen Nurpmeso wrote on Tue, Nov 11, 2014 at 10:55:16PM +0100: > .Op Fl t Ar Sh | Ss > > with mandoc you get > > mdocmx [-v] [-t Sh | Ss] > > but with groff it is > > mdocmx [-v] [-t file ... > > which is not nice but luckily it also echoes > > Usage: .Sh not callable by other macros (#26) > > which points out something correct since it really should be > > .Op Fl t Ar \&Sh | \&Ss > > Really unfortunate is imho that -Tlint doesn't catch this. This is harder than it may seem, the rules which macros are parsed and callable have changed in the past (in particular groff relaxed them), i'm not aware that what should happen when the rules are violated was ever written down, and even though the implementation of all this is not particularly complicated, it is non-trivial by its shere size, both in mandoc and groff. For now, i have added a todo entry: - warn about attempts to call non-callable macros Steffen Nurpmeso Tue, 11 Nov 2014 22:55:16 +0100 Note that formatting is inconsistent in groff. .Fn Po prints "Po()", .Ar Sh prints "file ..." and no "Sh". Relatively hard because the relevant code is scattered all over mdoc_macro.c and all subtly different. loc ** exist ** algo ** size ** imp ** Yours, Ingo -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv