Commit Graph

5187 Commits

Author SHA1 Message Date
강동윤
5bea4a6138
Add index.d.ts and export inline globals pass (#90) 2018-12-22 17:41:01 +09:00
Viktor Kuroljov
946a32adf8 readme: Fix npm install command (#89) 2018-12-22 17:19:16 +09:00
강동윤
fb77e996bd
v1.0.0-alpha (#88)
Currently using this library requires nightly rustc toolchian
2018-12-22 14:08:18 +09:00
강동윤
6a0a2cf34e
Class getter / setter (#86)
Implement class getter / setter.
2018-12-22 12:15:04 +09:00
강동윤
145d6f39eb
For-of loop (#85)
Implements `es2015::for_of`
2018-12-21 21:39:42 +09:00
강동윤
f0e4598f41
Update README.md
render table correctly
2018-12-21 16:58:44 +09:00
강동윤
4ff6d4ed4a
Performance & Node binding (#84)
swc_common:
 - update rustc-ap crates to v313

swc_ecma_ast:
 - use bool instead of Option<Span>


swc_ecma_parser:
 - remove LexerInput
 - use uncons_while
 - assert only on debug mode
 - use Visit instead of Fold while verifying
 - replace debug! with trace!
 - disable logging while benchmarking
 - drop slog

swc_ecma_transforms:
 - classes: fold Decl instead of Stmt

swc:
 - add nodejs binding
2018-12-21 16:54:36 +09:00
강동윤
22b9e08851 Add CONTRIBUTING.md and ARCHITECTURE.md 2018-12-04 15:11:50 +09:00
강동윤
222bdc191f
Performance (#82)
`Map<T>` adds a method named `map` which is actually `Box<T>` -> `Box<T>` without reallocation.

swc_ecma_transforms:
 - chain_at!(Type, passes)
This macro deeply joins path at 'Type' level.
2018-12-01 22:24:26 +09:00
강동윤
ea910a4dfb
add #[inline] to folder / visitors (#81) 2018-11-28 18:14:44 +09:00
강동윤
f82c722588 update README.md 2018-11-28 12:26:19 +09:00
강동윤
ab7d46c5bc
Es2015 (#80)
swc_common:
 - implement VisitWith for &T and [T]

swc_ecma_ast:
 - fix codegen of `===`

swc_ecma_parser:
 - fix parsing of array pattern


swc_ecma_transforms:
 - implement es2015::destructuring
 - implement es2015::computed_properties
 - implement es2015::duplicate_keys
 - implement es2015::parameters
 - fix `InjectHelper` pass

Note that getters / setters in class are not supported yet

 - Run execution tests via jest
 - ignore es2016::exponentation tests
2018-11-28 12:24:08 +09:00
강동윤
33d296af31
block scoped function and tagged template literal (#77)
swc_ecma_transforms:
 - implement es2015::block_scoped_functions
 - implement tagged template literal without escape handling
 - hygiene: rename to different number
 - scope: handle pattern by folding children


swc_ecma_ast:
 - use Str instead of String for template literal

swc_ecma_parser:
 - fix lexer tests
 - handle template literal correctly
template literals now have cooked field


swc_ecma_codegen:
 - escape newline character and backslash ('\')
2018-11-25 11:31:48 +09:00
강동윤
8524d93e9a spdy -> speedy & black box for benchmark 2018-11-23 19:52:46 +09:00
강동윤
7c58b89571
Scope analysis via ident hygiene (#74)
testing:
 - preserve context of the span in `::testing::DropSpan`

swc_ecma_codegen:
 - disable get_text_of_node to avoid deoptimization

swc_ecma_transforms:
 - allow using this inside arrow expression
 - implement es2015::block_scoping with hygiene ident
2018-11-23 19:22:07 +09:00
강동윤
8b992d6401
improve travis' caching (#75) 2018-11-22 17:28:23 +09:00
강동윤
d3e14b6533
Parser & transformers (#71)
swc_ecma_transforms:
 - implement es2015::arrow (without this support)
 - implement basical scope analysis
 - implement es2015::function_name
 - new.target is supported
 - implement untagged template literals

swc_ecma_parser
 - make test to use load_file()
 - fix eof handling
 - bump version
2018-11-21 18:59:17 +09:00
강동윤
3638dbc42c
Groundwork for linter (#73) 2018-11-20 18:32:53 +09:00
bors[bot]
be129db2a6 Merge #72
72: Fix parser tests r=kdy1 a=kdy1



Co-authored-by: 강동윤 <kdy1@outlook.kr>
2018-11-19 10:59:17 +00:00
강동윤
dc8e178088 fix parser tests 2018-11-19 19:58:35 +09:00
강동윤
c816d699ca
Improve ast (#70)
* Update ast (bool -> Option<Span>)

* fixup! Update ast (bool -> Option<Span>)
2018-11-19 15:52:06 +09:00
강동윤
84675d32df
Visitor (#69)
* Add Visit<T> and VisitWith<F>

* implement derive(VisitWith<T>)

* Bump versions
2018-11-19 13:02:55 +09:00
강동윤
3786c5f788
Make procmacro2_semver_exempt optional for FromVariant (#68)
- use call_site if cfg(procmacro2_semver_exempt) is false

 - Make `FromVariant` not to emit extern crate swc_common
2018-11-18 21:18:11 +09:00
강동윤
cd51cb1731
Make procmacro2_semver_exempt optional (#67)
* Reduce compile time of tests.

* Make procmacro2_semver_exempt optional

* Bump versions
2018-11-18 19:57:35 +09:00
강동윤
1d0c78de6c
More works (#66)
ecma_transforms:
 - implement es2015::instanceof
 - implement es2015::typeof_symbol
 - implement inline_globals pass

ecma_parser:
 - `PResult<T>` is now `Result<T, ()>` and `Err(())` means that an error is emitted.
 - add docs
2018-11-18 14:00:07 +09:00
강동윤
6f8ded406b Merge branch 'master' of github.com:swc-project/swc into travis 2018-11-17 18:02:39 +09:00
강동윤
4e21eb160d travis: don't cache docs 2018-11-17 18:01:29 +09:00
bors[bot]
76e0818eac Merge #65
65: Make it thread safe r=kdy1 a=kdy1



Co-authored-by: 강동윤 <kdy1@outlook.kr>
2018-11-17 08:22:47 +00:00
강동윤
8e0e9ca4c7 Make it thread safe 2018-11-17 17:02:34 +09:00
강동윤
b3a9d1a264
Cleanup (#64)
- rename packages to be consistent
 - `swc_macros` is removed. Now macros are imported with `extern crate macro_name` instead of `extern crate swc_macros`.
 - manage atoms with words.txt file
2018-11-17 16:38:23 +09:00
강동윤
fb08c18f7e
Support es2019 (#63)
ast:
 - Update ast to match es2019 spec

parser:
 - implement es2019 parser
 - ignore an old test

codegen:
 - fix

testing:
 - better output while testing (when failed)

transforms:
 - fix
2018-11-17 12:30:49 +09:00
강동윤
63ee25f0c5
Cleanup (#62)
- do not reexport swc crates

 - Add benchmark for parser

 135ns/op on my macbook pro
 
 - remove unused script
 
 - Update README.md
    - Make features section complete
2018-11-17 10:02:40 +09:00
강동윤
67daa279d8
Use rustdoc repository for rustdoc 2018-11-16 21:17:36 +09:00
강동윤
01d7e44a15
Update .gitmodules
Use https url instead
2018-11-16 20:51:56 +09:00
강동윤
f8ea0bdfea fix
It's not rust code..
2018-11-16 20:26:04 +09:00
강동윤
309a9de0fd
Fix tests & upgrade deps (#60)
common:
 - upgrade rustc-ap crates to 297
 - swc_common does not reexport sourcemap anymore
 - update rustfmt to 0.99.6

simplifier:
 - make some tests success when source code is equavalent
 - implement fixer to fix ast broken by simplifier
- implement bit shift operators
- fix str.length
- ignore some tests


compat:
 - fix `**=`
 - fix es3::prop_lits
2018-11-16 20:09:17 +09:00
강동윤
4f1dc24e40
Update deps (#59)
* constructor codegen

* Update string_cache to 0.7

* make swc_common not depend on sourcemap

* Remove unused dependencies

* update either to 1.5.0

* update rustc-ap crates to 297

* remove unused dependency (fnv)
2018-11-16 11:56:04 +09:00
강동윤
7b56b0bc74
Improve codegen (#57)
* travis: make it faster

* better codegen

* Move enable_comments field to config
2018-11-15 21:43:04 +09:00
강동윤
6234fd7a21
parse "constructor"() as constructor (#56) 2018-11-15 21:29:47 +09:00
강동윤
fae7bfc2c7
Chores (#54)
- improve readme
 - fix lints
 - Enable lto
 - better codegen (newline after stmts)
 - add some docs

 - implement `**=` transformer

 - use `quote_ident!`
 - use `.as_arg()` instead of constructing ExprOrSpread
 - use `as_callee()`
 - inject helpers

 - fix imports

 - split libswc

 - don't mark! useless span
2018-11-15 13:29:44 +09:00
강동윤
5cf15cb40f
Fix tests by updating references (#53) 2018-11-14 21:36:37 +09:00
강동윤
9a5de4beb6
More transcompilers (#49)
transforms:
 - implement String.length simplifier
 - implement more arithmetic operations
 - new Date() is side-effect free
 - implement left.rhs * right
 - optimize `SeqExpr` while creation
 
 - implement es3 - member expression literals pass
 - implement es2015 - classes pass

codegen: 
 - handle infinity correctly
 - disable comments for testing (it's buggy)

ast:
 - add methods about reserved words
2018-11-14 19:40:46 +09:00
강동윤
56a6429fad
Documentation (#48)
Use own repository for rustdoc.
2018-11-10 19:00:26 +09:00
강동윤
bbd9ec9eb9
travis: fix doc upload (#47) 2018-11-10 18:15:15 +09:00
강동윤
2a169c451b
Update README.md 2018-11-10 18:02:51 +09:00
강동윤
9d7af34aab
Initial release (#45)
common:
 - rename `Folder` to `Fold`
 - folder.then()
 - impl Fold for Box<F>
 - impl Fold<T> for &mut F where F: Fold<T>

transforms:
 - make Simplifier private
 - organize compat

codegen:
 - use `Mark` to avoid deoptimization

swc:
 - upgrade rayon and use global thread pool instead
2018-11-10 17:44:35 +09:00
강동윤
eb2a2a7f15
Fix tests and lints (#44)
- Temporarilly ignored comment codegen tests.
 - Split Simplify into SimplifyExpr and SimplifyStmt
 - fix lints
2018-11-05 13:12:52 +09:00
강동윤
e12dcf0452
Compiler baseline
- Fix binary
 - Add base for transformers

This will be last large squash.
2018-11-03 16:56:43 +09:00
강동윤
f9be576e02
Ecmascript codegen (#40)
Comment is not fully supported yet
2018-10-25 13:17:05 +09:00
강동윤
0a5f3f4ab5
rustup to 2018-08-29\ (#39)
- libswc is broken
2018-09-16 20:25:41 +09:00