Created
October 22, 2017 22:18
-
-
Save vadixidav/bfc838a96babdea1975790d0340eaeca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn fold_op<F: Fn(f64, f64)>(input: &[u8], init: f64, f: F) -> IResult<&[u8], f64> { | |
fold_many0!(ws!(alt!(apply!(list) | apply!(f64::from_str))), init, f) | |
} | |
named!(list<f64>, delimited!(tag!("("), ws!(alt!( | |
proceed!(tag!("+"), apply!(fop, 0.0, |acc, item| acc + item)) | |
)), tag!(")"))); | |
error: unexpected end of macro invocation | |
--> src\main.rs:19:76 | |
| | |
19 | fold_many0!(ws!(alt!(apply!(list) | apply!(f64::from_str))), init, f) | |
| ^ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment