aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/regress
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-07-06 00:19:54 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-07-06 00:19:54 +0000
commit85dde46a7c3beea67394f0a89322372457dcbbf4 (patch)
treeb005a91c14c7f0f5b74bbd5744dc6c218bdce789 /regress
parentacb30a24128863f2d57ac9aa20a93c8dd243b80b (diff)
downloadmandoc-85dde46a7c3beea67394f0a89322372457dcbbf4.tar.gz
mandoc-85dde46a7c3beea67394f0a89322372457dcbbf4.tar.zst
mandoc-85dde46a7c3beea67394f0a89322372457dcbbf4.zip
Fix operator precedence according to Brian W. Kernighan and Lorinda
L. Cherry, "Typesetting Mathematics - User's Guide (Second Edition)", August 15, 1978, paragraph 23; swarm of bugs pointed out by bentley@.
Diffstat (limited to 'regress')
-rw-r--r--regress/eqn/fromto/Makefile6
-rw-r--r--regress/eqn/fromto/precedence.in15
-rw-r--r--regress/eqn/fromto/precedence.out_ascii9
-rw-r--r--regress/eqn/fromto/precedence.out_html1
-rw-r--r--regress/eqn/over/precedence.in7
-rw-r--r--regress/eqn/over/precedence.out_ascii5
-rw-r--r--regress/eqn/over/precedence.out_html2
-rw-r--r--regress/eqn/subsup/Makefile6
-rw-r--r--regress/eqn/subsup/precedence.in14
-rw-r--r--regress/eqn/subsup/precedence.out_ascii9
-rw-r--r--regress/eqn/subsup/precedence.out_html1
-rw-r--r--regress/eqn/unary/bold.in6
-rw-r--r--regress/eqn/unary/bold.out_ascii4
-rw-r--r--regress/eqn/unary/bold.out_html2
-rw-r--r--regress/eqn/unary/diacrit.in5
-rw-r--r--regress/eqn/unary/diacrit.out_ascii4
-rw-r--r--regress/eqn/unary/diacrit.out_html2
-rw-r--r--regress/eqn/unary/sqrt.in6
-rw-r--r--regress/eqn/unary/sqrt.out_ascii5
-rw-r--r--regress/eqn/unary/sqrt.out_html2
20 files changed, 82 insertions, 29 deletions
diff --git a/regress/eqn/fromto/Makefile b/regress/eqn/fromto/Makefile
index a2012e8f..1384c543 100644
--- a/regress/eqn/fromto/Makefile
+++ b/regress/eqn/fromto/Makefile
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile,v 1.2 2015/01/01 15:34:43 schwarze Exp $
+# $OpenBSD: Makefile,v 1.3 2017/07/06 00:08:52 schwarze Exp $
-REGRESS_TARGETS = basic noarg
-HTML_TARGETS = basic noarg
+REGRESS_TARGETS = basic noarg precedence
+HTML_TARGETS = basic noarg precedence
.include <bsd.regress.mk>
diff --git a/regress/eqn/fromto/precedence.in b/regress/eqn/fromto/precedence.in
new file mode 100644
index 00000000..939ab51a
--- /dev/null
+++ b/regress/eqn/fromto/precedence.in
@@ -0,0 +1,15 @@
+.\" $OpenBSD: precedence.in,v 1.1 2017/07/06 00:08:52 schwarze Exp $
+.Dd $Mdocdate: July 6 2017 $
+.Dt SUBSUP-PRECEDENCE 1
+.Os
+.Sh NAME
+.Nm subsup-precedence
+.Nd precedence of subscripts and superscripts
+.Sh DESCRIPTION
+.ps 36
+initial text
+.EQ
+X from a under to c hat ; roman X from bold a to italic c ;
+X sub 1 sup 2 from a sub c sup e to o sub r sup s
+.EN
+final text
diff --git a/regress/eqn/fromto/precedence.out_ascii b/regress/eqn/fromto/precedence.out_ascii
new file mode 100644
index 00000000..1eba1bef
--- /dev/null
+++ b/regress/eqn/fromto/precedence.out_ascii
@@ -0,0 +1,9 @@
+SUBSUP-PRECEDENCE(1) General Commands Manual SUBSUP-PRECEDENCE(1)
+
+NNAAMMEE
+ ssuubbssuupp--pprreecceeddeennccee - precedence of subscripts and superscripts
+
+DDEESSCCRRIIPPTTIIOONN
+ initial text _X__a_^_c^ ; X_aa^_c ; _X_1^2__a__c^_e^_o__r^_s final text
+
+OpenBSD July 6, 2017 OpenBSD
diff --git a/regress/eqn/fromto/precedence.out_html b/regress/eqn/fromto/precedence.out_html
new file mode 100644
index 00000000..bb9074e6
--- /dev/null
+++ b/regress/eqn/fromto/precedence.out_html
@@ -0,0 +1 @@
+<mrow><munderover><mi>X</mi><munder><mi>a</mi><mo>_</mo></munder><mover><mi>c</mi><mo>^</mo></mover></munderover><mo>;</mo><munderover><mrow><mi fontstyle="normal">X</mi></mrow><mrow><mi fontweight="bold">a</mi></mrow><mrow><mi>c</mi></mrow></munderover><mo>;</mo><munderover><msubsup><mi>X</mi><mn>1</mn><mn>2</mn></msubsup><msubsup><mi>a</mi><mi>c</mi><mi>e</mi></msubsup><msubsup><mi>o</mi><mi>r</mi><mi>s</mi></msubsup></munderover></mrow>
diff --git a/regress/eqn/over/precedence.in b/regress/eqn/over/precedence.in
index 3bc0e7fc..12b28cef 100644
--- a/regress/eqn/over/precedence.in
+++ b/regress/eqn/over/precedence.in
@@ -1,5 +1,5 @@
-.\" $OpenBSD: precedence.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $
-.Dd $Mdocdate: July 4 2017 $
+.\" $OpenBSD: precedence.in,v 1.3 2017/07/06 00:08:52 schwarze Exp $
+.Dd $Mdocdate: July 6 2017 $
.Dt OVER-PRECEDENCE 1
.Os
.Sh NAME
@@ -8,6 +8,7 @@
.Sh DESCRIPTION
initial text
.EQ
-1 + x + x sup 2 over 2 + x sup 3 over { 2 * 3 }
+1 + x + x sup 2 over 2 + x sup 3 over { 2 * 3 } ;
+a hat over c tilde ; bold a over bold c ; sqrt a over sqrt c
.EN
final text
diff --git a/regress/eqn/over/precedence.out_ascii b/regress/eqn/over/precedence.out_ascii
index 92529bb4..a77aa47f 100644
--- a/regress/eqn/over/precedence.out_ascii
+++ b/regress/eqn/over/precedence.out_ascii
@@ -4,6 +4,7 @@ NNAAMMEE
oovveerr--pprreecceeddeennccee - precedence of the fraction operator
DDEESSCCRRIIPPTTIIOONN
- initial text 1 + _x + _x^2/2 + _x^3/(2 * 3) final text
+ initial text 1 + _x + _x^2/2 + _x^3/(2 * 3) ; _a^/_c~ ; aa/cc ; sqrt(_a)/sqrt(_c)
+ final text
-OpenBSD July 4, 2017 OpenBSD
+OpenBSD July 6, 2017 OpenBSD
diff --git a/regress/eqn/over/precedence.out_html b/regress/eqn/over/precedence.out_html
index b7c4f36d..52e45eb5 100644
--- a/regress/eqn/over/precedence.out_html
+++ b/regress/eqn/over/precedence.out_html
@@ -1 +1 @@
-<mrow><mn>1</mn><mo>+</mo><mi>x</mi><mo>+</mo><mfrac><msup><mi>x</mi><mn>2</mn></msup><mn>2</mn></mfrac><mo>+</mo><mfrac><msup><mi>x</mi><mn>3</mn></msup><mrow><mn>2</mn><mo>*</mo><mn>3</mn></mrow></mfrac></mrow>
+<mrow><mn>1</mn><mo>+</mo><mi>x</mi><mo>+</mo><mfrac><msup><mi>x</mi><mn>2</mn></msup><mn>2</mn></mfrac><mo>+</mo><mfrac><msup><mi>x</mi><mn>3</mn></msup><mrow><mn>2</mn><mo>*</mo><mn>3</mn></mrow></mfrac><mo>;</mo><mfrac><mover><mi>a</mi><mo>^</mo></mover><mover><mi>c</mi><mo>~</mo></mover></mfrac><mo>;</mo><mfrac><mrow><mi fontweight="bold">a</mi></mrow><mrow><mi fontweight="bold">c</mi></mrow></mfrac><mo>;</mo><mfrac><msqrt><mi>a</mi></msqrt><msqrt><mi>c</mi></msqrt></mfrac></mrow>
diff --git a/regress/eqn/subsup/Makefile b/regress/eqn/subsup/Makefile
index 4e11b33d..a7801046 100644
--- a/regress/eqn/subsup/Makefile
+++ b/regress/eqn/subsup/Makefile
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile,v 1.2 2015/01/01 15:34:43 schwarze Exp $
+# $OpenBSD: Makefile,v 1.3 2017/07/06 00:08:52 schwarze Exp $
-REGRESS_TARGETS = combine noarg sub_group
-HTML_TARGETS = combine noarg sub_group
+REGRESS_TARGETS = combine noarg precedence sub_group
+HTML_TARGETS = combine noarg precedence sub_group
.include <bsd.regress.mk>
diff --git a/regress/eqn/subsup/precedence.in b/regress/eqn/subsup/precedence.in
new file mode 100644
index 00000000..d184fc07
--- /dev/null
+++ b/regress/eqn/subsup/precedence.in
@@ -0,0 +1,14 @@
+.\" $OpenBSD: precedence.in,v 1.1 2017/07/06 00:08:52 schwarze Exp $
+.Dd $Mdocdate: July 6 2017 $
+.Dt SUBSUP-PRECEDENCE 1
+.Os
+.Sh NAME
+.Nm subsup-precedence
+.Nd precedence of subscripts and superscripts
+.Sh DESCRIPTION
+initial text
+.EQ
+x hat sub 1 under sup 2 bar + e tilde sup x hat sub s dyad ;
+roman I sub bold I sup italic I + roman I sup bold I sub italic I
+.EN
+final text
diff --git a/regress/eqn/subsup/precedence.out_ascii b/regress/eqn/subsup/precedence.out_ascii
new file mode 100644
index 00000000..60619b54
--- /dev/null
+++ b/regress/eqn/subsup/precedence.out_ascii
@@ -0,0 +1,9 @@
+SUBSUP-PRECEDENCE(1) General Commands Manual SUBSUP-PRECEDENCE(1)
+
+NNAAMMEE
+ ssuubbssuupp--pprreecceeddeennccee - precedence of subscripts and superscripts
+
+DDEESSCCRRIIPPTTIIOONN
+ initial text _x^_1_^2 + _e~^_x^__s<-> ; I_II^_I + I^II__I final text
+
+OpenBSD July 6, 2017 OpenBSD
diff --git a/regress/eqn/subsup/precedence.out_html b/regress/eqn/subsup/precedence.out_html
new file mode 100644
index 00000000..1cad9ce2
--- /dev/null
+++ b/regress/eqn/subsup/precedence.out_html
@@ -0,0 +1 @@
+<mrow><msubsup><mover><mi>x</mi><mo>^</mo></mover><munder><mn>1</mn><mo>_</mo></munder><mover><mn>2</mn><mo></mo></mover></msubsup><mo>+</mo><msup><mover><mi>e</mi><mo>~</mo></mover><msub><mover><mi>x</mi><mo>^</mo></mover><mover><mi>s</mi><mo>&#8596;</mo></mover></msub></msup><mo>;</mo><msubsup><mrow><mi fontstyle="normal">I</mi></mrow><mrow><mi fontweight="bold">I</mi></mrow><mrow><mi>I</mi></mrow></msubsup><mo>+</mo><msup><mrow><mi fontstyle="normal">I</mi></mrow><msub><mrow><mi fontweight="bold">I</mi></mrow><mrow><mi>I</mi></mrow></msub></msup></mrow>
diff --git a/regress/eqn/unary/bold.in b/regress/eqn/unary/bold.in
index ad098a83..e77398f4 100644
--- a/regress/eqn/unary/bold.in
+++ b/regress/eqn/unary/bold.in
@@ -1,5 +1,5 @@
-.\" $OpenBSD: bold.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $
-.Dd $Mdocdate: July 4 2017 $
+.\" $OpenBSD: bold.in,v 1.3 2017/07/06 00:08:52 schwarze Exp $
+.Dd $Mdocdate: July 6 2017 $
.Dt UNARY-BOLD 1
.Os
.Sh NAME
@@ -8,6 +8,6 @@
.Sh DESCRIPTION
initial text
.EQ
-bold { sin "sin" }
+bold { sin "sin" } "text" bold x hat
.EN
final text
diff --git a/regress/eqn/unary/bold.out_ascii b/regress/eqn/unary/bold.out_ascii
index c20dc638..7356ede0 100644
--- a/regress/eqn/unary/bold.out_ascii
+++ b/regress/eqn/unary/bold.out_ascii
@@ -4,6 +4,6 @@ NNAAMMEE
uunnaarryy--bboolldd - font handling in bold boxes
DDEESSCCRRIIPPTTIIOONN
- initial text ((sin ssiinn)) final text
+ initial text ((sin ssiinn)) _t_e_x_t xx^^ final text
-OpenBSD July 4, 2017 OpenBSD
+OpenBSD July 6, 2017 OpenBSD
diff --git a/regress/eqn/unary/bold.out_html b/regress/eqn/unary/bold.out_html
index 56d6762f..e1263a4f 100644
--- a/regress/eqn/unary/bold.out_html
+++ b/regress/eqn/unary/bold.out_html
@@ -1 +1 @@
-<mrow><mrow><mrow><mi>sin</mi><mi fontweight="bold">sin</mi></mrow></mrow></mrow>
+<mrow><mrow><mrow><mi>sin</mi><mi fontweight="bold">sin</mi></mrow></mrow><mi fontstyle="italic">text</mi><mrow><mover><mi fontweight="bold">x</mi><mo>^</mo></mover></mrow></mrow>
diff --git a/regress/eqn/unary/diacrit.in b/regress/eqn/unary/diacrit.in
index 6e91f847..ab83dbb1 100644
--- a/regress/eqn/unary/diacrit.in
+++ b/regress/eqn/unary/diacrit.in
@@ -1,5 +1,5 @@
-.\" $OpenBSD: diacrit.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $
-.Dd $Mdocdate: July 4 2017 $
+.\" $OpenBSD: diacrit.in,v 1.3 2017/07/06 00:08:52 schwarze Exp $
+.Dd $Mdocdate: July 6 2017 $
.Dt UNARY-DIACRIT 1
.Os
.Sh NAME
@@ -10,5 +10,6 @@ initial text
.EQ
x dot x dotdot x hat x tilde x vec x dyad
{ x + y } bar { x + y } under
+x tilde hat
.EN
final text
diff --git a/regress/eqn/unary/diacrit.out_ascii b/regress/eqn/unary/diacrit.out_ascii
index f2c5b0bb..62ac035f 100644
--- a/regress/eqn/unary/diacrit.out_ascii
+++ b/regress/eqn/unary/diacrit.out_ascii
@@ -4,6 +4,6 @@ NNAAMMEE
uunnaarryy--ddiiaaccrriitt - diacritical marks in equations
DDEESSCCRRIIPPTTIIOONN
- initial text _x. _x" _x^ _x~ _x-> _x<-> (_x + _y) (_x + _y)_ final text
+ initial text _x. _x" _x^ _x~ _x-> _x<-> (_x + _y) (_x + _y)_ _x~^ final text
-OpenBSD July 4, 2017 OpenBSD
+OpenBSD July 6, 2017 OpenBSD
diff --git a/regress/eqn/unary/diacrit.out_html b/regress/eqn/unary/diacrit.out_html
index 02dcc2f4..d3d4d361 100644
--- a/regress/eqn/unary/diacrit.out_html
+++ b/regress/eqn/unary/diacrit.out_html
@@ -1 +1 @@
-<mrow><mover><mi>x</mi><mo>&#729;</mo></mover><mover><mi>x</mi><mo>&#168;</mo></mover><mover><mi>x</mi><mo>^</mo></mover><mover><mi>x</mi><mo>~</mo></mover><mover><mi>x</mi><mo>&#8594;</mo></mover><mover><mi>x</mi><mo>&#8596;</mo></mover><mover><mrow><mi>x</mi><mo>+</mo><mi>y</mi></mrow><mo></mo></mover><munder><mrow><mi>x</mi><mo>+</mo><mi>y</mi></mrow><mo>_</mo></munder></mrow>
+<mrow><mover><mi>x</mi><mo>&#729;</mo></mover><mover><mi>x</mi><mo>&#168;</mo></mover><mover><mi>x</mi><mo>^</mo></mover><mover><mi>x</mi><mo>~</mo></mover><mover><mi>x</mi><mo>&#8594;</mo></mover><mover><mi>x</mi><mo>&#8596;</mo></mover><mover><mrow><mi>x</mi><mo>+</mo><mi>y</mi></mrow><mo></mo></mover><munder><mrow><mi>x</mi><mo>+</mo><mi>y</mi></mrow><mo>_</mo></munder><mover><mover><mi>x</mi><mo>~</mo></mover><mo>^</mo></mover></mrow>
diff --git a/regress/eqn/unary/sqrt.in b/regress/eqn/unary/sqrt.in
index a7059624..e007ff01 100644
--- a/regress/eqn/unary/sqrt.in
+++ b/regress/eqn/unary/sqrt.in
@@ -1,5 +1,5 @@
-.\" $OpenBSD: sqrt.in,v 1.4 2017/07/04 14:53:23 schwarze Exp $
-.Dd $Mdocdate: July 4 2017 $
+.\" $OpenBSD: sqrt.in,v 1.5 2017/07/06 00:08:52 schwarze Exp $
+.Dd $Mdocdate: July 6 2017 $
.Dt UNARY-SQRT 1
.Os
.Sh NAME
@@ -8,6 +8,6 @@
.Sh DESCRIPTION
initial text
.EQ
-r = sqrt { x sup 2 + y sup 2 } + sqrt a+b + sqrt { } + sqrt
+r = sqrt { x sup 2 + y sup 2 } + sqrt a+b + sqrt x hat + sqrt { } + sqrt
.EN
final text
diff --git a/regress/eqn/unary/sqrt.out_ascii b/regress/eqn/unary/sqrt.out_ascii
index 607a6013..72b7047d 100644
--- a/regress/eqn/unary/sqrt.out_ascii
+++ b/regress/eqn/unary/sqrt.out_ascii
@@ -4,6 +4,7 @@ NNAAMMEE
uunnaarryy--ssqqrrtt - square root
DDEESSCCRRIIPPTTIIOONN
- initial text _r = sqrt(_x^2 + _y^2) + sqrt(_a + _b) + sqrt() + sqrt final text
+ initial text _r = sqrt(_x^2 + _y^2) + sqrt(_a + _b) + sqrt(_x^) + sqrt() + sqrt
+ final text
-OpenBSD July 4, 2017 OpenBSD
+OpenBSD July 6, 2017 OpenBSD
diff --git a/regress/eqn/unary/sqrt.out_html b/regress/eqn/unary/sqrt.out_html
index ca2de199..0b5fe37e 100644
--- a/regress/eqn/unary/sqrt.out_html
+++ b/regress/eqn/unary/sqrt.out_html
@@ -1 +1 @@
-<mrow><mi>r</mi><mo>=</mo><msqrt><mrow><msup><mi>x</mi><mn>2</mn></msup><mo>+</mo><msup><mi>y</mi><mn>2</mn></msup></mrow></msqrt><mo>+</mo><msqrt><mrow><mi>a</mi><mo>+</mo><mi>b</mi></mrow></msqrt><mo>+</mo><msqrt><mrow></mrow></msqrt><mo>+</mo><msqrt></msqrt></mrow>
+<mrow><mi>r</mi><mo>=</mo><msqrt><mrow><msup><mi>x</mi><mn>2</mn></msup><mo>+</mo><msup><mi>y</mi><mn>2</mn></msup></mrow></msqrt><mo>+</mo><msqrt><mrow><mi>a</mi><mo>+</mo><mi>b</mi></mrow></msqrt><mo>+</mo><msqrt><mover><mi>x</mi><mo>^</mo></mover></msqrt><mo>+</mo><msqrt><mrow></mrow></msqrt><mo>+</mo><msqrt></msqrt></mrow>