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

WIP: Use the flow parser to support es6 #1231

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions flow/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
flow
ocaml-wtf8
6 changes: 6 additions & 0 deletions flow/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(env
(dev
(flags
(:standard -w -6-69))))

(data_only_dirs flow ocaml-wtf8)
39 changes: 39 additions & 0 deletions flow/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

[ -d flow ] || git clone git@github.com:facebook/flow.git
[ -d ocaml-wtf8 ] || git clone git@github.com:flowtype/ocaml-wtf8.git
rm -rf parser
mkdir parser

cp flow/src/hack_forked/utils/collections/flow_set.ml parser/
cp flow/src/hack_forked/utils/collections/flow_map.ml parser/
cp flow/src/third-party/sedlex/flow_sedlexing.ml parser/
cp flow/src/third-party/sedlex/flow_sedlexing.mli parser/
cp flow/src/parser/*.ml parser/
cp flow/src/parser/*.mli parser/
rm parser/flow_parser_dot_js.ml
rm parser/flow_parser_js.ml
rm parser/relativeLoc.ml
rm parser/relativeLoc.mli
rm parser/comment_utils.ml
rm parser/estree_translator.ml
rm parser/libflowparser.ml
rm parser/offset_utils.ml
rm parser/offset_utils.mli
rm parser/token_translator.ml
rm parser/translator_intf.ml

cat << EOF > parser/dune
(library
(name flow_parser)
(libraries sedlex)
(preprocess (pps sedlex.ppx)))
EOF

cat << EOF > parser/.ocamlformat
disable=true
EOF

cp ocaml-wtf8/src/wtf8.ml parser/
cp ocaml-wtf8/src/wtf8.mli parser/

1 change: 1 addition & 0 deletions flow/parser/.ocamlformat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
disable=true
Loading