Update API documentation (#330)

This commit is contained in:
Timothy Gu 2017-02-10 05:59:35 -08:00 committed by Daniel Tschinder
parent 4bd682e90b
commit 88d38a1abb

View File

@ -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][].