[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 51/62: [troff]: Make futile aliasing an error.
From: |
G. Branden Robinson |
Subject: |
[groff] 51/62: [troff]: Make futile aliasing an error. |
Date: |
Thu, 20 Apr 2023 06:14:40 -0400 (EDT) |
gbranden pushed a commit to branch branden-2023-04-20
in repository groff.
commit 9584fc9489e7fa24a5d5b124633b6a060b5278dd
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Apr 1 18:54:35 2023 -0500
[troff]: Make futile aliasing an error.
* src/roff/troff/input.cpp (alias_macro): Promote diagnostic when
attempting to alias a nonexistent macro/string/diversion from warning
to error; this aligns with the handling of the requests `chop`,
`stringup`, `stringdown`, `substring`, `asciify`, `unformat`, and
`writem` when they are regarded as impossible. Further, attempting to
alias a nonexistent object does not create an empty one, unlike
interpolating it; try ".als baz qux", then ".pm".
---
ChangeLog | 11 +++++++++++
src/roff/troff/input.cpp | 2 +-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 6b728bbe7..55d730450 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2023-04-01 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ * src/roff/troff/input.cpp (alias_macro): Promote diagnostic
+ when attempting to alias a nonexistent macro/string/diversion
+ from warning to error; this aligns with the handling of the
+ requests `chop`, `stringup`, `stringdown`, `substring`,
+ `asciify`, `unformat`, and `writem` when they are regarded as
+ impossible. Further, attempting to alias a nonexistent object
+ does not create an empty one, unlike interpolating it; try ".als
+ baz qux", then ".pm".
+
2023-03-07 G. Branden Robinson <g.branden.robinson@gmail.com>
[tbl]: Trivially refactor. Rename variables and functions to
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 292ee7389..baca587b4 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -4705,7 +4705,7 @@ void alias_macro()
symbol s2 = get_name(true /* required */);
if (!s2.is_null()) {
if (!request_dictionary.alias(s1, s2))
- warning(WARN_MAC, "macro '%1' not defined", s2.contents());
+ error("cannot alias undefined object '%1'", s2.contents());
}
}
skip_line();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 51/62: [troff]: Make futile aliasing an error.,
G. Branden Robinson <=