Skip to content

Commit

Permalink
Update to syntex 0.51
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Nov 23, 2016
1 parent ecc6984 commit 8d8920f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ with-syntex = ["syntex", "syntex_syntax"]

[dependencies]
clippy = { version = "^0.*", optional = true }
syntex = { version = "0.45.0", optional = true }
syntex_syntax = { version = "0.45.0", optional = true }
syntex = { version = "0.51.0", optional = true }
syntex_syntax = { version = "0.51.0", optional = true }
unindent = "0.1"

[dev-dependencies]
Expand Down
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ use std::path::Path;

use syntax::codemap::Span;
use syntax::parse;
use syntax::parse::token::{self, Lit, Literal};
use syntax::parse::token::{Lit, Literal};
use syntax::ast::{LitKind, StrStyle};
use syntax::ext::base::{DummyResult, ExtCtxt, MacEager, MacResult};
use syntax::ext::build::AstBuilder; // trait for expr_lit
use syntax::symbol::Symbol;
use syntax::tokenstream::TokenTree;

#[cfg(not(feature = "with-syntex"))]
Expand Down Expand Up @@ -84,12 +85,12 @@ fn expand_indoc<'a>(
let result = match lit {
Lit::Str_(name) => {
let unindented = parse::str_lit(&unindent(&name.as_str()));
let interned = token::intern_and_get_ident(&unindented);
let interned = Symbol::intern(&unindented);
LitKind::Str(interned, StrStyle::Cooked)
}
Lit::StrRaw(name, hashes) => {
let unindented = parse::raw_str_lit(&unindent(&name.as_str()));
let interned = token::intern_and_get_ident(&unindented);
let interned = Symbol::intern(&unindented);
LitKind::Str(interned, StrStyle::Raw(hashes))
}
Lit::ByteStr(name) |
Expand Down

0 comments on commit 8d8920f

Please sign in to comment.