aboutsummaryrefslogtreecommitdiff
path: root/src/lang/parser.clj
diff options
context:
space:
mode:
Diffstat (limited to 'src/lang/parser.clj')
-rw-r--r--src/lang/parser.clj6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lang/parser.clj b/src/lang/parser.clj
index 3149cf5d4..2f9a26c66 100644
--- a/src/lang/parser.clj
+++ b/src/lang/parser.clj
@@ -56,6 +56,11 @@
(partition 2 ?parts)))]
(return [::record =kvs])))
+(defparser ^:private parse-lambda
+ [::&lexer/list ([[::&lexer/ident "lambda"] [::&lexer/tuple ?args] ?body] :seq)]
+ (exec [=body (apply-m parse-form (list ?body))]
+ (return [::lambda (mapv ident->string ?args) =body])))
+
(defparser ^:private parse-def
[::&lexer/list ([[::&lexer/ident "def"] ?name ?body] :seq)]
(exec [=name (apply-m parse-form (list ?name))
@@ -192,6 +197,7 @@
parse-ident
parse-tuple
parse-record
+ parse-lambda
parse-def
parse-defdata
parse-if