Commit 3f56ba6e authored by Geoffry Song's avatar Geoffry Song Committed by GitHub

Merge pull request #15 from kazimuth/master

Update to nightly 2017-02-15
parents 2ecfecdd a6136893
...@@ -13,7 +13,7 @@ This crate provides a couple syntax extensions: ...@@ -13,7 +13,7 @@ This crate provides a couple syntax extensions:
give each nonterminal a Rust type, allowing you to build an AST recursively. give each nonterminal a Rust type, allowing you to build an AST recursively.
It also supports spans, giving you convenient source location reporting. It also supports spans, giving you convenient source location reporting.
You can find a demo in `examples/demo.rs`. Note that nightly Rust is required. You can find a demo in `examples/demo.rs`. Note that nightly Rust (> 2017-02-15) is required.
## Usage ## Usage
......
...@@ -113,7 +113,11 @@ fn parse_lexer<'a>(cx: &mut base::ExtCtxt<'a>, sp: codemap::Span, args: &[TokenT ...@@ -113,7 +113,11 @@ fn parse_lexer<'a>(cx: &mut base::ExtCtxt<'a>, sp: codemap::Span, args: &[TokenT
try!(parser.expect(&token::OpenDelim(token::Paren))); try!(parser.expect(&token::OpenDelim(token::Paren)));
let text_pat = try!(parser.parse_pat()); let text_pat = try!(parser.parse_pat());
let text_lt = if parser.eat(&token::Colon) { let text_lt = if parser.eat(&token::Colon) {
try!(parser.parse_lifetime()) if let Some(lt) = parser.eat_lifetime() {
lt
} else {
return Err(parser.fatal("expected a lifetime"));
}
} else { } else {
cx.lifetime(DUMMY_SP, Symbol::gensym("text")) cx.lifetime(DUMMY_SP, Symbol::gensym("text"))
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment