machete 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ 0.2.1 (2011-08-17)
2
+ ------------------
3
+
4
+ * Fixed whitespace skipping in the parser when newlines are present.
5
+
1
6
  0.2.0 (2011-08-17)
2
7
  ------------------
3
8
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -211,7 +211,7 @@ def next_token
211
211
  end
212
212
 
213
213
  def skip_whitespace
214
- if remaining_input =~ /^[ \t\r\n]+/
214
+ if remaining_input =~ /\A^[ \t\r\n]+/
215
215
  @pos += $&.length
216
216
  end
217
217
  end
@@ -328,6 +328,12 @@ module Machete
328
328
  '42 '.should be_parsed_as(@i42)
329
329
  end
330
330
 
331
+ it "whitespace skipping starts from the beginning of the input, not beginning of the line" do
332
+ # This basically verifies that the whitespace-skipping regexp has "\A" at
333
+ # the beginning, not "^".
334
+ "42\n ".should be_parsed_as(@i42)
335
+ end
336
+
331
337
  it "handles lexical errors" do
332
338
  '@#%'.should not_be_parsed("Unexpected character: \"@\".")
333
339
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: machete
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Majda