aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Parser.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Parser.hs')
-rw-r--r--src/Parser.hs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/Parser.hs b/src/Parser.hs
index 984c276..15400f6 100644
--- a/src/Parser.hs
+++ b/src/Parser.hs
@@ -144,12 +144,18 @@ parseFunction = do
parseMixfix :: Parser Expression
parseMixfix = do
s <- sepBy1
- (try prefixAsMixfix <|> try operatorAsMixfix <|> singletonAsMixfix)
+ ( try prefixAsMixfix
+ <|> try prefixOperatorAsMixfix
+ <|> try operatorAsMixfix
+ <|> singletonAsMixfix
+ )
sc
pure $ MixfixChain s
- where
- prefixAsMixfix = MixfixExpression <$> parsePrefix
- operatorAsMixfix = MixfixOperator <$> mixfixOperator
+ where -- TODO: Rethink this.
+ prefixAsMixfix = MixfixExpression <$> parsePrefix
+ prefixOperatorAsMixfix =
+ MixfixExpression . Function <$> (prefixOperator <* char '‣')
+ operatorAsMixfix = MixfixOperator . MixfixFunction <$> some mixfixSome
singletonAsMixfix = MixfixExpression <$> parseSingleton
parsePrefix :: Parser Expression