zwoop commented on code in PR #13058:
URL: https://github.com/apache/trafficserver/pull/13058#discussion_r3052726251


##########
tools/hrw4u/src/hrw_visitor.py:
##########
@@ -84,12 +87,23 @@ def _reset_condition_state(self) -> None:
         self._in_elif_mode = False
         self._in_group = False
         self._group_terms.clear()
+        self._expecting_if_cond = False
+
+    def _close_if_chain_for_new_rule(self) -> None:
+        """Close if-else chain when a new rule starts without elif/else."""
+        expecting_nested_if = self._expecting_if_cond
+        self._expecting_if_cond = False
+
+        if (self._if_depth > 0 and not self._in_elif_mode and not 
self._pending_terms and not expecting_nested_if and
+                not self._in_group):
+            self.debug("new rule detected - closing if chain")
+            self._start_new_section(SectionType.REMAP)

Review Comment:
   Albeit correct, right now, u4wrh only works in "remap" context. I'll 
consider this change anyways.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to