diff options
author | Eduardo Julian | 2016-05-20 21:36:13 -0400 |
---|---|---|
committer | Eduardo Julian | 2016-05-20 21:36:13 -0400 |
commit | 78eb074356a524248c3bac97ab2c9fbbe0d139b9 (patch) | |
tree | 1f762fbebc6d5950d17aa37aadc0216b511b545e | |
parent | b55a0a3f09d54bc2ef99891f1a40df8efa6a028f (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.clj | 6 | ||||
-rw-r--r-- | src/lux/lexer.clj | 2 |
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] |