Repository navigation
🐛 fix(xpath): allow an operator name after a * test - #1085
Merged
gaborbernat merged 1 commit intoOct 3, 2026
Merged
Conversation
gaborbernat
force-pushed
the
fix/xpath-operator-after-star
branch
from
October 3, 2026 10:03
cd930f0 to
22ab41b
Compare
Merging this PR will improve performance by 6.11%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | test_feature[select-relative-sibling] |
45.6 µs | 42.8 µs | +6.57% |
| ⚡ | test_feature[transform-number-count-last] |
585.5 µs | 554.2 µs | +5.64% |
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing gaborbernat:fix/xpath-operator-after-star (ad8dd53) with main (48ae9ac)
Footnotes
-
32 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
gaborbernat
force-pushed
the
fix/xpath-operator-after-star
branch
from
October 3, 2026 13:07
22ab41b to
ad8dd53
Compare
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.
xpath()rejectedor,and,divandmodused as operators right after a*name test, and the expressionscss_to_xpathemits for:has()tripped the same error, because the lexer always put the token after*in value position.A
*is a NameTest in value position and a MultiplyOperator in operator position per the XPath 1.0 lexical structure, so the token after a*NameTest is now an operator, and//* or 1,(* or 1)anddescendant::* or descendant::pevaluate as lxml evaluates them.//* or 1,(* or 1)anddescendant::* or descendant::pnow evaluate as they do in lxml, Saxon-HE 13 and elementpath. libxml2 parsesdivandmodonly after a complete unary expression, and elementpath reads an operator name as a name only in prefix position.closes #1039