Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filterx expr location fixes #120

Merged
merged 6 commits into from
Jun 4, 2024

Conversation

bazsi
Copy link
Member

@bazsi bazsi commented May 22, 2024

This improves filterx expression representation in trace level logs by improving the location tracking for filterx source text.

This will also cause any source related displays (e.g. error output or the filterx expression display) to use the postprocessed output, e.g. the text after substitution, instead of the original text read from the source file.

This makes it easier to find issues that are related to parts substituted from parameters/environment variables.

This sits on top of the app-transform() branch

@bazsi bazsi force-pushed the filterx-expr-location-fixes branch 2 times, most recently from d759a87 to 4759725 Compare May 24, 2024 16:41
@bazsi bazsi force-pushed the filterx-expr-location-fixes branch from 4759725 to 2deffff Compare June 1, 2024 07:05
bazsi added 6 commits June 2, 2024 08:25
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
If @line is encountered in the input stream, we overwrite our idea of where
we are in the input file so that we can properly report on file locations,
even if we are expanding a block or other generators.

This patch makes it possible to recover the original location (e.g. before
@line was called), which is needed to extract the source text _after_
generation/substitution has happened.

This means that whenever we display the source text (e.g. error report,
or as a part of the filterx expr being executed), we can use
the post-processed version.

Whenever we want to read the file that contained the source, we can use
the current yylloc. If we want to extract from the postprocessed
buffer, we need to get back to the original yylloc.

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
This pragma reverts to the original location, as if the previous @line
was not even there.

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
@bazsi bazsi force-pushed the filterx-expr-location-fixes branch from 2deffff to a9fae93 Compare June 2, 2024 06:25
@alltilla alltilla merged commit 82acac2 into axoflow:main Jun 4, 2024
21 checks passed
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