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


##########
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:
   The default is always REMAP in practice: this method only fires for bare 
rules without explicit hook conditions, which by definition means remap 
context. Global plugin configs always have explicit hook conditions. Using 
`self._section_label` would be technically more correct, but the current value 
is never wrong.



-- 
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