From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from scc-mailout-kit-01.scc.kit.edu (scc-mailout-kit-01.scc.kit.edu [129.13.231.81]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 3d6fb203 for ; Wed, 8 Jan 2020 07:21:51 -0500 (EST) Received: from hekate.asta.kit.edu ([141.3.145.153] helo=hekate.usta.de) by scc-mailout-kit-01.scc.kit.edu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (envelope-from ) id 1ipALN-0004pN-A5; Wed, 08 Jan 2020 13:21:51 +0100 Received: from donnerwolke.asta.kit.edu ([141.3.145.61] helo=donnerwolke.usta.de) by hekate.usta.de with esmtp (Exim 4.92.2) (envelope-from ) id 1ipALM-00081N-Ve; Wed, 08 Jan 2020 13:21:48 +0100 Received: from athene.asta.kit.edu ([141.3.145.60] helo=athene.usta.de) by donnerwolke.usta.de with esmtp (Exim 4.84_2) (envelope-from ) id 1ipALM-0007IG-PL; Wed, 08 Jan 2020 13:21:48 +0100 Received: from localhost (athene.usta.de [local]) by athene.usta.de (OpenSMTPD) with ESMTPA id 1a8e60d3; Wed, 8 Jan 2020 13:21:48 +0100 (CET) Date: Wed, 8 Jan 2020 13:21:48 +0100 From: Ingo Schwarze To: "Anthony J. Bentley" Cc: tech@mandoc.bsd.lv Subject: Re: eqn(7) "delim" is undocumented (maybe) Message-ID: <20200108122148.GC49182@athene.usta.de> References: <38466-1575794557.527458@DkTY.Emny.Ld6w> X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <38466-1575794557.527458@DkTY.Emny.Ld6w> User-Agent: Mutt/1.12.2 (2019-09-21) Hi Anthony, Anthony J. Bentley wrote on Sun, Dec 08, 2019 at 01:42:37AM -0700: > As an aside, I expected these two examples to render the same, but they > don't. Should they look the same, or am I misunderstanding how eqn(7) > works? >=20 > .\" "delim off sin()" > .EQ > delim $$ > delim off > .EN > $sin { pi }$ This was is indeed misparsed and consequently misrendered by mandoc(1); fixed by the following commit. > .\" "$sin { pi }$" > .EQ > delim $$ > .EN > .EQ > delim off > .EN > $sin { pi }$ Thanks for reporting, Ingo Log Message: ----------- Skip whitespace before tokens, too. Bug found by bentley@ with input like "delim $$ delim off". Modified Files: -------------- mandoc: eqn.c mandoc/regress/eqn/delim: Makefile basic.in basic.out_ascii Added Files: ----------- mandoc/regress/eqn/delim: basic.out_utf8 Revision Data ------------- Index: eqn.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/eqn.c,v retrieving revision 1.83 retrieving revision 1.84 diff -Leqn.c -Leqn.c -u -p -r1.83 -r1.84 --- eqn.c +++ eqn.c @@ -1,7 +1,7 @@ /* $Id$ */ /* * Copyright (c) 2011, 2014 Kristaps Dzonsons - * Copyright (c) 2014, 2015, 2017, 2018 Ingo Schwarze + * Copyright (c) 2014,2015,2017,2018,2020 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -399,6 +399,14 @@ eqn_next(struct eqn_node *ep, enum parse case '"': quoted =3D 1; break; + case ' ': + case '\t': + case '~': + case '^': + if (quoted) + break; + ep->start++; + continue; default: break; } @@ -669,7 +677,7 @@ eqn_parse(struct eqn_node *ep) if (ep->data =3D=3D NULL) return; =20 - ep->start =3D ep->end =3D ep->data + strspn(ep->data, " ^~"); + ep->start =3D ep->end =3D ep->data; =20 next_tok: tok =3D eqn_next(ep, MODE_TOK); Index: Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/regress/eqn/delim/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -Lregress/eqn/delim/Makefile -Lregress/eqn/delim/Makefile -u -p -r1.2 = -r1.3 --- regress/eqn/delim/Makefile +++ regress/eqn/delim/Makefile @@ -1,6 +1,7 @@ -# $OpenBSD: Makefile,v 1.2 2020/01/08 10:50:54 schwarze Exp $ +# $OpenBSD: Makefile,v 1.3 2020/01/08 12:09:14 schwarze Exp $ =20 REGRESS_TARGETS =3D basic +UTF8_TARGETS =3D basic GOPTS =3D -e SKIP_GROFF =3D =20 --- /dev/null +++ regress/eqn/delim/basic.out_utf8 @@ -0,0 +1,10 @@ +DELIM-BASIC(1) General Commands Manual DELIM-BASI= C(1) + +N=08NA=08AM=08ME=08E + d=08de=08el=08li=08im=08m-=08-b=08ba=08as=08si=08ic=08c =E2=80=93 inl= ine eqn delimiters + +D=08DE=08ES=08SC=08CR=08RI=08IP=08PT=08TI=08IO=08ON=08N + initial text =CE=B1 inline =CE=B2 =CE=B3 inline [delta] =CE=B5 inline= =CE=B6 inline $eta$ inline =CE=B8 + final text + +OpenBSD January 8, 2020 Ope= nBSD Index: basic.out_ascii =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/regress/eqn/delim/basic.out_ascii,v retrieving revision 1.4 retrieving revision 1.5 diff -Lregress/eqn/delim/basic.out_ascii -Lregress/eqn/delim/basic.out_asci= i -u -p -r1.4 -r1.5 --- regress/eqn/delim/basic.out_ascii +++ regress/eqn/delim/basic.out_ascii @@ -5,6 +5,6 @@ N=08NA=08AM=08ME=08E =20 D=08DE=08ES=08SC=08CR=08RI=08IP=08PT=08TI=08IO=08ON=08N initial text inline inline [delta] - inline final text + inline inline $eta$ inline final text =20 OpenBSD January 8, 2020 Ope= nBSD Index: basic.in =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/regress/eqn/delim/basic.in,v retrieving revision 1.3 retrieving revision 1.4 diff -Lregress/eqn/delim/basic.in -Lregress/eqn/delim/basic.in -u -p -r1.3 = -r1.4 --- regress/eqn/delim/basic.in +++ regress/eqn/delim/basic.in @@ -1,4 +1,4 @@ -.\" $OpenBSD: basic.in,v 1.3 2020/01/08 10:58:09 schwarze Exp $ +.\" $OpenBSD: basic.in,v 1.4 2020/01/08 12:09:14 schwarze Exp $ .Dd $Mdocdate$ .Dt DELIM-BASIC 1 .Os @@ -19,4 +19,13 @@ inline [delta] delim onepsilon .EN inline [zeta] +.EQ +delim $$ +delim off +.EN +inline $eta$ +.EQ +delim on +.EN +inline $theta$ final text -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv