softdevteam / grmtools

Rust grammar tool libraries and binaries
Other
494 stars 32 forks source link

Errors in catching incorrectly terminated productions #463

Closed bendrissou closed 1 month ago

bendrissou commented 1 month ago

Hi,

After the last merge, some of my projects are failing to build.

error: failed to run custom build command for `lua_repair v0.1.0 (/home/rust/lua_repair)`

Caused by:
  process didn't exit successfully: `/home/rust/target/release/build/lua_repair-162ad1ab4214539c/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at lua_repair/build.rs:14:10:
  called `Result::unwrap()` on an `Err` value: 
    Production not terminated correctly at line 73 column 5
    Unknown reference to rule 'retstatopt' at line 65 column 19
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

I don't think I have any grammar rules of the form:

R: A {B} C;

But I do have rules like:

R: A {B} 
 | {C};

Do you think that is an incorrectly terminated production?

Thank you.

ltratt commented 1 month ago

@bendrissou Can you send me a complete grammar that shows this problem please? I may well have made a mistake!

ltratt commented 1 month ago

I can confirm that this is due to a mistake on my part -- thanks for reporting!

ltratt commented 1 month ago

@bendrissou This should now be fixed.

bendrissou commented 1 month ago

Thank you for the prompt fix. Things are looking good now.