epub-cfi 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a79486ec6d7e2a618cfba25b35658411424f08ed77384025174935d8cbc8127
4
- data.tar.gz: e5cbd477b9b7ebdc0850d428b2494e795fddb0208a209e6969f5ff2adea4ec95
3
+ metadata.gz: cdf83e8e0bf1372467809ca0fbacdba9359e5fb9a55bcd6381b32a3e54f54b69
4
+ data.tar.gz: f812252ca173657a1f36a8ea986040540e5207e5bfdb24a53607974c67b4a55f
5
5
  SHA512:
6
- metadata.gz: c9434ba31524411d771d7abe463294f5154da32707ce640539e3dcb6f9e0c9d1507ee23e638cb746d22b97fd59ad885b190fed0c16943610c0ab1f99215bf30f
7
- data.tar.gz: d6b2a08aa5c7ca1d622e884645dd8a90eaf1bd4392f3a1d761f4976a0e5fa0a497e974bf940fecad7b3b20fe7976ad8e49d68fb3ad5be8bb276b0796b99aa96d
6
+ metadata.gz: b622f524b56193a6b49119ec8abd1ffa9d789bb8a4d5c0a653d10cf5fe6830d8f8c643a6c618cfb1a3b63f2141e644b3d2df92ae599e56cf31ad7f0bf47f494c
7
+ data.tar.gz: b5666e05f99b2072e8e4c47097eb87a5b3070a585b5489fb4f5be089ed3380008ed0d41ccc859cc959a7471d49db0e587f10a71b84b5ec7b4d6f34d4270eb2c5
data/.gitlab-ci.yml CHANGED
@@ -22,3 +22,8 @@ test:3.3:
22
22
  image: ruby:3.3
23
23
  script:
24
24
  rake test typecheck
25
+
26
+ test:3.4:
27
+ image: ruby:3.4
28
+ script:
29
+ rake test typecheck
data/ChangeLog.adoc CHANGED
@@ -1,3 +1,8 @@
1
+ === 0.1.4 / 2025-10-28
2
+
3
+ * Remove `NonEmptyArray` from signature
4
+ * Build parser table on installation
5
+
1
6
  === 0.1.3 / 2023-12-28
2
7
 
3
8
  * Suppress warning on unused variable
data/Rakefile CHANGED
@@ -3,30 +3,31 @@ require 'rake'
3
3
 
4
4
  task :default => [:test, :typecheck]
5
5
 
6
+ TARGET = "lib/epub/cfi/parser.tab.rb"
7
+
6
8
  desc "Build EPUB CFI parser"
7
- file "lib/epub/cfi/parser.tab.rb" => "lib/epub/cfi/parser.y" do |task|
8
- sh "racc #{task.source}"
9
+ file TARGET => "lib/epub/cfi/parser.y" do |task|
10
+ sh "racc", task.source
9
11
  end
10
12
 
11
13
  require "rake/clean"
12
- CLOBBER.include "lib/epub/cfi/parser.tab.rb"
14
+ CLOBBER.include TARGET
13
15
 
14
16
  require 'rubygems/tasks'
15
17
  Gem::Tasks.new
16
- task :build => "lib/epub/cfi/parser.tab.rb"
17
18
 
18
19
  require 'rake/testtask'
19
20
  Rake::TestTask.new do |test|
20
21
  test.libs << 'test'
21
22
  test.verbose = true
22
23
  end
23
- task :test => "lib/epub/cfi/parser.tab.rb"
24
+ task :test => TARGET
24
25
 
25
26
  require 'yard'
26
27
  YARD::Rake::YardocTask.new
27
28
 
28
29
  require "steep"
29
30
  desc "Check type"
30
- task typecheck: "lib/epub/cfi/parser.tab.rb" do
31
+ task typecheck: TARGET do
31
32
  Steep::Drivers::Check.new(stdout: $stdout, stderr: $stderr).run
32
33
  end
data/epub-cfi.gemspec CHANGED
@@ -9,12 +9,12 @@ Gem::Specification.new do |gem|
9
9
  gem.version = EPUB::CFI::VERSION
10
10
  gem.summary = %q{EPUB CFI parser and builder}
11
11
  gem.description = %q{Parser and builder implementation for EPUB CFI defined at http://www.idpf.org/epub/linking/cfi/}
12
- gem.license = "LGPL"
12
+ gem.license = "LGPL-3.0-or-later"
13
13
  gem.authors = ["KITAITI Makoto"]
14
14
  gem.email = "KitaitiMakoto@gmail.com"
15
15
  gem.homepage = "https://gitlab.com/KitaitiMakoto/epub-cfi"
16
16
 
17
- gem.files = `git ls-files`.split($/) << "lib/epub/cfi/parser.tab.rb"
17
+ gem.files = `git ls-files`.split($/)
18
18
 
19
19
  `git submodule --quiet foreach --recursive pwd`.split($/).each do |submodule|
20
20
  submodule.sub!("#{Dir.pwd}/",'')
@@ -28,6 +28,7 @@ Gem::Specification.new do |gem|
28
28
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
29
29
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
30
30
  gem.require_paths = ['lib']
31
+ gem.extensions = ["ext/epub-cfi/Rakefile"]
31
32
 
32
33
  gem.add_runtime_dependency "racc"
33
34
 
@@ -0,0 +1,12 @@
1
+ root = File.expand_path("../..", __dir__)
2
+ lib_dir = File.join(root, "lib")
3
+ source = File.join(lib_dir, "epub/cfi/parser.y")
4
+ target = File.join(lib_dir, "epub/cfi/parser.tab.rb")
5
+
6
+ task default: target
7
+
8
+ file target => source do |t|
9
+ Dir.chdir root do
10
+ sh "racc", "lib/epub/cfi/parser.y"
11
+ end
12
+ end
@@ -18,6 +18,6 @@
18
18
  module EPUB
19
19
  module CFI
20
20
  # epub-cfi version
21
- VERSION = "0.1.3"
21
+ VERSION = "0.1.4"
22
22
  end
23
23
  end
data/sig/epub-cfi.rbs CHANGED
@@ -16,10 +16,10 @@ module EPUB
16
16
  class Location
17
17
  include Comparable
18
18
 
19
- attr_reader paths: NonEmptyArray[Path]
20
- def self.from_parent_and_subpath: (NonEmptyArray[Path] parent_path, (NonEmptyArray[Path]?) subpath) -> Location
21
- def self.resolve_path: (NonEmptyArray[Path] parent_path, (NonEmptyArray[Path]?) subpath) -> NonEmptyArray[Path]
22
- def initialize: (?NonEmptyArray[Path] paths) -> void
19
+ attr_reader paths: Array[Path]
20
+ def self.from_parent_and_subpath: (Array[Path] parent_path, (Array[Path]?) subpath) -> Location
21
+ def self.resolve_path: (Array[Path] parent_path, (Array[Path]?) subpath) -> Array[Path]
22
+ def initialize: (?Array[Path] paths) -> void
23
23
  def initialize_copy: (self original) -> void
24
24
  def <=>: (self other) -> Integer?
25
25
  def path_string: -> String
@@ -45,7 +45,7 @@ module EPUB
45
45
  attr_accessor parent_path: Location
46
46
  attr_accessor start_subpath: String
47
47
  attr_accessor end_subpath: String
48
- def self.from_parent_and_start_and_end: (NonEmptyArray[Path] parent_path, NonEmptyArray[Path] start_subpath, NonEmptyArray[Path] end_subpath) -> Range
48
+ def self.from_parent_and_start_and_end: (Array[Path] parent_path, Array[Path] start_subpath, Array[Path] end_subpath) -> Range
49
49
  def to_s: -> String
50
50
  end
51
51
 
@@ -123,10 +123,3 @@ module EPUB
123
123
  end
124
124
  end
125
125
  end
126
-
127
- # Just for type checking
128
- class NonEmptyArray[T] < Array[T]
129
- def last: -> T
130
- def shift: -> T
131
- def collect: { (T) -> untyped } -> NonEmptyArray[untyped]
132
- end
data/test/test_cfi.rb CHANGED
@@ -205,6 +205,15 @@ class TestCFI < Test::Unit::TestCase
205
205
  end
206
206
  end
207
207
 
208
+ class TestRactor < self
209
+ def test_ractor
210
+ cfi = EPUB::CFI("/6/14[chap05ref]!/4[body01]/10/2/1:3[2^[1^]]")
211
+ ractor = Ractor.new {Ractor.receive.to_s}
212
+ ractor.send cfi
213
+ assert_equal "epubcfi(/6/14[chap05ref]!/4[body01]/10/2/1:3[2^[1^]])", ractor.take
214
+ end
215
+ end
216
+
208
217
  private
209
218
 
210
219
  def epubcfi(string)
@@ -0,0 +1,22 @@
1
+ require_relative "helper"
2
+ require "tempfile"
3
+
4
+ class TestPackage < Test::Unit::TestCase
5
+ def test_build
6
+ Tempfile.create do |file|
7
+ assert system("gem", "build", "epub-cfi.gemspec", "--output", file.to_path, exception: true)
8
+ assert_path_exist file.to_path
9
+ assert file.size > 0
10
+ end
11
+ end
12
+
13
+ def test_install
14
+ gemspec = Gem::Specification.load("epub-cfi.gemspec")
15
+ system "rake", "build", exception: true
16
+ Dir.mktmpdir do |dir|
17
+ dir = File.realpath(dir)
18
+ system "gem", "install", "--install-dir", dir, File.join("pkg", gemspec.file_name), exception: true
19
+ assert_path_exist File.join(dir, "gems/#{gemspec.full_name}/lib/epub/cfi/parser.tab.rb")
20
+ end
21
+ end
22
+ end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epub-cfi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - KITAITI Makoto
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-12-27 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: racc
@@ -125,7 +124,8 @@ dependencies:
125
124
  description: Parser and builder implementation for EPUB CFI defined at http://www.idpf.org/epub/linking/cfi/
126
125
  email: KitaitiMakoto@gmail.com
127
126
  executables: []
128
- extensions: []
127
+ extensions:
128
+ - ext/epub-cfi/Rakefile
129
129
  extra_rdoc_files: []
130
130
  files:
131
131
  - ".document"
@@ -138,9 +138,9 @@ files:
138
138
  - Rakefile
139
139
  - Steepfile
140
140
  - epub-cfi.gemspec
141
+ - ext/epub-cfi/Rakefile
141
142
  - lib/epub/cfi.rb
142
143
  - lib/epub/cfi/parser.rb
143
- - lib/epub/cfi/parser.tab.rb
144
144
  - lib/epub/cfi/parser.y
145
145
  - lib/epub/cfi/version.rb
146
146
  - sig-private/shims/simplecov.rbs
@@ -150,12 +150,12 @@ files:
150
150
  - sig/shims/racc.rbs
151
151
  - test/helper.rb
152
152
  - test/test_cfi.rb
153
+ - test/test_package.rb
153
154
  - test/test_parser.rb
154
155
  homepage: https://gitlab.com/KitaitiMakoto/epub-cfi
155
156
  licenses:
156
- - LGPL
157
+ - LGPL-3.0-or-later
157
158
  metadata: {}
158
- post_install_message:
159
159
  rdoc_options: []
160
160
  require_paths:
161
161
  - lib
@@ -170,11 +170,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  - !ruby/object:Gem::Version
171
171
  version: '0'
172
172
  requirements: []
173
- rubygems_version: 3.5.3
174
- signing_key:
173
+ rubygems_version: 3.7.2
175
174
  specification_version: 4
176
175
  summary: EPUB CFI parser and builder
177
176
  test_files:
178
177
  - test/helper.rb
179
178
  - test/test_cfi.rb
179
+ - test/test_package.rb
180
180
  - test/test_parser.rb
@@ -1,700 +0,0 @@
1
- #
2
- # DO NOT MODIFY!!!!
3
- # This file is automatically generated by Racc 1.7.3
4
- # from Racc grammar file "parser.y".
5
- #
6
-
7
- require 'racc/parser.rb'
8
- module EPUB
9
- module CFI
10
- class Parser < Racc::Parser
11
- ##### State transition tables begin ###
12
-
13
- racc_action_table = [
14
- 44, 61, 60, 57, 58, 59, 32, 31, 56, 47,
15
- 4, 49, 4, 22, 24, 25, 54, 62, 61, 60,
16
- 57, 58, 59, 32, 31, 56, 14, 13, 49, 32,
17
- 31, 72, 5, 54, 62, 61, 60, 57, 58, 59,
18
- 32, 31, 56, 32, 31, 49, 20, 4, 22, 24,
19
- 25, 62, 61, 60, 57, 58, 59, 32, 31, 56,
20
- 14, 13, 49, 39, 40, 39, 40, 54, 62, 61,
21
- 60, 57, 58, 59, 32, 31, 56, 32, 31, 49,
22
- 32, 31, 100, 31, 54, 62, 61, 60, 57, 58,
23
- 59, 32, 31, 56, 39, 40, 49, 107, 31, -63,
24
- -63, 8, 62, 61, 60, 57, 58, 59, 32, 31,
25
- 56, -63, -63, 49, 4, 15, 4, 28, 54, 62,
26
- 61, 60, 57, 58, 59, 32, 31, 56, 90, 33,
27
- 49, 28, 4, 28, 25, 54, 62, 91, 92, 87,
28
- 28, 75, 95, 96, 72, 73, 75, 47, 47, 80,
29
- 28, 47, 47, 47, 105, 47, 110 ]
30
-
31
- racc_action_check = [
32
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
33
- 0, 27, 20, 20, 20, 20, 27, 27, 44, 44,
34
- 44, 44, 44, 44, 44, 44, 4, 4, 44, 69,
35
- 69, 69, 1, 44, 44, 47, 47, 47, 47, 47,
36
- 47, 47, 47, 14, 14, 47, 10, 10, 10, 10,
37
- 10, 47, 48, 48, 48, 48, 48, 48, 48, 48,
38
- 22, 22, 48, 24, 24, 25, 25, 48, 48, 80,
39
- 80, 80, 80, 80, 80, 80, 80, 29, 29, 80,
40
- 39, 39, 72, 72, 80, 80, 82, 82, 82, 82,
41
- 82, 82, 82, 82, 73, 73, 82, 99, 99, 100,
42
- 100, 2, 82, 105, 105, 105, 105, 105, 105, 105,
43
- 105, 107, 107, 105, 3, 5, 8, 12, 105, 105,
44
- 110, 110, 110, 110, 110, 110, 110, 110, 49, 16,
45
- 110, 23, 33, 36, 38, 110, 110, 49, 49, 49,
46
- 49, 49, 49, 49, 40, 41, 42, 43, 45, 46,
47
- 67, 76, 78, 79, 81, 103, 108 ]
48
-
49
- racc_action_pointer = [
50
- 6, 32, 99, 110, 18, 115, nil, nil, 112, nil,
51
- 43, nil, 103, nil, 35, nil, 127, nil, nil, nil,
52
- 8, nil, 52, 117, 55, 57, nil, -2, nil, 69,
53
- nil, nil, nil, 128, nil, nil, 119, nil, 127, 72,
54
- 134, 140, 131, 136, 15, 137, 147, 32, 49, 126,
55
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
56
- nil, nil, nil, nil, nil, nil, nil, 136, nil, 21,
57
- nil, nil, 74, 86, nil, nil, 140, nil, 141, 142,
58
- 66, 142, 83, nil, nil, nil, nil, nil, nil, nil,
59
- nil, nil, nil, nil, nil, nil, nil, nil, nil, 89,
60
- 91, nil, nil, 144, nil, 100, nil, 103, 154, nil,
61
- 117, nil ]
62
-
63
- racc_action_default = [
64
- -81, -81, -3, -10, -81, -81, -1, -2, -10, -4,
65
- -15, -9, -23, -30, -34, 112, -81, -6, -7, -8,
66
- -81, -14, -81, -23, -81, -81, -13, -81, -66, -31,
67
- -33, -62, -63, -10, -11, -12, -23, -17, -20, -34,
68
- -27, -81, -81, -42, -81, -42, -39, -81, -46, -81,
69
- -54, -55, -57, -70, -71, -72, -73, -74, -75, -76,
70
- -77, -78, -79, -80, -32, -5, -16, -23, -19, -27,
71
- -25, -26, -81, -81, -22, -67, -35, -41, -42, -37,
72
- -81, -81, -47, -59, -60, -61, -56, -48, -49, -50,
73
- -51, -52, -53, -64, -65, -68, -69, -18, -24, -81,
74
- -29, -21, -40, -36, -38, -81, -58, -28, -43, -45,
75
- -81, -44 ]
76
-
77
- racc_goto_table = [
78
- 30, 46, 29, 76, 45, 79, 26, 85, 38, 41,
79
- 83, 84, 70, 2, 9, 64, 3, 37, 78, 16,
80
- 1, 12, 21, 6, 74, 30, 19, 69, 7, 17,
81
- 66, 94, 34, 35, 18, 68, 3, 67, 103, 36,
82
- 93, 98, 85, 42, 65, 106, 84, 43, 81, 108,
83
- 82, 88, 89, 102, 104, 64, 102, 101, 30, 86,
84
- 99, 97, nil, nil, nil, nil, nil, nil, nil, nil,
85
- nil, nil, nil, nil, nil, nil, nil, nil, nil, 109,
86
- 102, nil, nil, nil, 111, 64 ]
87
-
88
- racc_goto_check = [
89
- 22, 25, 19, 24, 26, 24, 12, 31, 14, 14,
90
- 36, 37, 20, 2, 6, 22, 5, 12, 25, 6,
91
- 1, 11, 10, 3, 18, 22, 5, 19, 4, 8,
92
- 12, 18, 10, 2, 9, 13, 5, 15, 24, 11,
93
- 16, 20, 31, 17, 6, 36, 37, 23, 27, 28,
94
- 30, 32, 33, 26, 25, 22, 26, 14, 22, 34,
95
- 19, 12, nil, nil, nil, nil, nil, nil, nil, nil,
96
- nil, nil, nil, nil, nil, nil, nil, nil, nil, 25,
97
- 26, nil, nil, nil, 25, 22 ]
98
-
99
- racc_goto_pointer = [
100
- nil, 20, 13, 21, 26, 16, 11, nil, 19, 24,
101
- 12, 17, -6, -3, -16, -1, -9, 16, -18, -12,
102
- -28, nil, -14, 20, -40, -26, -23, 1, -56, nil,
103
- 3, -40, 2, 3, 11, nil, -37, -36, nil ]
104
-
105
- racc_goto_default = [
106
- nil, nil, nil, nil, nil, 11, nil, 10, nil, nil,
107
- nil, nil, nil, 23, nil, nil, 27, nil, nil, nil,
108
- nil, 71, 63, nil, nil, nil, 77, nil, nil, 48,
109
- nil, 51, nil, nil, 52, 50, nil, 53, 55 ]
110
-
111
- racc_reduce_table = [
112
- 0, 0, :racc_error,
113
- 2, 21, :_reduce_1,
114
- 1, 23, :_reduce_none,
115
- 0, 23, :_reduce_none,
116
- 2, 22, :_reduce_4,
117
- 4, 24, :_reduce_5,
118
- 2, 26, :_reduce_6,
119
- 2, 26, :_reduce_7,
120
- 2, 27, :_reduce_8,
121
- 1, 27, :_reduce_9,
122
- 0, 27, :_reduce_10,
123
- 2, 28, :_reduce_11,
124
- 2, 28, :_reduce_12,
125
- 3, 25, :_reduce_13,
126
- 1, 29, :_reduce_none,
127
- 0, 29, :_reduce_none,
128
- 3, 30, :_reduce_16,
129
- 2, 30, :_reduce_17,
130
- 4, 30, :_reduce_18,
131
- 1, 35, :_reduce_none,
132
- 0, 35, :_reduce_none,
133
- 4, 33, :_reduce_21,
134
- 3, 32, :_reduce_22,
135
- 0, 32, :_reduce_none,
136
- 3, 34, :_reduce_24,
137
- 2, 34, :_reduce_25,
138
- 1, 40, :_reduce_none,
139
- 0, 40, :_reduce_none,
140
- 3, 41, :_reduce_28,
141
- 2, 41, :_reduce_29,
142
- 1, 31, :_reduce_none,
143
- 2, 31, :_reduce_31,
144
- 2, 39, :_reduce_32,
145
- 1, 39, :_reduce_none,
146
- 0, 39, :_reduce_none,
147
- 2, 37, :_reduce_35,
148
- 3, 37, :_reduce_36,
149
- 2, 37, :_reduce_37,
150
- 3, 43, :_reduce_38,
151
- 1, 43, :_reduce_39,
152
- 2, 44, :_reduce_40,
153
- 1, 44, :_reduce_41,
154
- 0, 44, :_reduce_42,
155
- 4, 46, :_reduce_43,
156
- 3, 48, :_reduce_44,
157
- 1, 48, :_reduce_45,
158
- 1, 45, :_reduce_46,
159
- 1, 47, :_reduce_none,
160
- 2, 51, :_reduce_48,
161
- 2, 51, :_reduce_49,
162
- 2, 51, :_reduce_50,
163
- 2, 51, :_reduce_51,
164
- 2, 51, :_reduce_52,
165
- 2, 51, :_reduce_53,
166
- 1, 54, :_reduce_none,
167
- 1, 54, :_reduce_none,
168
- 2, 49, :_reduce_56,
169
- 1, 49, :_reduce_57,
170
- 2, 50, :_reduce_none,
171
- 1, 50, :_reduce_none,
172
- 1, 56, :_reduce_none,
173
- 1, 56, :_reduce_none,
174
- 1, 42, :_reduce_none,
175
- 1, 42, :_reduce_none,
176
- 1, 52, :_reduce_none,
177
- 1, 52, :_reduce_none,
178
- 1, 36, :_reduce_none,
179
- 1, 38, :_reduce_none,
180
- 1, 53, :_reduce_none,
181
- 1, 53, :_reduce_none,
182
- 1, 55, :_reduce_none,
183
- 1, 55, :_reduce_none,
184
- 1, 57, :_reduce_none,
185
- 1, 57, :_reduce_none,
186
- 1, 57, :_reduce_none,
187
- 1, 57, :_reduce_none,
188
- 1, 57, :_reduce_none,
189
- 1, 57, :_reduce_none,
190
- 1, 57, :_reduce_none,
191
- 1, 58, :_reduce_none,
192
- 1, 58, :_reduce_none ]
193
-
194
- racc_reduce_n = 81
195
-
196
- racc_shift_n = 112
197
-
198
- racc_token_table = {
199
- false => 0,
200
- :error => 1,
201
- :COMMA => 2,
202
- :EXCLAMATION_MARK => 3,
203
- :SOLIDUS => 4,
204
- :COLON => 5,
205
- :TILDE => 6,
206
- :ATMARK => 7,
207
- :DIGIT_NON_ZERO => 8,
208
- :ZERO => 9,
209
- :DOT => 10,
210
- :SEMICOLON => 11,
211
- :EQUAL => 12,
212
- :CIRCUMFLEX => 13,
213
- :OPENING_SQUARE_BRACKET => 14,
214
- :CLOSING_SQUARE_BRACKET => 15,
215
- :OPENING_PARENTHESIS => 16,
216
- :CLOSING_PARENTHESIS => 17,
217
- :SPACE => 18,
218
- :UNICODE_CHARACTER_EXCLUDING_SPECIAL_CHARS_AND_SPACE_AND_DOT_AND_COLON_AND_TILDE_AND_ATMARK_AND_SOLIDUS_AND_EXCLAMATION_MARK => 19 }
219
-
220
- racc_nt_base = 20
221
-
222
- racc_use_result_var = true
223
-
224
- Racc_arg = [
225
- racc_action_table,
226
- racc_action_check,
227
- racc_action_default,
228
- racc_action_pointer,
229
- racc_goto_table,
230
- racc_goto_check,
231
- racc_goto_default,
232
- racc_goto_pointer,
233
- racc_nt_base,
234
- racc_reduce_table,
235
- racc_token_table,
236
- racc_shift_n,
237
- racc_reduce_n,
238
- racc_use_result_var ]
239
- Ractor.make_shareable(Racc_arg) if defined?(Ractor)
240
-
241
- Racc_token_to_s_table = [
242
- "$end",
243
- "error",
244
- "COMMA",
245
- "EXCLAMATION_MARK",
246
- "SOLIDUS",
247
- "COLON",
248
- "TILDE",
249
- "ATMARK",
250
- "DIGIT_NON_ZERO",
251
- "ZERO",
252
- "DOT",
253
- "SEMICOLON",
254
- "EQUAL",
255
- "CIRCUMFLEX",
256
- "OPENING_SQUARE_BRACKET",
257
- "CLOSING_SQUARE_BRACKET",
258
- "OPENING_PARENTHESIS",
259
- "CLOSING_PARENTHESIS",
260
- "SPACE",
261
- "UNICODE_CHARACTER_EXCLUDING_SPECIAL_CHARS_AND_SPACE_AND_DOT_AND_COLON_AND_TILDE_AND_ATMARK_AND_SOLIDUS_AND_EXCLAMATION_MARK",
262
- "$start",
263
- "fragment",
264
- "path",
265
- "range_zero_or_one",
266
- "range",
267
- "step",
268
- "local_path",
269
- "step_zero_or_more",
270
- "redirected_path",
271
- "offset_zero_or_one",
272
- "offset",
273
- "integer",
274
- "assertion_part_zero_or_one",
275
- "spatial_offset",
276
- "number",
277
- "spatial_offset_zero_or_one",
278
- "opening_square_bracket",
279
- "assertion",
280
- "closing_square_bracket",
281
- "digit_zero_or_more",
282
- "fractional_portion_zero_or_one",
283
- "fractional_portion",
284
- "digit",
285
- "value_csv_one_or_two",
286
- "parameter_zero_or_more",
287
- "value",
288
- "parameter",
289
- "value_no_space",
290
- "csv",
291
- "string_escaped_special_chars",
292
- "string_escaped_special_chars_excluding_space",
293
- "escaped_special_chars",
294
- "square_brackets",
295
- "parentheses",
296
- "character_escaped_special",
297
- "character_excluding_special_chars",
298
- "character_escaped_special_excluding_space",
299
- "character_excluding_special_chars_and_space",
300
- "character_excluding_special_chars_and_space_and_dot_and_colon_and_tilde_and_atmark_and_solidus_and_exclamation_mark" ]
301
- Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
302
-
303
- Racc_debug_parser = false
304
-
305
- ##### State transition tables end #####
306
-
307
- # reduce 0 omitted
308
-
309
- module_eval(<<'.,.,', 'parser.y', 5)
310
- def _reduce_1(val, _values, result)
311
- if val[1]
312
- result = CFI::Range.from_parent_and_start_and_end(val[0], *val[1])
313
- else
314
- result = CFI::Location.new(val[0])
315
- end
316
-
317
- result
318
- end
319
- .,.,
320
-
321
- # reduce 2 omitted
322
-
323
- # reduce 3 omitted
324
-
325
- module_eval(<<'.,.,', 'parser.y', 17)
326
- def _reduce_4(val, _values, result)
327
- path, _redirected_path = *val[1]
328
- path.steps.unshift val[0]
329
- result = val[1]
330
-
331
- result
332
- end
333
- .,.,
334
-
335
- module_eval(<<'.,.,', 'parser.y', 23)
336
- def _reduce_5(val, _values, result)
337
- result = [val[1], val[3]]
338
- result
339
- end
340
- .,.,
341
-
342
- module_eval(<<'.,.,', 'parser.y', 26)
343
- def _reduce_6(val, _values, result)
344
- result = [CFI::Path.new(val[0])] + val[1]
345
- result
346
- end
347
- .,.,
348
-
349
- module_eval(<<'.,.,', 'parser.y', 28)
350
- def _reduce_7(val, _values, result)
351
- result = [CFI::Path.new(val[0], val[1])]
352
- result
353
- end
354
- .,.,
355
-
356
- module_eval(<<'.,.,', 'parser.y', 31)
357
- def _reduce_8(val, _values, result)
358
- result = val[0] + [val[1]]
359
- result
360
- end
361
- .,.,
362
-
363
- module_eval(<<'.,.,', 'parser.y', 33)
364
- def _reduce_9(val, _values, result)
365
- result = [val[0]]
366
- result
367
- end
368
- .,.,
369
-
370
- module_eval(<<'.,.,', 'parser.y', 35)
371
- def _reduce_10(val, _values, result)
372
- result = []
373
- result
374
- end
375
- .,.,
376
-
377
- module_eval(<<'.,.,', 'parser.y', 38)
378
- def _reduce_11(val, _values, result)
379
- result = [CFI::Path.new([], val[1])]
380
- result
381
- end
382
- .,.,
383
-
384
- module_eval(<<'.,.,', 'parser.y', 40)
385
- def _reduce_12(val, _values, result)
386
- result = val[1]
387
- result
388
- end
389
- .,.,
390
-
391
- module_eval(<<'.,.,', 'parser.y', 44)
392
- def _reduce_13(val, _values, result)
393
- assertion = val[2] ? CFI::IDAssertion.new(val[2][0], val[2][2]) : nil
394
- result = CFI::Step.new(val[1].to_i, assertion)
395
-
396
- result
397
- end
398
- .,.,
399
-
400
- # reduce 14 omitted
401
-
402
- # reduce 15 omitted
403
-
404
- module_eval(<<'.,.,', 'parser.y', 53)
405
- def _reduce_16(val, _values, result)
406
- assertion = val[2] ? CFI::TextLocationAssertion.new(*val[2]) : nil
407
- result = CFI::CharacterOffset.new(val[1].to_i, assertion)
408
-
409
- result
410
- end
411
- .,.,
412
-
413
- module_eval(<<'.,.,', 'parser.y', 57)
414
- def _reduce_17(val, _values, result)
415
- result = CFI::TemporalSpatialOffset.new(nil, val[0][0].to_f, val[0][1].to_f, val[2])
416
- result
417
- end
418
- .,.,
419
-
420
- module_eval(<<'.,.,', 'parser.y', 60)
421
- def _reduce_18(val, _values, result)
422
- x = val[2] ? val[2][0].to_f : nil
423
- y = val[2] ? val[2][1].to_f : nil
424
- result = CFI::TemporalSpatialOffset.new(val[1].to_f, x, y, val[3])
425
-
426
- result
427
- end
428
- .,.,
429
-
430
- # reduce 19 omitted
431
-
432
- # reduce 20 omitted
433
-
434
- module_eval(<<'.,.,', 'parser.y', 69)
435
- def _reduce_21(val, _values, result)
436
- result = [val[1], val[3]]
437
- result
438
- end
439
- .,.,
440
-
441
- module_eval(<<'.,.,', 'parser.y', 72)
442
- def _reduce_22(val, _values, result)
443
- result = val[1]
444
- result
445
- end
446
- .,.,
447
-
448
- # reduce 23 omitted
449
-
450
- module_eval(<<'.,.,', 'parser.y', 76)
451
- def _reduce_24(val, _values, result)
452
- result = val.join
453
- result
454
- end
455
- .,.,
456
-
457
- module_eval(<<'.,.,', 'parser.y', 78)
458
- def _reduce_25(val, _values, result)
459
- result = val.join
460
- result
461
- end
462
- .,.,
463
-
464
- # reduce 26 omitted
465
-
466
- # reduce 27 omitted
467
-
468
- module_eval(<<'.,.,', 'parser.y', 84)
469
- def _reduce_28(val, _values, result)
470
- result = val.join
471
- result
472
- end
473
- .,.,
474
-
475
- module_eval(<<'.,.,', 'parser.y', 86)
476
- def _reduce_29(val, _values, result)
477
- result = val.join
478
- result
479
- end
480
- .,.,
481
-
482
- # reduce 30 omitted
483
-
484
- module_eval(<<'.,.,', 'parser.y', 90)
485
- def _reduce_31(val, _values, result)
486
- result = val.join
487
- result
488
- end
489
- .,.,
490
-
491
- module_eval(<<'.,.,', 'parser.y', 93)
492
- def _reduce_32(val, _values, result)
493
- result = val.join
494
- result
495
- end
496
- .,.,
497
-
498
- # reduce 33 omitted
499
-
500
- # reduce 34 omitted
501
-
502
- module_eval(<<'.,.,', 'parser.y', 98)
503
- def _reduce_35(val, _values, result)
504
- result = [val[0][0], val[0][1], val[1]]
505
- result
506
- end
507
- .,.,
508
-
509
- module_eval(<<'.,.,', 'parser.y', 100)
510
- def _reduce_36(val, _values, result)
511
- result = [nil, val[1], val[2]]
512
- result
513
- end
514
- .,.,
515
-
516
- module_eval(<<'.,.,', 'parser.y', 102)
517
- def _reduce_37(val, _values, result)
518
- result = [nil, nil, val[0].merge(val[1])]
519
- result
520
- end
521
- .,.,
522
-
523
- module_eval(<<'.,.,', 'parser.y', 105)
524
- def _reduce_38(val, _values, result)
525
- result = [val[0], val[2]]
526
- result
527
- end
528
- .,.,
529
-
530
- module_eval(<<'.,.,', 'parser.y', 107)
531
- def _reduce_39(val, _values, result)
532
- result = [val[0]]
533
- result
534
- end
535
- .,.,
536
-
537
- module_eval(<<'.,.,', 'parser.y', 110)
538
- def _reduce_40(val, _values, result)
539
- result = val[0].merge(val[1])
540
- result
541
- end
542
- .,.,
543
-
544
- module_eval(<<'.,.,', 'parser.y', 112)
545
- def _reduce_41(val, _values, result)
546
- result = val[0]
547
- result
548
- end
549
- .,.,
550
-
551
- module_eval(<<'.,.,', 'parser.y', 114)
552
- def _reduce_42(val, _values, result)
553
- result = {}
554
- result
555
- end
556
- .,.,
557
-
558
- module_eval(<<'.,.,', 'parser.y', 117)
559
- def _reduce_43(val, _values, result)
560
- result = {val[1] => val[3]}
561
- result
562
- end
563
- .,.,
564
-
565
- module_eval(<<'.,.,', 'parser.y', 120)
566
- def _reduce_44(val, _values, result)
567
- result = val[0] + [val[2]]
568
- result
569
- end
570
- .,.,
571
-
572
- module_eval(<<'.,.,', 'parser.y', 122)
573
- def _reduce_45(val, _values, result)
574
- result = [val[0]]
575
- result
576
- end
577
- .,.,
578
-
579
- module_eval(<<'.,.,', 'parser.y', 125)
580
- def _reduce_46(val, _values, result)
581
- result = val[0]
582
- result
583
- end
584
- .,.,
585
-
586
- # reduce 47 omitted
587
-
588
- module_eval(<<'.,.,', 'parser.y', 130)
589
- def _reduce_48(val, _values, result)
590
- result = val[1]
591
- result
592
- end
593
- .,.,
594
-
595
- module_eval(<<'.,.,', 'parser.y', 132)
596
- def _reduce_49(val, _values, result)
597
- result = val[1]
598
- result
599
- end
600
- .,.,
601
-
602
- module_eval(<<'.,.,', 'parser.y', 134)
603
- def _reduce_50(val, _values, result)
604
- result = val[1]
605
- result
606
- end
607
- .,.,
608
-
609
- module_eval(<<'.,.,', 'parser.y', 136)
610
- def _reduce_51(val, _values, result)
611
- result = val[1]
612
- result
613
- end
614
- .,.,
615
-
616
- module_eval(<<'.,.,', 'parser.y', 138)
617
- def _reduce_52(val, _values, result)
618
- result = val[1]
619
- result
620
- end
621
- .,.,
622
-
623
- module_eval(<<'.,.,', 'parser.y', 140)
624
- def _reduce_53(val, _values, result)
625
- result = val[1]
626
- result
627
- end
628
- .,.,
629
-
630
- # reduce 54 omitted
631
-
632
- # reduce 55 omitted
633
-
634
- module_eval(<<'.,.,', 'parser.y', 146)
635
- def _reduce_56(val, _values, result)
636
- result = val.join
637
- result
638
- end
639
- .,.,
640
-
641
- module_eval(<<'.,.,', 'parser.y', 148)
642
- def _reduce_57(val, _values, result)
643
- result = val[0]
644
- result
645
- end
646
- .,.,
647
-
648
- # reduce 58 omitted
649
-
650
- # reduce 59 omitted
651
-
652
- # reduce 60 omitted
653
-
654
- # reduce 61 omitted
655
-
656
- # reduce 62 omitted
657
-
658
- # reduce 63 omitted
659
-
660
- # reduce 64 omitted
661
-
662
- # reduce 65 omitted
663
-
664
- # reduce 66 omitted
665
-
666
- # reduce 67 omitted
667
-
668
- # reduce 68 omitted
669
-
670
- # reduce 69 omitted
671
-
672
- # reduce 70 omitted
673
-
674
- # reduce 71 omitted
675
-
676
- # reduce 72 omitted
677
-
678
- # reduce 73 omitted
679
-
680
- # reduce 74 omitted
681
-
682
- # reduce 75 omitted
683
-
684
- # reduce 76 omitted
685
-
686
- # reduce 77 omitted
687
-
688
- # reduce 78 omitted
689
-
690
- # reduce 79 omitted
691
-
692
- # reduce 80 omitted
693
-
694
- def _reduce_none(val, _values, result)
695
- val[0]
696
- end
697
-
698
- end # class Parser
699
- end # module CFI
700
- end # module EPUB