feat(lxp): Add parser option to disable attribute positions#41
Open
Omikhleia wants to merge 2 commits intolunarmodules:masterfrom
Open
feat(lxp): Add parser option to disable attribute positions#41Omikhleia wants to merge 2 commits intolunarmodules:masterfrom
Omikhleia wants to merge 2 commits intolunarmodules:masterfrom
Conversation
612d99e to
8c2b92f
Compare
8c2b92f to
5dbfb96
Compare
Tieske
requested changes
Dec 9, 2024
Member
Tieske
left a comment
There was a problem hiding this comment.
Can you please add some tests?
| {[1] = "Ierusalimschy, Roberto", | ||
| [2] = "Programming in Lua", | ||
| {[1] = "author", | ||
| [2] = "title", |
Co-authored-by: Caleb Maclennan <caleb@alerque.com>
Author
It's not clear to me how to write and run tests for this module (looking at the spec files, it apparently requires busted and penlight. Beyond that, I'm a bit lost, and dunno how to run them locally - Or more precisely, what to put in a docker file to run them (I don't install anything on my hosts). Of course, I could just try at random, and hope the github actions to do it automatically, but that trial and error process would not the most convenient way... Any pointer or contribution guideline would be welcome. |
Member
|
I can probably help with getting a test added. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 PR is a proposal to add an additional flag to disable the attribute positions in the attribute list passed on StartElement.
Rationale:
I understand attribute positions may be interesting in some use cases (e.g. to re-generate some other output respecting the same order), but for use cases where they are not needed, they take useless memory, and useless code if one wants to remove them.
Note:
I also fixed a small mistake in the example that was given in the "manual" (the position list consists in attribute names, not attribute value).
For reference: