aboutsummaryrefslogtreecommitdiff
path: root/src/lang/lexer.clj
diff options
context:
space:
mode:
authorEduardo Julian2014-12-04 00:28:48 -0400
committerEduardo Julian2014-12-04 00:28:48 -0400
commit0bccd6a2313dc5eadb635d1fbf02dbb0a5ff2cfe (patch)
tree4ad50bca52811d1f6be095028cbb6a3755ab28d9 /src/lang/lexer.clj
parentd95a64fddbee73c6433ba7485959766cb2d4c6f9 (diff)
Now compiles booleans and ifs.
Diffstat (limited to 'src/lang/lexer.clj')
-rw-r--r--src/lang/lexer.clj10
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