Clean up lifetimes stuff
This commit is contained in:
parent
f08963012a
commit
c75ced0f02
2 changed files with 12 additions and 12 deletions
|
@ -53,16 +53,16 @@ pub fn parse(cx: &ExtCtxt, input: &[TokenTree], sp: Span) -> P<Expr> {
|
||||||
parser.into_render().into_expr()
|
parser.into_render().into_expr()
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Parser<'cx, 's: 'cx, 'i> {
|
struct Parser<'cx, 'i> {
|
||||||
in_attr: bool,
|
in_attr: bool,
|
||||||
input: &'i [TokenTree],
|
input: &'i [TokenTree],
|
||||||
span: Span,
|
span: Span,
|
||||||
render: Renderer<'cx, 's>,
|
render: Renderer<'cx>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'cx, 's, 'i> Parser<'cx, 's, 'i> {
|
impl<'cx, 'i> Parser<'cx, 'i> {
|
||||||
/// Finalize the `Parser`, returning the `Renderer` underneath.
|
/// Finalize the `Parser`, returning the `Renderer` underneath.
|
||||||
fn into_render(self) -> Renderer<'cx, 's> {
|
fn into_render(self) -> Renderer<'cx> {
|
||||||
let Parser { render, .. } = self;
|
let Parser { render, .. } = self;
|
||||||
render
|
render
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ impl<'cx, 's, 'i> Parser<'cx, 's, 'i> {
|
||||||
|
|
||||||
/// Construct a Rust AST parser from the given token tree.
|
/// Construct a Rust AST parser from the given token tree.
|
||||||
fn with_rust_parser<F, T>(&self, tts: Vec<TokenTree>, callback: F) -> T where
|
fn with_rust_parser<F, T>(&self, tts: Vec<TokenTree>, callback: F) -> T where
|
||||||
F: FnOnce(&mut RustParser<'s>) -> T
|
F: FnOnce(&mut RustParser<'cx>) -> T
|
||||||
{
|
{
|
||||||
let mut parser = parse::tts_to_parser(self.render.cx.parse_sess, tts,
|
let mut parser = parse::tts_to_parser(self.render.cx.parse_sess, tts,
|
||||||
self.render.cx.cfg.clone());
|
self.render.cx.cfg.clone());
|
||||||
|
|
|
@ -12,15 +12,15 @@ pub enum Escape {
|
||||||
Escape,
|
Escape,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Renderer<'cx, 's: 'cx> {
|
pub struct Renderer<'cx> {
|
||||||
pub cx: &'cx ExtCtxt<'s>,
|
pub cx: &'cx ExtCtxt<'cx>,
|
||||||
stmts: Vec<P<Stmt>>,
|
stmts: Vec<P<Stmt>>,
|
||||||
w: Ident,
|
w: Ident,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'cx, 's> Renderer<'cx, 's> {
|
impl<'cx> Renderer<'cx> {
|
||||||
/// Create a new `Renderer` using the given extension context.
|
/// Creates a new `Renderer` using the given extension context.
|
||||||
pub fn new(cx: &'cx ExtCtxt<'s>) -> Renderer<'cx, 's> {
|
pub fn new(cx: &'cx ExtCtxt<'cx>) -> Renderer<'cx> {
|
||||||
Renderer {
|
Renderer {
|
||||||
cx: cx,
|
cx: cx,
|
||||||
stmts: vec![],
|
stmts: vec![],
|
||||||
|
@ -28,8 +28,8 @@ impl<'cx, 's> Renderer<'cx, 's> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a new `Renderer` under the same context as `self`.
|
/// Creates a new `Renderer` under the same context as `self`.
|
||||||
pub fn fork(&self) -> Renderer<'cx, 's> {
|
pub fn fork(&self) -> Renderer<'cx> {
|
||||||
Renderer {
|
Renderer {
|
||||||
cx: self.cx,
|
cx: self.cx,
|
||||||
stmts: vec![],
|
stmts: vec![],
|
||||||
|
|
Loading…
Add table
Reference in a new issue