Skip to content

Commit 78c8d14

Browse files
committed
[fix:Parser] desugar also on FunctionCall
1 parent c2bfffa commit 78c8d14

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Parser/Parser.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module Parser.Parser where
33
import Analyser.Util (rFoldl)
44
import Data.Either.Combinators (isRight)
55
import qualified Data.Text as T
6+
import Debug.Trace (trace)
67
import Parser.Ast (Expr (..), UnaryOp (Neg), VDataType)
78
import Parser.Combinators
89
( Parser,
@@ -118,7 +119,7 @@ arbitraryBlock :: Parser Expr
118119
arbitraryBlock = braces $ many expr >>= \x -> pure $ ArbitraryBlock x
119120

120121
functionCall :: Parser Expr
121-
functionCall = parens $ identifier >>= \x -> FunctionCall x <$> exprs
122+
functionCall = parens $ identifier >>= \x -> desugarExpr . FunctionCall x <$> exprs
122123

123124
conditional :: Parser Expr
124125
conditional = parens $ rword "if" >> Conditional <$> expr <*> expr <*> expr

src/Sugar/Sugar.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module Sugar.Sugar where
22

33
import Analyser.Util (rFoldl)
44
import qualified Data.Text as T
5+
import Debug.Trace (trace)
56
import Parser.Ast (Expr (FloatLiteral, FunctionCall))
67

78
mFilter :: [a] -> (a -> Bool) -> [a]

0 commit comments

Comments
 (0)