Skip to content

Make the library domain-safe#60

Merged
kit-ty-kate merged 4 commits intoocaml:masterfrom
kit-ty-kate:menhir
Dec 6, 2024
Merged

Make the library domain-safe#60
kit-ty-kate merged 4 commits intoocaml:masterfrom
kit-ty-kate:menhir

Conversation

@kit-ty-kate
Copy link
Copy Markdown
Member

PR on top of #51

This PR changes the parser from ocamlyacc to menhir. I made this sit on top of #51 for simplicity sake.

If merged I believe we should release this as opam-file-format.2.2.0

Copy link
Copy Markdown
Contributor

@rjbou rjbou left a comment

Choose a reason for hiding this comment

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

On the general idea, lgtm!

lexer lexbuf
in
let result =
try with_clear_parser (main lexer lexbuf) file_name
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With menhir, there is no more need to clear the parser?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

no menhir doesn't use the internal states from Stdlib.Parsing so it would be pointless to call this function, and as far as i know it doesn't have an equivalent function.

value:
value: valu_ EOF { $1 }

valu_:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's better to have value here, and rename value l.101

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

discussed elsewhere: sadly value is required to be defined this way because it is the name of the value exported. I've added comments instead

@rjbou
Copy link
Copy Markdown
Contributor

rjbou commented Dec 4, 2024

sounds good ☺️

@kit-ty-kate kit-ty-kate requested a review from rjbou December 4, 2024 20:17
@kit-ty-kate kit-ty-kate changed the title Make the library thread-safe Make the library domain-safe Dec 5, 2024
Copy link
Copy Markdown
Contributor

@rjbou rjbou left a comment

Choose a reason for hiding this comment

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

🚀

@rjbou rjbou added this to the 2.2.0 milestone Dec 6, 2024
@kit-ty-kate kit-ty-kate merged commit 941b988 into ocaml:master Dec 6, 2024
@kit-ty-kate kit-ty-kate deleted the menhir branch December 6, 2024 15:12
@kit-ty-kate kit-ty-kate mentioned this pull request Mar 2, 2026
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