From 09107d6abf85b51aa407880d0ed5dec7cfb22e85 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 29 Nov 2015 12:59:44 -0400 Subject: - 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 --- project.clj | 2 +- src/lux/compiler/base.clj | 2 +- src/lux/lexer.clj | 2 +- src/lux/reader.clj | 3 --- 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) -- cgit v1.2.3