groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 03/10: src/roff/troff/input.cpp: Add warning.


From: G. Branden Robinson
Subject: [groff] 03/10: src/roff/troff/input.cpp: Add warning.
Date: Fri, 16 Oct 2020 10:59:42 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 64097f3d7a5ac238fd5ee53d32114694469fa062
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Oct 16 23:03:25 2020 +1100

    src/roff/troff/input.cpp: Add warning.
    
    * src/roff/troff/input.cpp (do_if_request): Emit warning of type
      "syntax" if a groff conditional expression extension is used when
      compatibility mode is active.
    
    * doc/groff.texi:
    * src/roff/troff/troff.1.man: Update description of "syntax" warning
      type to be more general.  It was inaccurate, referring only to
      "dubious syntax in numeric expressions", which was not the case.
      Instead it was being used only for poor construction of character
      classes with the .class request.  And now it does more.
---
 ChangeLog                  | 13 +++++++++++++
 doc/groff.texi             |  2 +-
 src/roff/troff/input.cpp   | 14 ++++++++++++++
 src/roff/troff/troff.1.man |  2 +-
 4 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d1887cb..f909dfc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2020-10-16  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/troff/input.cpp (do_if_request): Emit warning of type
+       "syntax" if a groff conditional expression extension is used
+       when compatibility mode is active.
+
+       * doc/groff.texi:
+       * src/roff/troff/troff.1.man: Update description of "syntax"
+       warning type to be more general.  It was inaccurate, referring
+       only to "dubious syntax in numeric expressions", which was not
+       the case.  Instead it was being used only for poor construction
+       of character classes with the .class request.
+
 2020-10-14  Ingo Schwarze <schwarze@openbsd.org>
 
        In groff(1), fix the combination of -v with -k, -j, and -J.
diff --git a/doc/groff.texi b/doc/groff.texi
index aa827fd..944225f 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -14425,7 +14425,7 @@ Out of range arguments.
 
 @item syntax
 @itemx 128
-Dubious syntax in numeric expressions.
+Invalid syntax.
 
 @item di
 @itemx 256
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 7d0b90b..e3f3ab0 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -5692,6 +5692,20 @@ int do_if_request()
   }
   int result;
   unsigned char c = tok.ch();
+  if (compatible_flag)
+    switch (c) {
+    case 'F':
+    case 'S':
+    case 'c':
+    case 'd':
+    case 'm':
+    case 'r':
+      warning(WARN_SYNTAX,
+             "conditional '%1' used in compatibility mode", c);
+      break;
+    default:
+      break;
+    }
   if (c == 't') {
     tok.next();
     result = !nroff_mode;
diff --git a/src/roff/troff/troff.1.man b/src/roff/troff/troff.1.man
index a2120a1..dee888f 100644
--- a/src/roff/troff/troff.1.man
+++ b/src/roff/troff/troff.1.man
@@ -551,7 +551,7 @@ This warning will never occur in compatibility mode.
 .
 .TP
 .BR syntax "\t128"
-Dubious syntax in numeric expressions.
+Invalid syntax.
 .
 .TP
 .BR tab "\t2048"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]