diff options
author | Eduardo Julian | 2014-12-04 00:28:48 -0400 |
---|---|---|
committer | Eduardo Julian | 2014-12-04 00:28:48 -0400 |
commit | 0bccd6a2313dc5eadb635d1fbf02dbb0a5ff2cfe (patch) | |
tree | 4ad50bca52811d1f6be095028cbb6a3755ab28d9 /src/lang/lexer.clj | |
parent | d95a64fddbee73c6433ba7485959766cb2d4c6f9 (diff) |
Now compiles booleans and ifs.
Diffstat (limited to 'src/lang/lexer.clj')
-rw-r--r-- | src/lang/lexer.clj | 10 |
1 files changed, 6 insertions, 4 deletions
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 <regex>)] (return [<tag> 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 |