File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -229,6 +229,7 @@ term = P.lexeme lexer
229
229
term' :: Parser EgisonExpr
230
230
term' = matchExpr
231
231
<|> matchAllExpr
232
+ <|> matchLambdaExpr
232
233
<|> matcherExpr
233
234
<|> matcherDFSExpr
234
235
<|> functionWithArgExpr
@@ -322,6 +323,9 @@ matchAllExpr = keywordMatchAll >> MatchAllExpr <$> expr <* (inSpaces $ string "a
322
323
matchExpr :: Parser EgisonExpr
323
324
matchExpr = keywordMatch >> MatchExpr <$> expr <* (inSpaces $ string " as" ) <*> expr <*> matchClauses
324
325
326
+ matchLambdaExpr :: Parser EgisonExpr
327
+ matchLambdaExpr = keywordMatchLambda >> MatchLambdaExpr <$ (inSpaces $ string " as" ) <*> expr <*> matchClauses
328
+
325
329
matchClauses :: Parser [MatchClause ]
326
330
matchClauses = many1 matchClause
327
331
Original file line number Diff line number Diff line change 39
39
[_ {}]}]
40
40
[<apply $ $> [eq (list math-expr)]
41
41
{[<Div <Plus {<Term 1 {[<Apply $v $mexprs> 1] @{}}> @{}}>
42
- <Plus {<Term 1 {}> @{}}>>
42
+ <Plus {<Term 1 {}> @{}}>>
43
43
{[v (map to-math-expr' mexprs)]}]
44
44
[_ {}]}]
45
45
[<quote $> [math-expr]
281
281
[_ #f]})
282
282
xs))]}))
283
283
{@ts1 @ts2})]}))))
284
-
284
+
285
285
(define $find-symbols-from-poly
286
286
(lambda [$poly]
287
287
(match-all poly math-expr
301
301
(lambda [$x $a $mexpr]
302
302
(map-symbols (rewrite-symbol x a $) mexpr)))
303
303
304
- (define $rewrite-symbol
304
+ (define $rewrite-symbol
305
305
(lambda [$x $a $sexpr]
306
306
(match sexpr symbol-expr
307
307
{[,x a]
You can’t perform that action at this time.
0 commit comments