aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Julian2015-11-29 12:59:44 -0400
committerEduardo Julian2015-11-29 12:59:44 -0400
commit09107d6abf85b51aa407880d0ed5dec7cfb22e85 (patch)
tree4b884172ef8eee03248df127d96d15f0259d11fd
parent5683946988997517dadb01fbf6ebefd85251962f (diff)
- No longer removing empty lines from source code when reading it. Now lexing them as whitespace.
- Shifted version of the compiler to 0.3.1
-rw-r--r--project.clj2
-rw-r--r--src/lux/compiler/base.clj2
-rw-r--r--src/lux/lexer.clj2
-rw-r--r--src/lux/reader.clj3
4 files changed, 3 insertions, 6 deletions
diff --git a/project.clj b/project.clj
index 7cc66da22..74cc78dcb 100644
--- a/project.clj
+++ b/project.clj
@@ -1,4 +1,4 @@
-(defproject lux-jvm "0.3.0"
+(defproject lux-jvm "0.3.1"
:description "The JVM compiler for the Lux programming language."
:url "https://github.com/LuxLang/lux"
:license {:name "Mozilla Public License (Version 2.0)"
diff --git a/src/lux/compiler/base.clj b/src/lux/compiler/base.clj
index cf835a590..e677406a5 100644
--- a/src/lux/compiler/base.clj
+++ b/src/lux/compiler/base.clj
@@ -24,7 +24,7 @@
(java.lang.reflect Field)))
;; [Constants]
-(def ^String version "0.4")
+(def ^String version "0.3.1")
(def ^String input-dir "source")
(def ^String output-dir "target/jvm/")
(def ^String output-package (str output-dir "program.jar"))
diff --git a/src/lux/lexer.clj b/src/lux/lexer.clj
index 651f9ecce..e82e22ee4 100644
--- a/src/lux/lexer.clj
+++ b/src/lux/lexer.clj
@@ -54,7 +54,7 @@
;; [Lexers]
(def ^:private lex-white-space
- (|do [[meta white-space] (&reader/read-regex #"^(\s+)")]
+ (|do [[meta white-space] (&reader/read-regex #"^(\s+|$)")]
(return (&/T meta (&/V $White_Space white-space)))))
(def ^:private lex-single-line-comment
diff --git a/src/lux/reader.clj b/src/lux/reader.clj
index 751df7e6d..ce25527f3 100644
--- a/src/lux/reader.clj
+++ b/src/lux/reader.clj
@@ -130,9 +130,6 @@
(string/split-lines)
(&/->list)
(&/enumerate)
- (&/|filter (fn [line+line-num]
- (|let [[line-num line] line+line-num]
- (not= "" line))))
(&/|map (fn [line+line-num]
(|let [[line-num line] line+line-num]
(&/T (&/T name (inc line-num) 0)