Skip to content

Parser changes for Gecko integration #168

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

Merged
merged 9 commits into from
Jul 5, 2017
Merged

Parser changes for Gecko integration #168

merged 9 commits into from
Jul 5, 2017

Conversation

jdm
Copy link
Member

@jdm jdm commented Jul 4, 2017

This is a grab bag of changes that were important for getting Stylo tests passing.


This change is Reviewable

@@ -226,7 +226,7 @@ impl<'a> Tokenizer<'a> {
input: input,
position: 0,
last_known_source_location: Cell::new((SourcePosition(0),
SourceLocation { line: 1, column: 1 })),
SourceLocation { line: 0, column: 0 })),
Copy link
Member

Choose a reason for hiding this comment

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

SourceLocation’s doc-comments needs to up updated accordingly.

@@ -188,6 +188,11 @@ impl<'i: 't, 't> Parser<'i, 't> {
}
}

/// Return the current line that is being parsed.
Copy link
Member

Choose a reason for hiding this comment

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

Newlines are not significant in CSS. Why is the current line relevant? Is this counting on authors not using minification, adding newlines between declarations, and not writing multi-line declarations?

Copy link
Member Author

Choose a reason for hiding this comment

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

Gecko's error messages include a sourceLine property which is expected to be the current line being parsed.

@jdm
Copy link
Member Author

jdm commented Jul 4, 2017

Related Gecko work is in the second patch of https://bugzilla.mozilla.org/show_bug.cgi?id=1352669.

@SimonSapin
Copy link
Member

r+ with the doc-comment updated for line and columns numbers starting at 0 rather than 1.

I still think that "current line" is not the right thing to do, but I suppose adding it will help enable these tests and get more test coverage of other things more easily than changing the tests to do something else. So let’s add it.

@jdm
Copy link
Member Author

jdm commented Jul 5, 2017

@bors-servo: r=SimonSapin

@bors-servo
Copy link
Contributor

📌 Commit c6156c0 has been approved by SimonSapin

bors-servo pushed a commit that referenced this pull request Jul 5, 2017
Parser changes for Gecko integration

This is a grab bag of changes that were important for getting Stylo tests passing.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-cssparser/168)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

⌛ Testing commit c6156c0 with merge 5e9c5cb...

@bors-servo
Copy link
Contributor

☀️ Test successful - status-travis
Approved by: SimonSapin
Pushing 5e9c5cb to master...

@bors-servo bors-servo merged commit c6156c0 into master Jul 5, 2017
@SimonSapin SimonSapin deleted the foo branch July 17, 2017 14:36
@SimonSapin
Copy link
Member

@jdm It looks like you landed this without the doc-comment change I requested. Could you fix that? CC https://bugzilla.mozilla.org/show_bug.cgi?id=1380890

@jdm
Copy link
Member Author

jdm commented Jul 19, 2017

Weird; I remember making that change.

@jdm
Copy link
Member Author

jdm commented Jul 19, 2017

@SimonSapin
Copy link
Member

I misread the diff, sorry.

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.

3 participants