Skip to content
This repository was archived by the owner on May 6, 2020. It is now read-only.

Commit d0e5ad3

Browse files
committed
Merge pull request #41 from antrik/rustup
Update for latest libsyntax changes
2 parents 93c4b5a + 6f27746 commit d0e5ad3

6 files changed

Lines changed: 18 additions & 36 deletions

File tree

quasi/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "quasi"
3-
version = "0.9.0"
3+
version = "0.10.0"
44
authors = ["Erick Tryzelaar <[email protected]>"]
55
license = "MIT/Apache-2.0"
66
description = "A quasi-quoting macro system"
@@ -10,4 +10,4 @@ repository = "https://github.com/erickt/rust-quasi"
1010
with-syntex = ["syntex_syntax"]
1111

1212
[dependencies]
13-
syntex_syntax = { version = "^0.31.0", optional = true }
13+
syntex_syntax = { version = "^0.32.0", optional = true }

quasi/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl<T: ToTokens> ToTokens for Option<T> {
7979

8080
impl ToTokens for ast::Ident {
8181
fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {
82-
vec![ast::TokenTree::Token(DUMMY_SP, token::Ident(*self, token::Plain))]
82+
vec![ast::TokenTree::Token(DUMMY_SP, token::Ident(*self))]
8383
}
8484
}
8585

quasi_codegen/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "quasi_codegen"
3-
version = "0.9.0"
3+
version = "0.10.0"
44
authors = ["Erick Tryzelaar <[email protected]>"]
55
license = "MIT/Apache-2.0"
66
description = "A quasi-quoting macro system"
@@ -11,6 +11,6 @@ default = ["with-syntex"]
1111
with-syntex = ["syntex", "syntex_syntax", "aster/with-syntex"]
1212

1313
[dependencies]
14-
aster = { version = "^0.15.0", default-features = false }
15-
syntex = { version = "^0.31.0", optional = true }
16-
syntex_syntax = { version = "^0.31.0", optional = true }
14+
aster = { version = "^0.16.0", default-features = false }
15+
syntex = { version = "^0.32.0", optional = true }
16+
syntex_syntax = { version = "^0.32.0", optional = true }

quasi_codegen/src/lib.rs

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -362,16 +362,10 @@ fn expr_mk_token(builder: &aster::AstBuilder, tok: &token::Token) -> P<ast::Expr
362362
builder.expr().usize(n))
363363
}
364364

365-
token::Ident(ident, style) => {
366-
let style = match style {
367-
ModName => mk_token_path(builder, "ModName"),
368-
Plain => mk_token_path(builder, "Plain"),
369-
};
370-
365+
token::Ident(ident) => {
371366
builder.expr().call()
372367
.build(mk_token_path(builder, "Ident"))
373368
.with_arg(mk_ident(builder, ident))
374-
.with_arg(style)
375369
.build()
376370
}
377371

@@ -426,23 +420,11 @@ fn expr_mk_token(builder: &aster::AstBuilder, tok: &token::Token) -> P<ast::Expr
426420
.build()
427421
}
428422

429-
token::MatchNt(name, kind, namep, kindp) => {
430-
let namep = match namep {
431-
ModName => mk_token_path(builder, "ModName"),
432-
Plain => mk_token_path(builder, "Plain"),
433-
};
434-
435-
let kindp = match kindp {
436-
ModName => mk_token_path(builder, "ModName"),
437-
Plain => mk_token_path(builder, "Plain"),
438-
};
439-
423+
token::MatchNt(name, kind) => {
440424
builder.expr().call()
441425
.build(mk_token_path(builder, "MatchNt"))
442426
.arg().build(mk_ident(builder, name))
443427
.arg().build(mk_ident(builder, kind))
444-
.arg().build(namep)
445-
.arg().build(kindp)
446428
.build()
447429
}
448430

@@ -463,7 +445,7 @@ fn statements_mk_tt(tt: &ast::TokenTree, matcher: bool) -> Result<QuoteStmts, ()
463445
let builder = aster::AstBuilder::new();
464446

465447
match *tt {
466-
ast::TokenTree::Token(sp, SubstNt(ident, _)) => {
448+
ast::TokenTree::Token(sp, SubstNt(ident)) => {
467449
// tt.extend($ident.to_tokens(ext_cx).into_iter())
468450

469451
let builder = builder.clone().span(sp);

quasi_macros/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "quasi_macros"
3-
version = "0.9.0"
3+
version = "0.10.0"
44
authors = ["Erick Tryzelaar <[email protected]>"]
55
license = "MIT/Apache-2.0"
66
description = "A quasi-quoting macro system"
@@ -11,8 +11,8 @@ name = "quasi_macros"
1111
plugin = true
1212

1313
[dependencies]
14-
quasi_codegen = { version = "^0.9.0", path = "../quasi_codegen", default-features = false }
14+
quasi_codegen = { version = "^0.10.0", path = "../quasi_codegen", default-features = false }
1515

1616
[dev-dependencies]
17-
aster = "^0.15.0"
18-
quasi = { version = "^0.9.0", path = "../quasi" }
17+
aster = "^0.16.0"
18+
quasi = { version = "^0.10.0", path = "../quasi" }

quasi_tests/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ build = "build.rs"
99

1010
[build-dependencies]
1111
quasi_codegen = { path = "../quasi_codegen" }
12-
syntex = { version = "^0.31.0" }
12+
syntex = { version = "^0.32.0" }
1313

1414
[dev-dependencies]
15-
aster = { version = "^0.15.0", features = ["with-syntex"] }
15+
aster = { version = "^0.16.0", features = ["with-syntex"] }
1616
quasi = { path = "../quasi", features = ["with-syntex"] }
17-
syntex = { version = "^0.31.0" }
18-
syntex_syntax = { version = "^0.31.0" }
17+
syntex = { version = "^0.32.0" }
18+
syntex_syntax = { version = "^0.32.0" }

0 commit comments

Comments
 (0)