Copilot commented on code in PR #13699:
URL: https://github.com/apache/trafficserver/pull/13699#discussion_r4022677593


##########
tools/hrw4u/src/ast_visitor.py:
##########
@@ -123,6 +126,14 @@ def _visit_function_call(self, ctx) -> FunctionCall:
             args = tuple(self._extract_value(v) for v in 
ctx.argumentList().value())
         return FunctionCall(name=name, args=args, line=ctx.start.line)
 
+    def _extract_assignment_value(self, ctx) -> ValueExpr:
+        # Only an assignment RHS echoes its bool spelling; elsewhere a plain 
bool is enough.
+        if ctx.TRUE():
+            return BoolValue(raw=ctx.TRUE().getText())
+        if ctx.FALSE():

Review Comment:
   Preserving the spelling only for assignment RHS values is too narrow for the 
round-trip guarantee. `_extract_value()` still normalizes booleans used as 
comparison RHSs, function arguments, and procedure defaults, while 
`HRW4UVisitor` emits those contexts from `getText()`/the bound raw value; for 
example, `if inbound.req.X == TRUE` or `set-config("x", TRUE)` regenerates with 
`true` and produces different config. Preserve `BoolValue(raw=...)` in every 
value context whose spelling is emitted, and add a regression for one of these 
paths.



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