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

pure: Evaluate variables in the order they are declared #178

Merged

Conversation

bertrand-lorentz
Copy link
Contributor

Store the variables from the Schematron in a linked hashmap, to preserve their order. They are then evaluated in the order they are declared.

Before this, variables were sorted with the longest first. We were replacing variable references with their expressions, so starting with the longest was needed. With the new way of evaluating variables, this caused problems when a variable referenced another variable that has a shorter name.

This changes the IPSXPathVariables interface to return maps and sets, instead of navigable maps and sorted sets. It does not seem that the specifics of these types were used.

Add unit test that checks the correction of this bug.

Fixes #177.

Store the variables from the Schematron in a linked hashmap, to preserve
their order. They are then evaluated in the order they are declared.

Before this, variables were sorted with the longest first. We were
replacing variable references with their expressions, so starting with
the longest was needed. With the new way of evaluating variables, this
caused problems when a variable referenced another variable that has a
shorter name.

This changes the IPSXPathVariables interface to return maps and sets,
instead of navigable maps and sorted sets. It does not seem that the
specifics of these types were used.

Add unit test that checks the correction of this bug.

Fixes phax#177.
@phax
Copy link
Owner

phax commented Aug 23, 2024

Thanks, highly appreciated @bertrand-lorentz

@phax phax merged commit 47bf7aa into phax:master Aug 23, 2024
3 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.

Variables are not evaluated in the order they are declared
2 participants