diff --git a/README.md b/README.md index 68c136a851..50712b17e3 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,12 @@ Significant diversions are expected to occur in the future such as streaming, EB ### `babylon.parse(code, [options])` +### `babylon.parseExpression(code, [options])` + +`parse()` parses the provided `code` as an entire ECMAScript program, while +`parseExpression()` tries to parse a single Expression with performance in +mind. When in doubt, use `.parse()`. + ### Options - **allowImportExportEverywhere**: By default, `import` and `export` @@ -37,7 +43,7 @@ Significant diversions are expected to occur in the future such as streaming, EB the top level raises an error. Set this to `true` to accept such code. -- **allowSuperOutsideMethod** TODO +- **allowSuperOutsideMethod**: TODO - **sourceType**: Indicate the mode the code should be parsed in. Can be either `"script"` or `"module"`. @@ -46,6 +52,8 @@ Significant diversions are expected to occur in the future such as streaming, EB - **plugins**: Array containing the plugins that you want to enable. +- **strictMode**: TODO + ### Output Babylon generates AST according to [Babel AST format][].