Skip to content
This repository was archived by the owner on May 6, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions quasi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "quasi"
version = "0.9.0"
version = "0.10.0"
authors = ["Erick Tryzelaar <[email protected]>"]
license = "MIT/Apache-2.0"
description = "A quasi-quoting macro system"
Expand All @@ -10,4 +10,4 @@ repository = "https://github.com/erickt/rust-quasi"
with-syntex = ["syntex_syntax"]

[dependencies]
syntex_syntax = { version = "^0.31.0", optional = true }
syntex_syntax = { version = "^0.32.0", optional = true }
2 changes: 1 addition & 1 deletion quasi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl<T: ToTokens> ToTokens for Option<T> {

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

Expand Down
8 changes: 4 additions & 4 deletions quasi_codegen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "quasi_codegen"
version = "0.9.0"
version = "0.10.0"
authors = ["Erick Tryzelaar <[email protected]>"]
license = "MIT/Apache-2.0"
description = "A quasi-quoting macro system"
Expand All @@ -11,6 +11,6 @@ default = ["with-syntex"]
with-syntex = ["syntex", "syntex_syntax", "aster/with-syntex"]

[dependencies]
aster = { version = "^0.15.0", default-features = false }
syntex = { version = "^0.31.0", optional = true }
syntex_syntax = { version = "^0.31.0", optional = true }
aster = { version = "^0.16.0", default-features = false }
syntex = { version = "^0.32.0", optional = true }
syntex_syntax = { version = "^0.32.0", optional = true }
24 changes: 3 additions & 21 deletions quasi_codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,16 +362,10 @@ fn expr_mk_token(builder: &aster::AstBuilder, tok: &token::Token) -> P<ast::Expr
builder.expr().usize(n))
}

token::Ident(ident, style) => {
let style = match style {
ModName => mk_token_path(builder, "ModName"),
Plain => mk_token_path(builder, "Plain"),
};

token::Ident(ident) => {
builder.expr().call()
.build(mk_token_path(builder, "Ident"))
.with_arg(mk_ident(builder, ident))
.with_arg(style)
.build()
}

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

token::MatchNt(name, kind, namep, kindp) => {
let namep = match namep {
ModName => mk_token_path(builder, "ModName"),
Plain => mk_token_path(builder, "Plain"),
};

let kindp = match kindp {
ModName => mk_token_path(builder, "ModName"),
Plain => mk_token_path(builder, "Plain"),
};

token::MatchNt(name, kind) => {
builder.expr().call()
.build(mk_token_path(builder, "MatchNt"))
.arg().build(mk_ident(builder, name))
.arg().build(mk_ident(builder, kind))
.arg().build(namep)
.arg().build(kindp)
.build()
}

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

match *tt {
ast::TokenTree::Token(sp, SubstNt(ident, _)) => {
ast::TokenTree::Token(sp, SubstNt(ident)) => {
// tt.extend($ident.to_tokens(ext_cx).into_iter())

let builder = builder.clone().span(sp);
Expand Down
8 changes: 4 additions & 4 deletions quasi_macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "quasi_macros"
version = "0.9.0"
version = "0.10.0"
authors = ["Erick Tryzelaar <[email protected]>"]
license = "MIT/Apache-2.0"
description = "A quasi-quoting macro system"
Expand All @@ -11,8 +11,8 @@ name = "quasi_macros"
plugin = true

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

[dev-dependencies]
aster = "^0.15.0"
quasi = { version = "^0.9.0", path = "../quasi" }
aster = "^0.16.0"
quasi = { version = "^0.10.0", path = "../quasi" }
8 changes: 4 additions & 4 deletions quasi_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ build = "build.rs"

[build-dependencies]
quasi_codegen = { path = "../quasi_codegen" }
syntex = { version = "^0.31.0" }
syntex = { version = "^0.32.0" }

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