* `struct Expr` + `enum ExprKind` -> `enum Expr`
`Expr` / `ExprKind` approach does not work well with recursive
processing based on the type system because we can't access common
fields like span while processing child node like `MemberExpr`.
As ast processing is inherently recursive, we should use a
recursive-friendly approach.
* `#[derive(FromVariants)]`
It creates lots of `From<T>` to help using ast enums as a real sum type.
* `#[derive(Spanned)]`
Inspired by https://docs.rs/syn/0.12.13/syn/spanned/trait.Spanned.html
It does not handle attributes yet.
* Parser is not updated yet.
- Make rls happy.
- Some minor parser error improvements.
- Add reference files for ecmascript parser errors.
- Improve error message of import/export used outside of a module
rust-analysis chokes with `Option<Box<Expr>>` style fields.
Rls only shows a warning on the crate with that fields, but ICEs on
dependent crates.
This can be workarounded by using `Option<(Box<Expr>)>`.
Also, using multiple glob imports is bad for rls.
So this commit deglobs them.
* Remove CanIUse trait, which will be reimpplemented in future
using Visitor.
* Remove some other unused stuffs.
* Change public path of swc_common::fold::* to swc_common::*.
- Parser and lexer for lastest ecma spec https://tc39.github.io/ecma262
- Lexer is currently very inefficient
- Use https://github.com/tc39/test262-parser-tests/ for testing.
- Implement proc-macro based ast folder and assert_eq_ignore_span! based on it.
- Some utilities for proc macro at /macros/common