Skip to content

Commit

Permalink
Merge pull request #21 from zsiciarz/master
Browse files Browse the repository at this point in the history
Update for simplified parser API.
  • Loading branch information
sfackler committed Jan 19, 2016
2 parents 92fb9fe + 107877b commit e7911b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ fn expand_execute(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree])

let conn = parser.parse_expr().unwrap();

if !parser.eat(&Comma).ok().unwrap() {
if !parser.eat(&Comma) {
cx.span_err(parser.span, "expected `,`");
return DummyResult::expr(sp);
}
Expand All @@ -91,7 +91,7 @@ fn expand_execute(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree])
None => return DummyResult::expr(sp),
};

if parser.token != Eof && !parser.eat(&Comma).ok().unwrap() {
if parser.token != Eof && !parser.eat(&Comma) {
cx.span_err(parser.span, "expected `,`");
return DummyResult::expr(sp);
}
Expand Down Expand Up @@ -147,7 +147,7 @@ fn parse_args(cx: &mut ExtCtxt, parser: &mut Parser) -> Option<Vec<P<Expr>>> {
while parser.token != Eof {
args.push(parser.parse_expr().unwrap());

if !parser.eat(&Comma).ok().unwrap() && parser.token != Eof {
if !parser.eat(&Comma) && parser.token != Eof {
cx.span_err(parser.span, "expected `,`");
return None;
}
Expand Down

0 comments on commit e7911b8

Please sign in to comment.