Currently moving from Gitlab to Gitea at https://labs.phundrak.com. Some features may not work anymore on this Gitlab instance.

Commit 78ded822 authored by Geoffry Song's avatar Geoffry Song

Fix for latest nightly

parent 9e6e5cf6
......@@ -113,10 +113,19 @@ fn parse_lexer<'a>(cx: &mut base::ExtCtxt<'a>, sp: codemap::Span, args: &[TokenT
try!(parser.expect(&token::OpenDelim(token::Paren)));
let text_pat = try!(parser.parse_pat());
let text_lt = if parser.eat(&token::Colon) {
if let Some(lt) = parser.eat_lifetime() {
lt
} else {
return Err(parser.fatal("expected a lifetime"));
match parser.token {
token::Lifetime(ident) => {
parser.bump();
(ast::Lifetime {
id: ast::DUMMY_NODE_ID,
span: parser.prev_span,
name: ident.name
})
}
_ => {
parser.expected_tokens.push(parser::TokenType::Lifetime);
return Err(parser.fatal("expected a lifetime"));
}
}
} else {
cx.lifetime(DUMMY_SP, Symbol::gensym("text"))
......
......@@ -562,8 +562,12 @@ fn parse_parser<'a>(
while parser.check(&token::Pound) {
// attributes
let attr = try!(parser.parse_attribute(false)); // don't allow "#![..]" syntax
match attr.value.node {
ast::MetaItemKind::List(ref tokens) if attr.value.name == "no_reduce" => {
match attr.meta() {
Some(ast::MetaItem {
name,
node: ast::MetaItemKind::List(ref tokens),
..
}) if name == "no_reduce" => {
for token in tokens.iter() {
if let ast::NestedMetaItemKind::MetaItem(ref meta_item) = token.node {
if let ast::MetaItemKind::Word = meta_item.node {
......@@ -574,7 +578,11 @@ fn parse_parser<'a>(
parser.span_err(token.span, "not the name of a token");
}
}
ast::MetaItemKind::Word if attr.value.name == "overriding" => {
Some(ast::MetaItem {
name,
node: ast::MetaItemKind::Word,
..
}) if name == "overriding" => {
priority = 1;
}
_ => parser.span_err(attr.span, "unknown attribute"),
......
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