From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-2.sys.kth.se (smtp-2.sys.kth.se [130.237.32.160]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id p0ANAUBP017263 for ; Mon, 10 Jan 2011 18:10:30 -0500 (EST) Received: from smtp-2.sys.kth.se (localhost [127.0.0.1]) by smtp-2.sys.kth.se (Postfix) with ESMTP id 4B60014DC89; Tue, 11 Jan 2011 00:10:23 +0100 (CET) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-2.sys.kth.se ([127.0.0.1]) by smtp-2.sys.kth.se (smtp-2.sys.kth.se [127.0.0.1]) (amavisd-new, port 10024) with LMTP id vyetG4mZn-nH; Tue, 11 Jan 2011 00:10:22 +0100 (CET) X-KTH-Auth: kristaps [85.8.60.237] X-KTH-mail-from: kristaps@bsd.lv Received: from h85-8-60-237.dynamic.se.alltele.net (h85-8-60-237.dynamic.se.alltele.net [85.8.60.237]) by smtp-2.sys.kth.se (Postfix) with ESMTP id 8442214DC97; Tue, 11 Jan 2011 00:10:19 +0100 (CET) Message-ID: <4D2B91DA.3000607@bsd.lv> Date: Tue, 11 Jan 2011 00:10:18 +0100 From: Kristaps Dzonsons User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 To: tech@mdocml.bsd.lv CC: Ingo Schwarze Subject: Re: [PATCH] uniform parsing of names in libroff References: <20110110225213.GA4964@iris.usta.de> In-Reply-To: <20110110225213.GA4964@iris.usta.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 10/01/2011 23:52, Ingo Schwarze wrote: > Hi, > > i just started to implement .rm (remove macro) in libroff, > then realized that i would be introducing the third place > where names (that is, to be precise, roff macro and string names) > get parsed. > > The following patch moves this parsing into its own function, > to be soon reused by roff_rm(). > > I put that function roff_getname() in libroff (and not in > libmandoc) because i do not expect any macro package to deal > with that kind of low-level stuff. > > The interface is similar to mandoc_getarg(), but much simpler, > because quotes count as normal characters in this context, > space characters cannot be escaped, and backslashes are only > allowed in pairs. Yes, parsing of names has its own rules, > and they are quite different from the rules for parsing of > arguments. See, this is roff, right? > > As a bonus: > - Both roff_ds and roff_nr become much shorter. > - We get an ERROR when there are escapes in a name. > > OK? Ingo, I'm fine with this. Let me know when your changes into libroff are finished---I want to hash setstr() stuff, as there are a lot of pod2man and man pages with lots of requests, and we can probably make a measurably impact on performance. Thanks, Kristaps -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv