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

Comment parser should handle tailing comment #219

Closed
He-Pin opened this issue Feb 26, 2017 · 4 comments
Closed

Comment parser should handle tailing comment #219

He-Pin opened this issue Feb 26, 2017 · 4 comments
Assignees
Milestone

Comments

@He-Pin
Copy link
Contributor

He-Pin commented Feb 26, 2017

Seems like the current parser did not handle the tailing comments,
like

{
#comment1
field1 #comment2
field2
}

here,#comment2 should be a tailing comment of field1,not a comment of field2

image

@OlegIlyenko OlegIlyenko added this to the v1.0.1 milestone Feb 26, 2017
@OlegIlyenko
Copy link
Member

Good catch, thanks for reporting! Field does have trailingComments, but looks like rendering algorithm puts them in a wrong place :)

@He-Pin
Copy link
Contributor Author

He-Pin commented Feb 26, 2017

no,it doesn't:)

@OlegIlyenko
Copy link
Member

oops, looks like I jumped into conclusions too quickly. #comment2 looks in the right place, it's just assigned to a second field.

I think it would be a tricky to parse it in a way that preserves this information about comment placement, but let's see what I can do.

@OlegIlyenko OlegIlyenko removed this from the v1.0.1 milestone Feb 26, 2017
@He-Pin
Copy link
Contributor Author

He-Pin commented Feb 26, 2017

I think how about add a new field trailing:Boolean = false to the comment.
and add a new type of parser eg TrailingComment to the definition,and then try to parse it after a token,this type of Comment will end up with \nor \r\n`.

@OlegIlyenko OlegIlyenko added this to the v1.0.1 milestone Feb 26, 2017
@OlegIlyenko OlegIlyenko self-assigned this Feb 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants