aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Julian2016-05-20 21:36:13 -0400
committerEduardo Julian2016-05-20 21:36:13 -0400
commit78eb074356a524248c3bac97ab2c9fbbe0d139b9 (patch)
tree1f762fbebc6d5950d17aa37aadc0216b511b545e
parentb55a0a3f09d54bc2ef99891f1a40df8efa6a028f (diff)
- Fixed a bug when parsing the names of arguments in method definitions, wherein the names couldn't be full-blown (unprefixed) idents.
Diffstat (limited to '')
-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]