Copilot commented on code in PR #13665:
URL: https://github.com/apache/trafficserver/pull/13665#discussion_r3976990729
##########
tools/hrw4u/src/ast_visitor.py:
##########
@@ -67,22 +87,22 @@ def _visit_section(self, ctx) -> VarSection | Section:
return self._visit_var_section(ctx.sessionVarSection(), "session")
name = ctx.name.text
body = self._visit_body(ctx.sectionBody())
Review Comment:
`_visit_body` iterates over a list of body-item contexts (with
`.statement()/.conditional()/.commentLine()` access). Passing
`ctx.sectionBody()` (a rule context) is inconsistent with how `_visit_body` is
used elsewhere and can break traversal depending on the generated parser API.
Fix by passing the section body's item list (e.g.,
`ctx.sectionBody().blockItem()` or the specific `sectionBodyItem()` list from
the grammar) so `_visit_body` always receives homogeneous body-item contexts.
--
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]