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

Inspect the expression instead of parsing its representation #11

Merged
merged 6 commits into from
Mar 4, 2024

Conversation

gpetiot
Copy link

@gpetiot gpetiot commented Mar 3, 2024

Based on top of #10, and also the tests fixed in #9

The idea is to re-use the expressions (already parsed by the ocaml compiler) instead of re-parsing its string representation. It works because the config language is a subset of ocaml expressions. And this allows to lift some constraints to use more of the ocaml syntax, e.g. not enforcing parentheses if there is no ambiguity.

@KFoxder
Copy link
Contributor

KFoxder commented Mar 3, 2024

@gpetiot

  1. This makes a ton of sense to me (and I don't know that much about OCaml) but I did feel like I was re-building parts of parsing OCaml syntax. Much simpler, cleaner to read too 👍
  2. Should I close Fix: Make the equals operator work as expected. #9 and Fix: Allow the not token to be used. #7 and work off of this for future issues?

@leostera leostera merged commit f0f7ca5 into ocaml-sys:main Mar 4, 2024
1 of 2 checks passed
@gpetiot gpetiot deleted the parse-expr branch March 4, 2024 21:15
@KFoxder KFoxder mentioned this pull request Mar 7, 2024
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