rubymotionlisp 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rubylisp/tokenizer.rb +13 -10
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c46bbe332eafec414ca759ad841930af4a3e0e00
4
- data.tar.gz: 2419792364cf4230c6f0e54ae23b6f69d96f999f
3
+ metadata.gz: 0651f5a21b9eef38abe56e63192088deccc8bb45
4
+ data.tar.gz: 955912fc8020349b60cb610d3787a2b9e524a037
5
5
  SHA512:
6
- metadata.gz: e41ea5bd239d0418d16b1f7c9ff6edb36a056fdc64ad9295c5eb990c1481bbec3f829032e3195e3969a7c6b8ffda21505cfbdddc26bee9c724a398ce9085f019
7
- data.tar.gz: 978a44244abde936c1b68db58d20e159a7a8389e2f00350eb3491218c62a4b3821a3a479cd47ed09f5ab480d60ce48c5b4881ec0979072ccf41be0cc175938f5
6
+ metadata.gz: 61f5ebb8c719ef8a253a266533824bb013bf7dcfa470b8bf9783ac287771f23dd0b41231105c1ded889de05323031f633dd157e4cdd3aaead7369b489540e1a3
7
+ data.tar.gz: 775c7504c2579963d97fe3edf6cba8dc2979293446bcde19d6b9640767b01426e60c2a5e480c17792dbf6658556dcca7642c9c5a916cc1e2ae96771cf4f37a24
@@ -4,15 +4,16 @@ module Lisp
4
4
 
5
5
  attr_reader :line_number
6
6
 
7
- def self.from_string(str)
8
- self.new(StringIO.new(str, "r"))
7
+ def self.from_string(str, absorb_space=true)
8
+ self.new(StringIO.new(str, "r"), absorb_space)
9
9
  end
10
10
 
11
11
  def self.from_file(f)
12
12
  self.new(f)
13
13
  end
14
14
 
15
- def initialize(src)
15
+ def initialize(src, absorb_space=true)
16
+ @absorb_whitespace = absorb_space
16
17
  @source = src
17
18
  @lookahead_token = nil
18
19
  @lookahead_literal = ''
@@ -209,13 +210,15 @@ module Lisp
209
210
  def read_next_token
210
211
  return :EOF, '' if eof?
211
212
 
212
- # while space?(@current_ch)
213
- # @line_number += 1 if @current_ch == "\n"
214
- # advance
215
- # return :EOF, '' if eof?
216
- # end
217
-
218
- if space?(@current_ch)
213
+ if @absorb_whitespace
214
+ while space?(@current_ch)
215
+ @line_number += 1 if @current_ch == "\n"
216
+ advance
217
+ return :EOF, '' if eof?
218
+ end
219
+ end
220
+
221
+ if !@absorb_whitespace && space?(@current_ch)
219
222
  @line_number += 1 if @current_ch == "\n"
220
223
  advance
221
224
  return :WHITESPACE, " "
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubymotionlisp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Astels