rbs 0.12.2 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +8 -4
  3. data/.gitignore +0 -1
  4. data/CHANGELOG.md +32 -0
  5. data/Gemfile +4 -0
  6. data/README.md +8 -2
  7. data/Rakefile +9 -2
  8. data/Steepfile +1 -1
  9. data/bin/annotate-with-rdoc +1 -1
  10. data/bin/setup +0 -2
  11. data/bin/test_runner.rb +15 -1
  12. data/{stdlib/builtin → core}/array.rbs +124 -120
  13. data/{stdlib/builtin → core}/basic_object.rbs +54 -54
  14. data/{stdlib/builtin → core}/binding.rbs +42 -42
  15. data/core/builtin.rbs +70 -0
  16. data/{stdlib/builtin → core}/class.rbs +33 -33
  17. data/{stdlib/builtin → core}/comparable.rbs +0 -0
  18. data/{stdlib/builtin → core}/complex.rbs +90 -90
  19. data/{stdlib/builtin → core}/constants.rbs +0 -0
  20. data/{stdlib/builtin → core}/data.rbs +0 -0
  21. data/{stdlib/builtin → core}/deprecated.rbs +0 -0
  22. data/{stdlib/builtin → core}/dir.rbs +0 -0
  23. data/{stdlib/builtin → core}/encoding.rbs +33 -33
  24. data/{stdlib/builtin → core}/enumerable.rbs +58 -52
  25. data/{stdlib/builtin → core}/enumerator.rbs +35 -35
  26. data/{stdlib/builtin → core}/errno.rbs +0 -0
  27. data/{stdlib/builtin → core}/errors.rbs +2 -2
  28. data/{stdlib/builtin → core}/exception.rbs +50 -50
  29. data/{stdlib/builtin → core}/false_class.rbs +6 -6
  30. data/{stdlib/builtin → core}/fiber.rbs +14 -14
  31. data/{stdlib/builtin → core}/fiber_error.rbs +1 -1
  32. data/{stdlib/builtin → core}/file.rbs +0 -0
  33. data/{stdlib/builtin → core}/file_test.rbs +0 -0
  34. data/{stdlib/builtin → core}/float.rbs +161 -161
  35. data/{stdlib/builtin → core}/gc.rbs +3 -3
  36. data/{stdlib/builtin → core}/hash.rbs +7 -7
  37. data/{stdlib/builtin → core}/integer.rbs +0 -0
  38. data/{stdlib/builtin → core}/io.rbs +88 -88
  39. data/{stdlib/builtin → core}/kernel.rbs +71 -153
  40. data/{stdlib/builtin → core}/marshal.rbs +0 -0
  41. data/{stdlib/builtin → core}/match_data.rbs +1 -1
  42. data/{stdlib/builtin → core}/math.rbs +0 -0
  43. data/{stdlib/builtin → core}/method.rbs +19 -19
  44. data/{stdlib/builtin → core}/module.rbs +13 -13
  45. data/{stdlib/builtin → core}/nil_class.rbs +20 -20
  46. data/{stdlib/builtin → core}/numeric.rbs +101 -101
  47. data/{stdlib/builtin → core}/object.rbs +173 -173
  48. data/{stdlib/builtin → core}/proc.rbs +91 -91
  49. data/{stdlib/builtin → core}/process.rbs +0 -0
  50. data/{stdlib/builtin → core}/random.rbs +1 -1
  51. data/{stdlib/builtin → core}/range.rbs +3 -5
  52. data/{stdlib/builtin → core}/rational.rbs +83 -83
  53. data/{stdlib/builtin → core}/rb_config.rbs +0 -0
  54. data/{stdlib/builtin → core}/regexp.rbs +0 -0
  55. data/{stdlib/builtin → core}/ruby_vm.rbs +0 -0
  56. data/{stdlib/builtin → core}/signal.rbs +7 -7
  57. data/{stdlib/builtin → core}/string.rbs +10 -10
  58. data/{stdlib/builtin → core}/string_io.rbs +8 -8
  59. data/{stdlib/builtin → core}/struct.rbs +1 -1
  60. data/{stdlib/builtin → core}/symbol.rbs +1 -1
  61. data/{stdlib/builtin → core}/thread.rbs +189 -189
  62. data/{stdlib/builtin → core}/thread_group.rbs +2 -2
  63. data/{stdlib/builtin → core}/time.rbs +0 -0
  64. data/{stdlib/builtin → core}/trace_point.rbs +0 -0
  65. data/{stdlib/builtin → core}/true_class.rbs +10 -10
  66. data/{stdlib/builtin → core}/unbound_method.rbs +0 -0
  67. data/{stdlib/builtin → core}/warning.rbs +1 -1
  68. data/docs/CONTRIBUTING.md +1 -0
  69. data/docs/repo.md +125 -0
  70. data/docs/syntax.md +50 -6
  71. data/goodcheck.yml +22 -5
  72. data/lib/rbs.rb +1 -0
  73. data/lib/rbs/ast/comment.rb +1 -1
  74. data/lib/rbs/cli.rb +117 -107
  75. data/lib/rbs/constant.rb +1 -1
  76. data/lib/rbs/constant_table.rb +9 -8
  77. data/lib/rbs/definition_builder.rb +6 -7
  78. data/lib/rbs/environment.rb +5 -1
  79. data/lib/rbs/environment_loader.rb +79 -105
  80. data/lib/rbs/namespace.rb +1 -1
  81. data/lib/rbs/parser.rb +3148 -0
  82. data/lib/rbs/parser.y +10 -3
  83. data/lib/rbs/prototype/rb.rb +38 -6
  84. data/lib/rbs/prototype/runtime.rb +17 -7
  85. data/lib/rbs/repository.rb +121 -0
  86. data/lib/rbs/test/hook.rb +2 -0
  87. data/lib/rbs/test/setup.rb +5 -3
  88. data/lib/rbs/test/setup_helper.rb +4 -4
  89. data/lib/rbs/test/tester.rb +4 -1
  90. data/lib/rbs/test/type_check.rb +12 -6
  91. data/lib/rbs/type_name.rb +3 -2
  92. data/lib/rbs/variance_calculator.rb +2 -2
  93. data/lib/rbs/vendorer.rb +38 -16
  94. data/lib/rbs/version.rb +1 -1
  95. data/lib/rbs/writer.rb +25 -15
  96. data/sig/cli.rbs +58 -0
  97. data/sig/constant.rbs +21 -0
  98. data/sig/constant_table.rbs +30 -0
  99. data/sig/declarations.rbs +2 -2
  100. data/sig/definition.rbs +2 -2
  101. data/sig/definition_builder.rbs +6 -5
  102. data/sig/environment_loader.rbs +100 -0
  103. data/sig/members.rbs +2 -2
  104. data/sig/method_types.rbs +1 -1
  105. data/sig/namespace.rbs +4 -4
  106. data/sig/parser.rbs +25 -0
  107. data/sig/polyfill.rbs +42 -0
  108. data/sig/rbs.rbs +8 -0
  109. data/sig/repository.rbs +79 -0
  110. data/sig/substitution.rbs +3 -3
  111. data/sig/typename.rbs +1 -1
  112. data/sig/types.rbs +1 -1
  113. data/sig/vendorer.rbs +44 -0
  114. data/sig/version.rbs +3 -0
  115. data/sig/writer.rbs +40 -0
  116. data/stdlib/abbrev/{abbrev.rbs → 0/abbrev.rbs} +0 -0
  117. data/stdlib/base64/{base64.rbs → 0/base64.rbs} +1 -1
  118. data/stdlib/benchmark/{benchmark.rbs → 0/benchmark.rbs} +2 -2
  119. data/stdlib/{bigdecimal/math → bigdecimal-math/0}/big_math.rbs +0 -0
  120. data/stdlib/bigdecimal/{big_decimal.rbs → 0/big_decimal.rbs} +0 -0
  121. data/stdlib/coverage/{coverage.rbs → 0/coverage.rbs} +2 -2
  122. data/stdlib/csv/{csv.rbs → 0/csv.rbs} +1 -1
  123. data/stdlib/date/{date.rbs → 0/date.rbs} +4 -4
  124. data/stdlib/date/{date_time.rbs → 0/date_time.rbs} +1 -1
  125. data/stdlib/dbm/0/dbm.rbs +277 -0
  126. data/stdlib/erb/{erb.rbs → 0/erb.rbs} +0 -0
  127. data/stdlib/fiber/{fiber.rbs → 0/fiber.rbs} +0 -0
  128. data/stdlib/find/{find.rbs → 0/find.rbs} +12 -12
  129. data/stdlib/forwardable/{forwardable.rbs → 0/forwardable.rbs} +0 -0
  130. data/stdlib/ipaddr/{ipaddr.rbs → 0/ipaddr.rbs} +0 -0
  131. data/stdlib/json/{json.rbs → 0/json.rbs} +0 -0
  132. data/stdlib/logger/{formatter.rbs → 0/formatter.rbs} +0 -0
  133. data/stdlib/logger/{log_device.rbs → 0/log_device.rbs} +1 -1
  134. data/stdlib/logger/{logger.rbs → 0/logger.rbs} +1 -1
  135. data/stdlib/logger/{period.rbs → 0/period.rbs} +0 -0
  136. data/stdlib/logger/{severity.rbs → 0/severity.rbs} +0 -0
  137. data/stdlib/mutex_m/{mutex_m.rbs → 0/mutex_m.rbs} +0 -0
  138. data/stdlib/pathname/{pathname.rbs → 0/pathname.rbs} +41 -39
  139. data/stdlib/prime/{integer-extension.rbs → 0/integer-extension.rbs} +0 -0
  140. data/stdlib/prime/{prime.rbs → 0/prime.rbs} +0 -0
  141. data/stdlib/pstore/0/pstore.rbs +287 -0
  142. data/stdlib/pty/{pty.rbs → 0/pty.rbs} +1 -1
  143. data/stdlib/securerandom/{securerandom.rbs → 0/securerandom.rbs} +0 -0
  144. data/stdlib/set/{set.rbs → 0/set.rbs} +0 -0
  145. data/stdlib/tmpdir/{tmpdir.rbs → 0/tmpdir.rbs} +12 -12
  146. data/stdlib/uri/{file.rbs → 0/file.rbs} +0 -0
  147. data/stdlib/uri/{generic.rbs → 0/generic.rbs} +2 -2
  148. data/stdlib/uri/0/http.rbs +158 -0
  149. data/stdlib/uri/0/https.rbs +108 -0
  150. data/stdlib/uri/0/ldap.rbs +224 -0
  151. data/stdlib/uri/0/ldaps.rbs +108 -0
  152. data/stdlib/zlib/{zlib.rbs → 0/zlib.rbs} +0 -0
  153. data/steep/Gemfile.lock +13 -17
  154. metadata +105 -89
  155. data/stdlib/builtin/builtin.rbs +0 -42
@@ -2,7 +2,7 @@ module RBS
2
2
  class Constant
3
3
  attr_reader :name
4
4
  attr_reader :type
5
- attr_reader :declaration
5
+ attr_reader :entry
6
6
 
7
7
  def initialize(name:, type:, entry:)
8
8
  @name = name
@@ -47,6 +47,8 @@ module RBS
47
47
 
48
48
  head, *tail = split_name(name)
49
49
 
50
+ raise unless head
51
+
50
52
  head_constant = case
51
53
  when name.absolute?
52
54
  name_to_constant(TypeName.new(name: head, namespace: Namespace.root))
@@ -57,11 +59,13 @@ module RBS
57
59
  resolve_constant_reference_inherit(head, scopes: constant_scopes(context.first.to_type_name))
58
60
  end
59
61
 
60
- if head_constant
61
- tail.inject(head_constant) do |constant, name|
62
- resolve_constant_reference_inherit name,
63
- scopes: constant_scopes(constant.name),
64
- no_object: constant.name != BuiltinNames::Object.name
62
+ tail.inject(head_constant) do |constant, name|
63
+ if constant
64
+ resolve_constant_reference_inherit(
65
+ name,
66
+ scopes: constant_scopes(constant.name),
67
+ no_object: constant.name != BuiltinNames::Object.name
68
+ )
65
69
  end
66
70
  end
67
71
  end
@@ -150,9 +154,6 @@ module RBS
150
154
  when Environment::ModuleEntry
151
155
  constant_scopes0 BuiltinNames::Module.name, scopes: scopes
152
156
  constant_scopes_module name, scopes: scopes
153
-
154
- else
155
- raise "Unexpected declaration: #{name} (#{entry.class})"
156
157
  end
157
158
 
158
159
  scopes
@@ -40,7 +40,7 @@ module RBS
40
40
  if s = super_class
41
41
  yield s
42
42
  end
43
-
43
+
44
44
  self_types&.each(&block)
45
45
  included_modules&.each(&block)
46
46
  prepended_modules&.each(&block)
@@ -303,7 +303,7 @@ module RBS
303
303
  mod_ancestors = instance_ancestors(name, building_ancestors: building_ancestors)
304
304
  ancestors.unshift(*mod_ancestors.apply(arg_types, location: entry.primary.decl.location))
305
305
  end
306
- end
306
+ end
307
307
  end
308
308
 
309
309
  ancestors.unshift(self_ancestor)
@@ -316,7 +316,7 @@ module RBS
316
316
  mod_ancestors = instance_ancestors(name, building_ancestors: building_ancestors)
317
317
  ancestors.unshift(*mod_ancestors.apply(arg_types, location: entry.primary.decl.location))
318
318
  end
319
- end
319
+ end
320
320
  end
321
321
 
322
322
  building_ancestors.pop
@@ -814,8 +814,7 @@ module RBS
814
814
 
815
815
  methods.each do |name, method|
816
816
  method.method_types.each do |method_type|
817
- case method_type
818
- when MethodType
817
+ unless name == :initialize
819
818
  result = calculator.in_method_type(method_type: method_type, variables: param_names)
820
819
 
821
820
  validate_params_with type_params, result: result do |param|
@@ -941,8 +940,8 @@ module RBS
941
940
  Definition::Method::TypeDef.new(
942
941
  type: method_type,
943
942
  member: initialize_def.member,
944
- defined_in: nil,
945
- implemented_in: nil
943
+ defined_in: initialize_def.defined_in,
944
+ implemented_in: initialize_def.implemented_in
946
945
  )
947
946
  end,
948
947
  accessibility: :public,
@@ -13,7 +13,7 @@ module RBS
13
13
  def context
14
14
  @context ||= begin
15
15
  (outer + [decl]).each.with_object([Namespace.root]) do |decl, array|
16
- first = array.first or raise
16
+ first = array.first or raise
17
17
  array.unshift(first + decl.name.to_namespace)
18
18
  end
19
19
  end
@@ -258,6 +258,8 @@ module RBS
258
258
  outer: outer_,
259
259
  prefix: prefix_
260
260
  )
261
+ else
262
+ raise
261
263
  end
262
264
  end,
263
265
  location: decl.location,
@@ -288,6 +290,8 @@ module RBS
288
290
  outer: outer_,
289
291
  prefix: prefix_
290
292
  )
293
+ else
294
+ raise
291
295
  end
292
296
  end,
293
297
  location: decl.location,
@@ -1,156 +1,130 @@
1
1
  module RBS
2
2
  class EnvironmentLoader
3
- class UnknownLibraryNameError < StandardError
4
- attr_reader :name
3
+ class UnknownLibraryError < StandardError
4
+ attr_reader :library
5
5
 
6
- def initialize(name:)
7
- @name = name
8
- super "Cannot find a library or gem: `#{name}`"
6
+ def initialize(lib:)
7
+ @library = lib
8
+
9
+ super("Cannot find type definitions for library: #{lib.name} (#{lib.version || "[nil]"})")
9
10
  end
10
11
  end
11
12
 
12
- LibraryPath = Struct.new(:name, :path, keyword_init: true)
13
- GemPath = Struct.new(:name, :version, :path, keyword_init: true)
13
+ Library = _ = Struct.new(:name, :version, keyword_init: true)
14
+
15
+ attr_reader :core_root
16
+ attr_reader :repository
14
17
 
15
- attr_reader :paths
16
- attr_reader :stdlib_root
17
- attr_reader :gem_vendor_path
18
+ attr_reader :libs
19
+ attr_reader :dirs
18
20
 
19
- STDLIB_ROOT = Pathname(__dir__) + "../../stdlib"
21
+ DEFAULT_CORE_ROOT = Pathname(_ = __dir__) + "../../core"
20
22
 
21
23
  def self.gem_sig_path(name, version)
22
- Pathname(Gem::Specification.find_by_name(name, version).gem_dir) + "sig"
24
+ spec = Gem::Specification.find_by_name(name, version)
25
+ path = Pathname(spec.gem_dir) + "sig"
26
+ if path.directory?
27
+ [spec, path]
28
+ end
23
29
  rescue Gem::MissingSpecError
24
30
  nil
25
31
  end
26
32
 
27
- def initialize(stdlib_root: STDLIB_ROOT, gem_vendor_path: nil)
28
- @stdlib_root = stdlib_root
29
- @gem_vendor_path = gem_vendor_path
30
- @paths = []
31
- @no_builtin = false
33
+ def initialize(core_root: DEFAULT_CORE_ROOT, repository: Repository.new)
34
+ @core_root = core_root
35
+ @repository = repository
36
+
37
+ @libs = []
38
+ @dirs = []
32
39
  end
33
40
 
34
- def add(path: nil, library: nil)
41
+ def add(path: nil, library: nil, version: nil)
35
42
  case
36
43
  when path
37
- @paths << path
44
+ dirs << path
38
45
  when library
39
- name, version = self.class.parse_library(library)
40
-
41
- case
42
- when !version && path = stdlib?(name)
43
- @paths << LibraryPath.new(name: name, path: path)
44
- when (path = gem?(name, version))
45
- @paths << GemPath.new(name: name, version: version, path: path)
46
- else
47
- raise UnknownLibraryNameError.new(name: library)
48
- end
46
+ libs << Library.new(name: library, version: version)
49
47
  end
50
48
  end
51
49
 
52
- def self.parse_library(lib)
53
- lib.split(/:/)
50
+ def has_library?(library:, version:)
51
+ self.class.gem_sig_path(library, version) || repository.lookup(library, version)
54
52
  end
55
53
 
56
- def stdlib?(name)
57
- if stdlib_root
58
- path = stdlib_root + name
59
- if path.directory?
60
- path
61
- end
54
+ def load(env:)
55
+ # @type var loaded: Array[[AST::Declarations::t, Pathname, source]]
56
+ loaded = []
57
+
58
+ each_decl do |decl, buf, source, path|
59
+ env << decl
60
+ loaded << [decl, path, source]
62
61
  end
62
+
63
+ loaded
63
64
  end
64
65
 
65
- def gem?(name, version)
66
- if gem_vendor_path
67
- # Try vendored RBS first
68
- gem_dir = gem_vendor_path + name
69
- if gem_dir.directory?
70
- return gem_dir
71
- end
66
+ def each_dir
67
+ if root = core_root
68
+ yield :core, root
72
69
  end
73
70
 
74
- # Try ruby gem library
75
- self.class.gem_sig_path(name, version)
76
- end
71
+ libs.each do |lib|
72
+ unless has_library?(version: lib.version, library: lib.name)
73
+ raise UnknownLibraryError.new(lib: lib)
74
+ end
77
75
 
78
- def each_signature(path, immediate: true, &block)
79
- if block_given?
80
76
  case
81
- when path.file?
82
- if path.extname == ".rbs" || immediate
83
- yield path
84
- end
85
- when path.directory?
86
- path.children.each do |child|
87
- each_signature child, immediate: false, &block
88
- end
77
+ when from_gem = self.class.gem_sig_path(lib.name, lib.version)
78
+ yield lib, from_gem[1]
79
+ when from_repo = repository.lookup(lib.name, lib.version)
80
+ yield lib, from_repo
89
81
  end
90
- else
91
- enum_for :each_signature, path, immediate: immediate
92
82
  end
93
- end
94
83
 
95
- def each_library_path
96
- paths.each do |path|
97
- case path
98
- when Pathname
99
- yield path, path
100
- when LibraryPath
101
- yield path, path.path
102
- when GemPath
103
- yield path, path.path
104
- end
84
+ dirs.each do |dir|
85
+ yield dir, dir
105
86
  end
106
87
  end
107
88
 
108
- def no_builtin!(skip = true)
109
- @no_builtin = skip
110
- self
111
- end
112
-
113
- def no_builtin?
114
- @no_builtin
115
- end
116
-
117
- def each_decl
118
- if block_given?
119
- signature_files = []
120
-
121
- unless no_builtin?
122
- each_signature(stdlib_root + "builtin") do |path|
123
- signature_files << [:stdlib, path]
124
- end
89
+ def each_file(path, immediate:, skip_hidden:, &block)
90
+ case
91
+ when path.file?
92
+ if path.extname == ".rbs" || immediate
93
+ yield path
125
94
  end
126
95
 
127
- each_library_path do |library_path, pathname|
128
- each_signature(pathname) do |path|
129
- signature_files << [library_path, path]
96
+ when path.directory?
97
+ if path.basename.to_s.start_with?("_")
98
+ if skip_hidden
99
+ unless immediate
100
+ return
101
+ end
130
102
  end
131
103
  end
132
104
 
133
- signature_files.each do |lib_path, file_path|
134
- buffer = Buffer.new(name: file_path.to_s, content: file_path.read)
135
- Parser.parse_signature(buffer).each do |decl|
136
- yield decl, buffer, file_path, lib_path
137
- end
105
+ path.each_child do |child|
106
+ each_file(child, immediate: false, skip_hidden: skip_hidden, &block)
138
107
  end
139
- else
140
- enum_for :each_decl
141
108
  end
142
109
  end
143
110
 
144
- def load(env:)
145
- loadeds = []
111
+ def each_decl
112
+ files = Set[]
146
113
 
147
- each_decl do |decl, buffer, file_path, lib_path|
148
- env.buffers.push(buffer)
149
- env << decl
150
- loadeds << [decl, file_path, lib_path]
151
- end
114
+ each_dir do |source, dir|
115
+ skip_hidden = !source.is_a?(Pathname)
116
+
117
+ each_file(dir, skip_hidden: skip_hidden, immediate: true) do |path|
118
+ next if files.include?(path)
119
+
120
+ files << path
121
+ buffer = Buffer.new(name: path.to_s, content: path.read)
152
122
 
153
- loadeds
123
+ Parser.parse_signature(buffer).each do |decl|
124
+ yield decl, buffer, source, path
125
+ end
126
+ end
127
+ end
154
128
  end
155
129
  end
156
130
  end
@@ -100,7 +100,7 @@ module RBS
100
100
 
101
101
  until current.empty?
102
102
  yield current
103
- current = _ = current.parent
103
+ current = _ = current.parent
104
104
  end
105
105
 
106
106
  yield current
@@ -0,0 +1,3148 @@
1
+ #
2
+ # DO NOT MODIFY!!!!
3
+ # This file is automatically generated by Racc 1.5.0
4
+ # from Racc grammar file "".
5
+ #
6
+
7
+ require 'racc/parser.rb'
8
+ module RBS
9
+ class Parser < Racc::Parser
10
+
11
+ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 1044)
12
+
13
+ Types = RBS::Types
14
+ Namespace = RBS::Namespace
15
+ TypeName = RBS::TypeName
16
+ Declarations = RBS::AST::Declarations
17
+ Members = RBS::AST::Members
18
+ MethodType = RBS::MethodType
19
+ Annotation = RBS::AST::Annotation
20
+
21
+ class LocatedValue
22
+ attr_reader :location
23
+ attr_reader :value
24
+
25
+ def initialize(location:, value:)
26
+ @location = location
27
+ @value = value
28
+ end
29
+ end
30
+
31
+ require "strscan"
32
+
33
+ attr_reader :input
34
+ attr_reader :buffer
35
+ attr_reader :eof_re
36
+
37
+ def initialize(type, buffer:, eof_re:)
38
+ super()
39
+ @type = type
40
+ @buffer = buffer
41
+ @input = StringScanner.new(buffer.content)
42
+ @eof_re = eof_re
43
+ @eof = false
44
+ @bound_variables_stack = []
45
+ @comments = {}
46
+ @ascii_only = buffer.content.ascii_only?
47
+ end
48
+
49
+ def start_merged_variables_scope
50
+ set = @bound_variables_stack.last&.dup || Set.new
51
+ @bound_variables_stack.push set
52
+ end
53
+
54
+ def start_new_variables_scope
55
+ @bound_variables_stack.push Set.new
56
+ end
57
+
58
+ def reset_variable_scope
59
+ @bound_variables_stack.pop
60
+ end
61
+
62
+ def insert_bound_variable(var)
63
+ @bound_variables_stack.last << var
64
+ end
65
+
66
+ def is_bound_variable?(var)
67
+ (@bound_variables_stack.last || Set.new).member?(var)
68
+ end
69
+
70
+ def self.parse_signature(input, eof_re: nil)
71
+ case input
72
+ when RBS::Buffer
73
+ buffer = input
74
+ else
75
+ buffer = RBS::Buffer.new(name: nil, content: input.to_s)
76
+ end
77
+
78
+ self.new(:SIGNATURE, buffer: buffer, eof_re: eof_re).do_parse
79
+ end
80
+
81
+ def self.parse_type(input, variables: [], eof_re: nil)
82
+ case input
83
+ when RBS::Buffer
84
+ buffer = input
85
+ else
86
+ buffer = RBS::Buffer.new(name: nil, content: input.to_s)
87
+ end
88
+
89
+ self.new(:TYPE, buffer: buffer, eof_re: eof_re).yield_self do |parser|
90
+ parser.start_new_variables_scope
91
+
92
+ variables.each do |var|
93
+ parser.insert_bound_variable var
94
+ end
95
+
96
+ parser.do_parse
97
+ ensure
98
+ parser.reset_variable_scope
99
+ end
100
+ end
101
+
102
+ def self.parse_method_type(input, variables: [], eof_re: nil)
103
+ case input
104
+ when RBS::Buffer
105
+ buffer = input
106
+ else
107
+ buffer = RBS::Buffer.new(name: nil, content: input.to_s)
108
+ end
109
+
110
+ self.new(:METHODTYPE, buffer: buffer, eof_re: eof_re).yield_self do |parser|
111
+ parser.start_new_variables_scope
112
+
113
+ variables.each do |var|
114
+ parser.insert_bound_variable var
115
+ end
116
+
117
+ parser.do_parse
118
+ ensure
119
+ parser.reset_variable_scope
120
+ end
121
+ end
122
+
123
+ def leading_comment(location)
124
+ @comments[location.start_line-1]
125
+ end
126
+
127
+ def push_comment(string, location)
128
+ if (comment = leading_comment(location)) && comment.location.start_column == location.start_column
129
+ comment.concat(string: "#{string}\n", location: location)
130
+ @comments[comment.location.end_line] = comment
131
+ else
132
+ new_comment = AST::Comment.new(string: "#{string}\n", location: location)
133
+ @comments[new_comment.location.end_line] = new_comment
134
+ end
135
+ end
136
+
137
+ def new_token(type, value = input.matched)
138
+ charpos = charpos(input)
139
+ start_index = charpos - input.matched.size
140
+ end_index = charpos
141
+
142
+ location = RBS::Location.new(buffer: buffer,
143
+ start_pos: start_index,
144
+ end_pos: end_index)
145
+
146
+ [type, LocatedValue.new(location: location, value: value)]
147
+ end
148
+
149
+ def charpos(scanner)
150
+ if @ascii_only
151
+ scanner.pos
152
+ else
153
+ scanner.charpos
154
+ end
155
+ end
156
+
157
+ def empty_params_result
158
+ [
159
+ [],
160
+ [],
161
+ nil,
162
+ [],
163
+ {},
164
+ {},
165
+ nil
166
+ ]
167
+ end
168
+
169
+ KEYWORDS = {
170
+ "class" => :kCLASS,
171
+ "type" => :kTYPE,
172
+ "def" => :kDEF,
173
+ "self" => :kSELF,
174
+ "void" => :kVOID,
175
+ "any" => :kANY,
176
+ "untyped" => :kUNTYPED,
177
+ "top" => :kTOP,
178
+ "bot" => :kBOT,
179
+ "instance" => :kINSTANCE,
180
+ "bool" => :kBOOL,
181
+ "nil" => :kNIL,
182
+ "true" => :kTRUE,
183
+ "false" => :kFALSE,
184
+ "singleton" => :kSINGLETON,
185
+ "interface" => :kINTERFACE,
186
+ "end" => :kEND,
187
+ "include" => :kINCLUDE,
188
+ "extend" => :kEXTEND,
189
+ "prepend" => :kPREPEND,
190
+ "module" => :kMODULE,
191
+ "attr_reader" => :kATTRREADER,
192
+ "attr_writer" => :kATTRWRITER,
193
+ "attr_accessor" => :kATTRACCESSOR,
194
+ "public" => :kPUBLIC,
195
+ "private" => :kPRIVATE,
196
+ "alias" => :kALIAS,
197
+ "extension" => :kEXTENSION,
198
+ "incompatible" => :kINCOMPATIBLE,
199
+ "unchecked" => :kUNCHECKED,
200
+ "overload" => :kOVERLOAD,
201
+ "out" => :kOUT,
202
+ "in" => :kIN,
203
+ }
204
+ KEYWORDS_RE = /#{Regexp.union(*KEYWORDS.keys)}\b/
205
+
206
+ PUNCTS = {
207
+ "===" => :tOPERATOR,
208
+ "==" => :tOPERATOR,
209
+ "=~" => :tOPERATOR,
210
+ "!~" => :tOPERATOR,
211
+ "!=" => :tOPERATOR,
212
+ ">=" => :tOPERATOR,
213
+ "<<" => :tOPERATOR,
214
+ "<=>" => :tOPERATOR,
215
+ "<=" => :tOPERATOR,
216
+ ">>" => :tOPERATOR,
217
+ ">" => :tOPERATOR,
218
+ "~" => :tOPERATOR,
219
+ "+@" => :tOPERATOR,
220
+ "+" => :tOPERATOR,
221
+ "[]=" => :tOPERATOR,
222
+ "[]" => :tOPERATOR,
223
+ "::" => :kCOLON2,
224
+ ":" => :kCOLON,
225
+ "(" => :kLPAREN,
226
+ ")" => :kRPAREN,
227
+ "[" => :kLBRACKET,
228
+ "]" => :kRBRACKET,
229
+ "{" => :kLBRACE,
230
+ "}" => :kRBRACE,
231
+ "," => :kCOMMA,
232
+ "|" => :kBAR,
233
+ "&" => :kAMP,
234
+ "^" => :kHAT,
235
+ "->" => :kARROW,
236
+ "=>" => :kFATARROW,
237
+ "=" => :kEQ,
238
+ "?" => :kQUESTION,
239
+ "!" => :kEXCLAMATION,
240
+ "**" => :kSTAR2,
241
+ "*" => :kSTAR,
242
+ "..." => :kDOT3,
243
+ "." => :kDOT,
244
+ "<" => :kLT,
245
+ "-@" => :tOPERATOR,
246
+ "-" => :tOPERATOR,
247
+ "/" => :tOPERATOR,
248
+ "`" => :tOPERATOR,
249
+ "%" => :tOPERATOR,
250
+ }
251
+ PUNCTS_RE = Regexp.union(*PUNCTS.keys)
252
+
253
+ ANNOTATION_RE = Regexp.union(/%a\{.*?\}/,
254
+ /%a\[.*?\]/,
255
+ /%a\(.*?\)/,
256
+ /%a\<.*?\>/,
257
+ /%a\|.*?\|/)
258
+ def next_token
259
+ if @type
260
+ type = @type
261
+ @type = nil
262
+ return [:"type_#{type}", nil]
263
+ end
264
+
265
+ return if @eof
266
+
267
+ while true
268
+ return if input.eos?
269
+
270
+ case
271
+ when input.scan(/\s+/)
272
+ # skip
273
+ when input.scan(/#(( *)|( ?(?<string>.*)))\n/)
274
+ charpos = charpos(input)
275
+ start_index = charpos - input.matched.size
276
+ end_index = charpos-1
277
+
278
+ location = RBS::Location.new(buffer: buffer,
279
+ start_pos: start_index,
280
+ end_pos: end_index)
281
+
282
+ push_comment input[:string] || "", location
283
+ else
284
+ break
285
+ end
286
+ end
287
+
288
+ case
289
+ when eof_re && input.scan(eof_re)
290
+ @eof = true
291
+ [:tEOF, input.matched]
292
+ when input.scan(/`[a-zA-Z_]\w*`/)
293
+ s = input.matched.yield_self {|s| s[1, s.length-2] }
294
+ new_token(:tQUOTEDIDENT, s)
295
+ when input.scan(/`(\\`|[^` :])+`/)
296
+ s = input.matched.yield_self {|s| s[1, s.length-2] }.gsub(/\\`/, '`')
297
+ new_token(:tQUOTEDMETHOD, s)
298
+ when input.scan(ANNOTATION_RE)
299
+ s = input.matched.yield_self {|s| s[3, s.length-4] }.strip
300
+ new_token(:tANNOTATION, s)
301
+ when input.scan(/self\?/)
302
+ new_token(:kSELFQ, "self?")
303
+ when input.scan(/(([a-zA-Z]\w*)|(_\w+))=/)
304
+ new_token(:tWRITE_ATTR)
305
+ when input.scan(KEYWORDS_RE)
306
+ new_token(KEYWORDS[input.matched], input.matched.to_sym)
307
+ when input.scan(/:((@{,2}|\$)?\w+(\?|\!)?|\+|\-)\b?/)
308
+ s = input.matched.yield_self {|s| s[1, s.length] }.to_sym
309
+ new_token(:tSYMBOL, s)
310
+ when input.scan(/[+-]?\d[\d_]*/)
311
+ new_token(:tINTEGER, input.matched.to_i)
312
+ when input.scan(PUNCTS_RE)
313
+ new_token(PUNCTS[input.matched])
314
+ when input.scan(/(::)?([A-Z]\w*::)+/)
315
+ new_token(:tNAMESPACE)
316
+ when input.scan(/[a-z_]\w*:/)
317
+ new_token(:tLKEYWORD, input.matched.chop.to_sym)
318
+ when input.scan(/[a-z_]\w*[?!]:/)
319
+ new_token(:tLKEYWORD_Q_E, input.matched.chop.to_sym)
320
+ when input.scan(/[A-Z]\w*:/)
321
+ new_token(:tUKEYWORD, input.matched.chop.to_sym)
322
+ when input.scan(/[A-Z]\w*[?!]:/)
323
+ new_token(:tUKEYWORD_Q_E, input.matched.chop.to_sym)
324
+ when input.scan(/\$[A-Za-z_]\w*/)
325
+ new_token(:tGLOBALIDENT)
326
+ when input.scan(/@[a-zA-Z_]\w*/)
327
+ new_token(:tIVAR, input.matched.to_sym)
328
+ when input.scan(/@@[a-zA-Z_]\w*/)
329
+ new_token(:tCLASSVAR, input.matched.to_sym)
330
+ when input.scan(/_[a-zA-Z]\w*\b/)
331
+ new_token(:tINTERFACEIDENT)
332
+ when input.scan(/[A-Z]\w*\b/)
333
+ new_token(:tUIDENT)
334
+ when input.scan(/[a-z_]\w*\b/)
335
+ new_token(:tLIDENT)
336
+ when input.scan(/"(\\"|[^"])*"/)
337
+ s = input.matched.yield_self {|s| s[1, s.length - 2] }.gsub(/\\"/, '"')
338
+ new_token(:tSTRING, s)
339
+ when input.scan(/'(\\'|[^'])*'/)
340
+ s = input.matched.yield_self {|s| s[1, s.length - 2] }.gsub(/\\'/, "'")
341
+ new_token(:tSTRING, s)
342
+ else
343
+ raise "Unexpected token: #{input.peek(10)}..."
344
+ end
345
+ end
346
+
347
+ def on_error(token_id, error_value, value_stack)
348
+ raise SyntaxError.new(token_str: token_to_str(token_id), error_value: error_value, value_stack: value_stack)
349
+ end
350
+
351
+ class SyntaxError < StandardError
352
+ attr_reader :token_str, :error_value, :value_stack
353
+
354
+ def initialize(token_str:, error_value:, value_stack: nil)
355
+ @token_str = token_str
356
+ @error_value = error_value
357
+ @value_stack = value_stack
358
+
359
+ super "parse error on value: #{error_value.inspect} (#{token_str})"
360
+ end
361
+ end
362
+
363
+ class SemanticsError < StandardError
364
+ attr_reader :subject, :location, :original_message
365
+
366
+ def initialize(message, subject:, location:)
367
+ @subject = subject
368
+ @location = location
369
+ @original_message = message
370
+
371
+ super "parse error on #{location}: #{message}"
372
+ end
373
+ end
374
+
375
+ ...end parser.y/module_eval...
376
+ ##### State transition tables begin ###
377
+
378
+ clist = [
379
+ '341,342,33,343,406,76,5,33,33,380,354,37,50,33,33,340,42,379,352,2,3',
380
+ '4,209,210,211,212,213,214,215,216,220,33,217,208,218,219,104,115,105',
381
+ '106,107,121,33,32,51,336,330,331,32,32,334,332,335,301,32,32,33,333',
382
+ '120,108,109,110,112,114,113,329,338,339,111,116,118,196,32,199,87,122',
383
+ '123,119,124,341,342,33,343,32,58,59,60,61,279,280,43,33,33,33,340,231',
384
+ '50,32,200,88,197,209,210,211,212,213,214,215,216,220,361,217,208,218',
385
+ '219,104,115,105,106,107,121,33,32,48,336,330,331,50,51,334,332,335,32',
386
+ '32,32,88,333,120,108,109,110,112,114,113,329,338,339,111,116,118,341',
387
+ '342,320,343,122,123,119,124,66,51,158,39,32,40,41,340,157,83,324,395',
388
+ '89,316,209,210,211,212,213,214,215,216,355,276,217,208,218,219,104,115',
389
+ '105,106,107,121,39,88,88,336,330,331,40,41,334,332,335,40,41,144,277',
390
+ '333,120,108,109,110,112,114,113,329,338,339,111,116,118,164,397,396',
391
+ '145,122,123,119,124,341,342,146,343,147,58,59,60,61,63,64,148,65,272',
392
+ '273,340,76,88,88,88,40,41,209,210,211,212,213,214,215,216,220,156,217',
393
+ '208,218,219,104,115,105,106,107,121,40,41,159,336,330,331,40,41,334',
394
+ '332,335,40,41,387,388,333,120,108,109,110,112,114,113,329,338,339,111',
395
+ '116,118,341,342,161,343,122,123,119,124,163,58,59,60,61,40,41,340,55',
396
+ '54,56,40,41,41,209,210,211,212,213,214,215,216,220,166,217,208,218,219',
397
+ '104,115,105,106,107,121,40,41,158,336,330,331,40,41,334,332,335,40,41',
398
+ '40,41,333,120,108,109,110,112,114,113,329,338,339,111,116,118,40,41',
399
+ '40,41,122,123,119,124,341,342,-107,343,-108,58,59,60,61,58,59,60,61',
400
+ '40,41,340,55,54,56,40,41,-109,209,210,211,212,213,214,215,216,220,-110',
401
+ '217,208,218,219,104,115,105,106,107,121,40,41,-111,336,330,331,40,41',
402
+ '334,332,335,365,366,40,41,333,120,108,109,110,112,114,113,329,338,339',
403
+ '111,116,118,341,342,-112,343,122,123,119,124,40,41,-113,-114,-115,-116',
404
+ '-117,340,48,-132,171,172,173,174,209,210,211,212,213,214,215,216,220',
405
+ '175,217,208,218,219,104,115,105,106,107,121,176,177,42,336,330,331,201',
406
+ '234,334,332,335,235,237,238,239,333,120,108,109,110,112,114,113,329',
407
+ '338,339,111,116,118,241,83,245,245,122,123,119,124,341,342,245,343,251',
408
+ '58,59,60,61,254,42,257,259,263,265,340,267,268,42,270,307,309,209,210',
409
+ '211,212,213,214,215,216,220,263,217,208,218,219,104,115,105,106,107',
410
+ '121,311,267,321,336,330,331,322,323,334,332,335,359,364,364,364,333',
411
+ '120,108,109,110,112,114,113,329,338,339,111,116,118,371,372,373,374',
412
+ '122,123,119,124,33,375,377,58,59,60,61,378,381,382,22,23,21,392,26,-217',
413
+ '25,401,30,402,93,94,95,96,97,98,99,100,117,16,101,92,102,103,104,115',
414
+ '105,106,107,121,403,32,406,407,408,28,409,139,,140,142,,,,,,120,108',
415
+ '109,110,112,114,113,,,,111,116,118,,,,,122,123,119,124,33,,,58,59,60',
416
+ '61,,,,22,23,21,,26,,25,,30,,93,94,95,96,97,98,99,100,117,16,101,92,102',
417
+ '103,104,115,105,106,107,121,,32,,,,28,,,,,,,,,,,120,108,109,110,112',
418
+ '114,113,,,,111,116,118,,,,,122,123,119,124,33,,,58,59,60,61,,,,22,23',
419
+ '21,,26,-217,25,,30,,93,94,95,96,97,98,99,100,117,16,101,92,102,103,104',
420
+ '115,105,106,107,121,,32,,,,28,,207,,,142,,,,,,120,108,109,110,112,114',
421
+ '113,,,,111,116,118,,,,,122,123,119,124,33,,,58,59,60,61,,,,22,23,21',
422
+ ',26,-217,25,,30,,93,94,95,96,97,98,99,100,117,16,101,92,102,103,104',
423
+ '115,105,106,107,121,,32,,,,28,,207,,,142,,,,,,120,108,109,110,112,114',
424
+ '113,,,,111,116,118,,,,,122,123,119,124,33,,,58,59,60,61,,,,22,23,21',
425
+ ',26,-217,25,,30,,93,94,95,96,97,98,99,100,117,16,101,92,102,103,104',
426
+ '115,105,106,107,121,,32,,,,28,,139,,140,142,,,,,,120,108,109,110,112',
427
+ '114,113,,,,111,116,118,,,,,122,123,119,124,33,,,58,59,60,61,,,,22,23',
428
+ '21,,26,-217,25,,30,,93,94,95,96,97,98,99,100,117,16,101,92,102,103,104',
429
+ '115,105,106,107,121,-4,32,-239,,33,28,80,139,-239,140,142,,,76,,,120',
430
+ '108,109,110,112,114,113,,,,111,116,118,,,,,122,123,119,124,,,,,,,,,32',
431
+ ',,,,,,,,,,168,33,169,,58,59,60,61,,,,22,23,21,,26,-217,25,,30,39,93',
432
+ '94,95,96,97,98,99,100,117,16,101,92,102,103,104,115,105,106,107,121',
433
+ '168,32,169,40,41,28,,139,,140,142,,,,,,120,108,109,110,112,114,113,',
434
+ ',170,111,116,118,58,59,60,61,122,123,119,124,,,,,,,,40,41,209,210,211',
435
+ '212,213,214,215,216,220,,217,208,218,219,104,115,105,106,107,121,170',
436
+ ',,,,,,207,,,142,,,,,,120,108,109,110,112,114,113,168,,169,111,116,118',
437
+ '58,59,60,61,122,123,119,124,,,,,,,,,,209,210,211,212,213,214,215,216',
438
+ '220,,217,208,218,219,104,115,105,106,107,121,,40,41,,,,,207,,,142,,',
439
+ ',,,120,108,109,110,112,114,113,170,,,111,116,118,58,59,60,61,122,123',
440
+ '119,124,,,,,,,,,,209,210,211,212,213,214,215,216,220,,217,208,218,219',
441
+ '104,115,105,106,107,121,168,,169,168,152,169,168,155,169,153,,,,,,,120',
442
+ '108,109,110,112,114,113,,,,111,116,118,154,,,,122,123,119,124,,,,151',
443
+ ',,,40,41,,40,41,,40,41,-239,,33,,80,,-239,,,296,297,76,,,170,,,170,',
444
+ ',170,,-239,,33,,80,,-239,,298,296,297,76,,,,,,293,292,,,32,-239,,33',
445
+ ',80,,-239,,298,296,297,76,,,,284,,293,292,,,32,-239,,33,,80,,-239,,298',
446
+ '296,297,76,,,,312,,293,292,,,32,,,,,,,,,298,,,,,,,360,,293,292,,33,32',
447
+ ',,,,,,,,22,23,21,,26,,25,308,30,,8,12,19,20,9,10,13,14,15,16,17,18,11',
448
+ '27,,,33,,,,,32,,,,28,22,23,21,,26,,25,,30,,8,12,19,20,9,10,13,14,15',
449
+ '16,17,18,11,27,,,33,,,,,32,,,,28,22,23,21,,26,,25,,30,,8,12,19,20,9',
450
+ '10,13,14,15,16,17,18,11,27,,,33,,,,,32,,,,28,22,23,21,,26,,25,,30,,8',
451
+ '12,19,20,9,10,13,14,15,16,17,18,11,27,,,33,,,,,32,,,,28,22,23,21,,26',
452
+ ',25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27,,,33,,,,,32,,,,28,22',
453
+ '23,21,,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27,,,33,,,,',
454
+ '32,,,,28,22,23,21,,26,,25,45,30,,8,12,19,20,9,10,13,14,15,16,17,18,11',
455
+ '27,,,33,,,,,32,,,,28,22,23,21,,26,,25,,30,,8,12,19,20,9,10,13,14,15',
456
+ '16,17,18,11,27,,,33,,,,,32,,,,28,22,23,21,,26,,25,,30,,8,12,19,20,9',
457
+ '10,13,14,15,16,17,18,11,27,,,33,,,,,32,,,,28,22,23,21,,26,,25,,30,,8',
458
+ '12,19,20,9,10,13,14,15,16,17,18,11,27,,,33,,,,,32,,,,28,22,23,21,,26',
459
+ ',25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27,,,33,,,,,32,,,,28,22',
460
+ '23,21,,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27,,,33,,,,',
461
+ '32,,,,28,22,23,21,,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11',
462
+ '27,,,33,,,,,32,,,,28,22,23,21,,26,,25,,30,,8,12,19,20,9,10,13,14,15',
463
+ '16,17,18,11,27,,,33,,,,,32,,,,28,22,23,21,,26,,25,,30,,8,12,19,20,9',
464
+ '10,13,14,15,16,17,18,11,27,,,33,,,,,32,,,,28,22,23,21,,26,,25,,30,,8',
465
+ '12,19,20,9,10,13,14,15,16,17,18,11,27,,,33,,,,,32,,,,28,22,23,21,,26',
466
+ ',25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27,,,33,,,,,32,,,,28,22',
467
+ '23,21,,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27,,,33,,,,',
468
+ '32,,,,28,22,23,21,,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11',
469
+ '27,,,33,,,,,32,,,,28,22,23,21,,26,,25,,30,,8,12,19,20,9,10,13,14,15',
470
+ '16,17,18,11,27,,,33,,,,,32,,,,28,22,23,21,,26,,25,,30,,8,12,19,20,9',
471
+ '10,13,14,15,16,17,18,11,27,,,33,,,,,32,,,,28,22,23,21,,26,,25,,30,,8',
472
+ '12,19,20,9,10,13,14,15,16,17,18,11,27,,,33,,,,,32,,,,28,22,23,21,,26',
473
+ ',25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27,,,33,,,,,32,,,,28,22',
474
+ '23,21,,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27,,,33,,,,',
475
+ '32,,,,28,22,23,21,,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11',
476
+ '27,,,33,,,,,32,,,,28,22,23,21,,26,,25,,30,,8,12,19,20,9,10,13,14,15',
477
+ '16,17,18,11,27,,,33,,,,,32,,,,28,22,23,21,,26,,25,,30,,8,12,19,20,9',
478
+ '10,13,14,15,16,17,18,11,27,,,33,,,,,32,,,,28,22,23,21,,26,,25,,30,,8',
479
+ '12,19,20,9,10,13,14,15,16,17,18,11,27,,,33,,,,,32,,,,28,22,23,21,,26',
480
+ ',25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27,,,33,,,,,32,,,,28,22',
481
+ '23,21,,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27,,,33,,,,',
482
+ '32,,,,28,22,23,21,,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11',
483
+ '27,,,33,,,,,32,,,,28,22,23,21,,26,,25,,30,,8,12,19,20,9,10,13,14,15',
484
+ '16,17,18,11,27,,,33,,,,,32,,,,28,22,23,21,,26,,25,,30,,8,12,19,20,9',
485
+ '10,13,14,15,16,17,18,11,27,,,33,,,,,32,,,,28,22,23,21,,26,,25,,30,,8',
486
+ '12,19,20,9,10,13,14,15,16,17,18,11,27,,,33,,,,,32,,,,28,22,23,21,,26',
487
+ ',25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27,,,33,,,,,32,,,,28,22',
488
+ '23,21,,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27,152,,,155',
489
+ ',153,,32,320,,,28,,,,,,,,,,,,,,154,,316,317,313,314,315,,,,318,151' ]
490
+ racc_action_table = arr = ::Array.new(2819, nil)
491
+ idx = 0
492
+ clist.each do |str|
493
+ str.split(',', -1).each do |i|
494
+ arr[idx] = i.to_i unless i.empty?
495
+ idx += 1
496
+ end
497
+ end
498
+
499
+ clist = [
500
+ '375,375,317,375,409,269,1,259,267,364,319,5,28,265,231,375,7,364,319',
501
+ '0,0,0,375,375,375,375,375,375,375,375,375,318,375,375,375,375,375,375',
502
+ '375,375,375,375,316,317,28,375,375,375,259,267,375,375,375,269,265,231',
503
+ '190,375,375,375,375,375,375,375,375,375,375,375,375,375,375,160,318',
504
+ '162,46,375,375,375,375,314,314,188,314,316,314,314,314,314,262,262,24',
505
+ '189,187,48,314,189,196,190,162,46,160,314,314,314,314,314,314,314,314',
506
+ '314,326,314,314,314,314,314,314,314,314,314,314,155,188,27,314,314,314',
507
+ '237,196,314,314,314,189,187,48,326,314,314,314,314,314,314,314,314,314',
508
+ '314,314,314,314,314,320,320,306,320,314,314,314,314,32,237,79,35,155',
509
+ '6,6,320,79,36,300,383,47,306,320,320,320,320,320,320,320,320,320,260',
510
+ '320,320,320,320,320,320,320,320,320,320,6,300,383,320,320,320,47,47',
511
+ '320,320,320,252,252,52,260,320,320,320,320,320,320,320,320,320,320,320',
512
+ '320,320,320,86,385,384,53,320,320,320,320,386,386,54,386,55,386,386',
513
+ '386,386,31,31,56,31,257,257,386,76,86,385,384,149,149,386,386,386,386',
514
+ '386,386,386,386,386,78,386,386,386,386,386,386,386,386,386,386,391,391',
515
+ '80,386,386,386,393,393,386,386,386,394,394,374,374,386,386,386,386,386',
516
+ '386,386,386,386,386,386,386,386,386,408,408,82,408,386,386,386,386,83',
517
+ '30,30,30,30,369,369,408,30,30,30,367,367,84,408,408,408,408,408,408',
518
+ '408,408,408,90,408,408,408,408,408,408,408,408,408,408,184,184,91,408',
519
+ '408,408,185,185,408,408,408,186,186,362,362,408,408,408,408,408,408',
520
+ '408,408,408,408,408,408,408,408,165,165,358,358,408,408,408,408,315',
521
+ '315,92,315,93,315,315,315,315,145,145,145,145,192,192,315,145,145,145',
522
+ '193,193,94,315,315,315,315,315,315,315,315,315,95,315,315,315,315,315',
523
+ '315,315,315,315,315,194,194,96,315,315,315,357,357,315,315,315,337,337',
524
+ '390,390,315,315,315,315,315,315,315,315,315,315,315,315,315,315,356',
525
+ '356,97,356,315,315,315,315,44,44,98,99,100,101,102,356,103,117,127,128',
526
+ '129,131,356,356,356,356,356,356,356,356,356,133,356,356,356,356,356',
527
+ '356,356,356,356,356,136,137,143,356,356,356,172,191,356,356,356,195',
528
+ '197,198,200,356,356,356,356,356,356,356,356,356,356,356,356,356,356',
529
+ '205,228,229,230,356,356,356,356,313,313,232,313,233,313,313,313,313',
530
+ '236,240,243,244,245,246,313,247,249,253,255,271,275,313,313,313,313',
531
+ '313,313,313,313,313,277,313,313,313,313,313,313,313,313,313,313,278',
532
+ '282,296,313,313,313,297,298,313,313,313,323,328,346,348,313,313,313',
533
+ '313,313,313,313,313,313,313,313,313,313,313,349,350,351,353,313,313',
534
+ '313,313,174,355,359,174,174,174,174,363,368,370,174,174,174,380,174',
535
+ '174,174,387,174,388,174,174,174,174,174,174,174,174,174,174,174,174',
536
+ '174,174,174,174,174,174,174,174,389,174,398,400,403,174,405,174,,174',
537
+ '174,,,,,,174,174,174,174,174,174,174,,,,174,174,174,,,,,174,174,174',
538
+ '174,139,,,139,139,139,139,,,,139,139,139,,139,,139,,139,,139,139,139',
539
+ '139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139',
540
+ ',139,,,,139,,,,,,,,,,,139,139,139,139,139,139,139,,,,139,139,139,,,',
541
+ ',139,139,139,139,241,,,241,241,241,241,,,,241,241,241,,241,241,241,',
542
+ '241,,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241',
543
+ '241,241,241,241,,241,,,,241,,241,,,241,,,,,,241,241,241,241,241,241',
544
+ '241,,,,241,241,241,,,,,241,241,241,241,175,,,175,175,175,175,,,,175',
545
+ '175,175,,175,175,175,,175,,175,175,175,175,175,175,175,175,175,175,175',
546
+ '175,175,175,175,175,175,175,175,175,,175,,,,175,,175,,,175,,,,,,175',
547
+ '175,175,175,175,175,175,,,,175,175,175,,,,,175,175,175,175,161,,,161',
548
+ '161,161,161,,,,161,161,161,,161,161,161,,161,,161,161,161,161,161,161',
549
+ '161,161,161,161,161,161,161,161,161,161,161,161,161,161,,161,,,,161',
550
+ ',161,,161,161,,,,,,161,161,161,161,161,161,161,,,,161,161,161,,,,,161',
551
+ '161,161,161,173,,,173,173,173,173,,,,173,173,173,,173,173,173,,173,',
552
+ '173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173',
553
+ '173,173,173,34,173,34,,34,173,34,173,34,173,173,,,34,,,173,173,173,173',
554
+ '173,173,173,,,,173,173,173,,,,,173,173,173,173,,,,,,,,,34,,,,,,,,,,',
555
+ '180,50,180,,50,50,50,50,,,,50,50,50,,50,50,50,,50,34,50,50,50,50,50',
556
+ '50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,181,50,181,180,180,50,',
557
+ '50,,50,50,,,,,,50,50,50,50,50,50,50,,,180,50,50,50,177,177,177,177,50',
558
+ '50,50,50,,,,,,,,181,181,177,177,177,177,177,177,177,177,177,,177,177',
559
+ '177,177,177,177,177,177,177,177,181,,,,,,,177,,,177,,,,,,177,177,177',
560
+ '177,177,177,177,224,,224,177,177,177,176,176,176,176,177,177,177,177',
561
+ ',,,,,,,,,176,176,176,176,176,176,176,176,176,,176,176,176,176,176,176',
562
+ '176,176,176,176,,224,224,,,,,176,,,176,,,,,,176,176,176,176,176,176',
563
+ '176,224,,,176,176,176,207,207,207,207,176,176,176,176,,,,,,,,,,207,207',
564
+ '207,207,207,207,207,207,207,,207,207,207,207,207,207,207,207,207,207',
565
+ '125,,125,178,77,178,182,77,182,77,,,,,,,207,207,207,207,207,207,207',
566
+ ',,,207,207,207,77,,,,207,207,207,207,,,,77,,,,125,125,,178,178,,182',
567
+ '182,266,,266,,266,,266,,,266,266,266,,,125,,,178,,,182,,281,,281,,281',
568
+ ',281,,266,281,281,281,,,,,,266,266,,,266,325,,325,,325,,325,,281,325',
569
+ '325,325,,,,266,,281,281,,,281,274,,274,,274,,274,,325,274,274,274,,',
570
+ ',281,,325,325,,,325,,,,,,,,,274,,,,,,,325,,274,274,,156,274,,,,,,,,',
571
+ '156,156,156,,156,,156,274,156,,156,156,156,156,156,156,156,156,156,156',
572
+ '156,156,156,156,,,26,,,,,156,,,,156,26,26,26,,26,,26,,26,,26,26,26,26',
573
+ '26,26,26,26,26,26,26,26,26,26,,,40,,,,,26,,,,26,40,40,40,,40,,40,,40',
574
+ ',40,40,40,40,40,40,40,40,40,40,40,40,40,40,,,41,,,,,40,,,,40,41,41,41',
575
+ ',41,,41,,41,,41,41,41,41,41,41,41,41,41,41,41,41,41,41,,,43,,,,,41,',
576
+ ',,41,43,43,43,,43,,43,,43,,43,43,43,43,43,43,43,43,43,43,43,43,43,43',
577
+ ',,88,,,,,43,,,,43,88,88,88,,88,,88,,88,,88,88,88,88,88,88,88,88,88,88',
578
+ '88,88,88,88,,,25,,,,,88,,,,88,25,25,25,,25,,25,25,25,,25,25,25,25,25',
579
+ '25,25,25,25,25,25,25,25,25,,,235,,,,,25,,,,25,235,235,235,,235,,235',
580
+ ',235,,235,235,235,235,235,235,235,235,235,235,235,235,235,235,,,268',
581
+ ',,,,235,,,,235,268,268,268,,268,,268,,268,,268,268,268,268,268,268,268',
582
+ '268,268,268,268,268,268,268,,,140,,,,,268,,,,268,140,140,140,,140,,140',
583
+ ',140,,140,140,140,140,140,140,140,140,140,140,140,140,140,140,,,141',
584
+ ',,,,140,,,,140,141,141,141,,141,,141,,141,,141,141,141,141,141,141,141',
585
+ '141,141,141,141,141,141,141,,,142,,,,,141,,,,141,142,142,142,,142,,142',
586
+ ',142,,142,142,142,142,142,142,142,142,142,142,142,142,142,142,,,234',
587
+ ',,,,142,,,,142,234,234,234,,234,,234,,234,,234,234,234,234,234,234,234',
588
+ '234,234,234,234,234,234,234,,,146,,,,,234,,,,234,146,146,146,,146,,146',
589
+ ',146,,146,146,146,146,146,146,146,146,146,146,146,146,146,146,,,147',
590
+ ',,,,146,,,,146,147,147,147,,147,,147,,147,,147,147,147,147,147,147,147',
591
+ '147,147,147,147,147,147,147,,,57,,,,,147,,,,147,57,57,57,,57,,57,,57',
592
+ ',57,57,57,57,57,57,57,57,57,57,57,57,57,57,,,309,,,,,57,,,,57,309,309',
593
+ '309,,309,,309,,309,,309,309,309,309,309,309,309,309,309,309,309,309',
594
+ '309,309,,,321,,,,,309,,,,309,321,321,321,,321,,321,,321,,321,321,321',
595
+ '321,321,321,321,321,321,321,321,321,321,321,,,322,,,,,321,,,,321,322',
596
+ '322,322,,322,,322,,322,,322,322,322,322,322,322,322,322,322,322,322',
597
+ '322,322,322,,,148,,,,,322,,,,322,148,148,148,,148,,148,,148,,148,148',
598
+ '148,148,148,148,148,148,148,148,148,148,148,148,,,327,,,,,148,,,,148',
599
+ '327,327,327,,327,,327,,327,,327,327,327,327,327,327,327,327,327,327',
600
+ '327,327,327,327,,,201,,,,,327,,,,327,201,201,201,,201,,201,,201,,201',
601
+ '201,201,201,201,201,201,201,201,201,201,201,201,201,,,2,,,,,201,,,,201',
602
+ '2,2,2,,2,,2,,2,,2,2,2,2,2,2,2,2,2,2,2,2,2,2,,,345,,,,,2,,,,2,345,345',
603
+ '345,,345,,345,,345,,345,345,345,345,345,345,345,345,345,345,345,345',
604
+ '345,345,,,347,,,,,345,,,,345,347,347,347,,347,,347,,347,,347,347,347',
605
+ '347,347,347,347,347,347,347,347,347,347,347,,,157,,,,,347,,,,347,157',
606
+ '157,157,,157,,157,,157,,157,157,157,157,157,157,157,157,157,157,157',
607
+ '157,157,157,,,159,,,,,157,,,,157,159,159,159,,159,,159,,159,,159,159',
608
+ '159,159,159,159,159,159,159,159,159,159,159,159,,,51,,,,,159,,,,159',
609
+ '51,51,51,,51,,51,,51,,51,51,51,51,51,51,51,51,51,51,51,51,51,51,,,371',
610
+ ',,,,51,,,,51,371,371,371,,371,,371,,371,,371,371,371,371,371,371,371',
611
+ '371,371,371,371,371,371,371,,,372,,,,,371,,,,371,372,372,372,,372,,372',
612
+ ',372,,372,372,372,372,372,372,372,372,372,372,372,372,372,372,,,373',
613
+ ',,,,372,,,,372,373,373,373,,373,,373,,373,,373,373,373,373,373,373,373',
614
+ '373,373,373,373,373,373,373,,,377,,,,,373,,,,373,377,377,377,,377,,377',
615
+ ',377,,377,377,377,377,377,377,377,377,377,377,377,377,377,377,,,378',
616
+ ',,,,377,,,,377,378,378,378,,378,,378,,378,,378,378,378,378,378,378,378',
617
+ '378,378,378,378,378,378,378,,,381,,,,,378,,,,378,381,381,381,,381,,381',
618
+ ',381,,381,381,381,381,381,381,381,381,381,381,381,381,381,381,,,382',
619
+ ',,,,381,,,,381,382,382,382,,382,,382,,382,,382,382,382,382,382,382,382',
620
+ '382,382,382,382,382,382,382,,,179,,,,,382,,,,382,179,179,179,,179,,179',
621
+ ',179,,179,179,179,179,179,179,179,179,179,179,179,179,179,179,283,,',
622
+ '283,,283,,179,283,,,179,,,,,,,,,,,,,,283,,283,283,283,283,283,,,,283',
623
+ '283' ]
624
+ racc_action_check = arr = ::Array.new(2819, nil)
625
+ idx = 0
626
+ clist.each do |str|
627
+ str.split(',', -1).each do |i|
628
+ arr[idx] = i.to_i unless i.empty?
629
+ idx += 1
630
+ end
631
+ end
632
+
633
+ racc_action_pointer = [
634
+ -54, 6, 2276, nil, nil, 11, 116, -35, nil, nil,
635
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
636
+ nil, nil, nil, nil, 70, 1700, 1520, 105, -6, nil,
637
+ 302, 236, 154, nil, 1033, 85, 147, nil, nil, nil,
638
+ 1556, 1592, nil, 1628, 411, nil, 53, 151, 89, nil,
639
+ 1086, 2456, 182, 178, 176, 178, 185, 2024, nil, nil,
640
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
641
+ nil, nil, nil, nil, nil, nil, 232, 1297, 216, 158,
642
+ 229, nil, 284, 306, 273, nil, 200, nil, 1664, nil,
643
+ 312, 342, 337, 339, 356, 366, 379, 408, 416, 417,
644
+ 418, 419, 420, 448, nil, nil, nil, nil, nil, nil,
645
+ nil, nil, nil, nil, nil, nil, nil, 423, nil, nil,
646
+ nil, nil, nil, nil, nil, 1325, nil, 424, 450, 424,
647
+ nil, 425, nil, 435, nil, nil, 446, 447, nil, 681,
648
+ 1808, 1844, 1880, 443, nil, 381, 1952, 1988, 2168, 202,
649
+ nil, nil, nil, nil, nil, 117, 1484, 2384, nil, 2420,
650
+ 49, 912, 52, nil, nil, 324, nil, nil, nil, nil,
651
+ nil, nil, 448, 989, 604, 835, 1218, 1152, 1328, 2744,
652
+ 1086, 1127, 1331, nil, 295, 301, 306, 88, 77, 87,
653
+ 52, 443, 345, 351, 374, 453, 78, 482, 486, nil,
654
+ 504, 2240, nil, nil, nil, 475, nil, 1284, nil, nil,
655
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
656
+ nil, nil, nil, nil, 1216, nil, nil, nil, 502, 503,
657
+ 504, 10, 511, 528, 1916, 1736, 515, 109, nil, nil,
658
+ 488, 758, nil, 522, 482, 463, 499, 499, nil, 526,
659
+ nil, nil, 156, 496, nil, 525, nil, 240, nil, 3,
660
+ 160, nil, 11, nil, nil, 9, 1378, 4, 1772, -8,
661
+ nil, 530, nil, nil, 1444, 530, nil, 481, 569, nil,
662
+ nil, 1400, 526, 2747, nil, nil, nil, nil, nil, nil,
663
+ nil, nil, nil, nil, nil, nil, 529, 533, 521, nil,
664
+ 147, nil, nil, nil, nil, nil, 109, nil, nil, 2060,
665
+ nil, nil, nil, 527, 77, 377, 38, -2, 27, -62,
666
+ 148, 2096, 2132, 571, nil, 1422, 89, 2204, 565, nil,
667
+ nil, nil, nil, nil, nil, nil, nil, 381, nil, nil,
668
+ nil, nil, nil, nil, nil, 2312, 566, 2348, 567, 580,
669
+ 581, 582, nil, 564, nil, 552, 448, 380, 326, 566,
670
+ nil, nil, 308, 571, -2, nil, nil, 272, 572, 266,
671
+ 573, 2492, 2528, 2564, 252, -2, nil, 2600, 2636, nil,
672
+ 602, 2672, 2708, 148, 202, 201, 227, 568, 570, 616,
673
+ 387, 224, nil, 230, 235, nil, nil, nil, 592, nil,
674
+ 607, nil, nil, 595, nil, 607, nil, nil, 298, -54,
675
+ nil, nil ]
676
+
677
+ racc_action_default = [
678
+ -243, -243, -239, -6, -16, -243, -4, -160, -163, -164,
679
+ -165, -166, -167, -168, -169, -170, -171, -172, -173, -174,
680
+ -175, -176, -177, -178, -179, -239, -239, -243, -243, -187,
681
+ -243, -243, -240, -242, -17, -4, -150, 412, -1, -5,
682
+ -239, -239, -186, -239, -188, -181, -243, -243, -239, -185,
683
+ -239, -239, -243, -191, -243, -243, -243, -239, -199, -200,
684
+ -201, -202, -233, -234, -235, -236, -241, -2, -7, -8,
685
+ -9, -10, -11, -12, -13, -14, -17, -243, -243, -243,
686
+ -243, -3, -82, -243, -161, -162, -243, -182, -239, -183,
687
+ -243, -243, -173, -163, -167, -174, -175, -164, -165, -168,
688
+ -169, -172, -166, -118, -119, -120, -121, -122, -123, -124,
689
+ -125, -126, -127, -128, -129, -130, -131, -170, -133, -134,
690
+ -135, -136, -137, -138, -139, -229, -197, -243, -243, -206,
691
+ -207, -209, -210, -212, -213, -216, -219, -221, -222, -239,
692
+ -239, -239, -239, -204, -190, -243, -239, -239, -239, -196,
693
+ -18, -15, -15, -15, -15, -239, -239, -239, -238, -239,
694
+ -84, -239, -243, -152, -180, -189, -184, -223, -230, -231,
695
+ -232, -198, -243, -239, -239, -239, -217, -217, -229, -239,
696
+ -229, -229, -229, -192, -193, -194, -195, -239, -239, -239,
697
+ -239, -243, -157, -158, -159, -243, -243, -243, -243, -151,
698
+ -243, -239, -205, -213, -208, -215, -211, -243, -107, -108,
699
+ -109, -110, -111, -112, -113, -114, -115, -116, -117, -118,
700
+ -132, -218, -220, -224, -229, -225, -226, -228, -150, -140,
701
+ -140, -239, -140, -243, -239, -239, -243, -243, -83, -153,
702
+ -203, -239, -227, -243, -23, -148, -28, -34, -30, -33,
703
+ -59, -237, -156, -81, -85, -243, -214, -243, -34, -239,
704
+ -243, -142, -145, -149, -34, -239, -17, -239, -239, -17,
705
+ -86, -243, -20, -21, -17, -24, -141, -148, -243, -146,
706
+ -147, -17, -29, -73, -27, -35, -36, -37, -38, -39,
707
+ -40, -41, -42, -43, -44, -45, -243, -243, -243, -31,
708
+ -243, -58, -60, -61, -62, -63, -73, -34, -22, -239,
709
+ -143, -144, -26, -243, -243, -243, -239, -239, -239, -70,
710
+ -243, -239, -239, -243, -32, -17, -243, -239, -52, -89,
711
+ -90, -91, -92, -93, -94, -95, -96, -97, -100, -101,
712
+ -102, -103, -104, -105, -106, -239, -52, -239, -52, -64,
713
+ -66, -68, -71, -243, -74, -132, -243, -55, -56, -243,
714
+ -19, -25, -46, -243, -243, -98, -99, -48, -243, -50,
715
+ -243, -239, -239, -239, -75, -243, -154, -239, -239, -53,
716
+ -243, -239, -239, -243, -243, -243, -243, -243, -243, -243,
717
+ -57, -47, -54, -49, -51, -65, -67, -69, -16, -87,
718
+ -243, -76, -77, -243, -72, -78, -79, -88, -243, -16,
719
+ -155, -80 ]
720
+
721
+ racc_goto_table = [
722
+ 6, 57, 77, 46, 82, 191, 49, 128, 79, 90,
723
+ 143, 52, 167, 247, 179, 203, 62, 206, 344, 344,
724
+ 344, 86, 91, 38, 47, 344, 261, 328, 346, 348,
725
+ 205, 205, 266, 34, 356, 404, 363, 35, 84, 85,
726
+ 221, 222, 68, 274, 150, 271, 411, 282, 125, 281,
727
+ 258, 67, 81, 264, 368, 149, 370, 299, 310, 244,
728
+ 246, 344, 250, 303, 304, 223, 305, 225, 226, 227,
729
+ 376, 187, 188, 189, 190, 232, 269, 302, 353, 386,
730
+ 344, 249, 179, 256, 398, 160, 165, 195, 260, 389,
731
+ 278, 344, 325, 162, 204, 1, nil, 205, nil, nil,
732
+ 400, nil, nil, nil, nil, nil, nil, nil, nil, nil,
733
+ nil, 242, nil, 344, nil, 249, 57, 249, 198, nil,
734
+ nil, nil, 410, nil, nil, nil, 183, nil, nil, nil,
735
+ 202, nil, nil, nil, nil, nil, nil, 178, 180, 181,
736
+ 182, nil, nil, nil, 184, 185, 186, nil, 228, 229,
737
+ 230, nil, nil, nil, 192, 193, nil, 194, nil, 125,
738
+ 240, 91, 91, 91, 233, nil, 349, 350, 351, nil,
739
+ nil, 125, 125, 125, 236, nil, nil, 224, nil, nil,
740
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
741
+ nil, nil, nil, nil, 253, nil, 243, nil, nil, nil,
742
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
743
+ nil, nil, nil, nil, nil, 255, nil, nil, nil, nil,
744
+ 275, nil, nil, nil, nil, nil, nil, nil, nil, nil,
745
+ nil, nil, 252, 91, nil, nil, nil, 306, nil, 125,
746
+ 79, nil, nil, nil, nil, nil, 300, nil, 79, nil,
747
+ nil, nil, nil, nil, nil, 79, nil, nil, nil, nil,
748
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
749
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
750
+ nil, nil, nil, nil, 327, 345, 347, 326, nil, nil,
751
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, 79,
752
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
753
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, 357,
754
+ 358, nil, nil, nil, nil, 362, nil, nil, nil, nil,
755
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
756
+ nil, nil, nil, 367, nil, 369, nil, nil, nil, 383,
757
+ 384, 385, nil, nil, nil, nil, nil, 399, nil, nil,
758
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
759
+ nil, nil, nil, nil, nil, 390, 391, nil, nil, 393,
760
+ 394 ]
761
+
762
+ racc_goto_check = [
763
+ 2, 36, 16, 23, 18, 27, 51, 50, 59, 17,
764
+ 49, 61, 74, 25, 63, 69, 75, 69, 53, 53,
765
+ 53, 23, 59, 3, 2, 53, 55, 37, 37, 37,
766
+ 64, 64, 20, 4, 37, 46, 38, 5, 2, 2,
767
+ 70, 70, 6, 20, 16, 19, 46, 25, 2, 20,
768
+ 22, 3, 3, 24, 38, 2, 38, 26, 55, 21,
769
+ 21, 53, 21, 29, 30, 74, 35, 74, 74, 74,
770
+ 37, 14, 14, 14, 14, 39, 40, 41, 42, 44,
771
+ 53, 27, 63, 69, 45, 47, 2, 48, 54, 37,
772
+ 57, 53, 20, 58, 65, 1, nil, 64, nil, nil,
773
+ 37, nil, nil, nil, nil, nil, nil, nil, nil, nil,
774
+ nil, 74, nil, 53, nil, 27, 36, 27, 50, nil,
775
+ nil, nil, 37, nil, nil, nil, 61, nil, nil, nil,
776
+ 50, nil, nil, nil, nil, nil, nil, 2, 2, 2,
777
+ 2, nil, nil, nil, 2, 2, 2, nil, 17, 17,
778
+ 17, nil, nil, nil, 2, 2, nil, 2, nil, 2,
779
+ 49, 59, 59, 59, 59, nil, 27, 27, 27, nil,
780
+ nil, 2, 2, 2, 51, nil, nil, 2, nil, nil,
781
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
782
+ nil, nil, nil, nil, 49, nil, 18, nil, nil, nil,
783
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
784
+ nil, nil, nil, nil, nil, 51, nil, nil, nil, nil,
785
+ 17, nil, nil, nil, nil, nil, nil, nil, nil, nil,
786
+ nil, nil, 2, 59, nil, nil, nil, 16, nil, 2,
787
+ 59, nil, nil, nil, nil, nil, 23, nil, 59, nil,
788
+ nil, nil, nil, nil, nil, 59, nil, nil, nil, nil,
789
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
790
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
791
+ nil, nil, nil, nil, 36, 36, 36, 23, nil, nil,
792
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, 59,
793
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
794
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, 2,
795
+ 2, nil, nil, nil, nil, 2, nil, nil, nil, nil,
796
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
797
+ nil, nil, nil, 2, nil, 2, nil, nil, nil, 23,
798
+ 23, 23, nil, nil, nil, nil, nil, 36, nil, nil,
799
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
800
+ nil, nil, nil, nil, nil, 2, 2, nil, nil, 2,
801
+ 2 ]
802
+
803
+ racc_goto_pointer = [
804
+ nil, 95, -2, 17, 30, 33, 8, nil, nil, nil,
805
+ nil, nil, nil, nil, -80, nil, -32, -39, -32, -212,
806
+ -215, -170, -194, -22, -193, -218, -210, -150, nil, -206,
807
+ -205, nil, nil, nil, nil, -203, -29, -286, -292, -115,
808
+ -174, -192, -241, nil, -295, -302, -363, 3, -73, -41,
809
+ -43, -22, nil, -295, -157, -219, nil, -172, 10, -26,
810
+ nil, -19, nil, -125, -144, -80, nil, nil, nil, -158,
811
+ -136, nil, nil, nil, -113, -15 ]
812
+
813
+ racc_goto_default = [
814
+ nil, nil, 44, nil, nil, 405, 295, 69, 70, 71,
815
+ 72, 73, 74, 75, nil, 36, 283, 78, nil, nil,
816
+ nil, nil, nil, nil, nil, nil, 248, 24, 285, 286,
817
+ 287, 288, 289, 290, 291, 294, 126, nil, nil, nil,
818
+ nil, nil, nil, 319, nil, nil, nil, nil, nil, 7,
819
+ nil, nil, 337, 127, nil, nil, 262, nil, nil, 31,
820
+ 29, nil, 53, 141, 129, 130, 131, 132, 133, 134,
821
+ 135, 136, 137, 138, nil, nil ]
822
+
823
+ racc_reduce_table = [
824
+ 0, 0, :racc_error,
825
+ 3, 82, :_reduce_1,
826
+ 3, 82, :_reduce_2,
827
+ 3, 82, :_reduce_3,
828
+ 0, 84, :_reduce_none,
829
+ 1, 84, :_reduce_none,
830
+ 0, 85, :_reduce_6,
831
+ 2, 85, :_reduce_7,
832
+ 1, 87, :_reduce_none,
833
+ 1, 87, :_reduce_none,
834
+ 1, 87, :_reduce_none,
835
+ 1, 87, :_reduce_none,
836
+ 1, 87, :_reduce_none,
837
+ 1, 87, :_reduce_none,
838
+ 1, 87, :_reduce_none,
839
+ 0, 95, :_reduce_15,
840
+ 0, 96, :_reduce_16,
841
+ 0, 97, :_reduce_17,
842
+ 2, 97, :_reduce_18,
843
+ 10, 94, :_reduce_19,
844
+ 1, 100, :_reduce_none,
845
+ 1, 100, :_reduce_none,
846
+ 8, 93, :_reduce_22,
847
+ 0, 103, :_reduce_23,
848
+ 2, 103, :_reduce_24,
849
+ 5, 103, :_reduce_25,
850
+ 8, 92, :_reduce_26,
851
+ 7, 92, :_reduce_27,
852
+ 0, 105, :_reduce_28,
853
+ 2, 105, :_reduce_29,
854
+ 1, 106, :_reduce_30,
855
+ 3, 106, :_reduce_31,
856
+ 4, 107, :_reduce_32,
857
+ 1, 107, :_reduce_33,
858
+ 0, 101, :_reduce_34,
859
+ 2, 101, :_reduce_35,
860
+ 1, 109, :_reduce_none,
861
+ 1, 109, :_reduce_none,
862
+ 1, 109, :_reduce_none,
863
+ 1, 109, :_reduce_none,
864
+ 1, 109, :_reduce_none,
865
+ 1, 109, :_reduce_none,
866
+ 1, 109, :_reduce_42,
867
+ 1, 109, :_reduce_43,
868
+ 1, 109, :_reduce_none,
869
+ 1, 109, :_reduce_none,
870
+ 4, 115, :_reduce_46,
871
+ 6, 115, :_reduce_47,
872
+ 4, 115, :_reduce_48,
873
+ 6, 115, :_reduce_49,
874
+ 4, 115, :_reduce_50,
875
+ 6, 115, :_reduce_51,
876
+ 0, 119, :_reduce_52,
877
+ 2, 119, :_reduce_53,
878
+ 3, 119, :_reduce_54,
879
+ 3, 114, :_reduce_55,
880
+ 3, 114, :_reduce_56,
881
+ 5, 114, :_reduce_57,
882
+ 7, 91, :_reduce_58,
883
+ 0, 121, :_reduce_59,
884
+ 2, 121, :_reduce_60,
885
+ 1, 122, :_reduce_61,
886
+ 1, 122, :_reduce_62,
887
+ 1, 122, :_reduce_none,
888
+ 3, 111, :_reduce_64,
889
+ 6, 111, :_reduce_65,
890
+ 3, 112, :_reduce_66,
891
+ 6, 112, :_reduce_67,
892
+ 3, 113, :_reduce_68,
893
+ 6, 113, :_reduce_69,
894
+ 0, 123, :_reduce_70,
895
+ 1, 123, :_reduce_71,
896
+ 7, 110, :_reduce_72,
897
+ 0, 124, :_reduce_none,
898
+ 2, 124, :_reduce_74,
899
+ 0, 125, :_reduce_75,
900
+ 2, 125, :_reduce_76,
901
+ 2, 125, :_reduce_77,
902
+ 1, 127, :_reduce_78,
903
+ 1, 127, :_reduce_79,
904
+ 3, 127, :_reduce_80,
905
+ 6, 86, :_reduce_81,
906
+ 0, 128, :_reduce_82,
907
+ 3, 128, :_reduce_83,
908
+ 0, 129, :_reduce_84,
909
+ 3, 129, :_reduce_85,
910
+ 4, 129, :_reduce_86,
911
+ 1, 126, :_reduce_none,
912
+ 2, 126, :_reduce_88,
913
+ 1, 118, :_reduce_none,
914
+ 1, 118, :_reduce_none,
915
+ 1, 118, :_reduce_none,
916
+ 1, 118, :_reduce_none,
917
+ 1, 118, :_reduce_none,
918
+ 1, 118, :_reduce_none,
919
+ 1, 118, :_reduce_none,
920
+ 1, 118, :_reduce_none,
921
+ 1, 118, :_reduce_none,
922
+ 2, 118, :_reduce_98,
923
+ 2, 118, :_reduce_99,
924
+ 1, 118, :_reduce_none,
925
+ 1, 118, :_reduce_none,
926
+ 1, 118, :_reduce_none,
927
+ 1, 133, :_reduce_none,
928
+ 1, 133, :_reduce_none,
929
+ 1, 133, :_reduce_none,
930
+ 1, 133, :_reduce_none,
931
+ 1, 134, :_reduce_none,
932
+ 1, 134, :_reduce_none,
933
+ 1, 134, :_reduce_none,
934
+ 1, 134, :_reduce_none,
935
+ 1, 134, :_reduce_none,
936
+ 1, 134, :_reduce_none,
937
+ 1, 134, :_reduce_none,
938
+ 1, 134, :_reduce_none,
939
+ 1, 134, :_reduce_none,
940
+ 1, 134, :_reduce_none,
941
+ 1, 134, :_reduce_none,
942
+ 1, 134, :_reduce_none,
943
+ 1, 134, :_reduce_none,
944
+ 1, 134, :_reduce_none,
945
+ 1, 134, :_reduce_none,
946
+ 1, 134, :_reduce_none,
947
+ 1, 134, :_reduce_none,
948
+ 1, 134, :_reduce_none,
949
+ 1, 134, :_reduce_none,
950
+ 1, 134, :_reduce_none,
951
+ 1, 134, :_reduce_none,
952
+ 1, 134, :_reduce_none,
953
+ 1, 134, :_reduce_none,
954
+ 1, 134, :_reduce_none,
955
+ 1, 134, :_reduce_none,
956
+ 1, 134, :_reduce_none,
957
+ 1, 134, :_reduce_none,
958
+ 1, 134, :_reduce_none,
959
+ 1, 134, :_reduce_none,
960
+ 1, 134, :_reduce_none,
961
+ 1, 134, :_reduce_none,
962
+ 1, 134, :_reduce_none,
963
+ 1, 134, :_reduce_none,
964
+ 0, 102, :_reduce_140,
965
+ 3, 102, :_reduce_141,
966
+ 1, 135, :_reduce_142,
967
+ 3, 135, :_reduce_143,
968
+ 3, 136, :_reduce_144,
969
+ 0, 138, :_reduce_145,
970
+ 1, 138, :_reduce_146,
971
+ 1, 138, :_reduce_147,
972
+ 0, 137, :_reduce_148,
973
+ 1, 137, :_reduce_149,
974
+ 0, 99, :_reduce_150,
975
+ 3, 99, :_reduce_151,
976
+ 1, 139, :_reduce_152,
977
+ 3, 139, :_reduce_153,
978
+ 4, 116, :_reduce_154,
979
+ 8, 116, :_reduce_155,
980
+ 5, 88, :_reduce_156,
981
+ 3, 89, :_reduce_157,
982
+ 3, 89, :_reduce_158,
983
+ 3, 90, :_reduce_159,
984
+ 1, 83, :_reduce_none,
985
+ 3, 83, :_reduce_161,
986
+ 3, 83, :_reduce_162,
987
+ 1, 130, :_reduce_163,
988
+ 1, 130, :_reduce_164,
989
+ 1, 130, :_reduce_165,
990
+ 1, 130, :_reduce_166,
991
+ 1, 130, :_reduce_167,
992
+ 1, 130, :_reduce_168,
993
+ 1, 130, :_reduce_169,
994
+ 1, 130, :_reduce_170,
995
+ 1, 130, :_reduce_171,
996
+ 1, 130, :_reduce_172,
997
+ 1, 130, :_reduce_173,
998
+ 1, 130, :_reduce_174,
999
+ 1, 130, :_reduce_175,
1000
+ 1, 130, :_reduce_176,
1001
+ 1, 130, :_reduce_177,
1002
+ 1, 130, :_reduce_178,
1003
+ 1, 130, :_reduce_179,
1004
+ 4, 130, :_reduce_180,
1005
+ 2, 130, :_reduce_181,
1006
+ 3, 130, :_reduce_182,
1007
+ 3, 130, :_reduce_183,
1008
+ 4, 130, :_reduce_184,
1009
+ 2, 130, :_reduce_185,
1010
+ 2, 130, :_reduce_186,
1011
+ 1, 130, :_reduce_none,
1012
+ 1, 104, :_reduce_188,
1013
+ 3, 104, :_reduce_189,
1014
+ 3, 141, :_reduce_190,
1015
+ 1, 142, :_reduce_191,
1016
+ 3, 142, :_reduce_192,
1017
+ 3, 143, :_reduce_193,
1018
+ 3, 143, :_reduce_194,
1019
+ 3, 143, :_reduce_195,
1020
+ 2, 143, :_reduce_196,
1021
+ 1, 144, :_reduce_none,
1022
+ 2, 144, :_reduce_198,
1023
+ 1, 117, :_reduce_none,
1024
+ 1, 117, :_reduce_none,
1025
+ 1, 117, :_reduce_none,
1026
+ 1, 117, :_reduce_none,
1027
+ 5, 132, :_reduce_203,
1028
+ 2, 132, :_reduce_204,
1029
+ 3, 131, :_reduce_205,
1030
+ 1, 131, :_reduce_206,
1031
+ 1, 131, :_reduce_none,
1032
+ 3, 146, :_reduce_208,
1033
+ 1, 146, :_reduce_209,
1034
+ 1, 146, :_reduce_none,
1035
+ 3, 148, :_reduce_211,
1036
+ 1, 148, :_reduce_212,
1037
+ 1, 148, :_reduce_none,
1038
+ 3, 150, :_reduce_214,
1039
+ 1, 150, :_reduce_215,
1040
+ 1, 150, :_reduce_none,
1041
+ 0, 151, :_reduce_217,
1042
+ 3, 151, :_reduce_218,
1043
+ 1, 151, :_reduce_219,
1044
+ 3, 151, :_reduce_220,
1045
+ 1, 151, :_reduce_221,
1046
+ 1, 151, :_reduce_222,
1047
+ 2, 145, :_reduce_223,
1048
+ 3, 147, :_reduce_224,
1049
+ 3, 149, :_reduce_225,
1050
+ 3, 152, :_reduce_226,
1051
+ 4, 153, :_reduce_227,
1052
+ 3, 154, :_reduce_228,
1053
+ 0, 155, :_reduce_none,
1054
+ 1, 155, :_reduce_none,
1055
+ 1, 155, :_reduce_none,
1056
+ 1, 155, :_reduce_none,
1057
+ 2, 108, :_reduce_233,
1058
+ 1, 156, :_reduce_none,
1059
+ 1, 156, :_reduce_none,
1060
+ 1, 156, :_reduce_none,
1061
+ 2, 120, :_reduce_237,
1062
+ 2, 98, :_reduce_238,
1063
+ 0, 140, :_reduce_239,
1064
+ 1, 140, :_reduce_240,
1065
+ 2, 140, :_reduce_241,
1066
+ 1, 140, :_reduce_242 ]
1067
+
1068
+ racc_reduce_n = 243
1069
+
1070
+ racc_shift_n = 412
1071
+
1072
+ racc_token_table = {
1073
+ false => 0,
1074
+ :error => 1,
1075
+ :tUIDENT => 2,
1076
+ :tLIDENT => 3,
1077
+ :tNAMESPACE => 4,
1078
+ :tINTERFACEIDENT => 5,
1079
+ :tGLOBALIDENT => 6,
1080
+ :tLKEYWORD => 7,
1081
+ :tUKEYWORD => 8,
1082
+ :tLKEYWORD_Q_E => 9,
1083
+ :tUKEYWORD_Q_E => 10,
1084
+ :tIVAR => 11,
1085
+ :tCLASSVAR => 12,
1086
+ :tANNOTATION => 13,
1087
+ :tSTRING => 14,
1088
+ :tSYMBOL => 15,
1089
+ :tINTEGER => 16,
1090
+ :tWRITE_ATTR => 17,
1091
+ :kLPAREN => 18,
1092
+ :kRPAREN => 19,
1093
+ :kLBRACKET => 20,
1094
+ :kRBRACKET => 21,
1095
+ :kLBRACE => 22,
1096
+ :kRBRACE => 23,
1097
+ :kVOID => 24,
1098
+ :kNIL => 25,
1099
+ :kTRUE => 26,
1100
+ :kFALSE => 27,
1101
+ :kANY => 28,
1102
+ :kUNTYPED => 29,
1103
+ :kTOP => 30,
1104
+ :kBOT => 31,
1105
+ :kSELF => 32,
1106
+ :kSELFQ => 33,
1107
+ :kINSTANCE => 34,
1108
+ :kCLASS => 35,
1109
+ :kBOOL => 36,
1110
+ :kSINGLETON => 37,
1111
+ :kTYPE => 38,
1112
+ :kDEF => 39,
1113
+ :kMODULE => 40,
1114
+ :kPRIVATE => 41,
1115
+ :kPUBLIC => 42,
1116
+ :kALIAS => 43,
1117
+ :kCOLON => 44,
1118
+ :kCOLON2 => 45,
1119
+ :kCOMMA => 46,
1120
+ :kBAR => 47,
1121
+ :kAMP => 48,
1122
+ :kHAT => 49,
1123
+ :kARROW => 50,
1124
+ :kQUESTION => 51,
1125
+ :kEXCLAMATION => 52,
1126
+ :kSTAR => 53,
1127
+ :kSTAR2 => 54,
1128
+ :kFATARROW => 55,
1129
+ :kEQ => 56,
1130
+ :kDOT => 57,
1131
+ :kDOT3 => 58,
1132
+ :kLT => 59,
1133
+ :kINTERFACE => 60,
1134
+ :kEND => 61,
1135
+ :kINCLUDE => 62,
1136
+ :kEXTEND => 63,
1137
+ :kATTRREADER => 64,
1138
+ :kATTRWRITER => 65,
1139
+ :kATTRACCESSOR => 66,
1140
+ :tOPERATOR => 67,
1141
+ :tQUOTEDMETHOD => 68,
1142
+ :tQUOTEDIDENT => 69,
1143
+ :kPREPEND => 70,
1144
+ :kEXTENSION => 71,
1145
+ :kINCOMPATIBLE => 72,
1146
+ :type_TYPE => 73,
1147
+ :type_SIGNATURE => 74,
1148
+ :type_METHODTYPE => 75,
1149
+ :tEOF => 76,
1150
+ :kOUT => 77,
1151
+ :kIN => 78,
1152
+ :kUNCHECKED => 79,
1153
+ :kOVERLOAD => 80 }
1154
+
1155
+ racc_nt_base = 81
1156
+
1157
+ racc_use_result_var = true
1158
+
1159
+ Racc_arg = [
1160
+ racc_action_table,
1161
+ racc_action_check,
1162
+ racc_action_default,
1163
+ racc_action_pointer,
1164
+ racc_goto_table,
1165
+ racc_goto_check,
1166
+ racc_goto_default,
1167
+ racc_goto_pointer,
1168
+ racc_nt_base,
1169
+ racc_reduce_table,
1170
+ racc_token_table,
1171
+ racc_shift_n,
1172
+ racc_reduce_n,
1173
+ racc_use_result_var ]
1174
+
1175
+ Racc_token_to_s_table = [
1176
+ "$end",
1177
+ "error",
1178
+ "tUIDENT",
1179
+ "tLIDENT",
1180
+ "tNAMESPACE",
1181
+ "tINTERFACEIDENT",
1182
+ "tGLOBALIDENT",
1183
+ "tLKEYWORD",
1184
+ "tUKEYWORD",
1185
+ "tLKEYWORD_Q_E",
1186
+ "tUKEYWORD_Q_E",
1187
+ "tIVAR",
1188
+ "tCLASSVAR",
1189
+ "tANNOTATION",
1190
+ "tSTRING",
1191
+ "tSYMBOL",
1192
+ "tINTEGER",
1193
+ "tWRITE_ATTR",
1194
+ "kLPAREN",
1195
+ "kRPAREN",
1196
+ "kLBRACKET",
1197
+ "kRBRACKET",
1198
+ "kLBRACE",
1199
+ "kRBRACE",
1200
+ "kVOID",
1201
+ "kNIL",
1202
+ "kTRUE",
1203
+ "kFALSE",
1204
+ "kANY",
1205
+ "kUNTYPED",
1206
+ "kTOP",
1207
+ "kBOT",
1208
+ "kSELF",
1209
+ "kSELFQ",
1210
+ "kINSTANCE",
1211
+ "kCLASS",
1212
+ "kBOOL",
1213
+ "kSINGLETON",
1214
+ "kTYPE",
1215
+ "kDEF",
1216
+ "kMODULE",
1217
+ "kPRIVATE",
1218
+ "kPUBLIC",
1219
+ "kALIAS",
1220
+ "kCOLON",
1221
+ "kCOLON2",
1222
+ "kCOMMA",
1223
+ "kBAR",
1224
+ "kAMP",
1225
+ "kHAT",
1226
+ "kARROW",
1227
+ "kQUESTION",
1228
+ "kEXCLAMATION",
1229
+ "kSTAR",
1230
+ "kSTAR2",
1231
+ "kFATARROW",
1232
+ "kEQ",
1233
+ "kDOT",
1234
+ "kDOT3",
1235
+ "kLT",
1236
+ "kINTERFACE",
1237
+ "kEND",
1238
+ "kINCLUDE",
1239
+ "kEXTEND",
1240
+ "kATTRREADER",
1241
+ "kATTRWRITER",
1242
+ "kATTRACCESSOR",
1243
+ "tOPERATOR",
1244
+ "tQUOTEDMETHOD",
1245
+ "tQUOTEDIDENT",
1246
+ "kPREPEND",
1247
+ "kEXTENSION",
1248
+ "kINCOMPATIBLE",
1249
+ "type_TYPE",
1250
+ "type_SIGNATURE",
1251
+ "type_METHODTYPE",
1252
+ "tEOF",
1253
+ "kOUT",
1254
+ "kIN",
1255
+ "kUNCHECKED",
1256
+ "kOVERLOAD",
1257
+ "$start",
1258
+ "target",
1259
+ "type",
1260
+ "eof",
1261
+ "signatures",
1262
+ "method_type",
1263
+ "signature",
1264
+ "type_decl",
1265
+ "const_decl",
1266
+ "global_decl",
1267
+ "interface_decl",
1268
+ "module_decl",
1269
+ "class_decl",
1270
+ "extension_decl",
1271
+ "start_new_scope",
1272
+ "start_merged_scope",
1273
+ "annotations",
1274
+ "class_name",
1275
+ "type_params",
1276
+ "extension_name",
1277
+ "class_members",
1278
+ "module_type_params",
1279
+ "super_class",
1280
+ "type_list",
1281
+ "colon_module_self_types",
1282
+ "module_self_types",
1283
+ "module_self_type",
1284
+ "qualified_name",
1285
+ "class_member",
1286
+ "method_member",
1287
+ "include_member",
1288
+ "extend_member",
1289
+ "prepend_member",
1290
+ "var_type_member",
1291
+ "attribute_member",
1292
+ "alias_member",
1293
+ "keyword",
1294
+ "method_name",
1295
+ "attr_var_opt",
1296
+ "interface_name",
1297
+ "interface_members",
1298
+ "interface_member",
1299
+ "overload",
1300
+ "attributes",
1301
+ "method_kind",
1302
+ "def_name",
1303
+ "method_types",
1304
+ "params_opt",
1305
+ "block_opt",
1306
+ "simple_type",
1307
+ "params",
1308
+ "function_type",
1309
+ "method_name0",
1310
+ "identifier_keywords",
1311
+ "module_type_params0",
1312
+ "module_type_param",
1313
+ "type_param_check",
1314
+ "type_param_variance",
1315
+ "type_params0",
1316
+ "namespace",
1317
+ "record_type",
1318
+ "record_fields",
1319
+ "record_field",
1320
+ "keyword_name",
1321
+ "required_positional",
1322
+ "optional_positional_params",
1323
+ "optional_positional",
1324
+ "rest_positional_param",
1325
+ "rest_positional",
1326
+ "trailing_positional_params",
1327
+ "keyword_params",
1328
+ "required_keyword",
1329
+ "optional_keyword",
1330
+ "rest_keyword",
1331
+ "var_name_opt",
1332
+ "simple_name" ]
1333
+
1334
+ Racc_debug_parser = false
1335
+
1336
+ ##### State transition tables end #####
1337
+
1338
+ # reduce 0 omitted
1339
+
1340
+ module_eval(<<'.,.,', 'parser.y', 28)
1341
+ def _reduce_1(val, _values, result)
1342
+ result = val[1]
1343
+
1344
+ result
1345
+ end
1346
+ .,.,
1347
+
1348
+ module_eval(<<'.,.,', 'parser.y', 31)
1349
+ def _reduce_2(val, _values, result)
1350
+ result = val[1]
1351
+
1352
+ result
1353
+ end
1354
+ .,.,
1355
+
1356
+ module_eval(<<'.,.,', 'parser.y', 34)
1357
+ def _reduce_3(val, _values, result)
1358
+ result = val[1]
1359
+
1360
+ result
1361
+ end
1362
+ .,.,
1363
+
1364
+ # reduce 4 omitted
1365
+
1366
+ # reduce 5 omitted
1367
+
1368
+ module_eval(<<'.,.,', 'parser.y', 40)
1369
+ def _reduce_6(val, _values, result)
1370
+ result = []
1371
+ result
1372
+ end
1373
+ .,.,
1374
+
1375
+ module_eval(<<'.,.,', 'parser.y', 42)
1376
+ def _reduce_7(val, _values, result)
1377
+ result = val[0].push(val[1])
1378
+
1379
+ result
1380
+ end
1381
+ .,.,
1382
+
1383
+ # reduce 8 omitted
1384
+
1385
+ # reduce 9 omitted
1386
+
1387
+ # reduce 10 omitted
1388
+
1389
+ # reduce 11 omitted
1390
+
1391
+ # reduce 12 omitted
1392
+
1393
+ # reduce 13 omitted
1394
+
1395
+ # reduce 14 omitted
1396
+
1397
+ module_eval(<<'.,.,', 'parser.y', 54)
1398
+ def _reduce_15(val, _values, result)
1399
+ start_new_variables_scope
1400
+ result
1401
+ end
1402
+ .,.,
1403
+
1404
+ module_eval(<<'.,.,', 'parser.y', 55)
1405
+ def _reduce_16(val, _values, result)
1406
+ start_merged_variables_scope
1407
+ result
1408
+ end
1409
+ .,.,
1410
+
1411
+ module_eval(<<'.,.,', 'parser.y', 58)
1412
+ def _reduce_17(val, _values, result)
1413
+ result = []
1414
+ result
1415
+ end
1416
+ .,.,
1417
+
1418
+ module_eval(<<'.,.,', 'parser.y', 60)
1419
+ def _reduce_18(val, _values, result)
1420
+ result = val[1].unshift(Annotation.new(string: val[0].value, location: val[0].location))
1421
+
1422
+ result
1423
+ end
1424
+ .,.,
1425
+
1426
+ module_eval(<<'.,.,', 'parser.y', 65)
1427
+ def _reduce_19(val, _values, result)
1428
+ reset_variable_scope
1429
+
1430
+ location = val[1].location + val[9].location
1431
+ result = Declarations::Extension.new(
1432
+ name: val[3].value,
1433
+ type_params: val[4]&.value || [],
1434
+ extension_name: val[6].value.to_sym,
1435
+ members: val[8],
1436
+ annotations: val[0],
1437
+ location: location,
1438
+ comment: leading_comment(val[0].first&.location || location)
1439
+ )
1440
+
1441
+ result
1442
+ end
1443
+ .,.,
1444
+
1445
+ # reduce 20 omitted
1446
+
1447
+ # reduce 21 omitted
1448
+
1449
+ module_eval(<<'.,.,', 'parser.y', 83)
1450
+ def _reduce_22(val, _values, result)
1451
+ reset_variable_scope
1452
+
1453
+ location = val[1].location + val[7].location
1454
+ result = Declarations::Class.new(
1455
+ name: val[3].value,
1456
+ type_params: val[4]&.value || Declarations::ModuleTypeParams.empty,
1457
+ super_class: val[5],
1458
+ members: val[6],
1459
+ annotations: val[0],
1460
+ location: location,
1461
+ comment: leading_comment(val[0].first&.location || location)
1462
+ )
1463
+
1464
+ result
1465
+ end
1466
+ .,.,
1467
+
1468
+ module_eval(<<'.,.,', 'parser.y', 98)
1469
+ def _reduce_23(val, _values, result)
1470
+ result = nil
1471
+ result
1472
+ end
1473
+ .,.,
1474
+
1475
+ module_eval(<<'.,.,', 'parser.y', 100)
1476
+ def _reduce_24(val, _values, result)
1477
+ result = Declarations::Class::Super.new(name: val[1].value,
1478
+ args: [])
1479
+
1480
+ result
1481
+ end
1482
+ .,.,
1483
+
1484
+ module_eval(<<'.,.,', 'parser.y', 104)
1485
+ def _reduce_25(val, _values, result)
1486
+ result = Declarations::Class::Super.new(name: val[1].value,
1487
+ args: val[3])
1488
+
1489
+ result
1490
+ end
1491
+ .,.,
1492
+
1493
+ module_eval(<<'.,.,', 'parser.y', 110)
1494
+ def _reduce_26(val, _values, result)
1495
+ reset_variable_scope
1496
+
1497
+ location = val[1].location + val[7].location
1498
+ result = Declarations::Module.new(
1499
+ name: val[3].value,
1500
+ type_params: val[4]&.value || Declarations::ModuleTypeParams.empty,
1501
+ self_types: val[5],
1502
+ members: val[6],
1503
+ annotations: val[0],
1504
+ location: location,
1505
+ comment: leading_comment(val[0].first&.location || location)
1506
+ )
1507
+
1508
+ result
1509
+ end
1510
+ .,.,
1511
+
1512
+ module_eval(<<'.,.,', 'parser.y', 124)
1513
+ def _reduce_27(val, _values, result)
1514
+ reset_variable_scope
1515
+
1516
+ location = val[1].location + val[6].location
1517
+ result = Declarations::Module.new(
1518
+ name: val[3].value,
1519
+ type_params: Declarations::ModuleTypeParams.empty,
1520
+ self_types: val[4],
1521
+ members: val[5],
1522
+ annotations: val[0],
1523
+ location: location,
1524
+ comment: leading_comment(val[0].first&.location || location)
1525
+ )
1526
+
1527
+ result
1528
+ end
1529
+ .,.,
1530
+
1531
+ module_eval(<<'.,.,', 'parser.y', 139)
1532
+ def _reduce_28(val, _values, result)
1533
+ result = []
1534
+ result
1535
+ end
1536
+ .,.,
1537
+
1538
+ module_eval(<<'.,.,', 'parser.y', 141)
1539
+ def _reduce_29(val, _values, result)
1540
+ result = val[1]
1541
+
1542
+ result
1543
+ end
1544
+ .,.,
1545
+
1546
+ module_eval(<<'.,.,', 'parser.y', 146)
1547
+ def _reduce_30(val, _values, result)
1548
+ result = [val[0]]
1549
+
1550
+ result
1551
+ end
1552
+ .,.,
1553
+
1554
+ module_eval(<<'.,.,', 'parser.y', 149)
1555
+ def _reduce_31(val, _values, result)
1556
+ result = val[0].push(val[2])
1557
+
1558
+ result
1559
+ end
1560
+ .,.,
1561
+
1562
+ module_eval(<<'.,.,', 'parser.y', 154)
1563
+ def _reduce_32(val, _values, result)
1564
+ name = val[0].value
1565
+ args = val[2]
1566
+ location = val[0].location + val[3].location
1567
+
1568
+ case
1569
+ when name.class?
1570
+ result = Declarations::Module::Self.new(name: name, args: args, location: location)
1571
+ when name.interface?
1572
+ result = Declarations::Module::Self.new(name: name, args: args, location: location)
1573
+ else
1574
+ raise SemanticsError.new("Module self type should be instance or interface", subject: val[0], location: val[0].location)
1575
+ end
1576
+
1577
+ result
1578
+ end
1579
+ .,.,
1580
+
1581
+ module_eval(<<'.,.,', 'parser.y', 168)
1582
+ def _reduce_33(val, _values, result)
1583
+ name = val[0].value
1584
+ args = []
1585
+ location = val[0].location
1586
+
1587
+ case
1588
+ when name.class?
1589
+ result = Declarations::Module::Self.new(name: name, args: args, location: location)
1590
+ when name.interface?
1591
+ result = Declarations::Module::Self.new(name: name, args: args, location: location)
1592
+ else
1593
+ raise SemanticsError.new("Module self type should be instance or interface", subject: val[0], location: val[0].location)
1594
+ end
1595
+
1596
+ result
1597
+ end
1598
+ .,.,
1599
+
1600
+ module_eval(<<'.,.,', 'parser.y', 183)
1601
+ def _reduce_34(val, _values, result)
1602
+ result = []
1603
+ result
1604
+ end
1605
+ .,.,
1606
+
1607
+ module_eval(<<'.,.,', 'parser.y', 185)
1608
+ def _reduce_35(val, _values, result)
1609
+ result = val[0].push(val[1])
1610
+
1611
+ result
1612
+ end
1613
+ .,.,
1614
+
1615
+ # reduce 36 omitted
1616
+
1617
+ # reduce 37 omitted
1618
+
1619
+ # reduce 38 omitted
1620
+
1621
+ # reduce 39 omitted
1622
+
1623
+ # reduce 40 omitted
1624
+
1625
+ # reduce 41 omitted
1626
+
1627
+ module_eval(<<'.,.,', 'parser.y', 196)
1628
+ def _reduce_42(val, _values, result)
1629
+ result = Members::Public.new(location: val[0].location)
1630
+
1631
+ result
1632
+ end
1633
+ .,.,
1634
+
1635
+ module_eval(<<'.,.,', 'parser.y', 199)
1636
+ def _reduce_43(val, _values, result)
1637
+ result = Members::Private.new(location: val[0].location)
1638
+
1639
+ result
1640
+ end
1641
+ .,.,
1642
+
1643
+ # reduce 44 omitted
1644
+
1645
+ # reduce 45 omitted
1646
+
1647
+ module_eval(<<'.,.,', 'parser.y', 206)
1648
+ def _reduce_46(val, _values, result)
1649
+ location = val[1].location + val[3].location
1650
+ result = Members::AttrReader.new(name: val[2].value,
1651
+ ivar_name: nil,
1652
+ type: val[3],
1653
+ annotations: val[0],
1654
+ location: location,
1655
+ comment: leading_comment(val[0].first&.location || location))
1656
+
1657
+ result
1658
+ end
1659
+ .,.,
1660
+
1661
+ module_eval(<<'.,.,', 'parser.y', 215)
1662
+ def _reduce_47(val, _values, result)
1663
+ location = val[1].location + val[5].location
1664
+ result = Members::AttrReader.new(name: val[2].value.to_sym,
1665
+ ivar_name: val[3],
1666
+ type: val[5],
1667
+ annotations: val[0],
1668
+ location: location,
1669
+ comment: leading_comment(val[0].first&.location || location))
1670
+
1671
+ result
1672
+ end
1673
+ .,.,
1674
+
1675
+ module_eval(<<'.,.,', 'parser.y', 224)
1676
+ def _reduce_48(val, _values, result)
1677
+ location = val[1].location + val[3].location
1678
+ result = Members::AttrWriter.new(name: val[2].value,
1679
+ ivar_name: nil,
1680
+ type: val[3],
1681
+ annotations: val[0],
1682
+ location: location,
1683
+ comment: leading_comment(val[0].first&.location || location))
1684
+
1685
+ result
1686
+ end
1687
+ .,.,
1688
+
1689
+ module_eval(<<'.,.,', 'parser.y', 233)
1690
+ def _reduce_49(val, _values, result)
1691
+ location = val[1].location + val[5].location
1692
+ result = Members::AttrWriter.new(name: val[2].value.to_sym,
1693
+ ivar_name: val[3],
1694
+ type: val[5],
1695
+ annotations: val[0],
1696
+ location: location,
1697
+ comment: leading_comment(val[0].first&.location || location))
1698
+
1699
+ result
1700
+ end
1701
+ .,.,
1702
+
1703
+ module_eval(<<'.,.,', 'parser.y', 242)
1704
+ def _reduce_50(val, _values, result)
1705
+ location = val[1].location + val[3].location
1706
+ result = Members::AttrAccessor.new(name: val[2].value,
1707
+ ivar_name: nil,
1708
+ type: val[3],
1709
+ annotations: val[0],
1710
+ location: location,
1711
+ comment: leading_comment(val[0].first&.location || location))
1712
+
1713
+ result
1714
+ end
1715
+ .,.,
1716
+
1717
+ module_eval(<<'.,.,', 'parser.y', 251)
1718
+ def _reduce_51(val, _values, result)
1719
+ location = val[1].location + val[5].location
1720
+ result = Members::AttrAccessor.new(name: val[2].value.to_sym,
1721
+ ivar_name: val[3],
1722
+ type: val[5],
1723
+ annotations: val[0],
1724
+ location: location,
1725
+ comment: leading_comment(val[0].first&.location || location))
1726
+
1727
+ result
1728
+ end
1729
+ .,.,
1730
+
1731
+ module_eval(<<'.,.,', 'parser.y', 261)
1732
+ def _reduce_52(val, _values, result)
1733
+ result = nil
1734
+ result
1735
+ end
1736
+ .,.,
1737
+
1738
+ module_eval(<<'.,.,', 'parser.y', 262)
1739
+ def _reduce_53(val, _values, result)
1740
+ result = false
1741
+ result
1742
+ end
1743
+ .,.,
1744
+
1745
+ module_eval(<<'.,.,', 'parser.y', 263)
1746
+ def _reduce_54(val, _values, result)
1747
+ result = val[1].value
1748
+ result
1749
+ end
1750
+ .,.,
1751
+
1752
+ module_eval(<<'.,.,', 'parser.y', 267)
1753
+ def _reduce_55(val, _values, result)
1754
+ location = val[0].location + val[2].location
1755
+ result = Members::InstanceVariable.new(
1756
+ name: val[0].value,
1757
+ type: val[2],
1758
+ location: location,
1759
+ comment: leading_comment(location)
1760
+ )
1761
+
1762
+ result
1763
+ end
1764
+ .,.,
1765
+
1766
+ module_eval(<<'.,.,', 'parser.y', 276)
1767
+ def _reduce_56(val, _values, result)
1768
+ type = val[2]
1769
+
1770
+ if type.is_a?(Types::Variable)
1771
+ type = Types::ClassInstance.new(
1772
+ name: TypeName.new(name: type.name, namespace: Namespace.empty),
1773
+ args: [],
1774
+ location: type.location
1775
+ )
1776
+ end
1777
+
1778
+ location = val[0].location + val[2].location
1779
+ result = Members::ClassVariable.new(
1780
+ name: val[0].value,
1781
+ type: type,
1782
+ location: location,
1783
+ comment: leading_comment(location)
1784
+ )
1785
+
1786
+ result
1787
+ end
1788
+ .,.,
1789
+
1790
+ module_eval(<<'.,.,', 'parser.y', 295)
1791
+ def _reduce_57(val, _values, result)
1792
+ type = val[4]
1793
+
1794
+ if type.is_a?(Types::Variable)
1795
+ type = Types::ClassInstance.new(
1796
+ name: TypeName.new(name: type.name, namespace: Namespace.empty),
1797
+ args: [],
1798
+ location: type.location
1799
+ )
1800
+ end
1801
+
1802
+ location = val[0].location + val[4].location
1803
+ result = Members::ClassInstanceVariable.new(
1804
+ name: val[2].value,
1805
+ type: type,
1806
+ location: location,
1807
+ comment: leading_comment(location)
1808
+ )
1809
+
1810
+ result
1811
+ end
1812
+ .,.,
1813
+
1814
+ module_eval(<<'.,.,', 'parser.y', 316)
1815
+ def _reduce_58(val, _values, result)
1816
+ reset_variable_scope
1817
+
1818
+ location = val[1].location + val[6].location
1819
+ result = Declarations::Interface.new(
1820
+ name: val[3].value,
1821
+ type_params: val[4]&.value || Declarations::ModuleTypeParams.empty,
1822
+ members: val[5],
1823
+ annotations: val[0],
1824
+ location: location,
1825
+ comment: leading_comment(val[0].first&.location || location)
1826
+ )
1827
+
1828
+ result
1829
+ end
1830
+ .,.,
1831
+
1832
+ module_eval(<<'.,.,', 'parser.y', 330)
1833
+ def _reduce_59(val, _values, result)
1834
+ result = []
1835
+ result
1836
+ end
1837
+ .,.,
1838
+
1839
+ module_eval(<<'.,.,', 'parser.y', 332)
1840
+ def _reduce_60(val, _values, result)
1841
+ result = val[0].push(val[1])
1842
+
1843
+ result
1844
+ end
1845
+ .,.,
1846
+
1847
+ module_eval(<<'.,.,', 'parser.y', 337)
1848
+ def _reduce_61(val, _values, result)
1849
+ unless val[0].kind == :instance
1850
+ raise SemanticsError.new("Interface cannot have singleton method", subject: val[0], location: val[0].location)
1851
+ end
1852
+
1853
+ if val[0].types.last == :super
1854
+ raise SemanticsError.new("Interface method cannot have `super` type", subject: val[0], location: val[0].location)
1855
+ end
1856
+
1857
+ result = val[0]
1858
+
1859
+ result
1860
+ end
1861
+ .,.,
1862
+
1863
+ module_eval(<<'.,.,', 'parser.y', 348)
1864
+ def _reduce_62(val, _values, result)
1865
+ unless val[0].name.interface?
1866
+ raise SemanticsError.new("Interface should include an interface", subject: val[0], location: val[0].location)
1867
+ end
1868
+
1869
+ result = val[0]
1870
+
1871
+ result
1872
+ end
1873
+ .,.,
1874
+
1875
+ # reduce 63 omitted
1876
+
1877
+ module_eval(<<'.,.,', 'parser.y', 358)
1878
+ def _reduce_64(val, _values, result)
1879
+ if val[2].value.alias?
1880
+ raise SemanticsError.new("Should include module or interface", subject: val[2].value, location: val[2].location)
1881
+ end
1882
+ location = val[1].location + val[2].location
1883
+ result = Members::Include.new(name: val[2].value,
1884
+ args: [],
1885
+ annotations: val[0],
1886
+ location: location,
1887
+ comment: leading_comment(val[0].first&.location || location))
1888
+
1889
+ result
1890
+ end
1891
+ .,.,
1892
+
1893
+ module_eval(<<'.,.,', 'parser.y', 369)
1894
+ def _reduce_65(val, _values, result)
1895
+ if val[2].value.alias?
1896
+ raise SemanticsError.new("Should include module or interface", subject: val[2].value, location: val[2].location)
1897
+ end
1898
+ location = val[1].location + val[5].location
1899
+ result = Members::Include.new(name: val[2].value,
1900
+ args: val[4],
1901
+ annotations: val[0],
1902
+ location: location,
1903
+ comment: leading_comment(val[0].first&.location || location))
1904
+
1905
+ result
1906
+ end
1907
+ .,.,
1908
+
1909
+ module_eval(<<'.,.,', 'parser.y', 382)
1910
+ def _reduce_66(val, _values, result)
1911
+ if val[2].value.alias?
1912
+ raise SemanticsError.new("Should extend module or interface", subject: val[2].value, location: val[2].location)
1913
+ end
1914
+ location = val[1].location + val[2].location
1915
+ result = Members::Extend.new(name: val[2].value,
1916
+ args: [],
1917
+ annotations: val[0],
1918
+ location: location,
1919
+ comment: leading_comment(val[0].first&.location || location))
1920
+
1921
+ result
1922
+ end
1923
+ .,.,
1924
+
1925
+ module_eval(<<'.,.,', 'parser.y', 393)
1926
+ def _reduce_67(val, _values, result)
1927
+ if val[2].value.alias?
1928
+ raise SemanticsError.new("Should extend module or interface", subject: val[2].value, location: val[2].location)
1929
+ end
1930
+ location = val[1].location + val[5].location
1931
+ result = Members::Extend.new(name: val[2].value,
1932
+ args: val[4],
1933
+ annotations: val[0],
1934
+ location: location,
1935
+ comment: leading_comment(val[0].first&.location || location))
1936
+
1937
+ result
1938
+ end
1939
+ .,.,
1940
+
1941
+ module_eval(<<'.,.,', 'parser.y', 406)
1942
+ def _reduce_68(val, _values, result)
1943
+ unless val[2].value.class?
1944
+ raise SemanticsError.new("Should prepend module", subject: val[2].value, location: val[2].location)
1945
+ end
1946
+ location = val[1].location + val[2].location
1947
+ result = Members::Prepend.new(name: val[2].value,
1948
+ args: [],
1949
+ annotations: val[0],
1950
+ location: location,
1951
+ comment: leading_comment(val[0].first&.location || location))
1952
+
1953
+ result
1954
+ end
1955
+ .,.,
1956
+
1957
+ module_eval(<<'.,.,', 'parser.y', 417)
1958
+ def _reduce_69(val, _values, result)
1959
+ unless val[2].value.class?
1960
+ raise SemanticsError.new("Should prepend module", subject: val[2].value, location: val[2].location)
1961
+ end
1962
+ location = val[1].location + val[5].location
1963
+ result = Members::Prepend.new(name: val[2].value,
1964
+ args: val[4],
1965
+ annotations: val[0],
1966
+ location: location,
1967
+ comment: leading_comment(val[0].first&.location || location))
1968
+
1969
+ result
1970
+ end
1971
+ .,.,
1972
+
1973
+ module_eval(<<'.,.,', 'parser.y', 429)
1974
+ def _reduce_70(val, _values, result)
1975
+ result = nil
1976
+ result
1977
+ end
1978
+ .,.,
1979
+
1980
+ module_eval(<<'.,.,', 'parser.y', 431)
1981
+ def _reduce_71(val, _values, result)
1982
+ RBS.logger.warn "`overload def` syntax is deprecated. Use `...` syntax instead."
1983
+ result = val[0]
1984
+
1985
+ result
1986
+ end
1987
+ .,.,
1988
+
1989
+ module_eval(<<'.,.,', 'parser.y', 437)
1990
+ def _reduce_72(val, _values, result)
1991
+ location = val[3].location + val[6].last.location
1992
+
1993
+ last_type = val[6].last
1994
+ if last_type.is_a?(LocatedValue) && last_type.value == :dot3
1995
+ overload = true
1996
+ val[6].pop
1997
+ else
1998
+ overload = false
1999
+ end
2000
+
2001
+ result = Members::MethodDefinition.new(
2002
+ name: val[5].value,
2003
+ kind: val[4],
2004
+ types: val[6],
2005
+ annotations: val[0],
2006
+ location: location,
2007
+ comment: leading_comment(val[0].first&.location || val[2]&.location || val[3].location),
2008
+ overload: overload || !!val[2]
2009
+ )
2010
+
2011
+ result
2012
+ end
2013
+ .,.,
2014
+
2015
+ # reduce 73 omitted
2016
+
2017
+ module_eval(<<'.,.,', 'parser.y', 460)
2018
+ def _reduce_74(val, _values, result)
2019
+ RBS.logger.warn "`incompatible` method attribute is deprecated and ignored."
2020
+
2021
+ result
2022
+ end
2023
+ .,.,
2024
+
2025
+ module_eval(<<'.,.,', 'parser.y', 464)
2026
+ def _reduce_75(val, _values, result)
2027
+ result = :instance
2028
+ result
2029
+ end
2030
+ .,.,
2031
+
2032
+ module_eval(<<'.,.,', 'parser.y', 465)
2033
+ def _reduce_76(val, _values, result)
2034
+ result = :singleton
2035
+ result
2036
+ end
2037
+ .,.,
2038
+
2039
+ module_eval(<<'.,.,', 'parser.y', 466)
2040
+ def _reduce_77(val, _values, result)
2041
+ result = :singleton_instance
2042
+ result
2043
+ end
2044
+ .,.,
2045
+
2046
+ module_eval(<<'.,.,', 'parser.y', 469)
2047
+ def _reduce_78(val, _values, result)
2048
+ result = [val[0]]
2049
+ result
2050
+ end
2051
+ .,.,
2052
+
2053
+ module_eval(<<'.,.,', 'parser.y', 470)
2054
+ def _reduce_79(val, _values, result)
2055
+ result = [LocatedValue.new(value: :dot3, location: val[0].location)]
2056
+ result
2057
+ end
2058
+ .,.,
2059
+
2060
+ module_eval(<<'.,.,', 'parser.y', 472)
2061
+ def _reduce_80(val, _values, result)
2062
+ result = val[2].unshift(val[0])
2063
+
2064
+ result
2065
+ end
2066
+ .,.,
2067
+
2068
+ module_eval(<<'.,.,', 'parser.y', 477)
2069
+ def _reduce_81(val, _values, result)
2070
+ reset_variable_scope
2071
+
2072
+ location = (val[1] || val[2] || val[3] || val[4]).location + val[5].location
2073
+ type_params = val[1]&.value || []
2074
+
2075
+ params = val[2]&.value || empty_params_result
2076
+
2077
+ type = Types::Function.new(
2078
+ required_positionals: params[0],
2079
+ optional_positionals: params[1],
2080
+ rest_positionals: params[2],
2081
+ trailing_positionals: params[3],
2082
+ required_keywords: params[4],
2083
+ optional_keywords: params[5],
2084
+ rest_keywords: params[6],
2085
+ return_type: val[5]
2086
+ )
2087
+
2088
+ block = val[3]&.value
2089
+
2090
+ result = MethodType.new(type_params: type_params,
2091
+ type: type,
2092
+ block: block,
2093
+ location: location)
2094
+
2095
+ result
2096
+ end
2097
+ .,.,
2098
+
2099
+ module_eval(<<'.,.,', 'parser.y', 504)
2100
+ def _reduce_82(val, _values, result)
2101
+ result = nil
2102
+ result
2103
+ end
2104
+ .,.,
2105
+
2106
+ module_eval(<<'.,.,', 'parser.y', 506)
2107
+ def _reduce_83(val, _values, result)
2108
+ result = LocatedValue.new(value: val[1], location: val[0].location + val[2].location)
2109
+
2110
+ result
2111
+ end
2112
+ .,.,
2113
+
2114
+ module_eval(<<'.,.,', 'parser.y', 510)
2115
+ def _reduce_84(val, _values, result)
2116
+ result = nil
2117
+ result
2118
+ end
2119
+ .,.,
2120
+
2121
+ module_eval(<<'.,.,', 'parser.y', 512)
2122
+ def _reduce_85(val, _values, result)
2123
+ block = MethodType::Block.new(type: val[1].value, required: true)
2124
+ result = LocatedValue.new(value: block, location: val[0].location + val[2].location)
2125
+
2126
+ result
2127
+ end
2128
+ .,.,
2129
+
2130
+ module_eval(<<'.,.,', 'parser.y', 516)
2131
+ def _reduce_86(val, _values, result)
2132
+ block = MethodType::Block.new(type: val[2].value, required: false)
2133
+ result = LocatedValue.new(value: block, location: val[0].location + val[3].location)
2134
+
2135
+ result
2136
+ end
2137
+ .,.,
2138
+
2139
+ # reduce 87 omitted
2140
+
2141
+ module_eval(<<'.,.,', 'parser.y', 523)
2142
+ def _reduce_88(val, _values, result)
2143
+ result = LocatedValue.new(value: val[0].value.to_sym,
2144
+ location: val[0].location + val[1].location)
2145
+
2146
+ result
2147
+ end
2148
+ .,.,
2149
+
2150
+ # reduce 89 omitted
2151
+
2152
+ # reduce 90 omitted
2153
+
2154
+ # reduce 91 omitted
2155
+
2156
+ # reduce 92 omitted
2157
+
2158
+ # reduce 93 omitted
2159
+
2160
+ # reduce 94 omitted
2161
+
2162
+ # reduce 95 omitted
2163
+
2164
+ # reduce 96 omitted
2165
+
2166
+ # reduce 97 omitted
2167
+
2168
+ module_eval(<<'.,.,', 'parser.y', 532)
2169
+ def _reduce_98(val, _values, result)
2170
+ unless val[0].location.pred?(val[1].location)
2171
+ raise SyntaxError.new(token_str: "kQUESTION", error_value: val[1])
2172
+ end
2173
+
2174
+ result = LocatedValue.new(value: "#{val[0].value}?",
2175
+ location: val[0].location + val[1].location)
2176
+
2177
+ result
2178
+ end
2179
+ .,.,
2180
+
2181
+ module_eval(<<'.,.,', 'parser.y', 540)
2182
+ def _reduce_99(val, _values, result)
2183
+ unless val[0].location.pred?(val[1].location)
2184
+ raise SyntaxError.new(token_str: "kEXCLAMATION", error_value: val[1])
2185
+ end
2186
+
2187
+ result = LocatedValue.new(value: "#{val[0].value}!",
2188
+ location: val[0].location + val[1].location)
2189
+
2190
+ result
2191
+ end
2192
+ .,.,
2193
+
2194
+ # reduce 100 omitted
2195
+
2196
+ # reduce 101 omitted
2197
+
2198
+ # reduce 102 omitted
2199
+
2200
+ # reduce 103 omitted
2201
+
2202
+ # reduce 104 omitted
2203
+
2204
+ # reduce 105 omitted
2205
+
2206
+ # reduce 106 omitted
2207
+
2208
+ # reduce 107 omitted
2209
+
2210
+ # reduce 108 omitted
2211
+
2212
+ # reduce 109 omitted
2213
+
2214
+ # reduce 110 omitted
2215
+
2216
+ # reduce 111 omitted
2217
+
2218
+ # reduce 112 omitted
2219
+
2220
+ # reduce 113 omitted
2221
+
2222
+ # reduce 114 omitted
2223
+
2224
+ # reduce 115 omitted
2225
+
2226
+ # reduce 116 omitted
2227
+
2228
+ # reduce 117 omitted
2229
+
2230
+ # reduce 118 omitted
2231
+
2232
+ # reduce 119 omitted
2233
+
2234
+ # reduce 120 omitted
2235
+
2236
+ # reduce 121 omitted
2237
+
2238
+ # reduce 122 omitted
2239
+
2240
+ # reduce 123 omitted
2241
+
2242
+ # reduce 124 omitted
2243
+
2244
+ # reduce 125 omitted
2245
+
2246
+ # reduce 126 omitted
2247
+
2248
+ # reduce 127 omitted
2249
+
2250
+ # reduce 128 omitted
2251
+
2252
+ # reduce 129 omitted
2253
+
2254
+ # reduce 130 omitted
2255
+
2256
+ # reduce 131 omitted
2257
+
2258
+ # reduce 132 omitted
2259
+
2260
+ # reduce 133 omitted
2261
+
2262
+ # reduce 134 omitted
2263
+
2264
+ # reduce 135 omitted
2265
+
2266
+ # reduce 136 omitted
2267
+
2268
+ # reduce 137 omitted
2269
+
2270
+ # reduce 138 omitted
2271
+
2272
+ # reduce 139 omitted
2273
+
2274
+ module_eval(<<'.,.,', 'parser.y', 560)
2275
+ def _reduce_140(val, _values, result)
2276
+ result = nil
2277
+ result
2278
+ end
2279
+ .,.,
2280
+
2281
+ module_eval(<<'.,.,', 'parser.y', 562)
2282
+ def _reduce_141(val, _values, result)
2283
+ val[1].each {|p| insert_bound_variable(p.name) }
2284
+
2285
+ result = LocatedValue.new(value: val[1], location: val[0].location + val[2].location)
2286
+
2287
+ result
2288
+ end
2289
+ .,.,
2290
+
2291
+ module_eval(<<'.,.,', 'parser.y', 569)
2292
+ def _reduce_142(val, _values, result)
2293
+ result = Declarations::ModuleTypeParams.new()
2294
+ result.add(val[0])
2295
+
2296
+ result
2297
+ end
2298
+ .,.,
2299
+
2300
+ module_eval(<<'.,.,', 'parser.y', 573)
2301
+ def _reduce_143(val, _values, result)
2302
+ result = val[0].add(val[2])
2303
+
2304
+ result
2305
+ end
2306
+ .,.,
2307
+
2308
+ module_eval(<<'.,.,', 'parser.y', 578)
2309
+ def _reduce_144(val, _values, result)
2310
+ result = Declarations::ModuleTypeParams::TypeParam.new(name: val[2].value.to_sym,
2311
+ variance: val[1],
2312
+ skip_validation: val[0])
2313
+
2314
+ result
2315
+ end
2316
+ .,.,
2317
+
2318
+ module_eval(<<'.,.,', 'parser.y', 584)
2319
+ def _reduce_145(val, _values, result)
2320
+ result = :invariant
2321
+ result
2322
+ end
2323
+ .,.,
2324
+
2325
+ module_eval(<<'.,.,', 'parser.y', 585)
2326
+ def _reduce_146(val, _values, result)
2327
+ result = :covariant
2328
+ result
2329
+ end
2330
+ .,.,
2331
+
2332
+ module_eval(<<'.,.,', 'parser.y', 586)
2333
+ def _reduce_147(val, _values, result)
2334
+ result = :contravariant
2335
+ result
2336
+ end
2337
+ .,.,
2338
+
2339
+ module_eval(<<'.,.,', 'parser.y', 589)
2340
+ def _reduce_148(val, _values, result)
2341
+ result = false
2342
+ result
2343
+ end
2344
+ .,.,
2345
+
2346
+ module_eval(<<'.,.,', 'parser.y', 590)
2347
+ def _reduce_149(val, _values, result)
2348
+ result = true
2349
+ result
2350
+ end
2351
+ .,.,
2352
+
2353
+ module_eval(<<'.,.,', 'parser.y', 593)
2354
+ def _reduce_150(val, _values, result)
2355
+ result = nil
2356
+ result
2357
+ end
2358
+ .,.,
2359
+
2360
+ module_eval(<<'.,.,', 'parser.y', 595)
2361
+ def _reduce_151(val, _values, result)
2362
+ val[1].each {|var| insert_bound_variable(var) }
2363
+
2364
+ result = LocatedValue.new(value: val[1],
2365
+ location: val[0].location + val[2].location)
2366
+
2367
+ result
2368
+ end
2369
+ .,.,
2370
+
2371
+ module_eval(<<'.,.,', 'parser.y', 603)
2372
+ def _reduce_152(val, _values, result)
2373
+ result = [val[0].value.to_sym]
2374
+
2375
+ result
2376
+ end
2377
+ .,.,
2378
+
2379
+ module_eval(<<'.,.,', 'parser.y', 606)
2380
+ def _reduce_153(val, _values, result)
2381
+ result = val[0].push(val[2].value.to_sym)
2382
+
2383
+ result
2384
+ end
2385
+ .,.,
2386
+
2387
+ module_eval(<<'.,.,', 'parser.y', 611)
2388
+ def _reduce_154(val, _values, result)
2389
+ location = val[1].location + val[3].location
2390
+ result = Members::Alias.new(
2391
+ new_name: val[2].value.to_sym,
2392
+ old_name: val[3].value.to_sym,
2393
+ kind: :instance,
2394
+ annotations: val[0],
2395
+ location: location,
2396
+ comment: leading_comment(val[0].first&.location || location)
2397
+ )
2398
+
2399
+ result
2400
+ end
2401
+ .,.,
2402
+
2403
+ module_eval(<<'.,.,', 'parser.y', 622)
2404
+ def _reduce_155(val, _values, result)
2405
+ location = val[1].location + val[7].location
2406
+ result = Members::Alias.new(
2407
+ new_name: val[4].value.to_sym,
2408
+ old_name: val[7].value.to_sym,
2409
+ kind: :singleton,
2410
+ annotations: val[0],
2411
+ location: location,
2412
+ comment: leading_comment(val[0].first&.location || location)
2413
+ )
2414
+
2415
+ result
2416
+ end
2417
+ .,.,
2418
+
2419
+ module_eval(<<'.,.,', 'parser.y', 635)
2420
+ def _reduce_156(val, _values, result)
2421
+ location = val[1].location + val[4].location
2422
+ result = Declarations::Alias.new(name: val[2].value,
2423
+ type: val[4],
2424
+ annotations: val[0],
2425
+ location: location,
2426
+ comment: leading_comment(val[0].first&.location || location))
2427
+
2428
+ result
2429
+ end
2430
+ .,.,
2431
+
2432
+ module_eval(<<'.,.,', 'parser.y', 645)
2433
+ def _reduce_157(val, _values, result)
2434
+ location = val[0].location + val[2].location
2435
+ result = Declarations::Constant.new(name: val[0].value,
2436
+ type: val[2],
2437
+ location: location,
2438
+ comment: leading_comment(location))
2439
+
2440
+ result
2441
+ end
2442
+ .,.,
2443
+
2444
+ module_eval(<<'.,.,', 'parser.y', 652)
2445
+ def _reduce_158(val, _values, result)
2446
+ location = (val[0] || val[1]).location + val[2].location
2447
+ name = TypeName.new(name: val[1].value, namespace: val[0]&.value || Namespace.empty)
2448
+ result = Declarations::Constant.new(name: name,
2449
+ type: val[2],
2450
+ location: location,
2451
+ comment: leading_comment(location))
2452
+
2453
+ result
2454
+ end
2455
+ .,.,
2456
+
2457
+ module_eval(<<'.,.,', 'parser.y', 662)
2458
+ def _reduce_159(val, _values, result)
2459
+ location = val[0].location + val[2].location
2460
+ result = Declarations::Global.new(name: val[0].value.to_sym,
2461
+ type: val[2],
2462
+ location: location,
2463
+ comment: leading_comment(location))
2464
+
2465
+ result
2466
+ end
2467
+ .,.,
2468
+
2469
+ # reduce 160 omitted
2470
+
2471
+ module_eval(<<'.,.,', 'parser.y', 672)
2472
+ def _reduce_161(val, _values, result)
2473
+ types = case l = val[0]
2474
+ when Types::Union
2475
+ l.types + [val[2]]
2476
+ else
2477
+ [l, val[2]]
2478
+ end
2479
+
2480
+ result = Types::Union.new(types: types, location: val[0].location + val[2].location)
2481
+
2482
+ result
2483
+ end
2484
+ .,.,
2485
+
2486
+ module_eval(<<'.,.,', 'parser.y', 682)
2487
+ def _reduce_162(val, _values, result)
2488
+ types = case l = val[0]
2489
+ when Types::Intersection
2490
+ l.types + [val[2]]
2491
+ else
2492
+ [l, val[2]]
2493
+ end
2494
+
2495
+ result = Types::Intersection.new(types: types,
2496
+ location: val[0].location + val[2].location)
2497
+
2498
+ result
2499
+ end
2500
+ .,.,
2501
+
2502
+ module_eval(<<'.,.,', 'parser.y', 695)
2503
+ def _reduce_163(val, _values, result)
2504
+ result = Types::Bases::Void.new(location: val[0].location)
2505
+
2506
+ result
2507
+ end
2508
+ .,.,
2509
+
2510
+ module_eval(<<'.,.,', 'parser.y', 698)
2511
+ def _reduce_164(val, _values, result)
2512
+ RBS.logger.warn "`any` type is deprecated. Use `untyped` instead. (#{val[0].location.to_s})"
2513
+ result = Types::Bases::Any.new(location: val[0].location)
2514
+
2515
+ result
2516
+ end
2517
+ .,.,
2518
+
2519
+ module_eval(<<'.,.,', 'parser.y', 702)
2520
+ def _reduce_165(val, _values, result)
2521
+ result = Types::Bases::Any.new(location: val[0].location)
2522
+
2523
+ result
2524
+ end
2525
+ .,.,
2526
+
2527
+ module_eval(<<'.,.,', 'parser.y', 705)
2528
+ def _reduce_166(val, _values, result)
2529
+ result = Types::Bases::Bool.new(location: val[0].location)
2530
+
2531
+ result
2532
+ end
2533
+ .,.,
2534
+
2535
+ module_eval(<<'.,.,', 'parser.y', 708)
2536
+ def _reduce_167(val, _values, result)
2537
+ result = Types::Bases::Nil.new(location: val[0].location)
2538
+
2539
+ result
2540
+ end
2541
+ .,.,
2542
+
2543
+ module_eval(<<'.,.,', 'parser.y', 711)
2544
+ def _reduce_168(val, _values, result)
2545
+ result = Types::Bases::Top.new(location: val[0].location)
2546
+
2547
+ result
2548
+ end
2549
+ .,.,
2550
+
2551
+ module_eval(<<'.,.,', 'parser.y', 714)
2552
+ def _reduce_169(val, _values, result)
2553
+ result = Types::Bases::Bottom.new(location: val[0].location)
2554
+
2555
+ result
2556
+ end
2557
+ .,.,
2558
+
2559
+ module_eval(<<'.,.,', 'parser.y', 717)
2560
+ def _reduce_170(val, _values, result)
2561
+ result = Types::Bases::Self.new(location: val[0].location)
2562
+
2563
+ result
2564
+ end
2565
+ .,.,
2566
+
2567
+ module_eval(<<'.,.,', 'parser.y', 720)
2568
+ def _reduce_171(val, _values, result)
2569
+ result = Types::Optional.new(type: Types::Bases::Self.new(location: val[0].location),
2570
+ location: val[0].location)
2571
+
2572
+ result
2573
+ end
2574
+ .,.,
2575
+
2576
+ module_eval(<<'.,.,', 'parser.y', 724)
2577
+ def _reduce_172(val, _values, result)
2578
+ result = Types::Bases::Instance.new(location: val[0].location)
2579
+
2580
+ result
2581
+ end
2582
+ .,.,
2583
+
2584
+ module_eval(<<'.,.,', 'parser.y', 727)
2585
+ def _reduce_173(val, _values, result)
2586
+ result = Types::Bases::Class.new(location: val[0].location)
2587
+
2588
+ result
2589
+ end
2590
+ .,.,
2591
+
2592
+ module_eval(<<'.,.,', 'parser.y', 730)
2593
+ def _reduce_174(val, _values, result)
2594
+ result = Types::Literal.new(literal: true, location: val[0].location)
2595
+
2596
+ result
2597
+ end
2598
+ .,.,
2599
+
2600
+ module_eval(<<'.,.,', 'parser.y', 733)
2601
+ def _reduce_175(val, _values, result)
2602
+ result = Types::Literal.new(literal: false, location: val[0].location)
2603
+
2604
+ result
2605
+ end
2606
+ .,.,
2607
+
2608
+ module_eval(<<'.,.,', 'parser.y', 736)
2609
+ def _reduce_176(val, _values, result)
2610
+ result = Types::Literal.new(literal: val[0].value, location: val[0].location)
2611
+
2612
+ result
2613
+ end
2614
+ .,.,
2615
+
2616
+ module_eval(<<'.,.,', 'parser.y', 739)
2617
+ def _reduce_177(val, _values, result)
2618
+ result = Types::Literal.new(literal: val[0].value, location: val[0].location)
2619
+
2620
+ result
2621
+ end
2622
+ .,.,
2623
+
2624
+ module_eval(<<'.,.,', 'parser.y', 742)
2625
+ def _reduce_178(val, _values, result)
2626
+ result = Types::Literal.new(literal: val[0].value, location: val[0].location)
2627
+
2628
+ result
2629
+ end
2630
+ .,.,
2631
+
2632
+ module_eval(<<'.,.,', 'parser.y', 745)
2633
+ def _reduce_179(val, _values, result)
2634
+ name = val[0].value
2635
+ args = []
2636
+ location = val[0].location
2637
+
2638
+ case
2639
+ when name.class?
2640
+ if is_bound_variable?(name.name)
2641
+ result = Types::Variable.new(name: name.name, location: location)
2642
+ else
2643
+ result = Types::ClassInstance.new(name: name, args: args, location: location)
2644
+ end
2645
+ when name.alias?
2646
+ result = Types::Alias.new(name: name, location: location)
2647
+ when name.interface?
2648
+ result = Types::Interface.new(name: name, args: args, location: location)
2649
+ end
2650
+
2651
+ result
2652
+ end
2653
+ .,.,
2654
+
2655
+ module_eval(<<'.,.,', 'parser.y', 763)
2656
+ def _reduce_180(val, _values, result)
2657
+ name = val[0].value
2658
+ args = val[2]
2659
+ location = val[0].location + val[3].location
2660
+
2661
+ case
2662
+ when name.class?
2663
+ if is_bound_variable?(name.name)
2664
+ raise SemanticsError.new("#{name.name} is type variable and cannot be applied", subject: name, location: location)
2665
+ end
2666
+ result = Types::ClassInstance.new(name: name, args: args, location: location)
2667
+ when name.interface?
2668
+ result = Types::Interface.new(name: name, args: args, location: location)
2669
+ else
2670
+ raise SyntaxError.new(token_str: "kLBRACKET", error_value: val[1])
2671
+ end
2672
+
2673
+ result
2674
+ end
2675
+ .,.,
2676
+
2677
+ module_eval(<<'.,.,', 'parser.y', 780)
2678
+ def _reduce_181(val, _values, result)
2679
+ location = val[0].location + val[1].location
2680
+ result = Types::Tuple.new(types: [], location: location)
2681
+
2682
+ result
2683
+ end
2684
+ .,.,
2685
+
2686
+ module_eval(<<'.,.,', 'parser.y', 784)
2687
+ def _reduce_182(val, _values, result)
2688
+ location = val[0].location + val[2].location
2689
+ types = val[1]
2690
+ result = Types::Tuple.new(types: types, location: location)
2691
+
2692
+ result
2693
+ end
2694
+ .,.,
2695
+
2696
+ module_eval(<<'.,.,', 'parser.y', 789)
2697
+ def _reduce_183(val, _values, result)
2698
+ type = val[1].dup
2699
+ type.instance_eval do
2700
+ @location = val[0].location + val[2].location
2701
+ end
2702
+ result = type
2703
+
2704
+ result
2705
+ end
2706
+ .,.,
2707
+
2708
+ module_eval(<<'.,.,', 'parser.y', 796)
2709
+ def _reduce_184(val, _values, result)
2710
+ result = Types::ClassSingleton.new(name: val[2].value,
2711
+ location: val[0].location + val[3].location)
2712
+
2713
+ result
2714
+ end
2715
+ .,.,
2716
+
2717
+ module_eval(<<'.,.,', 'parser.y', 800)
2718
+ def _reduce_185(val, _values, result)
2719
+ result = Types::Proc.new(type: val[1].value, location: val[0].location + val[1].location)
2720
+
2721
+ result
2722
+ end
2723
+ .,.,
2724
+
2725
+ module_eval(<<'.,.,', 'parser.y', 803)
2726
+ def _reduce_186(val, _values, result)
2727
+ result = Types::Optional.new(type: val[0], location: val[0].location + val[1].location)
2728
+
2729
+ result
2730
+ end
2731
+ .,.,
2732
+
2733
+ # reduce 187 omitted
2734
+
2735
+ module_eval(<<'.,.,', 'parser.y', 809)
2736
+ def _reduce_188(val, _values, result)
2737
+ result = [val[0]]
2738
+
2739
+ result
2740
+ end
2741
+ .,.,
2742
+
2743
+ module_eval(<<'.,.,', 'parser.y', 812)
2744
+ def _reduce_189(val, _values, result)
2745
+ result = val[0] + [val[2]]
2746
+
2747
+ result
2748
+ end
2749
+ .,.,
2750
+
2751
+ module_eval(<<'.,.,', 'parser.y', 817)
2752
+ def _reduce_190(val, _values, result)
2753
+ result = Types::Record.new(
2754
+ fields: val[1],
2755
+ location: val[0].location + val[2].location
2756
+ )
2757
+
2758
+ result
2759
+ end
2760
+ .,.,
2761
+
2762
+ module_eval(<<'.,.,', 'parser.y', 825)
2763
+ def _reduce_191(val, _values, result)
2764
+ result = val[0]
2765
+
2766
+ result
2767
+ end
2768
+ .,.,
2769
+
2770
+ module_eval(<<'.,.,', 'parser.y', 828)
2771
+ def _reduce_192(val, _values, result)
2772
+ result = val[0].merge!(val[2])
2773
+
2774
+ result
2775
+ end
2776
+ .,.,
2777
+
2778
+ module_eval(<<'.,.,', 'parser.y', 833)
2779
+ def _reduce_193(val, _values, result)
2780
+ result = { val[0].value => val[2] }
2781
+
2782
+ result
2783
+ end
2784
+ .,.,
2785
+
2786
+ module_eval(<<'.,.,', 'parser.y', 836)
2787
+ def _reduce_194(val, _values, result)
2788
+ result = { val[0].value => val[2] }
2789
+
2790
+ result
2791
+ end
2792
+ .,.,
2793
+
2794
+ module_eval(<<'.,.,', 'parser.y', 839)
2795
+ def _reduce_195(val, _values, result)
2796
+ result = { val[0].value => val[2] }
2797
+
2798
+ result
2799
+ end
2800
+ .,.,
2801
+
2802
+ module_eval(<<'.,.,', 'parser.y', 842)
2803
+ def _reduce_196(val, _values, result)
2804
+ result = { val[0].value => val[1] }
2805
+
2806
+ result
2807
+ end
2808
+ .,.,
2809
+
2810
+ # reduce 197 omitted
2811
+
2812
+ module_eval(<<'.,.,', 'parser.y', 848)
2813
+ def _reduce_198(val, _values, result)
2814
+ result = val[0]
2815
+
2816
+ result
2817
+ end
2818
+ .,.,
2819
+
2820
+ # reduce 199 omitted
2821
+
2822
+ # reduce 200 omitted
2823
+
2824
+ # reduce 201 omitted
2825
+
2826
+ # reduce 202 omitted
2827
+
2828
+ module_eval(<<'.,.,', 'parser.y', 855)
2829
+ def _reduce_203(val, _values, result)
2830
+ location = val[0].location + val[4].location
2831
+ type = Types::Function.new(
2832
+ required_positionals: val[1][0],
2833
+ optional_positionals: val[1][1],
2834
+ rest_positionals: val[1][2],
2835
+ trailing_positionals: val[1][3],
2836
+ required_keywords: val[1][4],
2837
+ optional_keywords: val[1][5],
2838
+ rest_keywords: val[1][6],
2839
+ return_type: val[4],
2840
+ )
2841
+
2842
+ result = LocatedValue.new(value: type, location: location)
2843
+
2844
+ result
2845
+ end
2846
+ .,.,
2847
+
2848
+ module_eval(<<'.,.,', 'parser.y', 870)
2849
+ def _reduce_204(val, _values, result)
2850
+ location = val[0].location + val[1].location
2851
+ type = Types::Function.new(
2852
+ required_positionals: [],
2853
+ optional_positionals: [],
2854
+ rest_positionals: nil,
2855
+ trailing_positionals: [],
2856
+ required_keywords: {},
2857
+ optional_keywords: {},
2858
+ rest_keywords: nil,
2859
+ return_type: val[1]
2860
+ )
2861
+
2862
+ result = LocatedValue.new(value: type, location: location)
2863
+
2864
+ result
2865
+ end
2866
+ .,.,
2867
+
2868
+ module_eval(<<'.,.,', 'parser.y', 887)
2869
+ def _reduce_205(val, _values, result)
2870
+ result = val[2]
2871
+ result[0].unshift(val[0])
2872
+
2873
+ result
2874
+ end
2875
+ .,.,
2876
+
2877
+ module_eval(<<'.,.,', 'parser.y', 891)
2878
+ def _reduce_206(val, _values, result)
2879
+ result = empty_params_result
2880
+ result[0].unshift(val[0])
2881
+
2882
+ result
2883
+ end
2884
+ .,.,
2885
+
2886
+ # reduce 207 omitted
2887
+
2888
+ module_eval(<<'.,.,', 'parser.y', 898)
2889
+ def _reduce_208(val, _values, result)
2890
+ result = val[2]
2891
+ result[1].unshift(val[0])
2892
+
2893
+ result
2894
+ end
2895
+ .,.,
2896
+
2897
+ module_eval(<<'.,.,', 'parser.y', 902)
2898
+ def _reduce_209(val, _values, result)
2899
+ result = empty_params_result
2900
+ result[1].unshift(val[0])
2901
+
2902
+ result
2903
+ end
2904
+ .,.,
2905
+
2906
+ # reduce 210 omitted
2907
+
2908
+ module_eval(<<'.,.,', 'parser.y', 909)
2909
+ def _reduce_211(val, _values, result)
2910
+ result = val[2]
2911
+ result[2] = val[0]
2912
+
2913
+ result
2914
+ end
2915
+ .,.,
2916
+
2917
+ module_eval(<<'.,.,', 'parser.y', 913)
2918
+ def _reduce_212(val, _values, result)
2919
+ result = empty_params_result
2920
+ result[2] = val[0]
2921
+
2922
+ result
2923
+ end
2924
+ .,.,
2925
+
2926
+ # reduce 213 omitted
2927
+
2928
+ module_eval(<<'.,.,', 'parser.y', 920)
2929
+ def _reduce_214(val, _values, result)
2930
+ result = val[2]
2931
+ result[3].unshift(val[0])
2932
+
2933
+ result
2934
+ end
2935
+ .,.,
2936
+
2937
+ module_eval(<<'.,.,', 'parser.y', 924)
2938
+ def _reduce_215(val, _values, result)
2939
+ result = empty_params_result
2940
+ result[3].unshift(val[0])
2941
+
2942
+ result
2943
+ end
2944
+ .,.,
2945
+
2946
+ # reduce 216 omitted
2947
+
2948
+ module_eval(<<'.,.,', 'parser.y', 931)
2949
+ def _reduce_217(val, _values, result)
2950
+ result = empty_params_result
2951
+
2952
+ result
2953
+ end
2954
+ .,.,
2955
+
2956
+ module_eval(<<'.,.,', 'parser.y', 934)
2957
+ def _reduce_218(val, _values, result)
2958
+ result = val[2]
2959
+ result[4].merge!(val[0])
2960
+
2961
+ result
2962
+ end
2963
+ .,.,
2964
+
2965
+ module_eval(<<'.,.,', 'parser.y', 938)
2966
+ def _reduce_219(val, _values, result)
2967
+ result = empty_params_result
2968
+ result[4].merge!(val[0])
2969
+
2970
+ result
2971
+ end
2972
+ .,.,
2973
+
2974
+ module_eval(<<'.,.,', 'parser.y', 942)
2975
+ def _reduce_220(val, _values, result)
2976
+ result = val[2]
2977
+ result[5].merge!(val[0])
2978
+
2979
+ result
2980
+ end
2981
+ .,.,
2982
+
2983
+ module_eval(<<'.,.,', 'parser.y', 946)
2984
+ def _reduce_221(val, _values, result)
2985
+ result = empty_params_result
2986
+ result[5].merge!(val[0])
2987
+
2988
+ result
2989
+ end
2990
+ .,.,
2991
+
2992
+ module_eval(<<'.,.,', 'parser.y', 950)
2993
+ def _reduce_222(val, _values, result)
2994
+ result = empty_params_result
2995
+ result[6] = val[0]
2996
+
2997
+ result
2998
+ end
2999
+ .,.,
3000
+
3001
+ module_eval(<<'.,.,', 'parser.y', 956)
3002
+ def _reduce_223(val, _values, result)
3003
+ result = Types::Function::Param.new(type: val[0],
3004
+ name: val[1]&.value&.to_sym)
3005
+
3006
+ result
3007
+ end
3008
+ .,.,
3009
+
3010
+ module_eval(<<'.,.,', 'parser.y', 962)
3011
+ def _reduce_224(val, _values, result)
3012
+ result = Types::Function::Param.new(type: val[1],
3013
+ name: val[2]&.value&.to_sym)
3014
+
3015
+ result
3016
+ end
3017
+ .,.,
3018
+
3019
+ module_eval(<<'.,.,', 'parser.y', 968)
3020
+ def _reduce_225(val, _values, result)
3021
+ result = Types::Function::Param.new(type: val[1],
3022
+ name: val[2]&.value&.to_sym)
3023
+
3024
+ result
3025
+ end
3026
+ .,.,
3027
+
3028
+ module_eval(<<'.,.,', 'parser.y', 974)
3029
+ def _reduce_226(val, _values, result)
3030
+ param = Types::Function::Param.new(type: val[1],
3031
+ name: val[2]&.value&.to_sym)
3032
+ result = { val[0].value => param }
3033
+
3034
+ result
3035
+ end
3036
+ .,.,
3037
+
3038
+ module_eval(<<'.,.,', 'parser.y', 981)
3039
+ def _reduce_227(val, _values, result)
3040
+ param = Types::Function::Param.new(type: val[2],
3041
+ name: val[3]&.value&.to_sym)
3042
+ result = { val[1].value => param }
3043
+
3044
+ result
3045
+ end
3046
+ .,.,
3047
+
3048
+ module_eval(<<'.,.,', 'parser.y', 988)
3049
+ def _reduce_228(val, _values, result)
3050
+ result = Types::Function::Param.new(type: val[1],
3051
+ name: val[2]&.value&.to_sym)
3052
+
3053
+ result
3054
+ end
3055
+ .,.,
3056
+
3057
+ # reduce 229 omitted
3058
+
3059
+ # reduce 230 omitted
3060
+
3061
+ # reduce 231 omitted
3062
+
3063
+ # reduce 232 omitted
3064
+
3065
+ module_eval(<<'.,.,', 'parser.y', 997)
3066
+ def _reduce_233(val, _values, result)
3067
+ namespace = val[0]&.value || Namespace.empty
3068
+ name = val[1].value.to_sym
3069
+ type_name = TypeName.new(namespace: namespace, name: name)
3070
+ location = (loc0 = val[0]&.location) ? loc0 + val[1].location : val[1].location
3071
+ result = LocatedValue.new(value: type_name, location: location)
3072
+
3073
+ result
3074
+ end
3075
+ .,.,
3076
+
3077
+ # reduce 234 omitted
3078
+
3079
+ # reduce 235 omitted
3080
+
3081
+ # reduce 236 omitted
3082
+
3083
+ module_eval(<<'.,.,', 'parser.y', 1009)
3084
+ def _reduce_237(val, _values, result)
3085
+ namespace = val[0]&.value || Namespace.empty
3086
+ name = val[1].value.to_sym
3087
+ type_name = TypeName.new(namespace: namespace, name: name)
3088
+ location = (loc0 = val[0]&.location) ? loc0 + val[1].location : val[1].location
3089
+ result = LocatedValue.new(value: type_name, location: location)
3090
+
3091
+ result
3092
+ end
3093
+ .,.,
3094
+
3095
+ module_eval(<<'.,.,', 'parser.y', 1018)
3096
+ def _reduce_238(val, _values, result)
3097
+ namespace = val[0]&.value || Namespace.empty
3098
+ name = val[1].value.to_sym
3099
+ type_name = TypeName.new(namespace: namespace, name: name)
3100
+ location = (loc0 = val[0]&.location) ? loc0 + val[1].location : val[1].location
3101
+ result = LocatedValue.new(value: type_name, location: location)
3102
+
3103
+ result
3104
+ end
3105
+ .,.,
3106
+
3107
+ module_eval(<<'.,.,', 'parser.y', 1027)
3108
+ def _reduce_239(val, _values, result)
3109
+ result = nil
3110
+
3111
+ result
3112
+ end
3113
+ .,.,
3114
+
3115
+ module_eval(<<'.,.,', 'parser.y', 1030)
3116
+ def _reduce_240(val, _values, result)
3117
+ result = LocatedValue.new(value: Namespace.root, location: val[0].location)
3118
+
3119
+ result
3120
+ end
3121
+ .,.,
3122
+
3123
+ module_eval(<<'.,.,', 'parser.y', 1033)
3124
+ def _reduce_241(val, _values, result)
3125
+ namespace = Namespace.parse(val[1].value).absolute!
3126
+ result = LocatedValue.new(value: namespace, location: val[0].location + val[1].location)
3127
+
3128
+ result
3129
+ end
3130
+ .,.,
3131
+
3132
+ module_eval(<<'.,.,', 'parser.y', 1037)
3133
+ def _reduce_242(val, _values, result)
3134
+ namespace = Namespace.parse(val[0].value)
3135
+ result = LocatedValue.new(value: namespace, location: val[0].location)
3136
+
3137
+ result
3138
+ end
3139
+ .,.,
3140
+
3141
+ def _reduce_none(val, _values, result)
3142
+ val[0]
3143
+ end
3144
+
3145
+ end # class Parser
3146
+ end # module RBS
3147
+
3148
+