[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 03/09: [ms]: Emit error if .EQ used within .TS/.TE.
From: |
G. Branden Robinson |
Subject: |
[groff] 03/09: [ms]: Emit error if .EQ used within .TS/.TE. |
Date: |
Mon, 14 Jun 2021 14:32:26 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 95e9b7ad91403c131edbfd32cf847c296ad99ba5
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon Jun 14 21:02:11 2021 +1000
[ms]: Emit error if .EQ used within .TS/.TE.
* tmac/s.tmac: Add diagnostic error if .EQ used within .TS/.TE.
Introduce register `tbl@within-table` to track whether we're inside a
table.
(@EQ): Check register and issue error if it is true.
(@TS): Set register.
(@TE): Clear register.
Prompted by Savannah #55754.
---
ChangeLog | 11 +++++++++++
tmac/s.tmac | 5 +++++
2 files changed, 16 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index ff09150..e5cc787 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2021-06-14 G. Branden Robinson <g.branden.robinson@gmail.com>
+ * tmac/s.tmac: Add diagnostic error if .EQ used within .TS/.TE.
+ Introduce register `tbl@within-table` to track whether we're
+ inside a table.
+ (@EQ): Check register and issue error if it is true.
+ (@TS): Set register.
+ (@TE): Clear register.
+
+ Prompted by Savannah #55754.
+
+2021-06-14 G. Branden Robinson <g.branden.robinson@gmail.com>
+
* tmac/s.tmac: Permit document to start with .PS.
(cov*ab-init): Alias PS to @PS.
(PS): Call LP, then re-execute (aliased) self as TS does.
diff --git a/tmac/s.tmac b/tmac/s.tmac
index 857df76..84a1623 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -1764,6 +1764,8 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
.de EN
..
.de @EQ
+.if \\n[tbl@within-table] \
+. @error .EQ is not allowed within a .TS/.TE table
.br
.ds eqn*num "\\$2
.ie '\\$1'L' .nr eqn*type 0
@@ -1854,6 +1856,7 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
.\" ******** module tbl ********
.\" ****************************
.\" Tbl support.
+.nr tbl@within-table 0
.nr tbl*have-header 0
.\" This gets called if TS occurs before the first paragraph.
.de TS
@@ -1862,6 +1865,7 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
\\*[TS]\\
..
.de @TS
+.nr tbl@within-table 1
.sp \\n[DD]u
.if '\\$1'H' \{\
. ds tbl*stem .TS H table inside\"
@@ -1924,6 +1928,7 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
. ll \\n[tbl*ll]u
.\" reset tabs
.TA
+.nr tbl@within-table 0
..
.de tbl@bottom-hook
.if \\n[tbl*have-header] \{\
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 03/09: [ms]: Emit error if .EQ used within .TS/.TE.,
G. Branden Robinson <=