diff --git a/quasi/Cargo.toml b/quasi/Cargo.toml index 5c33662f..3622b597 100644 --- a/quasi/Cargo.toml +++ b/quasi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "quasi" -version = "0.5.0" +version = "0.5.1" authors = ["Erick Tryzelaar "] license = "MIT/Apache-2.0" description = "A quasi-quoting macro system" @@ -10,4 +10,4 @@ repository = "https://github.com/erickt/rust-quasi" with-syntex = ["syntex_syntax"] [dependencies] -syntex_syntax = { version = "^0.27.0", optional = true } +syntex_syntax = { version = "^0.28.0", optional = true } diff --git a/quasi/src/lib.rs b/quasi/src/lib.rs index 05900821..bc267a67 100644 --- a/quasi/src/lib.rs +++ b/quasi/src/lib.rs @@ -140,10 +140,10 @@ impl ToTokens for ast::WhereClause { } } -impl ToTokens for P { +impl ToTokens for ast::Stmt { fn to_tokens(&self, _cx: &ExtCtxt) -> Vec { let mut tts = vec![ - ast::TokenTree::Token(self.span, token::Interpolated(token::NtStmt(self.clone()))) + ast::TokenTree::Token(self.span, token::Interpolated(token::NtStmt(P(self.clone())))) ]; // Some statements require a trailing semicolon. @@ -219,7 +219,8 @@ impl ToTokens for ast::Attribute { impl ToTokens for str { fn to_tokens(&self, cx: &ExtCtxt) -> Vec { - let lit = ast::LitKind::Str( + let lit + = ast::LitKind::Str( token::intern_and_get_ident(self), ast::StrStyle::Cooked); dummy_spanned(lit).to_tokens(cx) } @@ -299,7 +300,7 @@ impl_to_tokens_int! { unsigned, u64, ast::UintTy::U64 } pub trait ExtParseUtils { fn parse_item(&self, s: String) -> P; fn parse_expr(&self, s: String) -> P; - fn parse_stmt(&self, s: String) -> P; + fn parse_stmt(&self, s: String) -> ast::Stmt; fn parse_tts(&self, s: String) -> Vec; } @@ -313,7 +314,7 @@ impl<'a> ExtParseUtils for ExtCtxt<'a> { self.parse_sess()).expect("parse error") } - fn parse_stmt(&self, s: String) -> P { + fn parse_stmt(&self, s: String) -> ast::Stmt { parse::parse_stmt_from_source_str("".to_string(), s, self.cfg(), @@ -355,7 +356,7 @@ pub fn parse_ty_panic(parser: &mut Parser) -> P { panictry!(parser.parse_ty()) } -pub fn parse_stmt_panic(parser: &mut Parser) -> Option> { +pub fn parse_stmt_panic(parser: &mut Parser) -> Option { panictry!(parser.parse_stmt()) } diff --git a/quasi_codegen/Cargo.toml b/quasi_codegen/Cargo.toml index 943fc0bf..f4f2b3cf 100644 --- a/quasi_codegen/Cargo.toml +++ b/quasi_codegen/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "quasi_codegen" -version = "0.5.0" +version = "0.5.1" authors = ["Erick Tryzelaar "] license = "MIT/Apache-2.0" description = "A quasi-quoting macro system" @@ -11,6 +11,6 @@ default = ["with-syntex"] with-syntex = ["syntex", "syntex_syntax", "aster/with-syntex"] [dependencies] -aster = { version = "^0.11.0", default-features = false } -syntex = { version = "^0.27.0", optional = true } -syntex_syntax = { version = "^0.27.0", optional = true } +aster = { version = "^0.12.0", default-features = false } +syntex = { version = "^0.28.0", optional = true } +syntex_syntax = { version = "^0.28.0", optional = true } diff --git a/quasi_codegen/src/lib.rs b/quasi_codegen/src/lib.rs index c72479eb..66901523 100644 --- a/quasi_codegen/src/lib.rs +++ b/quasi_codegen/src/lib.rs @@ -450,7 +450,7 @@ fn expr_mk_token(builder: &aster::AstBuilder, tok: &token::Token) -> P Vec> { +fn statements_mk_tt(tt: &ast::TokenTree, matcher: bool) -> Vec { let builder = aster::AstBuilder::new(); match *tt { @@ -594,7 +594,7 @@ fn parse_arguments_to_quote(cx: &ExtCtxt, tts: &[ast::TokenTree]) (cx_expr, tts) } -fn mk_stmts_let(builder: &aster::AstBuilder) -> Vec> { +fn mk_stmts_let(builder: &aster::AstBuilder) -> Vec { // We also bind a single value, sp, to ext_cx.call_site() // // This causes every span in a token-tree quote to be attributed to the @@ -636,7 +636,7 @@ fn mk_stmts_let(builder: &aster::AstBuilder) -> Vec> { vec!(stmt_let_sp, stmt_let_tt) } -fn statements_mk_tts(tts: &[ast::TokenTree], matcher: bool) -> Vec> { +fn statements_mk_tts(tts: &[ast::TokenTree], matcher: bool) -> Vec { let mut ss = Vec::new(); for tt in tts { ss.extend(statements_mk_tt(tt, matcher).into_iter()); diff --git a/quasi_macros/Cargo.toml b/quasi_macros/Cargo.toml index 488e3967..aced5fb8 100644 --- a/quasi_macros/Cargo.toml +++ b/quasi_macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "quasi_macros" -version = "0.5.0" +version = "0.5.1" authors = ["Erick Tryzelaar "] license = "MIT/Apache-2.0" description = "A quasi-quoting macro system" @@ -11,8 +11,8 @@ name = "quasi_macros" plugin = true [dependencies] -quasi_codegen = { version = "^0.5.0", path = "../quasi_codegen", default-features = false } +quasi_codegen = { version = "^0.5.1", path = "../quasi_codegen", default-features = false } [dev-dependencies] -aster = "^0.11.0" -quasi = { version = "^0.5.0", path = "../quasi" } +aster = "^0.12.0" +quasi = { version = "^0.5.1", path = "../quasi" } diff --git a/quasi_tests/Cargo.toml b/quasi_tests/Cargo.toml index 18141cb8..a8d20c88 100644 --- a/quasi_tests/Cargo.toml +++ b/quasi_tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "quasi_tests" -version = "0.5.0" +version = "0.5.1" authors = ["Erick Tryzelaar "] license = "MIT/Apache-2.0" description = "A quasi-quoting macro system" @@ -9,10 +9,10 @@ build = "build.rs" [build-dependencies] quasi_codegen = { path = "../quasi_codegen" } -syntex = { version = "^0.27.0" } +syntex = { version = "^0.28.0" } [dev-dependencies] -aster = { version = "^0.11.0", features = ["with-syntex"] } +aster = { version = "^0.12.0", features = ["with-syntex"] } quasi = { path = "../quasi", features = ["with-syntex"] } -syntex = { version = "^0.27.0" } -syntex_syntax = { version = "^0.27.0" } +syntex = { version = "^0.28.0" } +syntex_syntax = { version = "^0.28.0" }