edn_turbo 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +21 -0
- data/bin/ppedn +24 -3
- data/ext/edn_turbo/edn_parser.cc +524 -318
- data/ext/edn_turbo/edn_parser.h +21 -7
- data/ext/edn_turbo/edn_parser.rl +126 -29
- data/ext/edn_turbo/edn_parser_util.cc +70 -16
- data/ext/edn_turbo/main.cc +21 -11
- data/lib/edn_turbo/edn_parser.rb +2 -1
- data/lib/edn_turbo/version.rb +2 -2
- data/lib/edn_turbo.rb +30 -0
- data/test/test_output_diff.rb +28 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30d991ed7b0f1d538557b651a4e5d04eccf1b54b
|
4
|
+
data.tar.gz: 046f2b1f3f66814897e1ead26d5404737f2dc00f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8467a5aa1f6ae26b4ee414627ce49dddff1df50135bd48184972d93c334fb7a0f636cef089c759b524b2d30b04e3f2b517746e02cc65aa2c9f905e1594730d8
|
7
|
+
data.tar.gz: c1eea11deb70ce83ee4d322aaa424d288dcc272ec5097e284d8b2418c58630f907295b3437822ef28eb1b82ff7fe9c0c2cd2d211c4c530a3c1286fceb92cec8e
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) <year> <copyright holders>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/bin/ppedn
CHANGED
@@ -11,6 +11,11 @@ options = {}
|
|
11
11
|
optparse = OptionParser.new do |opts|
|
12
12
|
opts.banner = "Usage: #{$0} [options] filename"
|
13
13
|
|
14
|
+
options[:use_parse] = false
|
15
|
+
opts.on( '-p', '--use_parse', 'User single-shot parse() instead of token-wise read()' ) do
|
16
|
+
options[:use_parse] = true
|
17
|
+
end
|
18
|
+
|
14
19
|
opts.on( '-v', '--version', 'Display version information and exit' ) do
|
15
20
|
$stderr.puts "EDN parsing C++-extension version #{EDNt::VERSION}"
|
16
21
|
exit
|
@@ -34,8 +39,24 @@ if !File.exist? filename
|
|
34
39
|
exit 1
|
35
40
|
end
|
36
41
|
|
37
|
-
|
42
|
+
p = EDNT::Parser.new
|
43
|
+
|
44
|
+
|
38
45
|
File.open(filename) do |file|
|
39
|
-
|
40
|
-
|
46
|
+
|
47
|
+
if options[:use_parse]
|
48
|
+
pp p.parse(file.read)
|
49
|
+
else
|
50
|
+
p.set_input(file.read)
|
51
|
+
|
52
|
+
loop do
|
53
|
+
output = p.read
|
54
|
+
|
55
|
+
break if output == EDNT::EOF
|
56
|
+
|
57
|
+
pp output
|
58
|
+
|
59
|
+
# puts "\tread() meta: #{p.metadata}" if p.has_metadata?
|
60
|
+
end
|
61
|
+
end
|
41
62
|
end
|