summaryrefslogtreecommitdiff
path: root/tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2025-12-26 10:19:33 -0500
committerChuck Lever <chuck.lever@oracle.com>2026-01-26 10:10:58 -0500
commit63a5425ff5e077c54eb2719c735108e2aa1f9eb6 (patch)
treebbafb7b3c8af0231497a7624789c67e749c4c325 /tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git
parent3e6397b056335cc56ef0e9da36c95946a19f5118 (diff)
xdrgen: Extend error reporting to AST transformation phase
Commit 277df18d7df9 ("xdrgen: Improve parse error reporting") added clean, compiler-style error messages for syntax errors detected during parsing. However, semantic errors discovered during AST transformation still produce verbose Python stack traces. When an XDR specification references an undefined type, the transformer raises a VisitError wrapping a KeyError. Before this change: Traceback (most recent call last): File ".../lark/visitors.py", line 124, in _call_userfunc return f(children) ... KeyError: 'fsh4_mode' ... lark.exceptions.VisitError: Error trying to process rule "basic": 'fsh4_mode' After this change: file.x:156:2: semantic error Undefined type 'fsh4_mode' fsh4_mode mode; ^ The new handle_transform_error() function extracts position information from the Lark tree node metadata and formats the error consistently with parse error messages. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions