From 78eb074356a524248c3bac97ab2c9fbbe0d139b9 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 20 May 2016 21:36:13 -0400 Subject: - Fixed a bug when parsing the names of arguments in method definitions, wherein the names couldn't be full-blown (unprefixed) idents. --- src/lux/analyser/parser.clj | 6 +++++- 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] -- cgit v1.2.3