Skip to content

Improve error message for issue #618#626

Merged
ltratt merged 1 commit intosoftdevteam:masterfrom
ratmice:issue_618
Mar 4, 2026
Merged

Improve error message for issue #618#626
ltratt merged 1 commit intosoftdevteam:masterfrom
ratmice:issue_618

Conversation

@ratmice
Copy link
Collaborator

@ratmice ratmice commented Mar 3, 2026

This should fix #618 which is a similar CTParserBuilder error that lacked span information (or a good error).

Tested with the calc_parsetree example with the following diff applied

diff --git a/lrpar/examples/calc_parsetree/src/calc.y b/lrpar/examples/calc_parsetree/src/calc.y
index b8a1f34d..25b165ec 100644
--- a/lrpar/examples/calc_parsetree/src/calc.y
+++ b/lrpar/examples/calc_parsetree/src/calc.y
@@ -1,5 +1,5 @@
 %grmtools{
-    yacckind: Original(GenericParseTree),
+    yacckind: Original(UserAction),
     test_files: ["input*.txt"],
 }
 %start Expr
--- stderr
  thread 'main' (2467488) panicked at lrpar/examples/calc_parsetree/build.rs:16:10:
  called `Result::unwrap()` on an `Err` value:
  8| Expr: Expr '+' Term
     ^^^^ Rule missing action type
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@ratmice
Copy link
Collaborator Author

ratmice commented Mar 3, 2026

Oops, one thing I am just noticing is that this doesn't have filename information.

@ltratt
Copy link
Member

ltratt commented Mar 3, 2026

Please squash.

Also adds missing file information from the previous commit.
@ratmice
Copy link
Collaborator Author

ratmice commented Mar 3, 2026

Squashed

@ltratt ltratt added this pull request to the merge queue Mar 4, 2026
Merged via the queue into softdevteam:master with commit 50c380a Mar 4, 2026
2 checks passed
@ratmice ratmice deleted the issue_618 branch March 4, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve error when using wrong YaccOriginalActionKind

2 participants