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

Simpler parser ast #364

Merged
merged 9 commits into from
Jun 17, 2019
Merged

Simpler parser ast #364

merged 9 commits into from
Jun 17, 2019

Conversation

Julow
Copy link
Collaborator

@Julow Julow commented Jun 13, 2019

Hi!

As I explained in #355, Model.Comment is a bit hard to obtain and understand and too strict and lossy on the input.

Some of this issues could be solved by changing Model.Comment with a bit of work. But I think that in the future, this will make similar issues harder to solve as Odoc codebase and language change.

This PR simplifies Parser.Ast to make it closer to the concrete syntax and simpler by delaying some parsing to semantics.ml:

  • References are represented as strings
  • Raw_markup targets can be any string or none.
  • Keep concrete syntax used for lists
  • Keep whitespaces (Only when a Space element is generated)

This PR also removes some uses of Model types, as @lpw25 suggested, but not all yet.

This PR is supposed to follow #351 but if this approach is definitively rejected, it should be a good first step at improving Model.Comment.

What do you think?

Thanks!

@aantron aantron self-requested a review June 13, 2019 19:25
Copy link
Contributor

@aantron aantron left a comment

Choose a reason for hiding this comment

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

Ok, having seen this change, it actually looks quite reasonable, and I think we can merge this.

Apart from the comments, there are also some CI failures on older versions of OCaml.

Let me know if you'd like #351 reopened, or submit a new PR for how you want to expose this AST.

I still would like to avoid committing to the stability of Model.Comment, Parser.Ast, or the parser, but we can reach out when making any breaking changes.

src/parser/lexer.mll Outdated Show resolved Hide resolved
src/parser/syntax.ml Outdated Show resolved Hide resolved
@Julow
Copy link
Collaborator Author

Julow commented Jun 17, 2019

Thanks for your review !

I cleaned the code but did not manage to fix the CI with 4.08 yet.
Yes, I'd like to reopen #351 if possible, I just rebased the branch. The stability should not be an issue for us.

@aantron aantron merged commit 4b7f4e8 into ocaml:master Jun 17, 2019
@aantron
Copy link
Contributor

aantron commented Jun 17, 2019

Thanks! The 4.08 failure is not due to this PR, and is tracked in #367. It seems GitHub won't let me reopen #351, because the underlying branch has been rebased. Would you mind opening a new PR, or pinging me if you move the branch back to the last commit in #351 when it was open?

@Julow
Copy link
Collaborator Author

Julow commented Jun 17, 2019

Thanks for merging !
I changed the branch of #351.

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.

2 participants