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

M1452: Initial Step of Integrate an XML parser #3718

Merged
merged 1 commit into from Oct 29, 2014

Conversation

nchinth
Copy link
Contributor

@nchinth nchinth commented Oct 18, 2014

We have created parser trait and declared parse_chunk function in this trait. We are yet to implement this parse_chunk for ServoHTMLParser struct.

@hoppipolla-critic-bot
Copy link

Critic review: https://critic.hoppipolla.co.uk/r/2901

This is an external review system which you may optionally use for the code review of your pull request.

In order to help critic track your changes, please do not make in-place history rewrites (e.g. via git rebase -i or git commit --amend) when updating this pull request.

@jdm
Copy link
Member

jdm commented Oct 18, 2014

Thanks @nchinth! This is a good start, but I think it makes sense to hold off on merging these changes until the Parser trait is implemented by the HTML parser.

@jdm
Copy link
Member

jdm commented Oct 18, 2014

Additionally, I think the Parser trait belongs in components/script/parse/mod.rs, which you can create. Then the trait can be imported as parse::Parser in the future.

@jdm
Copy link
Member

jdm commented Oct 21, 2014

@nchinth This is better, but not equivalent - the changes in the commits cause every call to feed to be followed by end, when end really needs to happen when all parsing is finished. The Parser trait should probably grow another method to encapsulate that.

@nchinth
Copy link
Contributor Author

nchinth commented Oct 22, 2014

Sure Josh, shall i add another method like release_resources to Parser trait and call the end method in its implementation for ServoHTMLParser?

@jdm
Copy link
Member

jdm commented Oct 22, 2014

Let's just call it finish.

@nchinth
Copy link
Contributor Author

nchinth commented Oct 22, 2014

Yep Sure.

@jdm
Copy link
Member

jdm commented Oct 23, 2014

Almost there! The new file needs a license header, but otherwise this looks really good!

@jdm
Copy link
Member

jdm commented Oct 23, 2014

I've added a few more comments to the Critic review. Please make those changes, commit them, and then rebase your changes on top master following the instructions at https://github.com/servo/servo/wiki/Github-&-Critic-PR-handling-101 !

@nchinth nchinth force-pushed the master branch 2 times, most recently from 33ba093 to 9931ff2 Compare October 26, 2014 13:44
@jdm
Copy link
Member

jdm commented Oct 26, 2014

One very small issue left and this will be ready!

@nchinth
Copy link
Contributor Author

nchinth commented Oct 26, 2014

Thanks Josh. Fixed it as well.

@jdm
Copy link
Member

jdm commented Oct 27, 2014

Great! Please squash all these commits together and I'll merge them!

@kmcallister
Copy link
Contributor

fwiw this will move away from String at some point (servo/html5ever#34).

@nchinth nchinth changed the title Initial Version of Parser Trait M1452: XML parser student project Oct 27, 2014
@nchinth nchinth changed the title M1452: XML parser student project M1452: Integrate an XML parser Oct 27, 2014
@nchinth nchinth changed the title M1452: Integrate an XML parser M1452: Initial Step of Integrate an XML parser Oct 27, 2014
@nchinth
Copy link
Contributor Author

nchinth commented Oct 27, 2014

Hi Josh. I have squashed all of them into one one commit

@jdm
Copy link
Member

jdm commented Oct 28, 2014

Thanks @nchinth!

bors-servo pushed a commit that referenced this pull request Oct 28, 2014
We have created parser trait and declared parse_chunk function in this trait. We are yet to implement this parse_chunk for ServoHTMLParser struct.
@nchinth
Copy link
Contributor Author

nchinth commented Oct 29, 2014

Hi Josh, The failure is from "test-tidy" shell script and looks like its because of tabular spaces . The error message is as follows
"components/script/dom/servohtmlparser.rs:49: tab on line
components/script/dom/servohtmlparser.rs:52: tab on line"

Should i remove the tabs or would it be fine like this ?

@Ms2ger
Copy link
Contributor

Ms2ger commented Oct 29, 2014

No, it's not fine like this, that's why we have automatic tests for it. Remove the tabs.

Added parse_chunk method declaration to parser

Removed unnecessary visibilty for parse_chunk function

Implemented parse_chunk function

Implemented parse_chunk fn for ServoHTMLParser

Moved parser trait to mod.rs and added finish fn

added licence header to mod.rs and other review comments

Fixed trailing space issue

Fixed failed tabular space test
@nchinth
Copy link
Contributor Author

nchinth commented Oct 29, 2014

I have fixed this. Thanks.

bors-servo pushed a commit that referenced this pull request Oct 29, 2014
We have created parser trait and declared parse_chunk function in this trait. We are yet to implement this parse_chunk for ServoHTMLParser struct.
@bors-servo bors-servo closed this Oct 29, 2014
@bors-servo bors-servo merged commit 6a736c7 into servo:master Oct 29, 2014
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.

None yet

6 participants