edn_turbo 0.5.3 → 0.5.4

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: a8e0d2a17f93e47f4b57e786908b58d67943cfbc
4
- data.tar.gz: 9950b20be3ddca5ced388090e56f43bbf925d38c
3
+ metadata.gz: 73a4ad2ca7e8fe3d62d10c0922aa848d681a7bbc
4
+ data.tar.gz: 6c150c29710382b31ac9d2fa57b1bb92a80ebfc0
5
5
  SHA512:
6
- metadata.gz: 6d5ca08dbf8380ec7395df24800482739770e77c5d259e0626bb713dc8fb81f05561c4eedcd6392772c1d85501766f7c1e22054504c06c4aea7ac3f442e9773e
7
- data.tar.gz: a2c52665bc8ada8c8cfbb4da314ba2f59319fb24b9a1a13d5f42ec73b91134c6f51e425621d479f85ea449919556a46fa1ee13dee2b90fee3e1a543cbaf6908b
6
+ metadata.gz: 4894a11b2dd834bae3167a349813651340f4da142f3cd42b15ef8631d921524c9b4dfad61f5fa597e279ae2537b79dcee8f337eaa877a339b15923764a84d518
7
+ data.tar.gz: bfbca29dc9a58aefeb8e465f23961e1604e3f5e77100ec4027a96a53cdb916707c8d4342584df8a4d18d386dff64423f1b2b4be39cc31df2d95f3e95f964fab2
data/.gitignore CHANGED
@@ -10,3 +10,5 @@ tmp/*
10
10
  *.hpp
11
11
  *.ipp
12
12
  *.png
13
+ _*.edn
14
+ _*.rb
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in edn_ext.gemspec
data/Rakefile CHANGED
@@ -31,9 +31,8 @@ end
31
31
 
32
32
  CLEAN.include(["*.png", "*.gem"])
33
33
 
34
+ # ragel cc source generation
34
35
  task :ragel => GEN_CC_PARSER_SRC_PATH
35
-
36
-
37
36
  file GEN_CC_PARSER_SRC_PATH => RAGEL_PARSER_SRC_PATH do
38
37
  cd EXT_PATH do
39
38
  sh "ragel -G2 -o #{GEN_CC_PARSER_SRC} #{RAGEL_PARSER_SRC}"
@@ -42,7 +41,7 @@ file GEN_CC_PARSER_SRC_PATH => RAGEL_PARSER_SRC_PATH do
42
41
  end
43
42
  end
44
43
 
45
-
44
+ # graph generation for testing machine output
46
45
  task :graph, [:machine] do |t, args|
47
46
  args.with_defaults(:machine => 'EDN_value')
48
47
  TMPFILE='/tmp/ragel_edn'
data/bin/ppedn CHANGED
@@ -1,49 +1,49 @@
1
1
  #!/usr/bin/env ruby
2
2
  # -*- coding: utf-8 -*-
3
+ # frozen_string_literal: true
3
4
 
4
- $LOAD_PATH << File.expand_path( File.dirname(__FILE__) + '/../lib' )
5
+ $LOAD_PATH << File.expand_path(File.dirname(__FILE__) + '/../lib')
5
6
 
6
7
  require 'optparse'
8
+ require 'edn'
7
9
  require 'edn_turbo'
8
10
  require 'pp'
9
11
 
10
12
  options = {}
11
13
  optparse = OptionParser.new do |opts|
12
- opts.banner = "Usage: #{$0} [options] filename"
14
+ opts.banner = "Usage: #{$PROGRAM_NAME} [options] filename"
13
15
 
14
16
  options[:use_parse] = false
15
- opts.on( '-p', '--use_parse', 'User single-shot parse() instead of token-wise read()' ) do
17
+ opts.on('-p', '--use_parse', 'User single-shot parse() instead of token-wise read()') do
16
18
  options[:use_parse] = true
17
19
  end
18
20
 
19
- opts.on( '-v', '--version', 'Display version information and exit' ) do
20
- $stderr.puts "EDN parsing C++-extension version #{EDNt::VERSION}"
21
+ opts.on('-v', '--version', 'Display version information and exit') do
22
+ $stderr.puts "EDN parsing C++-extension version #{EDNT::VERSION}"
21
23
  exit
22
24
  end
23
25
 
24
- opts.on( '-h', '--help', 'Display this screen' ) do
26
+ opts.on('-h', '--help', 'Display this screen') do
25
27
  $stderr.puts opts
26
28
  exit
27
29
  end
28
30
  end
29
31
  optparse.parse!
30
32
 
31
- if ARGV.size == 0
33
+ if ARGV.empty?
32
34
  $stderr.puts optparse
33
35
  exit 1
34
36
  end
35
37
 
36
38
  filename = ARGV[0]
37
- if !File.exist? filename
39
+ unless File.exist? filename
38
40
  $stderr.puts "Path '#{filename}' not valid"
39
41
  exit 1
40
42
  end
41
43
 
42
44
  p = EDNT::Parser.new
43
45
 
44
-
45
46
  File.open(filename) do |file|
46
-
47
47
  if options[:use_parse]
48
48
  output = p.parse(file.read)
49
49
 
@@ -57,8 +57,7 @@ File.open(filename) do |file|
57
57
  break if output == EDN::EOF
58
58
 
59
59
  pp output
60
-
61
- # puts "\tread() meta: #{p.metadata}" if p.has_metadata?
60
+ # puts "\tread() meta: #{p.metadata}" if p.has_metadata?
62
61
  end
63
62
  end
64
63
  end
data/bin/ppedn-ruby CHANGED
@@ -1,17 +1,18 @@
1
1
  #!/usr/bin/env ruby
2
2
  # -*- coding: utf-8 -*-
3
+ # frozen_string_literal: true
3
4
 
4
5
  require 'edn'
5
6
  require 'pp'
6
7
 
7
- if ARGV.size == 0
8
- $stderr.puts "no filename given"
8
+ if ARGV.empty?
9
+ $stderr.puts 'no filename given'
9
10
  exit 1
10
11
  end
11
12
 
12
13
  # file checks
13
14
  filename = ARGV[0]
14
- if !File.exist? filename
15
+ unless File.exist? filename
15
16
  $stderr.puts "Error opening #{filename}"
16
17
  abort
17
18
  end
@@ -22,8 +23,8 @@ begin
22
23
  File.open(filename) do |file|
23
24
  doc_data = EDN.read(file)
24
25
  end
25
- rescue Exception => e
26
- $stderr.puts "Error reading file"
26
+ rescue StandardError
27
+ $stderr.puts 'Error reading file'
27
28
  abort
28
29
  end
29
30
 
data/ext/edn_turbo/depend CHANGED
@@ -1,3 +1,5 @@
1
- edn_parser.o: edn_parser.cc edn_parser.h
2
- edn_parser_util.o: edn_parser_util.cc edn_parser.h edn_parser_util.h
3
- edn_parser_util_encode.o: edn_parse_util_encode.cc edn_parser_util.h
1
+ main.o: main.cc parser.h
2
+ edn_parser.o: edn_parser.cc parser.h util.h
3
+ parser_def.o: parser_def.cc parser.h util.h
4
+ util.o: util.cc util_unicode.h
5
+ util_unicode.o: util_unicode.cc util_unicode.h