From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id 6776c2fa for ; Wed, 11 Jan 2017 15:30:45 -0500 (EST) Received: by mail-lf0-f47.google.com with SMTP id o140so89686526lff.3 for ; Wed, 11 Jan 2017 12:30:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=lsYaDvf6uH1kPkl25B8JuJ1DGaAq5VEr37/1cx+O1hs=; b=WXhU3HIUnyC8F84q2+AKhqSx5/zbB1amX4lROz5OaQMt5bZque89DzCvPyXVsb3VR/ AGju0hyi9Ld2+jPBPZDp8MTAudom1qKihmLs4WMpZDw3jDyaWvHzu7YlUDdZVb45hLAI 9eSvpMG5Uz48S67MVndPngXljjZzRZdRJ4NC6wveoz/gpiddu7LOIzUuV+CP03pr2gP6 XILKssva/pBszAVyCqrTxZ6yDFno75KXXo1i54QCpo7OCyqQQPE46BTbbD8VNxJa2VmR AUCN2arQwdmAHl2J07TA714yAThtte5yZfYhd6hwP3C7hA719gB6KoI1bCbOfOq0yqyz 3KNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=lsYaDvf6uH1kPkl25B8JuJ1DGaAq5VEr37/1cx+O1hs=; b=PL+PP6N5g/cGFBKUmcpAdMvgNvnVUaLS4DqXP0ZEAor4EvtdDCCulvbLoGjOeu+6er QwcRcH/SkgBy7LltojFUpxlKWStnnTqQrhI/YZTN4KoDc8yoMwD+G6fomIQ1BUV4v/DV QubFJLL3J93E3oa/oD0kujXkZ3JpGQPGVNaR7JC1brm6fVAADJmb9f/LlmqrEyXUs1X5 P50uEkZOqUzKtTuklIQd//hguVcthN3USWjs+vaL8eMeLQ9I+yAdWL59dP8MFiegjNCb hvbV6Kod2XI2ImEdhXyxNxeo9o3GBykB1+LFfS84ZE1VWBuvkHTgPlpXs4hCJtzYJ1XH JVsw== X-Gm-Message-State: AIkVDXJz1ILHKSlDeQiwIijsig1pwy1Vp0/UFw4215oehc5AAZy55a3w9yP9UaX0fD6kLtmTAWUSg8ASyhxjxw== X-Received: by 10.25.76.193 with SMTP id z184mr4340808lfa.61.1484166643040; Wed, 11 Jan 2017 12:30:43 -0800 (PST) X-Mailinglist: mdocml-discuss Reply-To: discuss@mdocml.bsd.lv MIME-Version: 1.0 Received: by 10.25.35.82 with HTTP; Wed, 11 Jan 2017 12:30:42 -0800 (PST) In-Reply-To: <20170111185309.GA40572@athene.usta.de> References: <20170111185309.GA40572@athene.usta.de> From: Abhinav Upadhyay Date: Thu, 12 Jan 2017 02:00:42 +0530 Message-ID: Subject: Re: Parsing of .Ex with -std argument To: Ingo Schwarze Cc: discuss@mdocml.bsd.lv Content-Type: text/plain; charset=UTF-8 On Thu, Jan 12, 2017 at 12:23 AM, Ingo Schwarze wrote: > Hi Abhinav, > > sorry for not answering this one in a timely fashion. > I was occupied with other matters back then and forgot > to send a preliminary answer. No problem, thanks for resolving it :) > > Abhinav Upadhyay wrote on Sun, Oct 02, 2016 at 11:13:00PM +0530: > >> I'm having issues parsing man pages which use the .Ex macro in the >> EXIT STATUS section. For example mandoc -Ttree shows following output >> for a man page using it: >> >> Sh (block) *138:2 >> Sh (head) 138:2 >> EXIT STATUS (text) 138:5 >> Sh (body) 138:2 >> Ex (elem) -std *139:2 >> nbperf (text) 139:2 >> >> This is causing makemandb(8) (NetBSD's indexing tool) parse the EXIT >> STATUS section just as "nbperf" instead of the complete expanded text. > > This was a symptom of a more general problem. The text production > macros - .At, .Bsx, .Bx, .Ex, .Fx, .Lb, .Nx, .Ox, .Rv, .St, .Ux > and the obsolete .Bt and .Ud - handled their task inconsistently. > Some produced text at the validation stage and added it to the > syntax tree, notably .Lb and .St. Others did little at the > validation stage and left text production to the formatters, > notably .Ex and .Rv. Both approaches had downsides. Text > production at the validation stage obscured the content of the > original source document, making it impossible to recover the source > from the finalized syntax tree. Text production in the formatters > implied code duplication and the problem you describe for tools > using the library. > > I now committed substantial changes cleaning this up, introducing > a flag NODE_NOPRT such that content that is required in the source > code but not intended to be printed can remain in the tree, for > example the argument of .St, solving the first problem, and introducing > a flag NODE_NOSRC such that generated content not contained in the > source document can be marked, allowing to solve the second problem > and do text generation at the validation stage for all macros, even > for .Ex and .Rv. This work required a number of commits; i'm > appending the commit message of the final one at the end. > > The resulting changes will be in mandoc-1.13.5 and in mandoc-1.14.x > when released. This is pretty awesome, any clues about when will 1.13.5 or 1.14.x come out? Regards Abhinav -- To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv