Commit Graph

415 Commits

Author SHA1 Message Date
강동윤
cae9286af0 Bump versions 2020-06-20 17:43:24 +09:00
강동윤
fe260a02e2
ES2020 (#855)
Adapt es2020. API is not changed, but config for merged proposals are now noop.
2020-06-20 15:09:57 +09:00
강동윤
28456d0b49
Default value for options.jsc.parser.syntax (#840) 2020-06-13 02:05:49 +09:00
강동윤
d82e6ab69d
Fix parsing of class member named declare (#822) 2020-06-04 02:52:40 +09:00
강동윤
f912e9493b
Add some tests for parser (#819) 2020-06-03 23:37:15 +09:00
David Sherret
99c164b628
Fix type-only import declaration with empty named imports being parsed as having a default import specifier (#817)
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-06-03 15:41:24 +09:00
강동윤
d7bb5c18ae
Fix parsing of type annotation (#816) 2020-06-03 12:19:05 +09:00
강동윤
58823f9590 Add examples 2020-06-02 19:53:20 +09:00
강동윤
0efba88e3f
Improve typescript parser (#811) 2020-06-02 19:22:41 +09:00
강동윤
85f068c011
Reduce stack usage on debug build (#799) 2020-05-27 19:26:50 +09:00
Gurwinder Singh
5f261fcd5c
Rename Import and Export Node names (#777)
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-05-17 19:15:31 +09:00
강동윤
65f2faa339
Reduce stack usage (#776) 2020-05-17 18:50:52 +09:00
강동윤
d74f74932e Support decorators on parameters (#775)
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2020-05-16 22:36:52 +09:00
David Sherret
8b4fc59805
Support template literals in types (#767) 2020-05-16 17:19:48 +09:00
강동윤
e1bf60909e
Optimize parser (#774)
Add some short-circuiting
2020-05-16 15:31:19 +09:00
강동윤
8615d69ac3
Fix bugs (#758)
swc_ecma_transforms:
 - Module passes resolver pass now shares 'global' context (Closes #724)
 - TypeScript enums are treated as concrete (Closes #757)
2020-04-30 23:48:52 +09:00
David Sherret
5bd432f7de
Fix ZeroFillRShift tokenized as Gt (#752)
Fixes #751
2020-04-29 22:09:50 +09:00
David Sherret
80f81d8cd7
Fix parsing async generator method in object expression (#749) 2020-04-22 12:37:17 +09:00
David Sherret
93ffb9700b
Increase swc_ecma_parser_macros version to 0.4.1 in swc_ecma_parser (#736) 2020-03-28 13:54:53 +09:00
강동윤
706ae00523
Fix deeply nested optional chaining (#735)
- Handle deeply nested optional chaining expression correctly (Closes #732)
2020-03-28 11:59:45 +09:00
강동윤
2225679ea7
Fix capturing (#731)
Fix token capturing (Closes #728)
2020-03-26 14:56:54 +09:00
강동윤
ebc7070d1f
Fix parser (#727)
- Allow await in an yield expression (fixes #720)
 - Prevent duplicate tokens while capturing (fixes #726)
2020-03-25 17:40:05 +09:00
David Sherret
b17b249fa6
Fix union and intersection type start (#725) 2020-03-22 11:02:41 +09:00
David Sherret
b677115702
Fix async arrow expression and TsIndexSignature param ident spans (#721)
- Fix async arrow expression start.
- Fix TsIndexSignature inner ident and type ann spans.
2020-03-15 08:18:28 +09:00
강동윤
c7b12cd408
Fix bugs (#718)
- Handle inline source map (Closes #706)
 - Fix parsing of conditional expression starting with async (Closes #706)
2020-03-13 23:34:36 +09:00
강동윤
dc2e2fabbd
Allow optional binding pattern in ambient context (#715) 2020-03-10 13:59:32 +09:00
David Sherret
2f47d41f2b
Fix tagged template start to include tag (#714)
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-03-10 12:35:42 +09:00
강동윤
6f4e534c88 Bump versions 2020-03-10 10:39:42 +09:00
David Sherret
5a2f9249b2
Fix class declaration with decorators start. (#711) 2020-03-10 10:38:56 +09:00
David Sherret
1e13299540
Fix arrow start in conditional expression. (#712) 2020-03-10 10:29:34 +09:00
강동윤
544090832d Bump 2020-03-10 00:41:04 +09:00
강동윤
e448a8910c
Fix bugs (#710)
- The parser now supports parsing optional patterns in .d.ts files (Closes #709)
 - The source map is handled properly (Closes #705, Closes #707)
2020-03-09 21:18:41 +09:00
강동윤
8f280c535c
Performance (#696)
- Parser performance is improved by ~15%
 - Codegen performance is improved by ~90% (when comment and source map is enabled)
2020-03-01 20:05:03 +09:00
강동윤
3911ab75b9 Bump version 2020-02-29 10:34:10 +09:00
David Sherret
0e8c5a6c93
Fix assignment pattern start when there is a type annotation (#693)
- Update dashmap to 3.5.1

Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-02-29 10:29:34 +09:00
강동윤
cb43a69e02
implement { Hash, Eq } for ast nodes (#684)
As NaN is`IIdent` not `Number`, we can use implement Hash and Eq for ast nodes.
2020-02-21 12:47:06 +09:00
강동윤
e3ca8e5d13
Fix bugs (#683)
- Fix block_scoping (Fix #682)
 - Handle new.target in susbscript position (Fix #675)
2020-02-20 13:06:28 +09:00
강동윤
087e768810 Bump version 2020-02-19 12:55:41 +09:00
David Sherret
0d17f014e3
Fix tagged template span to include tag. (#677) 2020-02-19 12:50:07 +09:00
David Sherret
4550f7e1af
Support type predicate "asserts" with no "is" (#667) 2020-02-15 10:44:02 +09:00
강동윤
1fc09caa2f
type-only import, exports (#662) 2020-02-13 22:56:13 +09:00
강동윤
348052b017
Improve optimizer (#660)
Although it's quite naive at the moment, I added two optimization passes.

 - dead code elimination (Closes #607)
 - inlining
2020-02-13 11:45:14 +09:00
kdy1
82e73b1121 Fix bugs (#659)
- Strip out const assertions (Closes #656)
 - Fix exclude of the file matcher (Closes #658) 
 - Automatic typescript detection (Closes #655)
2020-02-12 15:07:45 +00:00
David Sherret
1bf81c6e85
Fix span of the ExportNamespaceSpecifer (#651) 2020-02-11 11:02:37 +09:00
David Sherret
4b7222cbfe
Support export * as ns from "module" (#647) 2020-02-10 11:30:25 +09:00
David Sherret
530a5f34db Support ecmascript private fields when parsing TypeScript. (#642) 2020-02-10 03:22:51 +09:00
kdy1
add63826bd Allow await expression at other than expression statement (#636)
Fixes #635
2020-02-08 01:49:00 +00:00
dsherret
55c0258017 Remove empty expression in expression statement with top level await (#630)
Eats the semi-colon.

This doesn't compile (edit: doesn't compile the code in the tests) though because the target of that folder is ES2015. Also, this is kind of strange for me to put the tests in the "typescript" folder. Should we create something more general?

You can take over this PR if you'd like!
2020-02-07 05:33:26 +00:00
dsherret
bf5cff152b Fix start position on class declarations with decorators (#628)
Fixes: https://github.com/swc-project/swc/issues/626#issuecomment-582567305

See #581
2020-02-06 00:20:19 +00:00
alubbe
45604fa6e7 Remove dependency renaming to enable WASM (#625)
This PR supercedes https://github.com/swc-project/swc/pull/621 and tries to remove dependency renaming to enable WASM, as discussed in https://github.com/swc-project/swc/issues/106
2020-02-05 11:20:25 +00:00
kdy1
94eac1de89 Top level await (#627)
Implements a top level await for es2017+, and allow it for typescript and ecmascript (ecmascript requires topLevelAwait: true).

Closes #626.
2020-02-05 01:05:23 +00:00
kdy1
42373f975b Fix parsing of declare (#624)
Previously all children in declare context were marked as `declare`. It's wrong, and I fixed to set declare: true only on the exact node
2020-02-04 02:12:55 +00:00
kdy1
196740cdcd Allow optional chaining in ecmascript (#619)
Fixes #618
2020-01-31 15:59:47 +00:00
강동윤
8afa3413ea
Remove dependency on lazy_static and chashmap (#617)
- `lazy_static` is replaced by `once_cell`
 - `chashmap` is replaced by `dashmap`
2020-01-30 23:29:12 +09:00
kdy1
01659585e4 Fix parsing of jsx attribute values (#616)
Closes #614.
Closes #615.
2020-01-29 06:24:35 +00:00
강동윤
e92923b467 Bump 2020-01-29 12:21:45 +09:00
kdy1
d06eeed352 Async generator (#613)
Change parser to accept async generator.

Closes #612.
2020-01-29 02:59:25 +00:00
dsherret
d4fa2a6a96 Ensure semi-colon is eaten for dynamic imports and import meta found at the start of expression statements (#595)
Fixes #594.

Also fixes span for "imports" identifier.
2020-01-18 04:51:20 +00:00
David Sherret
a55fced20b Fix spans for "as" and const assertions (#593)
- Fix spans for "as" and const assertions
2020-01-18 12:33:01 +09:00
강동윤
8e476d8a83
Make parser work identically in release mode (#577)
swc_ecma_parser:
 - parser behaves identically on debug mode and release mode

swc:
 - run all tests on travis ci
 - use nvm on travis ci

swc_ecma_transforms:
 - make async_to_generator understand hoisting
2020-01-17 18:44:51 +09:00
kdy1
96e1dbe213 Improve hygiene and use JSXAttrValue (#592)
swc_ecmacript:
 - use JSXAttrValue (Fixes #584)

swc_ecma_transforms:
 - make hygiene pass check for exported vars (Fixes #591)
2020-01-17 05:45:33 +00:00
David Sherret
0d67d5d855 Fix JSX opening, closing, spread child, and expression container spans (#582)
swc_ecma_parser:
 - fix opening and closing jsx spans.
 - fix JSX expression.
 - fix JSX spread child.
2020-01-14 12:37:29 +09:00
David Sherret
e5004da87e - Spans of class members and classes should include decorators. (#581)
- spans of class members and classes should include decorators.
 - fix hi position for class parameter properties.
 - fix span of members with accessibility.
2020-01-12 08:41:43 +09:00
David Sherret
b7b7fda982 Fix type predicate start position. (#580) 2020-01-12 08:38:58 +09:00
David Sherret
fea4c5bd63 TypePredicate - Parse the asserts modifier (#567)
swc_ecma_parser:
 - add support for asserts modifier from typescript 3.7
2020-01-09 14:14:44 +09:00
kdy1
6eb066166f Don't emit error messages while trying (#574)
swc_ecma_parser:
 - don't emit error messages while trying (Closes #573)
2020-01-07 12:36:51 +00:00
kdy1
02d4fb60f2 Make capturing fast (#570)
swc_ecma_parser:
 - made capturing fast (Closes #533)
2020-01-06 01:02:51 +00:00
dsherret
8e3827403e Fix class and interface spans (#566)
The interface span for something like `interface Test {}` was `Test {}`. Also, for stuff like `export default abstract class Test{}` it was `class Test{}` instead of `abstract class Test {}`.
2020-01-06 00:08:59 +00:00
dsherret
9676a05853 Import type should have type arguments rather than type params (#560)
Just found another occurrence of this. Similar to #548. 

![image](https://user-images.githubusercontent.com/1609021/71735836-716b2d00-2e1d-11ea-8878-50d28da9fa5e.png)

I'm currently going through all the types right now so you might want to hold off on merging this or doing a breaking change release until I finish that.
2020-01-04 23:56:31 +00:00
강동윤
c0cc2185ea
Fix ci (#561)
- line endings are normalized
 - switched to github actions from travis to check forked branches
2020-01-04 13:33:25 +09:00
David Sherret
c43bc471dd Fix span for patterns with a type annotation (#558)
swc_ecma_parser:
* fix span for patterns with a type annotation.

Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-01-03 14:37:48 +09:00
David Sherret
5acf557e35 GetterProp - Add type_ann (#557)
swc_ecma_ast:
 - add type_ann to GetterProp

swc_ecmascript_parser:
 - parse type annotation after a getter property
2020-01-03 13:08:27 +09:00
강동윤
1bcfcb741a
Fix #555 (#556) 2020-01-03 12:19:39 +09:00
David Sherret
5f6b11348a Fix span of the switch statement. (#553) 2020-01-02 16:46:56 +09:00
David Sherret
4f76cddebd Fix span of await token in for/for-in/for-of stmts. (#551) 2020-01-02 10:18:20 +09:00
David Sherret
288008091a Typo (#550) 2020-01-02 10:13:47 +09:00
강동윤
916858ae81
Bugfixes (#549)
swc_ecma_ast:
 - fix TsExprWithTypeArgs (closes #548)

swc_ecma_codegen:
 - allow using default import with namespace import (closes #546)

swc_ecma_parser:
 - parse import.meta (closes #545)
2020-01-01 06:57:34 +09:00
David Sherret
64bddebb2b Fix parsing class properties as readonly (#547)
swc_ecma_parser
 - parse readonly property correctly
2020-01-01 03:14:46 +09:00
David Sherret
708efebac9 Fix comment line's end to be on same line (#544)
- fix comment line's end to be on same line.
2019-12-30 11:09:45 +09:00
강동윤
aa2a394f7d
Fix #542 (#543)
swc_ecma_transforms:
 - preserve space after a jsx element
2019-12-30 00:05:43 +09:00
David Sherret
bde5341bd7 Fix string literal span on import/export specifiers to only include string literal (#540) 2019-12-29 16:18:14 +09:00
강동윤
702800e0d9
Attach comments to correct node (#541) 2019-12-28 22:02:58 +09:00
강동윤
8562d3fbfb
Fix parser (#539)
swc_ecma_parser:
 - mark `declare` as `declare` (#538)
 - fix span of `export * from 'foo'` (#535)
2019-12-28 12:19:44 +09:00
강동윤
b98f17b84d Bump versions 2019-12-26 08:53:13 +09:00
David Sherret
32860576f2 Comment and TokenAndSpan - Implement Spanned (#534) 2019-12-26 08:35:43 +09:00
강동윤
31a5bed497
Legacy decorator for class and class members (#531) 2019-12-25 19:30:16 +09:00
강동윤
b1e4122b02
Nullish coalescing / optional chaining / comments (#529)
swc_ecma_ast:
 - rename `TsOptChain` to `OptChainExpr` (Fixes #525)
 - add `BinOp::NullishCoalescing`

swc_ecma_parser:
 - parse `??` (Fixes #526)

swc_ecma_transforms:
 - remap comments from fixer (Fixes #528)
2019-12-24 17:01:32 +09:00
David Sherret
668c2713d9 Support numeric separator for typescript. (#524) 2019-12-23 14:35:58 +09:00
강동윤
24b5c44ba3
Numeric separator & Bigint (#523)
swc_ecma_ast:
 - `BigInt` literal

swc_ecma_parser:
 - numeric separators. (#521)
 - parsing of bigint literal
2019-12-22 17:14:04 +09:00
강동윤
ed8ba26ae6 Fix tests 2019-12-21 17:09:53 +09:00
강동윤
6186af04a9
Fix handling of jsx texts (#519)
swc_ecma_transforms:
 - Fix handling of jsx texts (#517)
2019-12-21 16:59:04 +09:00
강동윤
51d21af031 Fix #516 2019-12-19 13:08:52 +09:00
강동윤
30af06bb70
Ast (#513)
swc_ecmascript:
 - add `ExprStmt`.
 - change type of regex.expression and regex.flags.
2019-12-16 18:08:21 +09:00
David Sherret
fb9539df6f Expose token module. (#510)
swc_ecma_parser:
- expose token module
2019-12-15 08:08:13 +09:00
강동윤
332061f44d
Parser: respect jsc.target (#507)
swc:
 - make parser respect `jsc.target`.
2019-12-14 18:51:08 +09:00
kdy1
3ec395ba75 Improve performance & update rustfmt (#504) 2019-12-13 06:21:25 +00:00
강동윤
5076249c90 fixup! Add a test for #503 2019-12-13 08:38:46 +09:00
강동윤
126b6bc761 Add a test for #503 2019-12-13 08:35:32 +09:00
kdy1
0df908fdb4 ast & parser improvement (#502)
Parser can now parse typescript source code and rxjs.

Closes #468.
2019-12-11 14:28:35 +00:00
강동윤
d53c94f1fb Bump parser's version.
Closes #500
2019-12-11 15:56:27 +09:00
강동윤
1a48efa4e4
ES3 (#498)
* Add a test for #496
 - Better error message for TS1056
 - Allow using dynamic import with es3 target
2019-12-11 13:35:15 +09:00
Nurbol Alpysbayev
79128a1d1e Typo (#497) 2019-12-11 07:09:45 +09:00
Nurbol Alpysbayev
2f4ce50d06 Fix the Wasm blocker for Parser (#495) 2019-12-11 00:02:39 +09:00
강동윤
ef45401a18 Update tests 2019-12-10 10:50:37 +09:00
강동윤
cd486288b7 Bump version 2019-12-10 07:23:27 +09:00
강동윤
ae6de87abb
Add more tests (#489) 2019-12-09 21:02:51 +09:00
강동윤
b3a2ee8e9b
Fix bugs (#482)
swc_ecma_parser:
 - fix lexing of numbers like 9.09

swc_ecma_transforms:
 - jsx_text_to_str
 - use fxhash instead of ahash for exports
2019-12-02 20:19:15 +09:00
강동윤
bc19ee274b Update parser test references 2019-12-02 17:12:53 +09:00
Zimon Dai
ec086a1dab use 2018 edition syntax (#479) 2019-12-02 17:10:05 +09:00
강동윤
776e014a11
Fix tests (#478) 2019-12-01 18:11:59 +09:00
강동윤
153cf36168
Jsonify large pure object literals (#477)
swc_ecma_transforms:
 - add `jsonify` transform
2019-12-01 17:32:44 +09:00
강동윤
265eb9e30c
Improve performance of serialization and deserialization (#475) 2019-11-30 14:49:18 +09:00
강동윤
a7a8a4a2e4
Plugin (#473)
swc_common:
 - apply patch from rust-lang/rust#59693

swc:
 - use &Options instead of Options
 - configures commons::CM
 - exposes `handler`
2019-11-29 23:46:06 +09:00
강동윤
41c6941dc5 fixup! Don't omit empty values while serializing 2019-11-28 17:53:03 +09:00
강동윤
5532e628b2 Don't run cargo clippy on push 2019-11-28 13:38:11 +09:00
강동윤
747a07f566 Update submodules 2019-11-26 20:42:41 +09:00
강동윤
b81200b1db Update references 2019-11-26 11:31:16 +09:00
강동윤
8c7005d7ab
More testing (#469)
swc:
 - Move tests from node-swc to swc
 - Add integration tests (webpack, rxjs, angular-core)
 - Support `exclude`
 
swc_ecma_transforms:
 - More span validation
 - classes:
    - Strip `TsIndexSignature`

swc_ecma_parser:
 - Fix span of member expression
 - Fix span of binary expression
 - Fix span of unary expression
2019-11-26 10:08:48 +09:00
강동윤
fc9880e4f4 Bump parser's version 2019-11-24 14:42:08 +09:00
강동윤
b46c4ec300
Update dependencies (#464) 2019-11-24 14:17:27 +09:00
강동윤
7d4168f415
Parser performance (#463)
- Update string_cache from 0.7 to 0.8
 - Update unicode_xid from 0.1 to 0.2

swc_ecma_parser:
 - Add benchmarks for lexer
2019-11-23 23:03:19 +09:00
강동윤
fa941b3ea3
resolver: Handle arrow expression correctly (#462)
swc_ecma_transforms:
 - resolver: Handle arrow expression correctly (#462)
2019-11-23 19:14:52 +09:00
강동윤
8ec7a69572
Parser performance (#459)
- codegen-units = 1 for benchmarks

swc_ecma_parser:
 - Add a benchmark for typescript lexer
 - Remove dynamic dispatch in lexer
 - Improve performance of typescript
2019-11-23 13:03:29 +09:00
강동윤
4a80790d73 Add benchmark for typescript parser 2019-11-22 21:13:14 +09:00
강동윤
3474c61a48
Fix codegen and parsing of template literal (#453)
- Fix codegen and parsing of template literal (#450)
2019-11-18 19:54:24 +09:00
강동윤
d50ab99ef0
Fix #451 (#452)
swc_ecma_parser:
 - Fix parser of eval and arguments

swc_ecma_transforms:
 - Improve fixer (#451)
2019-11-18 18:19:25 +09:00
강동윤
d074063867
Parser: Error recovery (#449)
Implement some error recovery logic to parser
2019-11-17 18:36:47 +09:00
Jasper De Sutter
716bfe05b2 Cleanup (#448)
- cargo fix
- update all crates to 2018 edition
2019-11-17 13:21:53 +09:00
강동윤
bc4a2976e5
Validate spans (#447)
- Add span validator to swc_ecma_transforms
2019-11-16 23:49:32 +09:00
강동윤
37b80dfd08
Optional chaining for typescript (#444)
Implement typescript 3.7's optional chaining
2019-11-15 14:34:48 +09:00
강동윤
25523f45bd Remove unsafe 2019-11-13 20:00:21 +09:00
강동윤
167008de6f
Expose tokenizer (#437)
swc_common:
 - Added input::Input

swc_ecma_parser:
 - Made lexer public
 - Make input type of parser generic
 - Added example of using lexer
2019-11-06 13:14:44 +09:00
강동윤
ae3326cd9d
Compiler apis & .swcrc improvement (#434)
- Expose high-level compiler apis (#431)
 - Support multiple entries in .swcrc (#414)
2019-10-25 10:11:24 +09:00
강동윤
2add7a08ef fixup! Bump versions 2019-10-23 22:22:54 +09:00
강동윤
4a41140854 Bump versions 2019-10-23 22:20:00 +09:00
강동윤
7f5d3a4db1 Fix parsing of single untyped param in IIFE
Closes #433
2019-10-23 20:53:28 +09:00
강동윤
2e5c81ee8e Fix parsing readonly array and tests
Closes #432
2019-10-23 20:20:17 +09:00
강동윤
34c3a0ece9 Fix lints 2019-10-19 12:47:25 +09:00
강동윤
9f1fca55ff Update rustc toolchain to nightly-2019-09-30 2019-10-02 13:53:56 +09:00
강동윤
d7d22c2d5e
Optional try catch binding (#422)
swc_ecma_parser:
 - Add test for optional try catch binding
 
swc_ecma_transforms:
 - Implement optional catch binding (#411)
2019-09-22 19:31:32 +09:00
강동윤
61a1367974 Fix #410 2019-09-20 23:35:45 +09:00
강동윤
c20176820e Fix #415 2019-09-20 23:07:24 +09:00
강동윤
c7abda95d4
typescript const assertion (#419)
Fixes #401.
2019-09-18 22:54:12 +09:00
강동윤
0e1991f62d
Fix bugs (#394)
- Add a test case for #392
 - Add tests for #389
 - Fix #388
 - Fix #387 
 - Add tests for #392

swc_ecma_parser:
 - Make non-last rest paramters in object pattern error
 - `...` must be followed by an identifier
2019-06-03 21:54:09 +09:00
강동윤
aa06bb7cc9 Bump version 2019-05-02 15:52:39 +09:00
강동윤
b4dde98c09
Fix #380 (#381)
swc_ecma_parser:
 - fix parsing of dot after dynamic imports (#380)
 - fix parsing of dynamic imports on top level
2019-04-29 23:36:30 +09:00
강동윤
0d52148dcd
Bugfixes (#375)
swc_ecma_transforms:
 - fix hygiene for decorators (#367)
 - add test for react with common js module (#351)

swc_ecma_parser:
  - add test for string escape problem (#350)
2019-04-28 14:58:52 +09:00
강동윤
b44da9dbe4
Fix #369, #370 (#373)
swc_common:
 - don't emit `loc` for dummy spans

swc_ecma_transforms:
 - prevent hygiene from changing key in object pattern (#369)
 - fix module tests (iteration order of FxHashSet is changed)

swc_ecma_parser:
 - fix parsing of arrow function (#370)
2019-04-27 16:28:34 +09:00
강동윤
fe451d5809 Fix #360 and update rustc 2019-04-05 12:19:18 +09:00
Michael Stewart
6f97012821 fix test imports for latest nightly (#355) 2019-03-23 13:18:55 +09:00
寧靜
84973890e7 Update util.rs (#352)
swc_ecma_parser:
 - handle unicode_xid properly
2019-03-19 21:51:12 +09:00
강동윤
8674a1dae9
Chores (#341)
- add tests for #340.
 - add backer
2019-03-12 17:24:51 +09:00
강동윤
13bf89d08c
Fix bugs (#339)
swc_ecma_parser:
 - fix parsing of type query (#338)
 - fix parsing of `in` in a let / const declaration (#337)

swc_ecma_transforms:
 - string literal is computed (#336)
 - modules: handle imports in lhs of assignment correctly (#335)
2019-03-11 20:33:15 +09:00
강동윤
a40518f667
v1.0.36 (#330)
swc_ecma_parser
 - decorator_before_export is true for typescript. (#325)
 - fix parsing of dynamic imports. (#328)
 - fix parsing of conditional expression. (#327)
2019-03-09 09:07:15 +09:00
강동윤
248a53ce7c
Make deserialization faster (#324)
swc_ecma_ast:
 - make deserialization faster
2019-03-08 11:36:23 +09:00
강동윤
a311f42acf
Bugs (#321)
swc_ecma_parser:
 - add a test to ensure that \r\n is lexed correctly (#316)

swc_ecma_transforms:
 - destructuring pass now handle variable exports correctly (#317)
 - es2017::async_to_generator now handles module items. Fix #319.
 - prevent hygiene pass from de-exporting class and funcrion (#315)
2019-03-07 15:48:45 +09:00
강동윤
ed100700f1
Make deserialization fast (#314)
swc_ecma_ast:
  - add deserialization benchmark

ast_node:
 - #[ast_node] on enum now implements faster deserialization
2019-03-05 23:16:45 +09:00
강동윤
1a0f1108a1
Bugs (#303)
swc_ecma_transforms:
 - report error if jsx namespace is used (#301)
2019-03-01 18:18:57 +09:00
강동윤
a2144bbbf5 Handle escapes in jsx attributes. Fix #299. 2019-03-01 16:31:26 +09:00
강동윤
f49fbea2af Update referenes 2019-02-28 19:30:58 +09:00
강동윤
a46804ab48 swc_ecma_ast:
- Split class member / property into separate types
2019-02-28 19:25:38 +09:00
강동윤
a5bc5c1490
Publish (again) (#279)
- swc_ecma_codegen@0.6.1
 - swc_ecma_codegen_macros@0.3.0
 - swc_ecma_parser@0.9.1
 - swc_ecma_parser_macros@0.3.0
2019-02-27 10:48:02 +09:00
강동윤
10cb9a4b21
Publish (#278)
- swc_macros_common@0.2.0
 - ast_node@0.4.1
 - string_enum @0.2.0 
 - swc_ecma_ast@0.8.0
 - swc_ecma_parser_macros@0.3.0
 - swc_ecma_codegen_macros@0.3.0
 - swc_ecma_parser@0.9.1
 - swc_ecma_parser@0.6.1
2019-02-27 10:42:22 +09:00
강동윤
1b28766c26
Improve comment api (#277)
swc_ecma_parser:
 - parser now take comments by reference
2019-02-26 13:56:58 +09:00
강동윤
a75dbdf2f2 Update references 2019-02-25 19:47:53 +09:00
강동윤
dff2cb8f75
Implement deserialize for ast nodes (#274)
string_enum:
 - #[derive(StringEnum)] now derives `Deserialize`

swc_ecma_ast:
 - implement deserialize for ast nodes.
 - change ast to make it serialized / deserialized correctly

swc_ecma_parser:
 - jsx, test262, typescript tests now verify serialization and deserialization of module
2019-02-24 14:12:04 +09:00
강동윤
7dcb2e34af Add test for #269. 2019-02-22 15:55:04 +09:00
강동윤
07e2cffb43
Fixes (#265)
swc_ecma_parsr:
 - fix parsing of invalid utf8 characters (#261)
 - fix parsing of function body (#257)
 - fix parsing of  () => (x = true) (#259)

swc_ecma_transforms:
 - fix default arguments in arrow expression (#254)
 - fix assignment pattern in array pattern (#260)
 - make amd / umd configurable. (#262)
2019-02-21 22:21:48 +09:00
강동윤
76ce98b685
Implement serialize for ast nodes (#244)
swc_common:
 - implement Serialize / Deserialize for span

swc_ecma_parser:
 - use json instead of {:#?} while testing
 - update test references
2019-02-20 11:35:41 +09:00
강동윤
7d5316463d
Fixes (#241)
swc_ecma_transforms:
 - handle constructor from object_rest_spread pass (#239)
 - typescript::strip pass now removes signature-only constructor

swc_ecma_parser:
 - fix parsing of do while statement (#242)

swc_ecma_codegen:
 - fix codegen of do while statement (#242)
2019-02-19 15:20:02 +09:00
강동윤
4dc10d849e
Fixes (#237)
swc_ecma_transforms:
 - handle pattern correctly in coomon_js pass (#235)
 - fix object rest in arrow expression (#233)
2019-02-19 12:52:03 +09:00
Nate Mara
6fd789aa34 Remove dbg! macro call (#232) 2019-02-19 10:34:12 +09:00
강동윤
aa8940c1b0 Fix #226.
Now parser works correctly when either
exportDefaultFrom and exportNamespace is enabled
2019-02-18 23:43:53 +09:00
강동윤
2b7240c595
Support export * as Foo from 'foo'; (#228)
swc_ecma_parser:
 - support `export * as Foo from 'foo';` (Fix #226)

swc_ecma_transforms:
 - support `export * as Foo from 'foo';` (Fix #226)
2019-02-18 14:01:56 +09:00
강동윤
1a1889f437
Fix bugs (#221)
swc_ecmascript_parser:
 - fix parsing of `export default from 'src';`

swc_ecmascript:
 - add a pass which allows injecting helpers before the module pass
2019-02-16 14:18:22 +09:00
강동윤
631eff9e8c
Bugfixes (#208)
swc_ecma_codegen:
 - fix codegen of shebang (#177)
 - add test for #197.

swc_ecma_transforms:
 - fix object rest spread pass (#162)
2019-02-14 13:24:01 +09:00
강동윤
b27829825e
Fix Bugs (#205)
swc_ecma_codegen:
 - escape characters (#204)

swc_ecma_parser:
 - fix parsing of `<!--`

swc_ecma_transforms:
 - promote VarCollector to crate-level utility
 - fix es3::member_expr_lits (#206)
 - fix es2015::duplicate_keys pass (#203)
 - improve fixer (paren for assignment) (#201)
 - improve fixer (arrow expression) (#207)
 - make typescript pass strip out type-only exports (#196)
2019-02-14 11:03:06 +09:00
강동윤
c1a3cc53c1
React jsx / improve fixer (#202)
swc_ecma_parser:
 - fix parsing of jsx

swc_ecma_transforms:
 - fix fixer (#199)
2019-02-13 19:12:00 +09:00
강동윤
c647cf1bc0
Fix bugs (#193)
swc_ecma_parser:
 - fix lexer
 - better error reporting for jsx reference test

swc_ecma_codegen:
 - Update references
2019-02-13 16:03:38 +09:00
강동윤
fedfea4e09 Fix #190 2019-02-13 14:24:44 +09:00
강동윤
2d062432a8
Shebang & small improvement for object rest spread (#184)
swc_ecma_ast:
 - handle shebang

swc_ecma_codegen:
 - handle shebang

swc_ecma_parser:
 - handle shebang

swc_ecma_transforms:
 - fix arrow expression used with object rest spread
2019-02-13 11:08:21 +09:00
강동윤
f797019b79
Use strict (#183)
swc_ecma_parser:
- fix parsing of use strict without semicolon.

swc_ecma_transforms:
 - emit helpers after use strict.
2019-02-13 08:44:54 +09:00
강동윤
bd219688ac
Typescript bugs (#170)
swc_ecma_parser:
 - fix parsing of cond expression (Closes #158)
 - fix parsing of function signature (Closes #159)
2019-02-12 22:05:46 +09:00
강동윤
227423d5f6
Export default from & fix codegen of imports (#168)
swc_ecma_ast:
 - Support `export v from 'foo';`

swc_ecma_parser:
 - Support `export v from 'foo';`

swc_ecma_codegen:
 - Fix codegen of side-effect imports
2019-02-12 15:30:11 +09:00
강동윤
7fe2245a3d
Cleanup (#152)
- replace Lrc with std::sync::Arc
swc_common:
 - make swc_common::sync private
 - improve MoveMap

swc_ecma_codegen:
 - fix codegen of import.

swc_ecma_transforms:
 - properly detect valid identifier.

swc_ecma_parser:
 - Fix parsing of cond expr inside paren.
2019-02-11 11:39:20 +09:00
Adrian Adamiak
c2142bc225 Remove a leftover (#149)
Remove unused variable from colors.js
2019-02-11 09:40:53 +09:00
nateroling
5afed275f1 Typo correction (#150)
Fix a couple comment typos.
2019-02-11 09:40:28 +09:00
강동윤
ab4f619257
Fix tests (#142) 2019-02-10 20:49:29 +09:00
강동윤
605019280f Fix parsing of import expression 2019-02-10 14:33:21 +09:00
강동윤
b1bf99c67c improve error messages 2019-02-10 12:26:27 +09:00
강동윤
3b8d36dc58 Parse dynamic imports 2019-02-10 12:07:40 +09:00
강동윤
43d633b44d
Handle comments and improve codegen (#136)
swc_ecma_codegen:
 - Improve codegen
 - Handle comments

swc_ecma_parser:
 - Handle comments
2019-02-08 13:00:58 +09:00
강동윤
b516c19133
Update dependencies (#135) 2019-02-07 00:05:25 +09:00
강동윤
e63be11d0e Fix order of the classes pass 2019-01-30 13:05:45 +09:00
강동윤
ba0c7c908c
Improve swc_ecma_trnasforms (#127)
# swc_ecma_ast
 - Add PrivateName to Expr

# swc_ecma_parser
 - Fix parsing of private name

# swc_ecma_transforms

## Hygiene
 - It correctly tracks `BindingIdentifer` / `IdentifierReference`
 - Preserve `IdentiferReference` if it conflicts with a `BindingIdentifier`

## Block scoping
 - It correctly tracks `BindingIdentifer` / `IdentifierReference`


## Fixer
 - It removes useless parens.
 - It removes useless `IdentiferReference`s in comma expressions.

## Classes properties
 - public prooperty
 - private property

## Class decorators
 - implemented
2019-01-29 23:56:16 +09:00
강동윤
c648232864
Classes improvements (#123)
Now swc passes all tests from `@babel/plugin-transform-classes`
2019-01-24 16:07:09 +09:00
강동윤
9313b04c6c Enable some assertions and fix ICE on release mode 2019-01-22 12:37:51 +09:00
강동윤
4379515f00 Bump version 2019-01-20 11:10:31 +09:00
강동윤
f87e2fb123 Fix parser 2019-01-20 11:08:26 +09:00
강동윤
cb12e13a0b Fix cfg(not(procmacro2_semver_exempt)) 2019-01-19 09:31:31 +09:00