rbs 0.13.1 → 0.18.0

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