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.
- Record -> Object
- Tuple -> Array
- Variant -> Object with property
typethe name of the constructor, and then other properties with names that help understand the function of each variant argument
The project requires esy to be built, you can install it using npm:
% npm install -g esy
Install the project dependencies using:
% esy install
Build the project dependencies along with the project itself:
% esy build
To test the compiled JS executable, open index.html in your browser.
To generate the production build (without sourcemaps, and minified) run:
% yarn run build:prod
The output bundle will be stored in the ./dist folder.
yarn linkin the project root folder- Clone
astexplorerlocally. - In
websitefolder ofastexplorer, callyarn link astexplorer-refmt.
Add some logging in AstExplorerRefmt.re, for example:
log("parse", parseReason("let f = a => \"1\"; /* Comment */ let a = 2;"));Then open src/index.html to see the parsed JavaScript object in the console.