lector 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lector (0.0.6)
4
+ lector (0.0.7)
5
5
  citrus
6
6
 
7
7
  GEM
@@ -83,12 +83,13 @@ grammar Lector::RubyParse
83
83
 
84
84
  rule hash
85
85
  #TODO: Spurious commas should be parse errors.
86
- ('{'
87
- (((space* form space* '=>' space* form space* ',') |
88
- (space* form ':' space* form space* ','))*
89
- ((space* form space* '=>' space* form space*) |
90
- (space* form ':' space* form space*)))
91
- '}') <Lector::Types::Hash>
86
+ (('{' space* '}') |
87
+ ('{'
88
+ (((space* form space* '=>' space* form space* ',') |
89
+ (space* form ':' space* form space* ','))*
90
+ ((space* form space* '=>' space* form space*) |
91
+ (space* form ':' space* form space*)))
92
+ '}')) <Lector::Types::Hash>
92
93
  end
93
94
 
94
95
  rule hashkey
@@ -1,3 +1,3 @@
1
1
  module Lector
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -100,6 +100,10 @@ Rns::using(Lector => [:read_s, :read_file]) do
100
100
  read_s("[ 42 ]").should == [42]
101
101
  end
102
102
 
103
+ it 'parses empty arrays' do
104
+ read_s("[]").should == []
105
+ end
106
+
103
107
  it 'parses arrays of multiple elements' do
104
108
  read_s("[42, -1]").should == [42, -1]
105
109
  end
@@ -119,6 +123,10 @@ Rns::using(Lector => [:read_s, :read_file]) do
119
123
  read_s("{:a => 7, b: 6}").should == {:a => 7, :b => 6}
120
124
  end
121
125
 
126
+ it 'parses empty hashes' do
127
+ read_s("{}").should == {}
128
+ end
129
+
122
130
  it 'parses nested collections' do
123
131
  read_s("[[1,2], 3, 4]").should == [[1, 2], 3, 4]
124
132
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: