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

XML attributes parsed in reverse order #172

Merged
merged 1 commit into from
Apr 22, 2019

Conversation

ashawley
Copy link
Member

This would fix #65 and scala/bug#6341

foldLeft(Null: MetaData) { (x, xs) =>
xs.copy(x)
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the manner that the recursive data structure is reversed.

@@ -134,7 +134,7 @@ abstract class FactoryAdapter extends DefaultHandler with factory.XMLLoader[Node
if (scopeStack.isEmpty) TopScope
else scopeStack.top

for (i <- 0 until attributes.getLength()) {
for (i <- (0 until attributes.getLength).reverse) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where it is added to the SAX parser infrastructure

@@ -340,7 +340,7 @@ trait MarkupParser extends MarkupParserCommon with TokenTests {
if (!aMap.wellformed(scope))
reportSyntaxError("double attribute")

(aMap, scope)
(aMap.reverse, scope)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where it is added to the constructing parser infrastructure

@ashawley ashawley added this to the 1.1.1 milestone Oct 23, 2017
@SethTisue SethTisue modified the milestone: 1.1.1 Feb 20, 2018
@ashawley ashawley force-pushed the fix-attribute-order branch 2 times, most recently from 2bec171 to 11f9d09 Compare May 24, 2018 13:57
@ashawley ashawley modified the milestones: 1.1.1, 1.2.0 May 24, 2018
@ashawley ashawley force-pushed the fix-attribute-order branch from 11f9d09 to 4e956fa Compare May 28, 2018 13:58
@ashawley ashawley force-pushed the fix-attribute-order branch from 4e956fa to 1e3573e Compare October 28, 2018 03:52
@ashawley ashawley modified the milestones: 1.2.0, 2.0 Mar 2, 2019
@ashawley ashawley force-pushed the fix-attribute-order branch from 1e3573e to f0691d3 Compare April 22, 2019 13:46
@ashawley ashawley force-pushed the fix-attribute-order branch from f0691d3 to eaf1532 Compare April 22, 2019 14:03
@ashawley ashawley merged commit 2017fa3 into scala:master Apr 22, 2019
@ashawley ashawley deleted the fix-attribute-order branch April 22, 2019 16:14
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.

XML parser reverses attribute order
2 participants