Skip to content

Commit

Permalink
setting up flow parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Launchpad5682 committed Aug 18, 2024
1 parent 82c1f26 commit 57aeae2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bin/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(executable
(public_name js_bundler)
(name main)
(libraries js_bundler))
(libraries js_bundler flow_parser))
1 change: 0 additions & 1 deletion src/bin/main.ml

This file was deleted.

20 changes: 20 additions & 0 deletions src/bin/main.re
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@


let parse_source = source => {
let parse_options =
Some(
Flow_parser.Parser_env.{
esproposal_nullish_coalescing: false,
esproposal_optional_chaining: false,
esproposal_class_instance_fields: true,
esproposal_class_static_fields: true,
esproposal_decorators: true,
esproposal_export_star_as: true,
types: true,
types_in_comments: false,
use_strict: false,
},
);

Flow_parser.Parser_flow.program(source, ~parse_options);
};

0 comments on commit 57aeae2

Please sign in to comment.