fixed bug in generating grammar script #5917
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
obligatory premise: I have absolutely no idea what I am doing
I am no bison expert, but I am tasked to extend the parser for my phd stuff, and after I made my changes and tried to regenerate the grammar, I encountered a bug that also happens if I don't touch anything and just try to regenerate the existing grammar.
here's what happens:
these are the instructions in the README. now, if I try to recompile duckdb with the new grammar cpp files, I get this error:
after investigating for a bit, I found that the python script to regenerate the grammar ultimately renames the header file generated with the
-d
flag in the filesystem, but does not rename the inclusion of this very same header in thesrc_backend_parser_gram.cpp
file. therefore I opted for the quick and dirty fix in python.as I said, I have no idea whether this is a me problem or whether this is the most efficient fix, but as always it works on my computer^tm
let me know if you have any thoughts and have a good day :)