Skip to content

Commit

Permalink
Update codegen and core for 2018-05-16 nightly.
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioBenitez committed May 17, 2018
1 parent 44bbca0 commit 87dbd39
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ fn gen_expr(
let remake = |new_params| ExprKind::MethodCall(ty, new_params);
remonad_params(ecx, input, binding, expr, params, false, remake)
}
ExprKind::Block(block) => {
ExprKind::Block(block, ..) => {
let stmt = gen_stmt(ecx, input, VecDeque::from(block.stmts.clone()));
quote_expr!(ecx, { $stmt })
}
Expand Down
6 changes: 3 additions & 3 deletions examples/json/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn is_whitespace(c: char) -> bool {

#[parser]
fn int<'a, I: StrLikeInput<'a>>(input: &mut I) -> ParseResult<I, i64> {
from!(take_some_while(|c| ('0'..='9').contains(c)).parse()) // NOT BENCH
from!(take_some_while(|c| ('0'..='9').contains(&c)).parse()) // NOT BENCH
// take_some_while(|c| ('0'..='9').contains(c)); // BENCH
// 1 // BENCH
}
Expand All @@ -44,7 +44,7 @@ fn signed_int<'a, I: StrLikeInput<'a>>(input: &mut I) -> ParseResult<I, i64> {
#[parser]
fn number<'a, I: StrLikeInput<'a>>(input: &mut I) -> ParseResult<I, f64> {
let whole_num = signed_int();
let frac = switch! { eat('.') => take_some_while(|c| ('0'..='9').contains(c)), _ => "" };
let frac = switch! { eat('.') => take_some_while(|c| ('0'..='9').contains(&c)), _ => "" };
let exp = switch! { eat_if(|c| "eE".contains(c)) => signed_int(), _ => 0 };
from!(format!("{}.{}e{}", whole_num, frac, exp).parse()) // NOT BENCH
// 0.0 // BENCH
Expand Down Expand Up @@ -100,7 +100,7 @@ fn value<'a, I: StrLikeInput<'a>>(input: &mut I) -> ParseResult<I, JsonValue<'a>
peek('{') => JsonValue::Object(object()),
peek('[') => JsonValue::Array(array()),
peek('"') => JsonValue::String(string()),
peek_if(|c| c == '-' || ('0'..='9').contains(c)) => JsonValue::Number(number())
peek_if(|c| c == '-' || ('0'..='9').contains(&c)) => JsonValue::Number(number())
};

skip_while(is_whitespace);
Expand Down

0 comments on commit 87dbd39

Please sign in to comment.