astexplorer-refmt
v2.0.0
Published
JavaScript wrapper for refmt parser to be used in astexplorer.net
Maintainers
Readme
astexplorer-refmt
JavaScript wrapper for refmt parser to be used to analyze and show Reason and OCaml AST in astexplorer.net.
Not intended to be used as a library.
Development
The project requires opam and pnpm to build, and it uses make to run the project.
make initYou can run the watch mode to automatically build the project when you make changes:
make devTo build the project as production mode:
(The output bundle will be stored in the ./dist folder)
make prodTo run an example, you can use the demo command:
make demoRunning with astexplorer
pnpm linkin the project root folder- Clone
astexplorerlocally. - In
websitefolder ofastexplorer, callyarn link <path-to-astexplorer-refmt>.
Running without astexplorer
Edit the code variable in src/example/example.js to parse some code.
let code = "let x = 1";
let ast = window.parseReason(code);
window.document.querySelector("#app").innerHTML = ast;Then run make demo and open http://localhost:3030/ in your browser.
