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

Update quasi for rustc 1.8.0-nightly (1ab22d7 2016-02-13) #32

Merged
merged 2 commits into from
Feb 13, 2016
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.5.0"
version = "0.5.1"
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
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.27.0", optional = true }
syntex_syntax = { version = "^0.28.0", optional = true }
13 changes: 7 additions & 6 deletions quasi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ impl ToTokens for ast::WhereClause {
}
}

impl ToTokens for P<ast::Stmt> {
impl ToTokens for ast::Stmt {
fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {
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.
Expand Down Expand Up @@ -219,7 +219,8 @@ impl ToTokens for ast::Attribute {

impl ToTokens for str {
fn to_tokens(&self, cx: &ExtCtxt) -> Vec<TokenTree> {
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)
}
Expand Down Expand Up @@ -299,7 +300,7 @@ impl_to_tokens_int! { unsigned, u64, ast::UintTy::U64 }
pub trait ExtParseUtils {
fn parse_item(&self, s: String) -> P<ast::Item>;
fn parse_expr(&self, s: String) -> P<ast::Expr>;
fn parse_stmt(&self, s: String) -> P<ast::Stmt>;
fn parse_stmt(&self, s: String) -> ast::Stmt;
fn parse_tts(&self, s: String) -> Vec<ast::TokenTree>;
}

Expand All @@ -313,7 +314,7 @@ impl<'a> ExtParseUtils for ExtCtxt<'a> {
self.parse_sess()).expect("parse error")
}

fn parse_stmt(&self, s: String) -> P<ast::Stmt> {
fn parse_stmt(&self, s: String) -> ast::Stmt {
parse::parse_stmt_from_source_str("<quote expansion>".to_string(),
s,
self.cfg(),
Expand Down Expand Up @@ -355,7 +356,7 @@ pub fn parse_ty_panic(parser: &mut Parser) -> P<ast::Ty> {
panictry!(parser.parse_ty())
}

pub fn parse_stmt_panic(parser: &mut Parser) -> Option<P<ast::Stmt>> {
pub fn parse_stmt_panic(parser: &mut Parser) -> Option<ast::Stmt> {
panictry!(parser.parse_stmt())
}

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.5.0"
version = "0.5.1"
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
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.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 }
6 changes: 3 additions & 3 deletions quasi_codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ fn expr_mk_token(builder: &aster::AstBuilder, tok: &token::Token) -> P<ast::Expr
}
}

fn statements_mk_tt(tt: &ast::TokenTree, matcher: bool) -> Vec<P<ast::Stmt>> {
fn statements_mk_tt(tt: &ast::TokenTree, matcher: bool) -> Vec<ast::Stmt> {
let builder = aster::AstBuilder::new();

match *tt {
Expand Down Expand Up @@ -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<P<ast::Stmt>> {
fn mk_stmts_let(builder: &aster::AstBuilder) -> Vec<ast::Stmt> {
// 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
Expand Down Expand Up @@ -636,7 +636,7 @@ fn mk_stmts_let(builder: &aster::AstBuilder) -> Vec<P<ast::Stmt>> {
vec!(stmt_let_sp, stmt_let_tt)
}

fn statements_mk_tts(tts: &[ast::TokenTree], matcher: bool) -> Vec<P<ast::Stmt>> {
fn statements_mk_tts(tts: &[ast::TokenTree], matcher: bool) -> Vec<ast::Stmt> {
let mut ss = Vec::new();
for tt in tts {
ss.extend(statements_mk_tt(tt, matcher).into_iter());
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.5.0"
version = "0.5.1"
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
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.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" }
10 changes: 5 additions & 5 deletions quasi_tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "quasi_tests"
version = "0.5.0"
version = "0.5.1"
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
license = "MIT/Apache-2.0"
description = "A quasi-quoting macro system"
Expand All @@ -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" }