summaryrefslogtreecommitdiffstats
path: root/src/parser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.rs')
-rw-r--r--src/parser.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/parser.rs b/src/parser.rs
index 66900a4..01faef2 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -136,9 +136,12 @@ pub enum Iterspec {
Every(i64, Unit),
}
+use nom::whitespace::sp;
+
named!(amount_expr<AmountExpr>, do_parse!(
amount:amount_parser >>
- o: opt!(do_parse!(op:operator_parser >> amexp:amount_expr >> ((op, Box::new(amexp))))) >>
+ opt!(sp) >>
+ o: opt!(do_parse!(op:operator_parser >> opt!(sp) >> amexp:amount_expr >> ((op, Box::new(amexp))))) >>
(AmountExpr { amount: amount, next: o, })
));