groff-commit
[Top][All Lists]
Advanced

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

[groff] 07/09: [troff]: Trivially refactor.


From: G. Branden Robinson
Subject: [groff] 07/09: [troff]: Trivially refactor.
Date: Wed, 4 Dec 2024 09:51:23 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit a1d1fe38bc0b67781a4c216efcf6b38fd0813887
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Dec 4 04:12:01 2024 -0600

    [troff]: Trivially refactor.
    
    * src/roff/troff/input.cpp: Trivially refactor.
      (do_if_request): Rename this...
      (is_conditional_expression_true): ...to this.
      (if_else_request, if_request, while_request): Update call sites.
---
 ChangeLog                | 7 +++++++
 src/roff/troff/input.cpp | 8 ++++----
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 332df7884..7e8c31203 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-12-04  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/troff/input.cpp: Trivially refactor.
+       (do_if_request): Rename this...
+       (is_conditional_expression_true): ...to this.
+       (if_else_request, if_request, while_request): Update call sites.
+
 2024-12-03  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        Adapt tests to feeble systems lacking a shell or grep conforming
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 3263d987a..2be0b1e0a 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -6317,7 +6317,7 @@ static void nop_request()
 
 static std::stack<bool> if_else_stack;
 
-static bool do_if_request()
+static bool is_conditional_expression_true()
 {
   bool want_test_sense_inverted = false;
   while (tok.is_space())
@@ -6483,7 +6483,7 @@ static void if_else_request()
     skip_line();
     return;
   }
-  if_else_stack.push(do_if_request());
+  if_else_stack.push(is_conditional_expression_true());
 }
 
 static void if_request()
@@ -6493,7 +6493,7 @@ static void if_request()
     skip_line();
     return;
   }
-  do_if_request();
+  (void) is_conditional_expression_true();
 }
 
 static void else_request()
@@ -6561,7 +6561,7 @@ static void while_request()
     for (;;) {
       input_stack::push(new string_iterator(mac, "while loop"));
       tok.next();
-      if (!do_if_request()) {
+      if (!is_conditional_expression_true()) {
        while (input_stack::get(0 /* nullptr */) != EOF)
          ;
        break;



reply via email to

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