Skip to content

Commit

Permalink
Downgrade rust toolchain to 2018-02-01 (swc-project#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 authored Mar 9, 2018
1 parent c9b1016 commit 79f3660
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
required_version = "0.3.8"
required_version = "0.3.6"
reorder_imports = true
reorder_imports_in_group = true
reorder_imported_names = true
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"[rust]": {
"editor.formatOnSave": true
},
"rust-client.channel": "nightly-2018-02-28",
"rust-client.channel": "nightly-2018-02-01",
"rust.unstable_features": true,
"rust.workspace_mode": true,
"rust.rustflags": "--cfg procmacro2_semver_exempt",
Expand Down
12 changes: 4 additions & 8 deletions ecmascript/parser/src/lexer/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,21 +332,17 @@ impl Context {
#[kind(fucntion(is_expr = "bool", preserve_space = "bool"))]
enum Type {
BraceStmt,
#[kind(is_expr)]
BraceExpr,
#[kind(is_expr)]
TplQuasi,
#[kind(is_expr)] BraceExpr,
#[kind(is_expr)] TplQuasi,
ParenStmt {
/// Is this `for` loop?
is_for_loop: bool,
},
#[kind(is_expr)]
ParenExpr,
#[kind(is_expr)] ParenExpr,
#[kind(is_expr, preserve_space)]
Tpl {
/// Start of a template literal.
start: BytePos,
},
#[kind(is_expr)]
FnExpr,
#[kind(is_expr)] FnExpr,
}
69 changes: 23 additions & 46 deletions ecmascript/parser/src/token/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,18 +194,13 @@ pub(crate) struct TokenAndSpan {
#[derive(Kind, Clone, PartialEq, Eq, Hash, Fold)]
#[kind(functions(starts_expr = "bool", before_expr = "bool"))]
pub enum Word {
#[kind(delegate)]
Keyword(Keyword),
#[kind(delegate)] Keyword(Keyword),

#[kind(starts_expr)]
Null,
#[kind(starts_expr)]
True,
#[kind(starts_expr)]
False,
#[kind(starts_expr)] Null,
#[kind(starts_expr)] True,
#[kind(starts_expr)] False,

#[kind(starts_expr)]
Ident(JsWord),
#[kind(starts_expr)] Ident(JsWord),
}

impl From<JsWord> for Word {
Expand Down Expand Up @@ -346,33 +341,26 @@ pub enum Keyword {
Await,

Break,
#[kind(before_expr)]
Case,
#[kind(before_expr)] Case,
Catch,
Continue,
Debugger,
#[kind(before_expr)]
Default_,
#[kind(before_expr)]
Do,
#[kind(before_expr)]
Else,
#[kind(before_expr)] Default_,
#[kind(before_expr)] Do,
#[kind(before_expr)] Else,

Finally,
For,

#[kind(starts_expr)]
Function,
#[kind(starts_expr)] Function,

If,

#[kind(before_expr)]
Return,
#[kind(before_expr)] Return,

Switch,

#[kind(before_expr, starts_expr)]
Throw,
#[kind(before_expr, starts_expr)] Throw,

Try,
Var,
Expand All @@ -381,40 +369,29 @@ pub enum Keyword {
While,
With,

#[kind(before_expr, starts_expr)]
New,
#[kind(starts_expr)]
This,
#[kind(starts_expr)]
Super,
#[kind(before_expr, starts_expr)] New,
#[kind(starts_expr)] This,
#[kind(starts_expr)] Super,

#[kind(starts_expr)]
Class,
#[kind(starts_expr)] Class,

#[kind(before_expr)]
Extends,
#[kind(before_expr)] Extends,

Export,
#[kind(starts_expr)]
Import,
#[kind(starts_expr)] Import,

/// Spec says this might be identifier.
#[kind(before_expr, starts_expr)]
Yield,

#[kind(before_expr)]
In,
#[kind(before_expr)]
InstanceOf,
#[kind(before_expr)] In,
#[kind(before_expr)] InstanceOf,

#[kind(before_expr, starts_expr)]
TypeOf,
#[kind(before_expr, starts_expr)] TypeOf,

#[kind(before_expr, starts_expr)]
Void,
#[kind(before_expr, starts_expr)] Void,

#[kind(before_expr, starts_expr)]
Delete,
#[kind(before_expr, starts_expr)] Delete,
}

impl Keyword {
Expand Down
15 changes: 5 additions & 10 deletions macros/enum_kind/tests/usage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ pub enum Tokens {
#[kind(is_a)]
#[kind(prec = "7")]
A,
#[kind(prec = "6")]
StructLike {},
#[kind(prec = "5")]
TupleLike(u8),
#[kind(prec = "6")] StructLike {},
#[kind(prec = "5")] TupleLike(u8),

#[kind(prec = "6")]
#[cfg(feature = "not-used")]
Expand All @@ -27,16 +25,13 @@ fn simple_bool() {
#[derive(Debug, Kind)]
#[kind(functions(wanted = "bool"))]
pub enum Delegate {
#[kind(wanted)]
Wanted,
#[kind(delegate)]
May(Del),
#[kind(wanted)] Wanted,
#[kind(delegate)] May(Del),
}

#[derive(Debug, Kind)]
#[kind(functions(wanted = "bool"))]
pub enum Del {
#[kind(wanted)]
Yes,
#[kind(wanted)] Yes,
No,
}
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2018-02-28
nightly-2018-02-01

0 comments on commit 79f3660

Please sign in to comment.