aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lux/analyser/parser.clj6
-rw-r--r--src/lux/lexer.clj2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/lux/analyser/parser.clj b/src/lux/analyser/parser.clj
index e0851100d..532e96b83 100644
--- a/src/lux/analyser/parser.clj
+++ b/src/lux/analyser/parser.clj
@@ -45,6 +45,10 @@
(|do [[_ _ =name] (&reader/read-regex #"^([a-zA-Z0-9_\.]+)")]
(return =name)))
+(def ^:private parse-ident
+ (|do [[_ _ =name] (&reader/read-regex &lexer/+ident-re+)]
+ (return =name)))
+
(defn ^:private with-parens [body]
(|do [_ (&reader/read-text "(")
output body
@@ -161,7 +165,7 @@
(def ^:private parse-arg-decl
(with-parens
- (|do [=arg-name parse-name
+ (|do [=arg-name parse-ident
_ (&reader/read-text " ")
=gclass parse-gclass]
(return (&/T [=arg-name =gclass])))))
diff --git a/src/lux/lexer.clj b/src/lux/lexer.clj
index 490f37ac3..9754456b9 100644
--- a/src/lux/lexer.clj
+++ b/src/lux/lexer.clj
@@ -123,7 +123,7 @@
_ (&reader/read-text "\"")]
(return (&/T [meta ($Text token)]))))
-(def ^:private +ident-re+
+(def +ident-re+
#"^([^0-9\[\]\{\}\(\)\s\"#;][^\[\]\{\}\(\)\s\"#;]*)")
;; [Lexers]