22 Commits

Author SHA1 Message Date
Sosuke Suzuki
2ba9265198
Add missing semicolon in AST spec (#12454)
[skip ci]
2020-12-07 19:32:35 +01:00
Sosuke Suzuki
285402d82f
Add StaticBlock to Table of Contents in AST spec (#12449) 2020-12-05 14:12:42 +01:00
Sosuke Suzuki
ff6c3792bb
Make assertions optional and update AST spec (#12280) 2020-10-29 10:21:52 -05:00
Sosuke Suzuki
faaebfe91f
Support Import Assertions for re-export statement (#12249) 2020-10-26 15:18:45 +01:00
Sven Sauleau
af8e0facc1
Parse import-assertions (#12139)
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-10-14 21:18:16 +02:00
Huáng Jùnliàng
3ccca88178 Parse class static block (#12079)
Co-authored-by: Brian Ng <bng412@gmail.com>
2020-10-14 21:16:24 +02:00
Huáng Jùnliàng
21d7ee2610 String import/export specifier (#12091)
* feat: parse moduleExportName
* feat: add validators
* Support string specifier name in commonjs transform
* Support string specifier name in export-ns-from
* test: add loose testcases
* test: add testcases for amd and umd
* feat: support systemjs
* test: update fixtures fixed in #12110
* add plugin name typings
* test: rename test layout
* feat: implement under moduleStringNames flag
* chore: add plugin syntax module string names
* feat: support ModuleExportName as ModuleExportName
* test: update test fixtures
* fix flow errors
* docs: update AST spec
* feat: support { "some imports" as "some exports" }
* feat: support { "some imports" as "some exports" } in systemjs
* test: add test on `import { "foo" }`
* Address review comments
* add moduleStringNames to missing plugin helpers
* Apply suggestions from code review
* update test fixtures
* Update packages/babel-parser/src/parser/error-message.js
* update test fixtures

Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>
Co-authored-by: Brian Ng <bng412@gmail.com>
2020-10-14 20:01:37 +02:00
Huáng Jùnliàng
059e9124ff
Add decimal parsing support (#11640)
* docs: add DecimalLiteral to AST spec

* add decimal support

* fix: throw invalid decimal on start

* add DecimalLiteral type definitions

* update parser typings

* add generator support

* add syntax-decimal plugin

* Add syntax-decimal to babel-standalone

* add syntax-decimal to missing plugin helpers

* fix incorrect test macro
2020-07-29 16:43:15 -04:00
Huáng Jùnliàng
b1b21e5c03
docs: add AST spec on optional chain [skip ci] (#11729) 2020-07-01 14:20:17 -04:00
Huáng Jùnliàng
fa98a0a5b3
docs: update AST spec (#11492)
Co-Authored-By: Brian Ng <bng412@gmail.com>
2020-04-28 12:30:01 -04:00
Rick Button
3ce7c2e394
Added support for record and tuple syntax. (#10865)
* Added support for record and tuple syntax.

This commit adds support for both the hash #{} and bar {||}
syntaxes to babel-parser, as well as adds the supporting
babel-plugin-syntax-record-and-tuple plugin to enable support
for the syntax. Does not include any transform for records and
tuples.

* typo

* added check to ensure recordAndTuple in babel-parser

* switched to syntaxType option instead of explicit entries for each record and tuple type

* switched to using recordAndTupleSyntaxType for generator options instead of adding to node

* added tests for generator option recordAndTupleSyntaxType

* added test for record and tuple bar syntax with flow typings

* added tests for invalid/missing recordAndTuple syntaxType parser option

* fixed flowcheck errors

* fix merge with class privates in tokenizer

* Update packages/babel-parser/src/types.js

Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>

* improved recordAndTuple generator error message, added tests for invalid,missing options

* updated error messages for invalid parser syntaxType option

* updated error message

* added better error messages for when the recordAndTuple syntaxType is doesn't match the syntax used

* updated record and tuple support to use new error message templates

* added recordAndTuple to missing plugin helpers

* Fix linting

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-03-16 23:57:44 +01:00
Sven Sauleau
34a9653281 add AST for the module attribute proposal (#11015)
Introduce a `ImportAttribute` structure and add an `attributes` key on
the `ImportDeclaration` node.

[skip ci]
2020-01-17 20:58:30 +01:00
James DiGioia
7f47cb65d0 Add Pipeline nodes to ast.spec [skip ci] (#10214) 2019-07-13 19:11:51 +02:00
Erik Arvidsson
fba5655a44 Parenthesized expressions (#8025)
* Add parser createParenthesizedExpressions option  …

When set to `true` we create `ParenthesizedExpression` nodes instead of
setting `extra.parenthesized`.

* Also update babel-parser.d.ts
2019-03-06 22:43:36 +01:00
Behrang Yarahmadi
c60c4dd375
Partial Application Syntax: Stage 1 (#9343)
* add partial application syntax and some tests

* remove unnecessary error message and hasPartial function from parseNewArguments

* add types for PartialExpression

* Update the tests

* rename PartialExpression to Partial

* move Partial from expressions to types and rename to ArgumentPlaceholder

* add tests for ArgumentPlaceholder in babel-generator

* rename Partial to ArgumentPlaceholder

* update the tests

* remove alias from the type and undo changes in generated folder

* adds a nice error message

* better definition for the type

* auto-generated files

* update the conditional for allowPlaceholder message and tests

* update CallExpression definition to accept ArgumentPlaceholder

* change description

* clean up

* indent ArgumentPlaceholder entry and revert unwanted changes
2019-03-05 00:34:02 +01:00
Justin Ridgewell
fc1ea7f496 Revert "Parenthesized expressions (#8025)"
This reverts commit dd8b700a2c4c975584c7b2ea43023aa275c16167.
2019-02-25 19:03:00 +01:00
Erik Arvidsson
dd8b700a2c Parenthesized expressions (#8025)
* Add parser createParenthesizedExpressions option  …

When set to `true` we create `ParenthesizedExpression` nodes instead of
setting `extra.parenthesized`.

* Also update babel-parser.d.ts
2019-02-23 02:45:25 -05:00
Daniel Tschinder
4ba998c5db Add importKind to spec 2019-02-14 21:53:29 +01:00
Sven SAULEAU
7d99a96f9f
docs: [skip ci] add InterpreterDirective 2018-05-23 09:50:23 +02:00
Sven SAULEAU
ad1de09b5f
docs: [skip ci] update AST spec 2018-05-23 09:42:33 +02:00
Henry Zhu
51eef099b3 fixes [skip ci] 2018-05-19 00:12:26 -04:00
Chaitanya Kumar Kamatham
daf0ca8680 Rename "babylon" to "@babel/parser" (#7937) 🎉 2018-05-19 00:03:05 -04:00