Skip to content

Conversation

@ratmice
Copy link
Collaborator

@ratmice ratmice commented Mar 11, 2025

During development I'd added the %grmtools section to a few of the examples, to test it.
But forgot to add them to all the rest, this adds those, and removes the .yacckind calls in build.rs.

Tested using the following shell script, which never specifies a -y flag and also performing cargo run in the examples,

echo -n "/* /* */ */" | ./target/debug/nimbleparse lrpar/examples/start_states/src/comment.{l,y} -
echo -n 5+++ | ./target/debug/nimbleparse ./lrpar/examples/clone_param/src/param.{l,y} -
echo -n 1+1 | ./target/debug/nimbleparse ./lrpar/examples/calc_storaget/src/calc.{l,y} -
echo -n 1+1 | ./target/debug/nimbleparse ./lrpar/examples/calc_parsetree/src/calc.{l,y} -
echo -n 1+1 | ./target/debug/nimbleparse ./lrpar/examples/calc_ast/src/calc.{l,y} -
echo -n 1+1 | ./target/debug/nimbleparse ./lrpar/examples/calc_actions/src/calc.{l,y} -

All looked good, the only question I have is about calc_parsetree which when I cargo run the compile time version,
I don't seem to see a parse tree emitted (just the calc computation), which is not what I had expected, but I'm now uncertain of whether that behavior has changed with these recent patches.

I will need to build a prior release and check the behavior against that.

@ratmice
Copy link
Collaborator Author

ratmice commented Mar 11, 2025

So, I did test every 0.x.0 release from 0.13.0 to 0.5.0 and all had the same output for cargo run in calc_parsetree.
So I believe that this is behaving correctly, and perhaps just me misunderstanding the expected behavior.

@ratmice
Copy link
Collaborator Author

ratmice commented Mar 11, 2025

I think that should cover all of the examples/documentation, assuming we want to go so far as removing the places where it was set but could be inferred.

@ltratt
Copy link
Member

ltratt commented Mar 11, 2025

the only question I have is about calc_parsetree which when I cargo run the compile time version, I don't seem to see a parse tree emitted

The idea of calc_parsetree is to use grmtools' generic parse tree internally: in essence the calc_* examples are mostly intended to be "let's show you different ways of doing the same thing".

@ltratt ltratt added this pull request to the merge queue Mar 11, 2025
Merged via the queue into softdevteam:master with commit 7669305 Mar 11, 2025
2 checks passed
@ratmice ratmice deleted the grmtools_section_y_files branch March 11, 2025 14:33
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.

2 participants