From 0bccd6a2313dc5eadb635d1fbf02dbb0a5ff2cfe Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 4 Dec 2014 00:28:48 -0400 Subject: Now compiles booleans and ifs. --- src/lang/lexer.clj | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/lang/lexer.clj') diff --git a/src/lang/lexer.clj b/src/lang/lexer.clj index e2de44d82..65e57114b 100644 --- a/src/lang/lexer.clj +++ b/src/lang/lexer.clj @@ -56,9 +56,10 @@ (exec [token (lex-regex )] (return [ token]))) - ^:private lex-float ::float #"^(0|[1-9][0-9]*)\.[0-9]+" - ^:private lex-int ::int #"^(0|[1-9][0-9]*)" - ^:private lex-ident ::ident +ident-re+) + ^:private lex-boolean ::boolean #"^(true|false)" + ^:private lex-float ::float #"^(0|[1-9][0-9]*)\.[0-9]+" + ^:private lex-int ::int #"^(0|[1-9][0-9]*)" + ^:private lex-ident ::ident +ident-re+) (def lex-string (exec [_ (lex-str "\"") @@ -112,7 +113,8 @@ (def ^:private lex-form (exec [_ (try-m lex-white-space) - form (try-all-m [lex-float + form (try-all-m [lex-boolean + lex-float lex-int lex-string lex-ident -- cgit v1.2.3