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

Make opam-file-format work with BuckleScript #98

Closed
wokalski opened this issue May 12, 2017 · 4 comments
Closed

Make opam-file-format work with BuckleScript #98

wokalski opened this issue May 12, 2017 · 4 comments

Comments

@wokalski
Copy link
Contributor

opam-file-format is a parser for opam files. If it is compilable by BuckleScript, we save a lot of time when implementing #81.

If we compile it with Bucklescript we can drop the OCaml dependency and publish a package containing the JS output.

#81 depends on this one.

I have started working on this feature.

@wokalski
Copy link
Contributor Author

wokalski commented May 14, 2017

This one was trivial. opam-file-format works with BuckleScript out of the box. There's some problem with Pervasives module.

  1. in_channel is an argument to Lexing.from_channel
  2. in the simplest scenario you use OcamlParser.main
  3. it takes lexbuf as one of its args
  4. BuckleScript doesn't implement open_in yet.

The parser itself works though so this is a good first step.

The source is here, although it's probably gonna live in the esy at the end of the day.
https://github.com/wokalski/opam-file-format-bs

@wokalski
Copy link
Contributor Author

Actually it's not a problem because we can create a lexbuf with a string. Even if there's no way to read a file into a string in BuckleScript we can resort to bs.raw.

@andreypopp
Copy link
Collaborator

andreypopp commented May 14, 2017 via email

@IwanKaramazow
Copy link

@wokalski Awesome work!

This issue was closed.
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

No branches or pull requests

3 participants