Use schema include name for keep-prefix #7469
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.
This has been more complicated than I like. There was a subtle difference between what was stored in the parser
included_files
and thefiles_included_per_file
. The former stored the schema-defined name of the include, while the later stored the relative file path. In most cases, this was the same and things worked OK, but there were cases whenflatc
is invoked with include paths (-I ...
) which caused the relative file path to include more prefix than expected. My fix in #7456 fixed some of those, but made an exception for files in super directories, which wasn't always right.So all of that lead me to examine this code in depth and more clearly detail what each piece is. Instead of storing a string to represented included files, I store a struct with clearly labelled fields. Hopefully this will reduce the confusion going forward.