We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b95668e commit 0a9d9cfCopy full SHA for 0a9d9cf
1 file changed
lrpar/src/lib/ctbuilder.rs
@@ -1459,7 +1459,18 @@ where
1459
for i in 0..grm.prod(pidx).len() {
1460
let argt = match grm.prod(pidx)[i] {
1461
Symbol::Rule(ref_ridx) => {
1462
- str::parse::<TokenStream>(grm.actiontype(ref_ridx).as_ref().unwrap())?
+ if let Some(action_type) = grm.actiontype(ref_ridx).as_ref() {
1463
+ str::parse::<TokenStream>(action_type)?
1464
+ } else {
1465
+ let mut s = String::from("\n");
1466
+ let rule_span = grm.rule_name_span(ref_ridx);
1467
+ s.push_str(&diag.underline_span_with_text(
1468
+ rule_span,
1469
+ "Rule missing action type".to_string(),
1470
+ '^',
1471
+ ));
1472
+ return Err(ErrorString(s).into());
1473
+ }
1474
}
1475
Symbol::Token(_) => {
1476
let lexemet =
0 commit comments