diff options
author | tomsmeding <tom.smeding@gmail.com> | 2016-06-20 22:07:22 +0200 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2016-06-20 22:07:22 +0200 |
commit | dfe39f59f9ad203a8231f85efb54a6030305ca56 (patch) | |
tree | 96558b640bc329e720f2b0b9b67f49729d4975e7 | |
parent | 7957dc36354a803ba96231c5bf8397a154f0ca59 (diff) |
Allow whitespace around expression in parser
-rw-r--r-- | parser.hs | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -157,7 +157,11 @@ pinfixoperator (plus,minus) pterm sumconstr negconstr plusopt noneg = do pmoreterms thissum +++ return thissum psum :: Parser AST -psum = pinfixoperator ('+','-') pproduct Sum Negative False False +psum = do + poptws + res <- pinfixoperator ('+','-') pproduct Sum Negative False False + poptws + return res pproduct :: Parser AST pproduct = pinfixoperator ('*','/') pfactor Product Reciprocal True True |