77 Commits

Author SHA1 Message Date
Daniel Tschinder
e4b8cfc768 perf: use Set instead of string indexOf 2019-01-17 16:15:00 -08:00
Daniel Tschinder
a7757ec4d0 perf: Use increment operator 2019-01-17 16:14:58 -08:00
Daniel Tschinder
2dc1c91955 perf: Move input to state and precalculate length
This also fixes a bug with async functions
2019-01-17 16:14:54 -08:00
Daniel Tschinder
ae154c86ed perf: Minor optimizations 2019-01-17 16:14:53 -08:00
Sven Sauleau
fdc869ce16
Merge pull request #8289 from valtech-nyc/implement-smart-pipeline-in-parser
Implement Smart Pipeline proposal in @babel/parser
2018-12-03 19:28:45 +01:00
Daniel Tschinder
3932830535
Parse non-octals with leading zeros in non strict mode correctly (#9114)
* Parse non-octals with leading zeros in non strict mode correctly

* Better error message
2018-12-03 00:04:37 -08:00
mAAdhaTTah
4cbd22a15f Hardcode "#" in error message
It's not going to be anything else...
2018-11-21 21:05:51 -05:00
Brian Ng
4f206b2416
prettier@1.15.1 (#9001) 2018-11-09 15:25:13 -06:00
Daniel Tschinder
5d5cd8612f
Fix several edge cases with context expression state (#8972)
* Fix several edge cases with context expression state

* Fix review comments

* Remove unused field
2018-11-06 19:37:24 -08:00
Nicolò Ribaudo
24c4901ff5
Remove Babylon plugins for features already merged to the ECMAScript spec (#8448)
These are now enabled by default:
- objectRestSpread (2018)
- asyncGenerators (2018)
- optionalCatchBInding (2019)
- jsonStrings (2019)

TODO (after this commit):
- [ ] Deprecate the `@babel/plugin-syntax-*` packages.
- [ ] Deprecate the `@babel/plugin-proposal-*` packages.
- [ ] Create the `@babel/plugin-transform-*` packages.
2018-11-05 23:48:06 +01:00
mAAdhaTTah
b593af17a9 Replace codePointToString with ES6 method 2018-11-03 14:00:42 -04:00
mAAdhaTTah
4521204ea0 Merge branch 'master' into implement-smart-pipeline-in-parser
* master: (222 commits)
  Set correct methods name
  Use toPropertyKey in the "decorate" helper
  Allow function types in type params within arrow return types (#8954)
  Fix message when plugin of a wrong type is passed (#8950)
  rename colliding let bindings with for loop init (#8937)
  edge incomplete support for arrow destructuring (babel #8349) (#8926)
  fix single-arg async arrows when retainLines=true (#8868)
  [flow] Explicit inexact objects with `...` (#8884)
  Update preset-env data (#8898)
  Treat break inside block inside loop (#8914)
  fixed "source map" formatting in comment (#8878) [skip ci]
  fix typo in contributing guidelines (#8901) [skip ci]
  fix: Expression x === 'y' && '' should not evaluate to undefined. (#8880)
  fixed an extra word
  Fixes #8865 (#8866)
  v7.1.4
  v7.1.3
  Bump Babel deps (#8770)
  flow-bin@0.82.0 (#8832)
  Insertafter jsx fix (#8833)
  ...

# Conflicts:
#	packages/babel-parser/src/tokenizer/index.js
#	packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-numeric-literal/options.json
#	packages/babel-parser/test/fixtures/experimental/pipeline-operator/invalid-proposal/options.json
2018-11-03 14:00:12 -04:00
Byron Luk
929567523c Fixes #8865 (#8866) 2018-10-12 09:28:15 -05:00
Justin Ridgewell
72ee1816a4
Update to ES6 String methods (#8541) 2018-08-26 13:26:51 -04:00
Justin Ridgewell
5899940156
Update parser whitespace for clarity (#8539)
* Update parser whitespace for clarity

Has the nice benefit of not requiring a charCode to String conversion.

* Remove test262 exceptions

Per https://github.com/tc39/ecma262/pull/1218#issuecomment-395340891,
ECMA262 follows whatever the latest Unicode version specifies for Zs
Space_Separator category. MONGOLIAN VOWEL SEPARATOR was moved to the Cf
Other_Format category in Unicode 8.
2018-08-25 19:12:38 -04:00
James DiGioia
25d01460fd Fix error message for #4 case
This impact private fields as well as smart pipeline, providing a clearer
error message for both.
2018-08-10 07:52:55 -04:00
James DiGioia
d1cae2dec2 Remove unneeded comment
This is no longer true, now that we return `tt.hash`.
2018-08-09 21:10:43 -04:00
James DiGioia
afd0638b74 Reuse hash token instead of new primaryTopicToken
Set whether we're in a pipeline in order to determine how to parse the
hash. The error message changes as a result, since the `hash` never
enters the block.
2018-07-22 18:46:31 -04:00
James DiGioia
7188820151 Delete commented code 2018-07-12 22:55:01 -04:00
James DiGioia
00845709ce Add comment for number sign 2018-07-12 22:48:53 -04:00
James DiGioia
ef0f723fc5 Reverse yoda conditions
If "smart" proposal is, we'll no longer say.
2018-07-12 22:46:34 -04:00
Andy
301db1b921 TypeScript: Support type arguments on JSX opening and self-closing tags (#7799) 2018-07-10 17:19:42 -05:00
J. S. Choi
fbf62b4830 Implement Smart Pipeline proposal in @babel/parser 2018-07-09 22:44:27 -04:00
hassanAli321
6480ae4a9f fix flow-double-nullable-type-cant-be-parsed 2018-06-07 13:22:45 -05:00
Logan Smyth
2058e0686e Add support for an InterpreterDirective AST node. 2018-05-21 18:19:58 -07:00
Justin Ridgewell
0879a6d608
Subsume json (#7985)
* Add Subsume JSON transform

https://github.com/tc39/proposal-json-superset is at stage 3.

This allows U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR to appear unescaped inside strings and directives.

* Move to Stage 3

* Break diretive parsing

* Update README

* Handle multi-escape sequences

* Remove babylon files after rename
2018-05-19 15:32:05 -04:00
Chaitanya Kumar Kamatham
daf0ca8680 Rename "babylon" to "@babel/parser" (#7937) 🎉 2018-05-19 00:03:05 -04:00