commit
5deba439c3
@ -9,9 +9,9 @@ default = ["serde_codegen"]
|
||||
nightly = ["serde_macros"]
|
||||
|
||||
[build-dependencies]
|
||||
serde_codegen = { version = "^0.7.11", optional = true }
|
||||
serde_codegen = { version = "^0.7.12", optional = true }
|
||||
|
||||
[dependencies]
|
||||
serde = "^0.7.11"
|
||||
serde = "^0.7.12"
|
||||
serde_json = "^0.7.0"
|
||||
serde_macros = { version = "^0.7.11", optional = true }
|
||||
serde_macros = { version = "^0.7.12", optional = true }
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "serde"
|
||||
version = "0.7.11"
|
||||
version = "0.7.12"
|
||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
||||
license = "MIT/Apache-2.0"
|
||||
description = "A generic serialization/deserialization framework"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "serde_codegen"
|
||||
version = "0.7.11"
|
||||
version = "0.7.12"
|
||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
||||
license = "MIT/Apache-2.0"
|
||||
description = "Macros to auto-generate implementations for the serde framework"
|
||||
@ -24,14 +24,14 @@ with-syntex = [
|
||||
]
|
||||
|
||||
[build-dependencies]
|
||||
quasi_codegen = { version = "^0.13.0", optional = true }
|
||||
syntex = { version = "^0.36.0", optional = true }
|
||||
quasi_codegen = { version = "^0.14.0", optional = true }
|
||||
syntex = { version = "^0.37.0", optional = true }
|
||||
|
||||
[dependencies]
|
||||
aster = { version = "^0.19.0", default-features = false }
|
||||
aster = { version = "^0.20.0", default-features = false }
|
||||
clippy = { version = "^0.*", optional = true }
|
||||
quasi = { version = "^0.13.0", default-features = false }
|
||||
quasi_macros = { version = "^0.13.0", optional = true }
|
||||
serde_codegen_internals = { version = "^0.1.0", path = "../serde_codegen_internals", default-features = false }
|
||||
syntex = { version = "^0.36.0", optional = true }
|
||||
syntex_syntax = { version = "^0.36.0", optional = true }
|
||||
quasi = { version = "^0.14.0", default-features = false }
|
||||
quasi_macros = { version = "^0.14.0", optional = true }
|
||||
serde_codegen_internals = { version = "^0.2.0", path = "../serde_codegen_internals", default-features = false }
|
||||
syntex = { version = "^0.37.0", optional = true }
|
||||
syntex_syntax = { version = "^0.37.0", optional = true }
|
||||
|
@ -96,8 +96,8 @@ fn contains_recursion(ty: &ast::Ty, ident: ast::Ident) -> bool {
|
||||
ident: ast::Ident,
|
||||
found_recursion: bool,
|
||||
}
|
||||
impl<'v> visit::Visitor<'v> for FindRecursion {
|
||||
fn visit_path(&mut self, path: &'v ast::Path, _id: ast::NodeId) {
|
||||
impl visit::Visitor for FindRecursion {
|
||||
fn visit_path(&mut self, path: &ast::Path, _id: ast::NodeId) {
|
||||
if !path.global
|
||||
&& path.segments.len() == 1
|
||||
&& path.segments[0].identifier == self.ident {
|
||||
|
@ -5,6 +5,7 @@ use syntax::codemap::Span;
|
||||
use syntax::ext::base::{Annotatable, ExtCtxt};
|
||||
use syntax::parse::token::InternedString;
|
||||
use syntax::ptr::P;
|
||||
use syntax::tokenstream::TokenTree;
|
||||
|
||||
use bound;
|
||||
use internals::ast::{Body, Field, Item, Style, Variant};
|
||||
@ -471,7 +472,7 @@ fn deserialize_newtype_struct(
|
||||
type_path: &ast::Path,
|
||||
impl_generics: &ast::Generics,
|
||||
field: &Field,
|
||||
) -> Vec<ast::TokenTree> {
|
||||
) -> Vec<TokenTree> {
|
||||
let value = match field.attrs.deserialize_with() {
|
||||
None => {
|
||||
let field_ty = &field.ty;
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "serde_codegen_internals"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
||||
license = "MIT/Apache-2.0"
|
||||
description = "AST representation used by Serde codegen. Unstable."
|
||||
@ -12,8 +12,9 @@ include = ["Cargo.toml", "src/**/*.rs"]
|
||||
[features]
|
||||
default = ["with-syntex"]
|
||||
nightly-testing = ["clippy"]
|
||||
with-syntex = ["syntex_syntax"]
|
||||
with-syntex = ["syntex_syntax", "syntex_errors"]
|
||||
|
||||
[dependencies]
|
||||
clippy = { version = "^0.*", optional = true }
|
||||
syntex_syntax = { version = "^0.36.0", optional = true }
|
||||
syntex_syntax = { version = "^0.37.0", optional = true }
|
||||
syntex_errors = { version = "^0.37.0", optional = true }
|
||||
|
@ -1,7 +1,5 @@
|
||||
use std::rc::Rc;
|
||||
|
||||
use syntax::ast::{self, TokenTree};
|
||||
use syntax::attr;
|
||||
use syntax::ast;
|
||||
use syntax::attr::{self, HasAttrs};
|
||||
use syntax::codemap::{Span, Spanned, respan};
|
||||
use syntax::ext::base::ExtCtxt;
|
||||
use syntax::fold::Folder;
|
||||
@ -10,6 +8,7 @@ use syntax::parse::token::{self, InternedString};
|
||||
use syntax::parse;
|
||||
use syntax::print::pprust::{lit_to_string, meta_item_to_string};
|
||||
use syntax::ptr::P;
|
||||
use syntax::tokenstream::{self, TokenTree};
|
||||
|
||||
// This module handles parsing of `#[serde(...)]` attributes. The entrypoints
|
||||
// are `attr::Item::from_ast`, `attr::Variant::from_ast`, and
|
||||
@ -518,33 +517,33 @@ struct Respanner<'a, 'b: 'a> {
|
||||
}
|
||||
|
||||
impl<'a, 'b> Folder for Respanner<'a, 'b> {
|
||||
fn fold_tt(&mut self, tt: &TokenTree) -> TokenTree {
|
||||
match *tt {
|
||||
fn fold_tt(&mut self, tt: TokenTree) -> TokenTree {
|
||||
match tt {
|
||||
TokenTree::Token(span, ref tok) => {
|
||||
TokenTree::Token(
|
||||
self.new_span(span),
|
||||
self.fold_token(tok.clone())
|
||||
)
|
||||
}
|
||||
TokenTree::Delimited(span, ref delimed) => {
|
||||
TokenTree::Delimited(span, delimed) => {
|
||||
TokenTree::Delimited(
|
||||
self.new_span(span),
|
||||
Rc::new(ast::Delimited {
|
||||
tokenstream::Delimited {
|
||||
delim: delimed.delim,
|
||||
open_span: delimed.open_span,
|
||||
tts: self.fold_tts(&delimed.tts),
|
||||
tts: self.fold_tts(delimed.tts),
|
||||
close_span: delimed.close_span,
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
TokenTree::Sequence(span, ref seq) => {
|
||||
TokenTree::Sequence(span, seq) => {
|
||||
TokenTree::Sequence(
|
||||
self.new_span(span),
|
||||
Rc::new(ast::SequenceRepetition {
|
||||
tts: self.fold_tts(&seq.tts),
|
||||
tokenstream::SequenceRepetition {
|
||||
tts: self.fold_tts(seq.tts),
|
||||
separator: seq.separator.clone().map(|tok| self.fold_token(tok)),
|
||||
..**seq
|
||||
})
|
||||
..seq
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -590,7 +589,7 @@ fn parse_string_via_tts<T, F>(cx: &ExtCtxt, name: &str, string: String, action:
|
||||
cx.parse_sess()));
|
||||
|
||||
// Respan the spans to say they are all coming from this macro.
|
||||
let tts = Respanner { cx: cx }.fold_tts(&tts);
|
||||
let tts = Respanner { cx: cx }.fold_tts(tts);
|
||||
|
||||
let mut parser = parse::new_parser_from_tts(cx.parse_sess(), cx.cfg(), tts);
|
||||
|
||||
|
@ -5,10 +5,14 @@
|
||||
#[cfg(feature = "with-syntex")]
|
||||
#[macro_use]
|
||||
extern crate syntex_syntax as syntax;
|
||||
#[cfg(feature = "with-syntex")]
|
||||
extern crate syntex_errors as errors;
|
||||
|
||||
#[cfg(not(feature = "with-syntex"))]
|
||||
#[macro_use]
|
||||
extern crate syntax;
|
||||
#[cfg(not(feature = "with-syntex"))]
|
||||
extern crate rustc_errors as errors;
|
||||
|
||||
pub mod ast;
|
||||
pub mod attr;
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "serde_macros"
|
||||
version = "0.7.11"
|
||||
version = "0.7.12"
|
||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
||||
license = "MIT/Apache-2.0"
|
||||
description = "Macros to auto-generate implementations for the serde framework"
|
||||
@ -18,14 +18,14 @@ nightly-testing = ["clippy", "serde/nightly-testing", "serde_codegen/nightly-tes
|
||||
|
||||
[dependencies]
|
||||
clippy = { version = "^0.*", optional = true }
|
||||
serde_codegen = { version = "^0.7.11", path = "../serde_codegen", default-features = false, features = ["nightly"] }
|
||||
serde_codegen = { version = "^0.7.12", path = "../serde_codegen", default-features = false, features = ["nightly"] }
|
||||
|
||||
[dev-dependencies]
|
||||
compiletest_rs = "^0.2.0"
|
||||
fnv = "1.0"
|
||||
rustc-serialize = "^0.3.16"
|
||||
serde = { version = "^0.7.11", path = "../serde" }
|
||||
serde_test = { version = "^0.7.11", path = "../serde_test" }
|
||||
serde = { version = "^0.7.12", path = "../serde" }
|
||||
serde_test = { version = "^0.7.12", path = "../serde_test" }
|
||||
|
||||
[[test]]
|
||||
name = "test"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "serde_test"
|
||||
version = "0.7.11"
|
||||
version = "0.7.12"
|
||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
||||
license = "MIT/Apache-2.0"
|
||||
description = "Token De/Serializer for testing De/Serialize implementations"
|
||||
@ -11,4 +11,4 @@ keywords = ["serde", "serialization"]
|
||||
include = ["Cargo.toml", "src/**/*.rs"]
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "0.7.11", path = "../serde" }
|
||||
serde = { version = "0.7.12", path = "../serde" }
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "serde_testing"
|
||||
version = "0.7.11"
|
||||
version = "0.7.12"
|
||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
||||
license = "MIT/Apache-2.0"
|
||||
description = "A generic serialization/deserialization framework"
|
||||
|
Loading…
Reference in New Issue
Block a user