Skip to content

Commit

Permalink
src/asm_parser.rs: wrap long line
Browse files Browse the repository at this point in the history
  • Loading branch information
rlane committed Feb 7, 2017
1 parent 2244209 commit 0fe35dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/asm_parser.rs
Expand Up @@ -45,8 +45,9 @@ fn integer<I>(input: I) -> ParseResult<i64, I>
Some('-') => -1,
_ => 1,
});
let hex =
string("0x").with(many1(hex_digit())).map(|x: String| i64::from_str_radix(&x, 16).unwrap());
let hex = string("0x")
.with(many1(hex_digit()))
.map(|x: String| i64::from_str_radix(&x, 16).unwrap());
let dec = many1(digit()).map(|x: String| i64::from_str_radix(&x, 10).unwrap());
(sign, try(hex).or(dec)).map(|(s, x)| s * x).parse_stream(input)
}
Expand Down

0 comments on commit 0fe35dc

Please sign in to comment.