Commit Graph

129 Commits

Author SHA1 Message Date
강동윤
0efba88e3f
Improve typescript parser (#811) 2020-06-02 19:22:41 +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
David Sherret
80f81d8cd7
Fix parsing async generator method in object expression (#749) 2020-04-22 12:37:17 +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
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
강동윤
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
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
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
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
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
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
01659585e4 Fix parsing of jsx attribute values (#616)
Closes #614.
Closes #615.
2020-01-29 06:24:35 +00: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
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
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
강동윤
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
강동윤
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
강동윤
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
강동윤
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
강동윤
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