nmote and facebook-github-bot Move `ALoc` module to its own directory
Reviewed By: gabelevi

Differential Revision: D13090742

fbshipit-source-id: 78bd44b4dd9185088abd536d59fba2862700b7ec
Latest commit 1f0fe32 Nov 16, 2018
Permalink
..
Failed to load latest commit information.
test [parser] include default in type_param loc Oct 29, 2018
.gitignore [PR] [flow-parser-bin] download prebuilt libflowparser Dec 26, 2017
.merlin use wtf8 from opam instead of vendored version Dec 11, 2017
META v0.86.0 Nov 8, 2018
Makefile Fix parser make test Sep 21, 2018
README.md Fix Travis 4.03 build Aug 27, 2016
_tags [parser] use @@@warning in lexer.ml Jul 13, 2018
declaration_parser.ml Add the location of function signatures to the AST Nov 9, 2018
estree_translator.ml refactor frag_closingElement to not be option Nov 8, 2018
expression_parser.ml Add the location of function signatures to the AST Nov 9, 2018
file_key.ml add `[@@deriving show]` to Ast Jul 10, 2018
flow_ast.ml Add the location of function signatures to the AST Nov 9, 2018
flow_ast_utils.ml Parameterize Ast_utils types over location Oct 30, 2018
flow_ast_utils.mli Parameterize Ast_utils types over location Oct 30, 2018
flow_parser_dot_js.ml Update file headers from BSD3 to MIT Sep 27, 2017
flow_parser_js.ml implement nullish coalescing Apr 27, 2018
jsx_parser.ml refactor frag_closingElement to not be option Nov 8, 2018
lex_env.ml [parser] accumulate comments instead of mutating state Jul 17, 2018
lex_result.ml Rename ast.ml -> flow_ast.ml Aug 23, 2018
lexer.ml Rename ast.ml -> flow_ast.ml Aug 23, 2018
libflowparser.h Add a default virtual destructor to the virtual class Nov 8, 2018
libflowparser.ml [parser] add tokens option to JS API Mar 27, 2018
loc.ml Use improved diff algorithm in ast diffing Sep 14, 2018
loc.mli Use improved diff algorithm in ast diffing Sep 14, 2018
object_parser.ml Add the location of function signatures to the AST Nov 9, 2018
opam v0.86.0 Nov 8, 2018
parse_error.ml [parser] Allow '...' to indicate explicit inexact object Oct 12, 2018
parser_common.ml Reuse Parser_common.is_munged_property_name in flow_js.ml Sep 17, 2018
parser_env.ml [parser] Add parser support for _ in constructors and calls Oct 9, 2018
parser_env.mli Add a location hint to the AST whenever a type annotation is missing Oct 4, 2018
parser_flow.ml [parser] let/const parser cleanup Oct 23, 2018
pattern_cover.ml Rename ast.ml -> flow_ast.ml Aug 23, 2018
pattern_parser.ml Add a location hint to the AST whenever a type annotation is missing Oct 4, 2018
statement_parser.ml [parser] let/const parser cleanup Oct 23, 2018
token.ml implement nullish coalescing Apr 27, 2018
token_translator.ml [parser] add tokens option to JS API Mar 27, 2018
translator_intf.ml [parser] add tokens option to JS API Mar 27, 2018
type_parser.ml [parser] include default in type_param loc Oct 29, 2018
yarn.lock use Yarn in CI Apr 26, 2017

README.md

The Flow Parser

The Flow Parser is a JavaScript parser written in OCaml. It produces an AST that conforms to SpiderMonkey's Parser API and that mostly matches what esprima produces. The Flow Parser can be compiled to native code or can be compiled to JavaScript using js_of_ocaml.

Building the Flow Parser

Building the Flow Parser requires OCaml. Compiling to JavaScript requires js_of_ocaml >= 2.8.

Initial set up

Building the OCaml Flow Parser library

make

Compiling the Flow Parser to JavaScript

make js

Tests

The Flow Parser's test suite tests the JavaScript version of the parser, so you will need js_of_ocaml installed. The tests and tools also have some node module dependencies, so you will need to run

Initial set up

Running the Tests

make test