Skip to content

Commit 7a21bcb

Browse files
committed
(#801) Update exprs syntax
1 parent 6487714 commit 7a21bcb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Bot/Expr.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ funcallarg = funcall <|> var <|> stringLiteral
6969

7070
funcall :: Parser Expr
7171
funcall = do
72-
_ <- charP '%' >> whitespaces
72+
_ <- charP '%'
7373
name <- symbol
7474
_ <- whitespaces >> charP '(' >> whitespaces
7575
args <-
@@ -103,7 +103,7 @@ whitespaces :: Parser T.Text
103103
whitespaces = takeWhileP isSpace
104104

105105
var :: Parser Expr
106-
var = charP '%' >> whitespaces >> (VarExpr <$> symbol)
106+
var = charP '%' *> (VarExpr <$> symbol) <* charP '%'
107107

108108
textBlock :: Parser Expr
109109
textBlock =

src/FuzzyMain.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ unparseFunCallArgs = T.concat . intersperse "," . map unparseFunCallArg
6565

6666
unparseExpr :: Expr -> T.Text
6767
unparseExpr (TextExpr text) = text
68-
unparseExpr (VarExpr name) = "%" <> name
68+
unparseExpr (VarExpr name) = "%" <> name <> "%"
6969
unparseExpr (FunCallExpr name args) =
7070
"%" <> name <> "(" <> unparseFunCallArgs args <> ")"
7171

0 commit comments

Comments
 (0)