rubylisp 1.0.3 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rubylisp/parser.rb +2 -0
- data/lib/rubylisp/tokenizer.rb +10 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b93affab132db5c0e9bf534996928f4e6776a30
|
4
|
+
data.tar.gz: ccbee829606fe1643ab3a1f8ee9a9a994d73c844
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc72c561b43fa6af68e15e5b6edae3963adb94ab3a56c2f6529f8eddfd56ae155f12a3bfd564016c40dd8a868ba4efdef73885a63f49930062a36d8c584cce31
|
7
|
+
data.tar.gz: fbd4d2548fc905bfeef54c46c1bca940dc3e6a4cc95e134627107680105454b5077295aa56cb25a82a9ce3fb61921f0011c9546a7f36fc7f10401c6656b117a4
|
data/lib/rubylisp/parser.rb
CHANGED
@@ -173,6 +173,8 @@ module Lisp
|
|
173
173
|
when :COMMAAT
|
174
174
|
expr = parse_sexpr(tokens)
|
175
175
|
return Lisp::ConsCell.array_to_list([Lisp::Symbol.named('unquote-splicing'), expr])
|
176
|
+
when :WHITESPACE
|
177
|
+
next
|
176
178
|
when :ILLEGAL
|
177
179
|
return Lisp::Debug.process_error("Illegal token: #{lit} on line #{tokens.line_number}", Lisp::EnvironmentFrame.global)
|
178
180
|
else
|
data/lib/rubylisp/tokenizer.rb
CHANGED
@@ -24,6 +24,7 @@ module Lisp
|
|
24
24
|
init
|
25
25
|
end
|
26
26
|
|
27
|
+
|
27
28
|
def advance
|
28
29
|
if @source.eof?
|
29
30
|
@eof = true
|
@@ -208,13 +209,16 @@ module Lisp
|
|
208
209
|
def read_next_token
|
209
210
|
return :EOF, '' if eof?
|
210
211
|
|
211
|
-
while space?(@current_ch)
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
end
|
212
|
+
# while space?(@current_ch)
|
213
|
+
# @line_number += 1 if @current_ch == "\n"
|
214
|
+
# advance
|
215
|
+
# return :EOF, '' if eof?
|
216
|
+
# end
|
216
217
|
|
217
|
-
if
|
218
|
+
if space?(@current_ch)
|
219
|
+
advance
|
220
|
+
return :WHITESPACE, " "
|
221
|
+
elsif number?(@current_ch)
|
218
222
|
return read_number(false)
|
219
223
|
elsif @current_ch == '-' && number?(@next_ch)
|
220
224
|
return read_number(false)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubylisp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Astels
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|