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


##########
tools/hrw4u/src/hrw_symbols.py:
##########
@@ -414,6 +415,20 @@ def negate_expression(self, term: str) -> str:
 
     def percent_to_ident_or_func(self, percent: str, section: SectionType | 
None) -> tuple[str, bool]:
         """Convert percent block to identifier or function call."""
+        stripped, mods = split_percent_mods(percent)
+        expr, is_func = self._percent_to_ident_or_func(stripped, section)
+
+        if not mods:
+            return expr, is_func
+
+        # A block with no DSL equivalent comes back as %{...}, where the 
modifiers belong
+        # inside the braces rather than in a "with" clause.
+        if expr == stripped:
+            return apply_percent_mods(expr, mods), is_func
+
+        return f"{expr} with {','.join(mods)}", is_func

Review Comment:
   Fixed: modifier-bearing state/session values now reverse to a quoted 
interpolation, like the header path (`int8_0 = "{inbound.req.X-Input with 
NORM}";`), with a unit test in `test_coverage.py`.
   
   A full round-trip test isn't possible yet: the forward's 
`validate_assignment()` accepts only literals or same-typed variables for 
int8/int16/bool, so `int8_0 = inbound.req.X-Input;` fails today without NORM 
too, although header_rewrite evaluates `%{...}` values for int8/int16. I'd 
rather close that pre-existing gap in a follow-up than grow this PR.
   



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