edn_turbo 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 40150e3db9c9690a44858cbbaeb1354cf455fae0
4
- data.tar.gz: cbd2dcb30ea31f014a50f390e988c1a0b499f7f0
3
+ metadata.gz: 8a087faff28667fe082bf7562ae36b749db1ee77
4
+ data.tar.gz: 50e07981c8864a7257a3a3fc99054b839719404c
5
5
  SHA512:
6
- metadata.gz: e00749730b5ac6e6ed30ac7875c0cb2420011fbd0a6a0aeb3e2fa816ab165ae2b6327dc0c532ebe6c907548737728aae54e22317450338228b99c2996c0e038d
7
- data.tar.gz: 76eb4c11b06efd7c36055402f2317cc7d8ce0f8c5e14217bf759b2a1cfe60511d22ee04e97bd8ecad5969638885e11bf5cecf526f74e736a794f69eef1cfecab
6
+ metadata.gz: 2876add49e35091384d97a89ffd8d7f9306a08ebd4854443c21700c3417c1fea48806e2bcc7c582b752d810c6ab86ef2f9d7b146669e4713a54b2226db0f00a3
7
+ data.tar.gz: fd59be0e552b7cf5d4932179553dc2ae971dee20cd927e2ef7c05a7f88c1bbc12827b95e94faa36c2d91dbd3df152b6e7c5fecd834cf0bb70a8fe6f8530168e4
data/README.md CHANGED
@@ -18,13 +18,13 @@ and `edn_turbo` (see [issue 12](https://github.com/relevance/edn-ruby/issues/12)
18
18
  irb(main):004:0> s = "[{\"x\" {\"id\" \"/model/952\", \"model_name\" \"person\", \"ancestors\" [\"record\" \"asset\"], \"format\" \"edn\"}, \"id\" 952, \"name\" nil, \"model_name\" \"person\", \"rel\" {}, \"description\" nil, \"age\" nil, \"updated_at\" nil, \"created_at\" nil, \"anniversary\" nil, \"job\" nil, \"start_date\" nil, \"username\" nil, \"vacation_start\" nil, \"vacation_end\" nil, \"expenses\" nil, \"rate\" nil, \"display_name\" nil, \"gross_profit_per_month\" nil}]"
19
19
  => "[{\"x\" {\"id\" \"/model/952\", \"model_name\" \"person\", \"ancestors\" [\"record\" \"asset\"], \"format\" \"edn\"}, \"id\" 952, \"name\" nil, \"model_name\" \"person\", \"rel\" {}, \"description\" nil, \"age\" nil, \"updated_at\" nil, \"created_at\" nil, \"anniversary\" nil, \"job\" nil, \"start_date\" nil, \"username\" nil, \"vacation_start\" nil, \"vacation_end\" nil, \"expenses\" nil, \"rate\" nil, \"display_name\" nil, \"gross_profit_per_month\" nil}]"
20
20
  irb(main):005:0> Benchmark.realtime { 100.times { EDN::read(s) } }
21
- => 0.078503
21
+ => 0.0786
22
22
  irb(main):006:0> Benchmark.realtime { 100.times { EDNT::read(s) } }
23
- => 0.002669
23
+ => 0.002991
24
24
  irb(main):007:0> Benchmark.realtime { 100000.times { EDN::read(s) } }
25
- => 75.219344
25
+ => 72.421565
26
26
  irb(main):008:0> Benchmark.realtime { 100000.times { EDNT::read(s) } }
27
- => 2.560593
27
+ => 2.993059
28
28
  ```
29
29
 
30
30
  Dependencies
@@ -57,7 +57,7 @@ Simlar to `edn-ruby`:
57
57
 
58
58
  File.open(filename) do |file|
59
59
  output = EDNT.read(file)
60
- pp output if output != nil
60
+ pp output if output != EOF
61
61
  end
62
62
 
63
63
  # also accepts a string
@@ -78,7 +78,7 @@ Or instantiate and reuse an instance of a parser:
78
78
  p = EDNT::Parser.new
79
79
  File.open(filename) do |file|
80
80
  output = p.parse(file)
81
- pp output if output != nil
81
+ pp output if output != EOF
82
82
  end
83
83
 
84
84
  # with a string
@@ -92,7 +92,7 @@ Or instantiate and reuse an instance of a parser:
92
92
  # parse token by token
93
93
  loop do
94
94
  t = p.read
95
- break if t == EDNT::EOF
95
+ break if t == EOF
96
96
 
97
97
  pp t
98
98
  end
@@ -101,8 +101,9 @@ Or instantiate and reuse an instance of a parser:
101
101
 
102
102
  Known problems
103
103
  ==============
104
- v0.3.1:
104
+ v0.3.2:
105
105
 
106
106
  - Some unhandled corner cases with operators and spacing
107
107
  remain. `edn_turbo` handles things like `1 / 12` and `1/ 12` but
108
- parse errors occur with `1/12` and `1 /12`.
108
+ parse errors occur with `1/12` and `1 /12` because it treats `/12`
109
+ as an invalid symbol.