# # DO NOT MODIFY!!!! # This file is automatically generated by Racc 1.5.0 # from Racc grammar file "". # require 'racc/parser.rb' module RBS class Parser < Racc::Parser module_eval(<<'...end parser.y/module_eval...', 'parser.y', 1051) Types = RBS::Types Namespace = RBS::Namespace TypeName = RBS::TypeName Declarations = RBS::AST::Declarations Members = RBS::AST::Members MethodType = RBS::MethodType Annotation = RBS::AST::Annotation class LocatedValue attr_reader :location attr_reader :value def initialize(location:, value:) @location = location @value = value end end require "strscan" attr_reader :input attr_reader :buffer attr_reader :eof_re def initialize(type, buffer:, eof_re:) super() @type = type @buffer = buffer @input = StringScanner.new(buffer.content) @eof_re = eof_re @eof = false @bound_variables_stack = [] @comments = {} @ascii_only = buffer.content.ascii_only? end def start_merged_variables_scope set = @bound_variables_stack.last&.dup || Set.new @bound_variables_stack.push set end def start_new_variables_scope @bound_variables_stack.push Set.new end def reset_variable_scope @bound_variables_stack.pop end def insert_bound_variable(var) @bound_variables_stack.last << var end def is_bound_variable?(var) (@bound_variables_stack.last || Set.new).member?(var) end def self.parse_signature(input, eof_re: nil) case input when RBS::Buffer buffer = input else buffer = RBS::Buffer.new(name: nil, content: input.to_s) end self.new(:SIGNATURE, buffer: buffer, eof_re: eof_re).do_parse end def self.parse_type(input, variables: [], eof_re: nil) case input when RBS::Buffer buffer = input else buffer = RBS::Buffer.new(name: nil, content: input.to_s) end self.new(:TYPE, buffer: buffer, eof_re: eof_re).yield_self do |parser| parser.start_new_variables_scope variables.each do |var| parser.insert_bound_variable var end parser.do_parse ensure parser.reset_variable_scope end end def self.parse_method_type(input, variables: [], eof_re: nil) case input when RBS::Buffer buffer = input else buffer = RBS::Buffer.new(name: nil, content: input.to_s) end self.new(:METHODTYPE, buffer: buffer, eof_re: eof_re).yield_self do |parser| parser.start_new_variables_scope variables.each do |var| parser.insert_bound_variable var end parser.do_parse ensure parser.reset_variable_scope end end def leading_comment(location) @comments[location.start_line-1] end def push_comment(string, location) if (comment = leading_comment(location)) && comment.location.start_column == location.start_column comment.concat(string: "#{string}\n", location: location) @comments[comment.location.end_line] = comment else new_comment = AST::Comment.new(string: "#{string}\n", location: location) @comments[new_comment.location.end_line] = new_comment end end def new_token(type, value = input.matched) charpos = charpos(input) start_index = charpos - input.matched.size end_index = charpos location = RBS::Location.new(buffer: buffer, start_pos: start_index, end_pos: end_index) [type, LocatedValue.new(location: location, value: value)] end def charpos(scanner) if @ascii_only scanner.pos else scanner.charpos end end def empty_params_result [ [], [], nil, [], {}, {}, nil ] end KEYWORDS = { "class" => :kCLASS, "type" => :kTYPE, "def" => :kDEF, "self" => :kSELF, "void" => :kVOID, "any" => :kANY, "untyped" => :kUNTYPED, "top" => :kTOP, "bot" => :kBOT, "instance" => :kINSTANCE, "bool" => :kBOOL, "nil" => :kNIL, "true" => :kTRUE, "false" => :kFALSE, "singleton" => :kSINGLETON, "interface" => :kINTERFACE, "end" => :kEND, "include" => :kINCLUDE, "extend" => :kEXTEND, "prepend" => :kPREPEND, "module" => :kMODULE, "attr_reader" => :kATTRREADER, "attr_writer" => :kATTRWRITER, "attr_accessor" => :kATTRACCESSOR, "public" => :kPUBLIC, "private" => :kPRIVATE, "alias" => :kALIAS, "extension" => :kEXTENSION, "incompatible" => :kINCOMPATIBLE, "unchecked" => :kUNCHECKED, "overload" => :kOVERLOAD, "out" => :kOUT, "in" => :kIN, } KEYWORDS_RE = /#{Regexp.union(*KEYWORDS.keys)}\b/ PUNCTS = { "===" => :tOPERATOR, "==" => :tOPERATOR, "=~" => :tOPERATOR, "!~" => :tOPERATOR, "!=" => :tOPERATOR, ">=" => :tOPERATOR, "<<" => :tOPERATOR, "<=>" => :tOPERATOR, "<=" => :tOPERATOR, ">>" => :tOPERATOR, ">" => :tOPERATOR, "~" => :tOPERATOR, "+@" => :tOPERATOR, "+" => :tOPERATOR, "[]=" => :tOPERATOR, "[]" => :tOPERATOR, "::" => :kCOLON2, ":" => :kCOLON, "(" => :kLPAREN, ")" => :kRPAREN, "[" => :kLBRACKET, "]" => :kRBRACKET, "{" => :kLBRACE, "}" => :kRBRACE, "," => :kCOMMA, "|" => :kBAR, "&" => :kAMP, "^" => :kHAT, "->" => :kARROW, "=>" => :kFATARROW, "=" => :kEQ, "?" => :kQUESTION, "!" => :kEXCLAMATION, "**" => :kSTAR2, "*" => :kSTAR, "..." => :kDOT3, "." => :kDOT, "<" => :kLT, "-@" => :tOPERATOR, "-" => :tOPERATOR, "/" => :tOPERATOR, "`" => :tOPERATOR, "%" => :tOPERATOR, } PUNCTS_RE = Regexp.union(*PUNCTS.keys) ANNOTATION_RE = Regexp.union(/%a\{.*?\}/, /%a\[.*?\]/, /%a\(.*?\)/, /%a\<.*?\>/, /%a\|.*?\|/) def next_token if @type type = @type @type = nil return [:"type_#{type}", nil] end return if @eof while true return if input.eos? case when input.scan(/\s+/) # skip when input.scan(/#(( *)|( ?(?.*)))\n/) charpos = charpos(input) start_index = charpos - input.matched.size end_index = charpos-1 location = RBS::Location.new(buffer: buffer, start_pos: start_index, end_pos: end_index) push_comment input[:string] || "", location else break end end case when eof_re && input.scan(eof_re) @eof = true [:tEOF, input.matched] when input.scan(/`[a-zA-Z_]\w*`/) s = input.matched.yield_self {|s| s[1, s.length-2] } new_token(:tQUOTEDIDENT, s) when input.scan(/`(\\`|[^` :])+`/) s = input.matched.yield_self {|s| s[1, s.length-2] }.gsub(/\\`/, '`') new_token(:tQUOTEDMETHOD, s) when input.scan(ANNOTATION_RE) s = input.matched.yield_self {|s| s[3, s.length-4] }.strip new_token(:tANNOTATION, s) when input.scan(/self\?/) new_token(:kSELFQ, "self?") when input.scan(/(([a-zA-Z]\w*)|(_\w+))=/) new_token(:tWRITE_ATTR) when input.scan(KEYWORDS_RE) new_token(KEYWORDS[input.matched], input.matched.to_sym) when input.scan(/:((@{,2}|\$)?\w+(\?|\!)?|\+|\-)\b?/) s = input.matched.yield_self {|s| s[1, s.length] }.to_sym new_token(:tSYMBOL, s) when input.scan(/[+-]?\d[\d_]*/) new_token(:tINTEGER, input.matched.to_i) when input.scan(PUNCTS_RE) new_token(PUNCTS[input.matched]) when input.scan(/(::)?([A-Z]\w*::)+/) new_token(:tNAMESPACE) when input.scan(/[a-z_]\w*:/) new_token(:tLKEYWORD, input.matched.chop.to_sym) when input.scan(/[A-Z]\w*:/) new_token(:tUKEYWORD, input.matched.chop.to_sym) when input.scan(/\$[A-Za-z_]\w*/) new_token(:tGLOBALIDENT) when input.scan(/@[a-zA-Z_]\w*/) new_token(:tIVAR, input.matched.to_sym) when input.scan(/@@[a-zA-Z_]\w*/) new_token(:tCLASSVAR, input.matched.to_sym) when input.scan(/_[a-zA-Z]\w*\b/) new_token(:tINTERFACEIDENT) when input.scan(/[A-Z]\w*\b/) new_token(:tUIDENT) when input.scan(/[a-z_]\w*\b/) new_token(:tLIDENT) when input.scan(/"(\\"|[^"])*"/) s = input.matched.yield_self {|s| s[1, s.length - 2] }.gsub(/\\"/, '"') new_token(:tSTRING, s) when input.scan(/'(\\'|[^'])*'/) s = input.matched.yield_self {|s| s[1, s.length - 2] }.gsub(/\\'/, "'") new_token(:tSTRING, s) else raise "Unexpected token: #{input.peek(10)}..." end end def on_error(token_id, error_value, value_stack) raise SyntaxError.new(token_str: token_to_str(token_id), error_value: error_value, value_stack: value_stack) end class SyntaxError < StandardError attr_reader :token_str, :error_value, :value_stack def initialize(token_str:, error_value:, value_stack: nil) @token_str = token_str @error_value = error_value @value_stack = value_stack super "parse error on value: #{error_value.inspect} (#{token_str})" end end class SemanticsError < StandardError attr_reader :subject, :location, :original_message def initialize(message, subject:, location:) @subject = subject @location = location @original_message = message super "parse error on #{location}: #{message}" end end ...end parser.y/module_eval... ##### State transition tables begin ### clist = [ '339,340,33,341,74,277,278,33,33,352,50,378,33,338,33,33,404,350,5,377', '207,208,209,210,211,212,213,214,218,37,215,206,216,217,102,113,103,104', '105,119,33,32,51,334,328,329,32,32,332,330,333,32,299,32,32,331,118', '106,107,108,110,112,111,327,336,337,109,114,116,197,85,359,42,120,121', '117,122,339,340,32,341,58,59,43,33,33,50,50,229,33,338,33,33,48,198', '86,86,207,208,209,210,211,212,213,214,218,64,215,206,216,217,102,113', '103,104,105,119,33,51,51,334,328,329,32,32,332,330,333,32,194,32,32', '331,118,106,107,108,110,112,111,327,336,337,109,114,116,339,340,39,341', '120,121,117,122,81,156,32,142,195,338,155,322,143,40,41,144,207,208', '209,210,211,212,213,214,353,393,215,206,216,217,102,113,103,104,105', '119,86,87,145,334,328,329,39,274,332,330,333,2,3,4,86,331,118,106,107', '108,110,112,111,327,336,337,109,114,116,40,41,162,275,120,121,117,122', '339,340,146,341,58,59,61,62,74,63,318,40,41,338,154,395,394,270,271', '86,207,208,209,210,211,212,213,214,218,314,215,206,216,217,102,113,103', '104,105,119,86,86,157,334,328,329,58,59,332,330,333,159,55,54,56,331', '118,106,107,108,110,112,111,327,336,337,109,114,116,339,340,161,341', '120,121,117,122,58,59,40,41,41,338,55,54,56,40,41,164,207,208,209,210', '211,212,213,214,218,156,215,206,216,217,102,113,103,104,105,119,40,41', '-107,334,328,329,40,41,332,330,333,385,386,40,41,331,118,106,107,108', '110,112,111,327,336,337,109,114,116,40,41,40,41,120,121,117,122,339', '340,-108,341,58,59,40,41,40,41,40,41,-109,338,40,41,40,41,40,41,207', '208,209,210,211,212,213,214,218,-110,215,206,216,217,102,113,103,104', '105,119,40,41,-111,334,328,329,40,41,332,330,333,40,41,363,364,331,118', '106,107,108,110,112,111,327,336,337,109,114,116,339,340,-112,341,120', '121,117,122,40,41,40,41,-113,338,-114,-115,-116,-117,48,-132,207,208', '209,210,211,212,213,214,218,169,215,206,216,217,102,113,103,104,105', '119,170,171,172,334,328,329,173,174,332,330,333,175,42,199,232,331,118', '106,107,108,110,112,111,327,336,337,109,114,116,233,235,236,237,120', '121,117,122,339,340,239,341,58,59,81,243,243,243,249,252,42,338,255', '257,261,263,265,266,207,208,209,210,211,212,213,214,218,42,215,206,216', '217,102,113,103,104,105,119,268,305,307,334,328,329,261,309,332,330', '333,265,319,320,321,331,118,106,107,108,110,112,111,327,336,337,109', '114,116,33,357,58,59,120,121,117,122,22,23,21,362,26,-215,25,362,30', '362,91,92,93,94,95,96,97,98,115,16,99,90,100,101,102,113,103,104,105', '119,369,32,370,371,372,28,373,137,375,138,140,376,379,380,390,399,118', '106,107,108,110,112,111,400,401,404,109,114,116,33,405,58,59,120,121', '117,122,22,23,21,406,26,407,25,,30,,91,92,93,94,95,96,97,98,115,16,99', '90,100,101,102,113,103,104,105,119,,32,,,,28,,,,,,,,,,,118,106,107,108', '110,112,111,,,,109,114,116,33,,58,59,120,121,117,122,22,23,21,,26,-215', '25,,30,,91,92,93,94,95,96,97,98,115,16,99,90,100,101,102,113,103,104', '105,119,,32,,,,28,,205,,,140,,,,,,118,106,107,108,110,112,111,,,,109', '114,116,33,,58,59,120,121,117,122,22,23,21,,26,-215,25,,30,,91,92,93', '94,95,96,97,98,115,16,99,90,100,101,102,113,103,104,105,119,,32,,,,28', ',205,,,140,,,,,,118,106,107,108,110,112,111,,,,109,114,116,33,,58,59', '120,121,117,122,22,23,21,,26,-215,25,,30,,91,92,93,94,95,96,97,98,115', '16,99,90,100,101,102,113,103,104,105,119,,32,,,,28,,137,,138,140,,,', ',,118,106,107,108,110,112,111,,,,109,114,116,33,,58,59,120,121,117,122', '22,23,21,,26,-215,25,,30,,91,92,93,94,95,96,97,98,115,16,99,90,100,101', '102,113,103,104,105,119,,32,,,-4,28,-237,137,33,138,140,-237,78,,,74', '118,106,107,108,110,112,111,,,,109,114,116,,,,,120,121,117,122,,,166', '33,167,58,59,,,,32,22,23,21,,26,-215,25,,30,,91,92,93,94,95,96,97,98', '115,16,99,90,100,101,102,113,103,104,105,119,39,32,,40,41,28,,137,,138', '140,,,,,,118,106,107,108,110,112,111,58,59,168,109,114,116,,,,,120,121', '117,122,,,207,208,209,210,211,212,213,214,218,,215,206,216,217,102,113', '103,104,105,119,,,,,,,,205,,,140,,,,,,118,106,107,108,110,112,111,58', '59,,109,114,116,,,,,120,121,117,122,,,207,208,209,210,211,212,213,214', '218,,215,206,216,217,102,113,103,104,105,119,,,,,,,,205,,,140,,,,,,118', '106,107,108,110,112,111,58,59,,109,114,116,,,,,120,121,117,122,,,207', '208,209,210,211,212,213,214,218,,215,206,216,217,102,113,103,104,105', '119,166,,167,166,,167,166,,167,166,,167,166,,167,,118,106,107,108,110', '112,111,,,,109,114,116,,,,,120,121,117,122,,,,,,40,41,,40,41,,40,41', ',40,41,,40,41,,150,,,153,,151,,168,,,168,,,168,,-237,168,33,,168,-237', '78,294,295,74,152,-237,,33,,,-237,78,294,295,74,149,,,,-237,,33,296', ',-237,78,294,295,74,,,291,290,296,,32,,,,,,,291,290,,,32,296,,,150,282', ',153,,151,291,290,318,-237,32,33,310,,-237,78,294,295,74,,,,,,,152,358', '314,315,311,312,313,,,,316,149,296,,,,,,,,,291,290,,33,32,,,,,,,22,23', '21,,26,,25,,30,306,8,12,19,20,9,10,13,14,15,16,17,18,11,27,33,,,,,,', '32,22,23,21,28,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27,33', ',,,,,,32,22,23,21,28,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11', '27,33,,,,,,,32,22,23,21,28,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17', '18,11,27,33,,,,,,,32,22,23,21,28,26,,25,,30,,8,12,19,20,9,10,13,14,15', '16,17,18,11,27,33,,,,,,,32,22,23,21,28,26,,25,,30,,8,12,19,20,9,10,13', '14,15,16,17,18,11,27,33,,,,,,,32,22,23,21,28,26,,25,45,30,,8,12,19,20', '9,10,13,14,15,16,17,18,11,27,33,,,,,,,32,22,23,21,28,26,,25,,30,,8,12', '19,20,9,10,13,14,15,16,17,18,11,27,33,,,,,,,32,22,23,21,28,26,,25,,30', ',8,12,19,20,9,10,13,14,15,16,17,18,11,27,33,,,,,,,32,22,23,21,28,26', ',25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27,33,,,,,,,32,22,23,21', '28,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27,33,,,,,,,32,22', '23,21,28,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27,33,,,,', ',,32,22,23,21,28,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27', '33,,,,,,,32,22,23,21,28,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18', '11,27,33,,,,,,,32,22,23,21,28,26,,25,,30,,8,12,19,20,9,10,13,14,15,16', '17,18,11,27,33,,,,,,,32,22,23,21,28,26,,25,,30,,8,12,19,20,9,10,13,14', '15,16,17,18,11,27,33,,,,,,,32,22,23,21,28,26,,25,,30,,8,12,19,20,9,10', '13,14,15,16,17,18,11,27,33,,,,,,,32,22,23,21,28,26,,25,,30,,8,12,19', '20,9,10,13,14,15,16,17,18,11,27,33,,,,,,,32,22,23,21,28,26,,25,,30,', '8,12,19,20,9,10,13,14,15,16,17,18,11,27,33,,,,,,,32,22,23,21,28,26,', '25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27,33,,,,,,,32,22,23,21', '28,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27,33,,,,,,,32,22', '23,21,28,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27,33,,,,', ',,32,22,23,21,28,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27', '33,,,,,,,32,22,23,21,28,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18', '11,27,33,,,,,,,32,22,23,21,28,26,,25,,30,,8,12,19,20,9,10,13,14,15,16', '17,18,11,27,33,,,,,,,32,22,23,21,28,26,,25,,30,,8,12,19,20,9,10,13,14', '15,16,17,18,11,27,33,,,,,,,32,22,23,21,28,26,,25,,30,,8,12,19,20,9,10', '13,14,15,16,17,18,11,27,33,,,,,,,32,22,23,21,28,26,,25,,30,,8,12,19', '20,9,10,13,14,15,16,17,18,11,27,33,,,,,,,32,22,23,21,28,26,,25,,30,', '8,12,19,20,9,10,13,14,15,16,17,18,11,27,33,,,,,,,32,22,23,21,28,26,', '25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27,33,,,,,,,32,22,23,21', '28,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27,33,,,,,,,32,22', '23,21,28,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27,33,,,,', ',,32,22,23,21,28,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18,11,27', '33,,,,,,,32,22,23,21,28,26,,25,,30,,8,12,19,20,9,10,13,14,15,16,17,18', '11,27,33,,,,,,,32,22,23,21,28,26,,25,,30,,8,12,19,20,9,10,13,14,15,16', '17,18,11,27,33,,,,,,,32,22,23,21,28,26,,25,,30,,8,12,19,20,9,10,13,14', '15,16,17,18,11,27,,,,,,,,32,,,,28' ] racc_action_table = arr = ::Array.new(2553, nil) idx = 0 clist.each do |str| str.split(',', -1).each do |i| arr[idx] = i.to_i unless i.empty? idx += 1 end end clist = [ '373,373,315,373,267,260,260,257,265,317,28,362,263,373,229,316,407,317', '1,362,373,373,373,373,373,373,373,373,373,5,373,373,373,373,373,373', '373,373,373,373,314,315,28,373,373,373,257,265,373,373,373,263,267,229', '316,373,373,373,373,373,373,373,373,373,373,373,373,373,373,160,46,324', '7,373,373,373,373,312,312,314,312,312,312,24,188,187,194,235,187,186', '312,185,48,27,160,46,324,312,312,312,312,312,312,312,312,312,32,312', '312,312,312,312,312,312,312,312,312,153,194,235,312,312,312,188,187', '312,312,312,186,158,185,48,312,312,312,312,312,312,312,312,312,312,312', '312,312,312,318,318,35,318,312,312,312,312,36,77,153,52,158,318,77,298', '53,6,6,54,318,318,318,318,318,318,318,318,318,381,318,318,318,318,318', '318,318,318,318,318,298,47,55,318,318,318,6,258,318,318,318,0,0,0,381', '318,318,318,318,318,318,318,318,318,318,318,318,318,318,47,47,84,258', '318,318,318,318,384,384,56,384,384,384,31,31,74,31,304,250,250,384,76', '383,382,255,255,84,384,384,384,384,384,384,384,384,384,304,384,384,384', '384,384,384,384,384,384,384,383,382,78,384,384,384,30,30,384,384,384', '80,30,30,30,384,384,384,384,384,384,384,384,384,384,384,384,384,384', '406,406,81,406,384,384,384,384,143,143,147,147,82,406,143,143,143,389', '389,88,406,406,406,406,406,406,406,406,406,89,406,406,406,406,406,406', '406,406,406,406,391,391,90,406,406,406,392,392,406,406,406,372,372,367', '367,406,406,406,406,406,406,406,406,406,406,406,406,406,406,365,365', '182,182,406,406,406,406,313,313,91,313,313,313,183,183,184,184,360,360', '92,313,163,163,356,356,190,190,313,313,313,313,313,313,313,313,313,93', '313,313,313,313,313,313,313,313,313,313,191,191,94,313,313,313,192,192', '313,313,313,355,355,335,335,313,313,313,313,313,313,313,313,313,313', '313,313,313,313,354,354,95,354,313,313,313,313,388,388,44,44,96,354', '97,98,99,100,101,115,354,354,354,354,354,354,354,354,354,125,354,354', '354,354,354,354,354,354,354,354,126,127,129,354,354,354,131,134,354', '354,354,135,141,170,189,354,354,354,354,354,354,354,354,354,354,354', '354,354,354,193,195,196,198,354,354,354,354,311,311,203,311,311,311', '226,227,228,230,231,234,238,311,241,242,243,244,245,247,311,311,311', '311,311,311,311,311,311,251,311,311,311,311,311,311,311,311,311,311', '253,269,273,311,311,311,275,276,311,311,311,280,294,295,296,311,311', '311,311,311,311,311,311,311,311,311,311,311,311,172,321,172,172,311', '311,311,311,172,172,172,326,172,172,172,344,172,346,172,172,172,172', '172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,347', '172,348,349,351,172,353,172,357,172,172,361,366,368,378,385,172,172', '172,172,172,172,172,386,387,396,172,172,172,137,398,137,137,172,172', '172,172,137,137,137,401,137,403,137,,137,,137,137,137,137,137,137,137', '137,137,137,137,137,137,137,137,137,137,137,137,137,,137,,,,137,,,,', ',,,,,,137,137,137,137,137,137,137,,,,137,137,137,239,,239,239,137,137', '137,137,239,239,239,,239,239,239,,239,,239,239,239,239,239,239,239,239', '239,239,239,239,239,239,239,239,239,239,239,239,,239,,,,239,,239,,,239', ',,,,,239,239,239,239,239,239,239,,,,239,239,239,173,,173,173,239,239', '239,239,173,173,173,,173,173,173,,173,,173,173,173,173,173,173,173,173', '173,173,173,173,173,173,173,173,173,173,173,173,,173,,,,173,,173,,,173', ',,,,,173,173,173,173,173,173,173,,,,173,173,173,159,,159,159,173,173', '173,173,159,159,159,,159,159,159,,159,,159,159,159,159,159,159,159,159', '159,159,159,159,159,159,159,159,159,159,159,159,,159,,,,159,,159,,159', '159,,,,,,159,159,159,159,159,159,159,,,,159,159,159,171,,171,171,159', '159,159,159,171,171,171,,171,171,171,,171,,171,171,171,171,171,171,171', '171,171,171,171,171,171,171,171,171,171,171,171,171,,171,,,34,171,34', '171,34,171,171,34,34,,,34,171,171,171,171,171,171,171,,,,171,171,171', ',,,,171,171,171,171,,,178,50,178,50,50,,,,34,50,50,50,,50,50,50,,50', ',50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,34,50,', '178,178,50,,50,,50,50,,,,,,50,50,50,50,50,50,50,175,175,178,50,50,50', ',,,,50,50,50,50,,,175,175,175,175,175,175,175,175,175,,175,175,175,175', '175,175,175,175,175,175,,,,,,,,175,,,175,,,,,,175,175,175,175,175,175', '175,174,174,,175,175,175,,,,,175,175,175,175,,,174,174,174,174,174,174', '174,174,174,,174,174,174,174,174,174,174,174,174,174,,,,,,,,174,,,174', ',,,,,174,174,174,174,174,174,174,205,205,,174,174,174,,,,,174,174,174', '174,,,205,205,205,205,205,205,205,205,205,,205,205,205,205,205,205,205', '205,205,205,179,,179,222,,222,123,,123,176,,176,180,,180,,205,205,205', '205,205,205,205,,,,205,205,205,,,,,205,205,205,205,,,,,,179,179,,222', '222,,123,123,,176,176,,180,180,,75,,,75,,75,,179,,,222,,,123,,264,176', '264,,180,264,264,264,264,264,75,279,,279,,,279,279,279,279,279,75,,', ',323,,323,264,,323,323,323,323,323,,,264,264,279,,264,,,,,,,279,279', ',,279,323,,,281,264,,281,,281,323,323,281,272,323,272,279,,272,272,272', '272,272,,,,,,,281,323,281,281,281,281,281,,,,281,281,272,,,,,,,,,272', '272,,154,272,,,,,,,154,154,154,,154,,154,,154,272,154,154,154,154,154', '154,154,154,154,154,154,154,154,154,26,,,,,,,154,26,26,26,154,26,,26', ',26,,26,26,26,26,26,26,26,26,26,26,26,26,26,26,40,,,,,,,26,40,40,40', '26,40,,40,,40,,40,40,40,40,40,40,40,40,40,40,40,40,40,40,41,,,,,,,40', '41,41,41,40,41,,41,,41,,41,41,41,41,41,41,41,41,41,41,41,41,41,41,43', ',,,,,,41,43,43,43,41,43,,43,,43,,43,43,43,43,43,43,43,43,43,43,43,43', '43,43,86,,,,,,,43,86,86,86,43,86,,86,,86,,86,86,86,86,86,86,86,86,86', '86,86,86,86,86,25,,,,,,,86,25,25,25,86,25,,25,25,25,,25,25,25,25,25', '25,25,25,25,25,25,25,25,25,233,,,,,,,25,233,233,233,25,233,,233,,233', ',233,233,233,233,233,233,233,233,233,233,233,233,233,233,266,,,,,,,233', '266,266,266,233,266,,266,,266,,266,266,266,266,266,266,266,266,266,266', '266,266,266,266,138,,,,,,,266,138,138,138,266,138,,138,,138,,138,138', '138,138,138,138,138,138,138,138,138,138,138,138,139,,,,,,,138,139,139', '139,138,139,,139,,139,,139,139,139,139,139,139,139,139,139,139,139,139', '139,139,140,,,,,,,139,140,140,140,139,140,,140,,140,,140,140,140,140', '140,140,140,140,140,140,140,140,140,140,232,,,,,,,140,232,232,232,140', '232,,232,,232,,232,232,232,232,232,232,232,232,232,232,232,232,232,232', '144,,,,,,,232,144,144,144,232,144,,144,,144,,144,144,144,144,144,144', '144,144,144,144,144,144,144,144,145,,,,,,,144,145,145,145,144,145,,145', ',145,,145,145,145,145,145,145,145,145,145,145,145,145,145,145,57,,,', ',,,145,57,57,57,145,57,,57,,57,,57,57,57,57,57,57,57,57,57,57,57,57', '57,57,307,,,,,,,57,307,307,307,57,307,,307,,307,,307,307,307,307,307', '307,307,307,307,307,307,307,307,307,319,,,,,,,307,319,319,319,307,319', ',319,,319,,319,319,319,319,319,319,319,319,319,319,319,319,319,319,320', ',,,,,,319,320,320,320,319,320,,320,,320,,320,320,320,320,320,320,320', '320,320,320,320,320,320,320,146,,,,,,,320,146,146,146,320,146,,146,', '146,,146,146,146,146,146,146,146,146,146,146,146,146,146,146,325,,,', ',,,146,325,325,325,146,325,,325,,325,,325,325,325,325,325,325,325,325', '325,325,325,325,325,325,199,,,,,,,325,199,199,199,325,199,,199,,199', ',199,199,199,199,199,199,199,199,199,199,199,199,199,199,2,,,,,,,199', '2,2,2,199,2,,2,,2,,2,2,2,2,2,2,2,2,2,2,2,2,2,2,343,,,,,,,2,343,343,343', '2,343,,343,,343,,343,343,343,343,343,343,343,343,343,343,343,343,343', '343,345,,,,,,,343,345,345,345,343,345,,345,,345,,345,345,345,345,345', '345,345,345,345,345,345,345,345,345,155,,,,,,,345,155,155,155,345,155', ',155,,155,,155,155,155,155,155,155,155,155,155,155,155,155,155,155,157', ',,,,,,155,157,157,157,155,157,,157,,157,,157,157,157,157,157,157,157', '157,157,157,157,157,157,157,51,,,,,,,157,51,51,51,157,51,,51,,51,,51', '51,51,51,51,51,51,51,51,51,51,51,51,51,369,,,,,,,51,369,369,369,51,369', ',369,,369,,369,369,369,369,369,369,369,369,369,369,369,369,369,369,370', ',,,,,,369,370,370,370,369,370,,370,,370,,370,370,370,370,370,370,370', '370,370,370,370,370,370,370,371,,,,,,,370,371,371,371,370,371,,371,', '371,,371,371,371,371,371,371,371,371,371,371,371,371,371,371,375,,,', ',,,371,375,375,375,371,375,,375,,375,,375,375,375,375,375,375,375,375', '375,375,375,375,375,375,376,,,,,,,375,376,376,376,375,376,,376,,376', ',376,376,376,376,376,376,376,376,376,376,376,376,376,376,379,,,,,,,376', '379,379,379,376,379,,379,,379,,379,379,379,379,379,379,379,379,379,379', '379,379,379,379,380,,,,,,,379,380,380,380,379,380,,380,,380,,380,380', '380,380,380,380,380,380,380,380,380,380,380,380,177,,,,,,,380,177,177', '177,380,177,,177,,177,,177,177,177,177,177,177,177,177,177,177,177,177', '177,177,,,,,,,,177,,,,177' ] racc_action_check = arr = ::Array.new(2553, nil) idx = 0 clist.each do |str| str.split(',', -1).each do |i| arr[idx] = i.to_i unless i.empty? idx += 1 end end racc_action_pointer = [ 126, 18, 2089, nil, nil, 29, 118, 23, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 65, 1577, 1417, 77, -6, nil, 263, 227, 102, nil, 961, 74, 136, nil, nil, nil, 1449, 1481, nil, 1513, 403, nil, 51, 170, 88, nil, 993, 2249, 136, 118, 112, 135, 172, 1865, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 220, 1236, 195, 153, 223, nil, 258, 292, 258, nil, 198, nil, 1545, nil, 294, 319, 292, 329, 339, 356, 369, 398, 408, 410, 411, 412, 413, 440, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 415, nil, nil, nil, nil, nil, nil, nil, 1215, nil, 425, 461, 435, nil, 436, nil, 440, nil, nil, 441, 445, nil, 647, 1673, 1705, 1737, 441, nil, 294, 1801, 1833, 1993, 257, nil, nil, nil, nil, nil, 113, 1385, 2185, nil, 2217, 109, 848, 50, nil, nil, 338, nil, nil, nil, nil, nil, nil, 443, 915, 580, 781, 1111, 1052, 1218, 2505, 993, 1209, 1221, nil, 318, 330, 332, 87, 85, 81, 80, 438, 342, 364, 370, 459, 70, 488, 492, nil, 508, 2057, nil, nil, nil, 473, nil, 1170, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1212, nil, nil, nil, 503, 504, 505, 10, 506, 520, 1769, 1609, 505, 71, nil, nil, 478, 714, nil, 513, 473, 454, 490, 489, nil, 516, nil, nil, 189, 495, nil, 534, nil, 238, nil, 3, 174, nil, -70, nil, nil, 8, 1282, 4, 1641, -7, nil, 539, nil, nil, 1347, 539, nil, 484, 560, nil, nil, 1293, 522, 1307, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 525, 526, 514, nil, 142, nil, nil, nil, nil, nil, 192, nil, nil, 1897, nil, nil, nil, 513, 75, 367, 36, -2, 11, -61, 144, 1929, 1961, 576, nil, 1307, 52, 2025, 579, nil, nil, nil, nil, nil, nil, nil, nil, 373, nil, nil, nil, nil, nil, nil, nil, 2121, 583, 2153, 585, 604, 606, 607, nil, 589, nil, 573, 436, 375, 340, 588, nil, nil, 334, 591, 2, nil, nil, 316, 592, 300, 593, 2281, 2313, 2345, 313, -2, nil, 2377, 2409, nil, 619, 2441, 2473, 156, 220, 219, 221, 582, 590, 616, 401, 264, nil, 287, 293, nil, nil, nil, 591, nil, 610, nil, nil, 607, nil, 619, nil, nil, 290, -40, nil, nil ] racc_action_default = [ -241, -241, -237, -6, -16, -241, -4, -160, -163, -164, -165, -166, -167, -168, -169, -170, -171, -172, -173, -174, -175, -176, -177, -178, -179, -237, -237, -241, -241, -187, -241, -241, -238, -240, -17, -4, -150, 410, -1, -5, -237, -237, -186, -237, -188, -181, -241, -241, -237, -185, -237, -237, -241, -191, -241, -241, -241, -237, -199, -200, -231, -232, -233, -234, -239, -2, -7, -8, -9, -10, -11, -12, -13, -14, -17, -241, -241, -241, -241, -3, -82, -241, -161, -162, -241, -182, -237, -183, -241, -241, -173, -163, -167, -174, -175, -164, -165, -168, -169, -172, -166, -118, -119, -120, -121, -122, -123, -124, -125, -126, -127, -128, -129, -130, -131, -170, -133, -134, -135, -136, -137, -138, -139, -227, -197, -241, -241, -204, -205, -207, -208, -210, -211, -214, -217, -219, -220, -237, -237, -237, -237, -202, -190, -241, -237, -237, -237, -196, -18, -15, -15, -15, -15, -237, -237, -237, -236, -237, -84, -237, -241, -152, -180, -189, -184, -221, -228, -229, -230, -198, -241, -237, -237, -237, -215, -215, -227, -237, -227, -227, -227, -192, -193, -194, -195, -237, -237, -237, -237, -241, -157, -158, -159, -241, -241, -241, -241, -151, -241, -237, -203, -211, -206, -213, -209, -241, -107, -108, -109, -110, -111, -112, -113, -114, -115, -116, -117, -118, -132, -216, -218, -222, -227, -223, -224, -226, -150, -140, -140, -237, -140, -241, -237, -237, -241, -241, -83, -153, -201, -237, -225, -241, -23, -148, -28, -34, -30, -33, -59, -235, -156, -81, -85, -241, -212, -241, -34, -237, -241, -142, -145, -149, -34, -237, -17, -237, -237, -17, -86, -241, -20, -21, -17, -24, -141, -148, -241, -146, -147, -17, -29, -73, -27, -35, -36, -37, -38, -39, -40, -41, -42, -43, -44, -45, -241, -241, -241, -31, -241, -58, -60, -61, -62, -63, -73, -34, -22, -237, -143, -144, -26, -241, -241, -241, -237, -237, -237, -70, -241, -237, -237, -241, -32, -17, -241, -237, -52, -89, -90, -91, -92, -93, -94, -95, -96, -97, -100, -101, -102, -103, -104, -105, -106, -237, -52, -237, -52, -64, -66, -68, -71, -241, -74, -132, -241, -55, -56, -241, -19, -25, -46, -241, -241, -98, -99, -48, -241, -50, -241, -237, -237, -237, -75, -241, -154, -237, -237, -53, -241, -237, -237, -241, -241, -241, -241, -241, -241, -241, -57, -47, -54, -49, -51, -65, -67, -69, -16, -87, -241, -76, -77, -241, -72, -78, -79, -88, -241, -16, -155, -80 ] racc_goto_table = [ 6, 57, 75, 46, 80, 189, 49, 126, 77, 88, 141, 52, 165, 342, 342, 342, 245, 177, 38, 259, 342, 84, 89, 201, 47, 204, 402, 326, 344, 346, 203, 203, 264, 60, 354, 219, 220, 409, 82, 83, 361, 34, 148, 272, 35, 66, 65, 79, 123, 279, 280, 308, 269, 256, 262, 147, 342, 297, 366, 301, 368, 242, 244, 302, 248, 221, 303, 223, 224, 225, 374, 185, 186, 187, 188, 342, 230, 267, 300, 351, 384, 247, 396, 158, 163, 177, 342, 193, 258, 387, 276, 254, 323, 160, 202, 1, nil, 203, nil, nil, 398, nil, nil, nil, nil, nil, nil, nil, 342, nil, nil, 240, nil, nil, 57, 247, 196, 247, nil, nil, nil, nil, 408, nil, 181, nil, nil, nil, 200, nil, nil, nil, nil, nil, nil, 176, 178, 179, 180, nil, nil, nil, 182, 183, 184, nil, 226, 227, 228, nil, nil, nil, 190, 191, nil, 192, nil, 123, 238, 89, 89, 89, 231, nil, nil, nil, 347, 348, 349, 123, 123, 123, 234, nil, nil, 222, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 251, nil, 241, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 253, nil, nil, nil, nil, 273, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 250, 89, nil, nil, nil, 304, nil, 123, 77, nil, nil, nil, nil, nil, 298, nil, 77, nil, nil, nil, nil, nil, nil, 77, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 325, 343, 345, 324, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 77, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 355, 356, nil, nil, nil, nil, 360, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 365, nil, 367, nil, nil, nil, 381, 382, 383, nil, nil, nil, nil, nil, 397, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 388, 389, nil, nil, 391, 392 ] racc_goto_check = [ 2, 36, 16, 23, 18, 27, 51, 50, 59, 17, 49, 61, 74, 53, 53, 53, 25, 63, 3, 55, 53, 23, 59, 69, 2, 69, 46, 37, 37, 37, 64, 64, 20, 75, 37, 70, 70, 46, 2, 2, 38, 4, 16, 20, 5, 6, 3, 3, 2, 20, 25, 55, 19, 22, 24, 2, 53, 26, 38, 29, 38, 21, 21, 30, 21, 74, 35, 74, 74, 74, 37, 14, 14, 14, 14, 53, 39, 40, 41, 42, 44, 27, 45, 47, 2, 63, 53, 48, 54, 37, 57, 69, 20, 58, 65, 1, nil, 64, nil, nil, 37, nil, nil, nil, nil, nil, nil, nil, 53, nil, nil, 74, nil, nil, 36, 27, 50, 27, nil, nil, nil, nil, 37, nil, 61, nil, nil, nil, 50, nil, nil, nil, nil, nil, nil, 2, 2, 2, 2, nil, nil, nil, 2, 2, 2, nil, 17, 17, 17, nil, nil, nil, 2, 2, nil, 2, nil, 2, 49, 59, 59, 59, 59, nil, nil, nil, 27, 27, 27, 2, 2, 2, 51, nil, nil, 2, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 49, nil, 18, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 51, nil, nil, nil, nil, 17, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 2, 59, nil, nil, nil, 16, nil, 2, 59, nil, nil, nil, nil, nil, 23, nil, 59, nil, nil, nil, nil, nil, nil, 59, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 36, 36, 36, 23, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 59, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 2, 2, nil, nil, nil, nil, 2, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 2, nil, 2, nil, nil, nil, 23, 23, 23, nil, nil, nil, nil, nil, 36, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 2, 2, nil, nil, 2, 2 ] racc_goto_pointer = [ nil, 95, -2, 12, 38, 40, 11, nil, nil, nil, nil, nil, nil, nil, -78, nil, -32, -39, -32, -203, -213, -166, -189, -22, -190, -213, -208, -148, nil, -208, -204, nil, nil, nil, nil, -201, -29, -284, -286, -112, -171, -189, -238, nil, -292, -302, -370, 3, -71, -41, -43, -22, nil, -298, -155, -224, nil, -170, 12, -26, nil, -19, nil, -120, -142, -78, nil, nil, nil, -148, -139, nil, nil, nil, -111, 2 ] racc_goto_default = [ nil, nil, 44, nil, nil, 403, 293, 67, 68, 69, 70, 71, 72, 73, nil, 36, 281, 76, nil, nil, nil, nil, nil, nil, nil, nil, 246, 24, 283, 284, 285, 286, 287, 288, 289, 292, 124, nil, nil, nil, nil, nil, nil, 317, nil, nil, nil, nil, nil, 7, nil, nil, 335, 125, nil, nil, 260, nil, nil, 31, 29, nil, 53, 139, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, nil, nil ] racc_reduce_table = [ 0, 0, :racc_error, 3, 80, :_reduce_1, 3, 80, :_reduce_2, 3, 80, :_reduce_3, 0, 82, :_reduce_none, 1, 82, :_reduce_none, 0, 83, :_reduce_6, 2, 83, :_reduce_7, 1, 85, :_reduce_none, 1, 85, :_reduce_none, 1, 85, :_reduce_none, 1, 85, :_reduce_none, 1, 85, :_reduce_none, 1, 85, :_reduce_none, 1, 85, :_reduce_none, 0, 93, :_reduce_15, 0, 94, :_reduce_16, 0, 95, :_reduce_17, 2, 95, :_reduce_18, 10, 92, :_reduce_19, 1, 98, :_reduce_none, 1, 98, :_reduce_none, 8, 91, :_reduce_22, 0, 101, :_reduce_23, 2, 101, :_reduce_24, 5, 101, :_reduce_25, 8, 90, :_reduce_26, 7, 90, :_reduce_27, 0, 103, :_reduce_28, 2, 103, :_reduce_29, 1, 104, :_reduce_30, 3, 104, :_reduce_31, 4, 105, :_reduce_32, 1, 105, :_reduce_33, 0, 99, :_reduce_34, 2, 99, :_reduce_35, 1, 107, :_reduce_none, 1, 107, :_reduce_none, 1, 107, :_reduce_none, 1, 107, :_reduce_none, 1, 107, :_reduce_none, 1, 107, :_reduce_none, 1, 107, :_reduce_42, 1, 107, :_reduce_43, 1, 107, :_reduce_none, 1, 107, :_reduce_none, 4, 113, :_reduce_46, 6, 113, :_reduce_47, 4, 113, :_reduce_48, 6, 113, :_reduce_49, 4, 113, :_reduce_50, 6, 113, :_reduce_51, 0, 117, :_reduce_52, 2, 117, :_reduce_53, 3, 117, :_reduce_54, 3, 112, :_reduce_55, 3, 112, :_reduce_56, 5, 112, :_reduce_57, 7, 89, :_reduce_58, 0, 119, :_reduce_59, 2, 119, :_reduce_60, 1, 120, :_reduce_61, 1, 120, :_reduce_62, 1, 120, :_reduce_none, 3, 109, :_reduce_64, 6, 109, :_reduce_65, 3, 110, :_reduce_66, 6, 110, :_reduce_67, 3, 111, :_reduce_68, 6, 111, :_reduce_69, 0, 121, :_reduce_70, 1, 121, :_reduce_71, 7, 108, :_reduce_72, 0, 122, :_reduce_73, 2, 122, :_reduce_74, 0, 123, :_reduce_75, 2, 123, :_reduce_76, 2, 123, :_reduce_77, 1, 125, :_reduce_78, 1, 125, :_reduce_79, 3, 125, :_reduce_80, 6, 84, :_reduce_81, 0, 126, :_reduce_82, 3, 126, :_reduce_83, 0, 127, :_reduce_84, 3, 127, :_reduce_85, 4, 127, :_reduce_86, 1, 124, :_reduce_none, 2, 124, :_reduce_88, 1, 116, :_reduce_none, 1, 116, :_reduce_none, 1, 116, :_reduce_none, 1, 116, :_reduce_none, 1, 116, :_reduce_none, 1, 116, :_reduce_none, 1, 116, :_reduce_none, 1, 116, :_reduce_none, 1, 116, :_reduce_none, 2, 116, :_reduce_98, 2, 116, :_reduce_99, 1, 116, :_reduce_none, 1, 116, :_reduce_none, 1, 116, :_reduce_none, 1, 131, :_reduce_none, 1, 131, :_reduce_none, 1, 131, :_reduce_none, 1, 131, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 1, 132, :_reduce_none, 0, 100, :_reduce_140, 3, 100, :_reduce_141, 1, 133, :_reduce_142, 3, 133, :_reduce_143, 3, 134, :_reduce_144, 0, 136, :_reduce_145, 1, 136, :_reduce_146, 1, 136, :_reduce_147, 0, 135, :_reduce_148, 1, 135, :_reduce_149, 0, 97, :_reduce_150, 3, 97, :_reduce_151, 1, 137, :_reduce_152, 3, 137, :_reduce_153, 4, 114, :_reduce_154, 8, 114, :_reduce_155, 5, 86, :_reduce_156, 3, 87, :_reduce_157, 3, 87, :_reduce_158, 3, 88, :_reduce_159, 1, 81, :_reduce_none, 3, 81, :_reduce_161, 3, 81, :_reduce_162, 1, 128, :_reduce_163, 1, 128, :_reduce_164, 1, 128, :_reduce_165, 1, 128, :_reduce_166, 1, 128, :_reduce_167, 1, 128, :_reduce_168, 1, 128, :_reduce_169, 1, 128, :_reduce_170, 1, 128, :_reduce_171, 1, 128, :_reduce_172, 1, 128, :_reduce_173, 1, 128, :_reduce_174, 1, 128, :_reduce_175, 1, 128, :_reduce_176, 1, 128, :_reduce_177, 1, 128, :_reduce_178, 1, 128, :_reduce_179, 4, 128, :_reduce_180, 2, 128, :_reduce_181, 3, 128, :_reduce_182, 3, 128, :_reduce_183, 4, 128, :_reduce_184, 2, 128, :_reduce_185, 2, 128, :_reduce_186, 1, 128, :_reduce_none, 1, 102, :_reduce_188, 3, 102, :_reduce_189, 3, 139, :_reduce_190, 1, 140, :_reduce_191, 3, 140, :_reduce_192, 3, 141, :_reduce_193, 3, 141, :_reduce_194, 3, 141, :_reduce_195, 2, 141, :_reduce_196, 1, 142, :_reduce_none, 2, 142, :_reduce_198, 1, 115, :_reduce_none, 1, 115, :_reduce_none, 5, 130, :_reduce_201, 2, 130, :_reduce_202, 3, 129, :_reduce_203, 1, 129, :_reduce_204, 1, 129, :_reduce_none, 3, 144, :_reduce_206, 1, 144, :_reduce_207, 1, 144, :_reduce_none, 3, 146, :_reduce_209, 1, 146, :_reduce_210, 1, 146, :_reduce_none, 3, 148, :_reduce_212, 1, 148, :_reduce_213, 1, 148, :_reduce_none, 0, 149, :_reduce_215, 3, 149, :_reduce_216, 1, 149, :_reduce_217, 3, 149, :_reduce_218, 1, 149, :_reduce_219, 1, 149, :_reduce_220, 2, 143, :_reduce_221, 3, 145, :_reduce_222, 3, 147, :_reduce_223, 3, 150, :_reduce_224, 4, 151, :_reduce_225, 3, 152, :_reduce_226, 0, 153, :_reduce_none, 1, 153, :_reduce_none, 1, 153, :_reduce_none, 1, 153, :_reduce_none, 2, 106, :_reduce_231, 1, 154, :_reduce_none, 1, 154, :_reduce_none, 1, 154, :_reduce_none, 2, 118, :_reduce_235, 2, 96, :_reduce_236, 0, 138, :_reduce_237, 1, 138, :_reduce_238, 2, 138, :_reduce_239, 1, 138, :_reduce_240 ] racc_reduce_n = 241 racc_shift_n = 410 racc_token_table = { false => 0, :error => 1, :tUIDENT => 2, :tLIDENT => 3, :tNAMESPACE => 4, :tINTERFACEIDENT => 5, :tLKEYWORD => 6, :tUKEYWORD => 7, :tGLOBALIDENT => 8, :tIVAR => 9, :tCLASSVAR => 10, :tANNOTATION => 11, :tSTRING => 12, :tSYMBOL => 13, :tINTEGER => 14, :tWRITE_ATTR => 15, :kLPAREN => 16, :kRPAREN => 17, :kLBRACKET => 18, :kRBRACKET => 19, :kLBRACE => 20, :kRBRACE => 21, :kVOID => 22, :kNIL => 23, :kTRUE => 24, :kFALSE => 25, :kANY => 26, :kUNTYPED => 27, :kTOP => 28, :kBOT => 29, :kSELF => 30, :kSELFQ => 31, :kINSTANCE => 32, :kCLASS => 33, :kBOOL => 34, :kSINGLETON => 35, :kTYPE => 36, :kDEF => 37, :kMODULE => 38, :kPRIVATE => 39, :kPUBLIC => 40, :kALIAS => 41, :kCOLON => 42, :kCOLON2 => 43, :kCOMMA => 44, :kBAR => 45, :kAMP => 46, :kHAT => 47, :kARROW => 48, :kQUESTION => 49, :kEXCLAMATION => 50, :kSTAR => 51, :kSTAR2 => 52, :kFATARROW => 53, :kEQ => 54, :kDOT => 55, :kDOT3 => 56, :kLT => 57, :kINTERFACE => 58, :kEND => 59, :kINCLUDE => 60, :kEXTEND => 61, :kATTRREADER => 62, :kATTRWRITER => 63, :kATTRACCESSOR => 64, :tOPERATOR => 65, :tQUOTEDMETHOD => 66, :tQUOTEDIDENT => 67, :kPREPEND => 68, :kEXTENSION => 69, :kINCOMPATIBLE => 70, :type_TYPE => 71, :type_SIGNATURE => 72, :type_METHODTYPE => 73, :tEOF => 74, :kOUT => 75, :kIN => 76, :kUNCHECKED => 77, :kOVERLOAD => 78 } racc_nt_base = 79 racc_use_result_var = true Racc_arg = [ racc_action_table, racc_action_check, racc_action_default, racc_action_pointer, racc_goto_table, racc_goto_check, racc_goto_default, racc_goto_pointer, racc_nt_base, racc_reduce_table, racc_token_table, racc_shift_n, racc_reduce_n, racc_use_result_var ] Racc_token_to_s_table = [ "$end", "error", "tUIDENT", "tLIDENT", "tNAMESPACE", "tINTERFACEIDENT", "tLKEYWORD", "tUKEYWORD", "tGLOBALIDENT", "tIVAR", "tCLASSVAR", "tANNOTATION", "tSTRING", "tSYMBOL", "tINTEGER", "tWRITE_ATTR", "kLPAREN", "kRPAREN", "kLBRACKET", "kRBRACKET", "kLBRACE", "kRBRACE", "kVOID", "kNIL", "kTRUE", "kFALSE", "kANY", "kUNTYPED", "kTOP", "kBOT", "kSELF", "kSELFQ", "kINSTANCE", "kCLASS", "kBOOL", "kSINGLETON", "kTYPE", "kDEF", "kMODULE", "kPRIVATE", "kPUBLIC", "kALIAS", "kCOLON", "kCOLON2", "kCOMMA", "kBAR", "kAMP", "kHAT", "kARROW", "kQUESTION", "kEXCLAMATION", "kSTAR", "kSTAR2", "kFATARROW", "kEQ", "kDOT", "kDOT3", "kLT", "kINTERFACE", "kEND", "kINCLUDE", "kEXTEND", "kATTRREADER", "kATTRWRITER", "kATTRACCESSOR", "tOPERATOR", "tQUOTEDMETHOD", "tQUOTEDIDENT", "kPREPEND", "kEXTENSION", "kINCOMPATIBLE", "type_TYPE", "type_SIGNATURE", "type_METHODTYPE", "tEOF", "kOUT", "kIN", "kUNCHECKED", "kOVERLOAD", "$start", "target", "type", "eof", "signatures", "method_type", "signature", "type_decl", "const_decl", "global_decl", "interface_decl", "module_decl", "class_decl", "extension_decl", "start_new_scope", "start_merged_scope", "annotations", "class_name", "type_params", "extension_name", "class_members", "module_type_params", "super_class", "type_list", "colon_module_self_types", "module_self_types", "module_self_type", "qualified_name", "class_member", "method_member", "include_member", "extend_member", "prepend_member", "var_type_member", "attribute_member", "alias_member", "keyword", "method_name", "attr_var_opt", "interface_name", "interface_members", "interface_member", "overload", "attributes", "method_kind", "def_name", "method_types", "params_opt", "block_opt", "simple_type", "params", "function_type", "method_name0", "identifier_keywords", "module_type_params0", "module_type_param", "type_param_check", "type_param_variance", "type_params0", "namespace", "record_type", "record_fields", "record_field", "keyword_name", "required_positional", "optional_positional_params", "optional_positional", "rest_positional_param", "rest_positional", "trailing_positional_params", "keyword_params", "required_keyword", "optional_keyword", "rest_keyword", "var_name_opt", "simple_name" ] Racc_debug_parser = false ##### State transition tables end ##### # reduce 0 omitted module_eval(<<'.,.,', 'parser.y', 27) def _reduce_1(val, _values, result) result = val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 30) def _reduce_2(val, _values, result) result = val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 33) def _reduce_3(val, _values, result) result = val[1] result end .,., # reduce 4 omitted # reduce 5 omitted module_eval(<<'.,.,', 'parser.y', 39) def _reduce_6(val, _values, result) result = [] result end .,., module_eval(<<'.,.,', 'parser.y', 41) def _reduce_7(val, _values, result) result = val[0].push(val[1]) result end .,., # reduce 8 omitted # reduce 9 omitted # reduce 10 omitted # reduce 11 omitted # reduce 12 omitted # reduce 13 omitted # reduce 14 omitted module_eval(<<'.,.,', 'parser.y', 53) def _reduce_15(val, _values, result) start_new_variables_scope result end .,., module_eval(<<'.,.,', 'parser.y', 54) def _reduce_16(val, _values, result) start_merged_variables_scope result end .,., module_eval(<<'.,.,', 'parser.y', 57) def _reduce_17(val, _values, result) result = [] result end .,., module_eval(<<'.,.,', 'parser.y', 59) def _reduce_18(val, _values, result) result = val[1].unshift(Annotation.new(string: val[0].value, location: val[0].location)) result end .,., module_eval(<<'.,.,', 'parser.y', 64) def _reduce_19(val, _values, result) reset_variable_scope location = val[1].location + val[9].location result = Declarations::Extension.new( name: val[3].value, type_params: val[4]&.value || [], extension_name: val[6].value.to_sym, members: val[8], annotations: val[0], location: location, comment: leading_comment(val[0].first&.location || location) ) result end .,., # reduce 20 omitted # reduce 21 omitted module_eval(<<'.,.,', 'parser.y', 82) def _reduce_22(val, _values, result) reset_variable_scope location = val[1].location + val[7].location result = Declarations::Class.new( name: val[3].value, type_params: val[4]&.value || Declarations::ModuleTypeParams.empty, super_class: val[5], members: val[6], annotations: val[0], location: location, comment: leading_comment(val[0].first&.location || location) ) result end .,., module_eval(<<'.,.,', 'parser.y', 97) def _reduce_23(val, _values, result) result = nil result end .,., module_eval(<<'.,.,', 'parser.y', 99) def _reduce_24(val, _values, result) result = Declarations::Class::Super.new(name: val[1].value, args: []) result end .,., module_eval(<<'.,.,', 'parser.y', 103) def _reduce_25(val, _values, result) result = Declarations::Class::Super.new(name: val[1].value, args: val[3]) result end .,., module_eval(<<'.,.,', 'parser.y', 109) def _reduce_26(val, _values, result) reset_variable_scope location = val[1].location + val[7].location result = Declarations::Module.new( name: val[3].value, type_params: val[4]&.value || Declarations::ModuleTypeParams.empty, self_types: val[5], members: val[6], annotations: val[0], location: location, comment: leading_comment(val[0].first&.location || location) ) result end .,., module_eval(<<'.,.,', 'parser.y', 123) def _reduce_27(val, _values, result) reset_variable_scope location = val[1].location + val[6].location result = Declarations::Module.new( name: val[3].value, type_params: Declarations::ModuleTypeParams.empty, self_types: val[4], members: val[5], annotations: val[0], location: location, comment: leading_comment(val[0].first&.location || location) ) result end .,., module_eval(<<'.,.,', 'parser.y', 138) def _reduce_28(val, _values, result) result = [] result end .,., module_eval(<<'.,.,', 'parser.y', 140) def _reduce_29(val, _values, result) result = val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 145) def _reduce_30(val, _values, result) result = [val[0]] result end .,., module_eval(<<'.,.,', 'parser.y', 148) def _reduce_31(val, _values, result) result = val[0].push(val[2]) result end .,., module_eval(<<'.,.,', 'parser.y', 153) def _reduce_32(val, _values, result) name = val[0].value args = val[2] location = val[0].location + val[3].location case when name.class? result = Declarations::Module::Self.new(name: name, args: args, location: location) when name.interface? result = Declarations::Module::Self.new(name: name, args: args, location: location) else raise SemanticsError.new("Module self type should be instance or interface", subject: val[0], location: val[0].location) end result end .,., module_eval(<<'.,.,', 'parser.y', 167) def _reduce_33(val, _values, result) name = val[0].value args = [] location = val[0].location case when name.class? result = Declarations::Module::Self.new(name: name, args: args, location: location) when name.interface? result = Declarations::Module::Self.new(name: name, args: args, location: location) else raise SemanticsError.new("Module self type should be instance or interface", subject: val[0], location: val[0].location) end result end .,., module_eval(<<'.,.,', 'parser.y', 182) def _reduce_34(val, _values, result) result = [] result end .,., module_eval(<<'.,.,', 'parser.y', 184) def _reduce_35(val, _values, result) result = val[0].push(val[1]) result end .,., # reduce 36 omitted # reduce 37 omitted # reduce 38 omitted # reduce 39 omitted # reduce 40 omitted # reduce 41 omitted module_eval(<<'.,.,', 'parser.y', 195) def _reduce_42(val, _values, result) result = Members::Public.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 198) def _reduce_43(val, _values, result) result = Members::Private.new(location: val[0].location) result end .,., # reduce 44 omitted # reduce 45 omitted module_eval(<<'.,.,', 'parser.y', 205) def _reduce_46(val, _values, result) location = val[1].location + val[3].location result = Members::AttrReader.new(name: val[2].value, ivar_name: nil, type: val[3], annotations: val[0], location: location, comment: leading_comment(val[0].first&.location || location)) result end .,., module_eval(<<'.,.,', 'parser.y', 214) def _reduce_47(val, _values, result) location = val[1].location + val[5].location result = Members::AttrReader.new(name: val[2].value.to_sym, ivar_name: val[3], type: val[5], annotations: val[0], location: location, comment: leading_comment(val[0].first&.location || location)) result end .,., module_eval(<<'.,.,', 'parser.y', 223) def _reduce_48(val, _values, result) location = val[1].location + val[3].location result = Members::AttrWriter.new(name: val[2].value, ivar_name: nil, type: val[3], annotations: val[0], location: location, comment: leading_comment(val[0].first&.location || location)) result end .,., module_eval(<<'.,.,', 'parser.y', 232) def _reduce_49(val, _values, result) location = val[1].location + val[5].location result = Members::AttrWriter.new(name: val[2].value.to_sym, ivar_name: val[3], type: val[5], annotations: val[0], location: location, comment: leading_comment(val[0].first&.location || location)) result end .,., module_eval(<<'.,.,', 'parser.y', 241) def _reduce_50(val, _values, result) location = val[1].location + val[3].location result = Members::AttrAccessor.new(name: val[2].value, ivar_name: nil, type: val[3], annotations: val[0], location: location, comment: leading_comment(val[0].first&.location || location)) result end .,., module_eval(<<'.,.,', 'parser.y', 250) def _reduce_51(val, _values, result) location = val[1].location + val[5].location result = Members::AttrAccessor.new(name: val[2].value.to_sym, ivar_name: val[3], type: val[5], annotations: val[0], location: location, comment: leading_comment(val[0].first&.location || location)) result end .,., module_eval(<<'.,.,', 'parser.y', 260) def _reduce_52(val, _values, result) result = nil result end .,., module_eval(<<'.,.,', 'parser.y', 261) def _reduce_53(val, _values, result) result = false result end .,., module_eval(<<'.,.,', 'parser.y', 262) def _reduce_54(val, _values, result) result = val[1].value result end .,., module_eval(<<'.,.,', 'parser.y', 266) def _reduce_55(val, _values, result) location = val[0].location + val[2].location result = Members::InstanceVariable.new( name: val[0].value, type: val[2], location: location, comment: leading_comment(location) ) result end .,., module_eval(<<'.,.,', 'parser.y', 275) def _reduce_56(val, _values, result) type = val[2] if type.is_a?(Types::Variable) type = Types::ClassInstance.new( name: TypeName.new(name: type.name, namespace: Namespace.empty), args: [], location: type.location ) end location = val[0].location + val[2].location result = Members::ClassVariable.new( name: val[0].value, type: type, location: location, comment: leading_comment(location) ) result end .,., module_eval(<<'.,.,', 'parser.y', 294) def _reduce_57(val, _values, result) type = val[4] if type.is_a?(Types::Variable) type = Types::ClassInstance.new( name: TypeName.new(name: type.name, namespace: Namespace.empty), args: [], location: type.location ) end location = val[0].location + val[4].location result = Members::ClassInstanceVariable.new( name: val[2].value, type: type, location: location, comment: leading_comment(location) ) result end .,., module_eval(<<'.,.,', 'parser.y', 315) def _reduce_58(val, _values, result) reset_variable_scope location = val[1].location + val[6].location result = Declarations::Interface.new( name: val[3].value, type_params: val[4]&.value || Declarations::ModuleTypeParams.empty, members: val[5], annotations: val[0], location: location, comment: leading_comment(val[0].first&.location || location) ) result end .,., module_eval(<<'.,.,', 'parser.y', 329) def _reduce_59(val, _values, result) result = [] result end .,., module_eval(<<'.,.,', 'parser.y', 331) def _reduce_60(val, _values, result) result = val[0].push(val[1]) result end .,., module_eval(<<'.,.,', 'parser.y', 336) def _reduce_61(val, _values, result) unless val[0].kind == :instance raise SemanticsError.new("Interface cannot have singleton method", subject: val[0], location: val[0].location) end if val[0].types.last == :super raise SemanticsError.new("Interface method cannot have `super` type", subject: val[0], location: val[0].location) end result = val[0] result end .,., module_eval(<<'.,.,', 'parser.y', 347) def _reduce_62(val, _values, result) unless val[0].name.interface? raise SemanticsError.new("Interface should include an interface", subject: val[0], location: val[0].location) end result = val[0] result end .,., # reduce 63 omitted module_eval(<<'.,.,', 'parser.y', 357) def _reduce_64(val, _values, result) if val[2].value.alias? raise SemanticsError.new("Should include module or interface", subject: val[2].value, location: val[2].location) end location = val[1].location + val[2].location result = Members::Include.new(name: val[2].value, args: [], annotations: val[0], location: location, comment: leading_comment(val[0].first&.location || location)) result end .,., module_eval(<<'.,.,', 'parser.y', 368) def _reduce_65(val, _values, result) if val[2].value.alias? raise SemanticsError.new("Should include module or interface", subject: val[2].value, location: val[2].location) end location = val[1].location + val[5].location result = Members::Include.new(name: val[2].value, args: val[4], annotations: val[0], location: location, comment: leading_comment(val[0].first&.location || location)) result end .,., module_eval(<<'.,.,', 'parser.y', 381) def _reduce_66(val, _values, result) if val[2].value.alias? raise SemanticsError.new("Should extend module or interface", subject: val[2].value, location: val[2].location) end location = val[1].location + val[2].location result = Members::Extend.new(name: val[2].value, args: [], annotations: val[0], location: location, comment: leading_comment(val[0].first&.location || location)) result end .,., module_eval(<<'.,.,', 'parser.y', 392) def _reduce_67(val, _values, result) if val[2].value.alias? raise SemanticsError.new("Should extend module or interface", subject: val[2].value, location: val[2].location) end location = val[1].location + val[5].location result = Members::Extend.new(name: val[2].value, args: val[4], annotations: val[0], location: location, comment: leading_comment(val[0].first&.location || location)) result end .,., module_eval(<<'.,.,', 'parser.y', 405) def _reduce_68(val, _values, result) unless val[2].value.class? raise SemanticsError.new("Should prepend module", subject: val[2].value, location: val[2].location) end location = val[1].location + val[2].location result = Members::Prepend.new(name: val[2].value, args: [], annotations: val[0], location: location, comment: leading_comment(val[0].first&.location || location)) result end .,., module_eval(<<'.,.,', 'parser.y', 416) def _reduce_69(val, _values, result) unless val[2].value.class? raise SemanticsError.new("Should prepend module", subject: val[2].value, location: val[2].location) end location = val[1].location + val[5].location result = Members::Prepend.new(name: val[2].value, args: val[4], annotations: val[0], location: location, comment: leading_comment(val[0].first&.location || location)) result end .,., module_eval(<<'.,.,', 'parser.y', 428) def _reduce_70(val, _values, result) result = nil result end .,., module_eval(<<'.,.,', 'parser.y', 430) def _reduce_71(val, _values, result) RBS.logger.warn "`overload def` syntax is deprecated. Use `...` syntax instead." result = val[0] result end .,., module_eval(<<'.,.,', 'parser.y', 436) def _reduce_72(val, _values, result) location = val[3].location + val[6].last.location types = val[6].map do |type| case type when LocatedValue type.value else type end end last_type = val[6].last if last_type.is_a?(LocatedValue) && last_type.value == :dot3 overload = true val[6].pop else overload = false end result = Members::MethodDefinition.new( name: val[5].value, kind: val[4], types: val[6], annotations: val[0], location: location, comment: leading_comment(val[0].first&.location || val[1].first&.location || val[2]&.location || val[3].location), attributes: val[1].map(&:value), overload: overload || !!val[2] ) result end .,., module_eval(<<'.,.,', 'parser.y', 467) def _reduce_73(val, _values, result) result = [] result end .,., module_eval(<<'.,.,', 'parser.y', 469) def _reduce_74(val, _values, result) result = val[0].push(val[1]) result end .,., module_eval(<<'.,.,', 'parser.y', 473) def _reduce_75(val, _values, result) result = :instance result end .,., module_eval(<<'.,.,', 'parser.y', 474) def _reduce_76(val, _values, result) result = :singleton result end .,., module_eval(<<'.,.,', 'parser.y', 475) def _reduce_77(val, _values, result) result = :singleton_instance result end .,., module_eval(<<'.,.,', 'parser.y', 478) def _reduce_78(val, _values, result) result = [val[0]] result end .,., module_eval(<<'.,.,', 'parser.y', 479) def _reduce_79(val, _values, result) result = [LocatedValue.new(value: :dot3, location: val[0].location)] result end .,., module_eval(<<'.,.,', 'parser.y', 481) def _reduce_80(val, _values, result) result = val[2].unshift(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 486) def _reduce_81(val, _values, result) location = (val[1] || val[2] || val[3] || val[4]).location + val[5].location type_params = val[1]&.value || [] params = val[2]&.value || empty_params_result type = Types::Function.new( required_positionals: params[0], optional_positionals: params[1], rest_positionals: params[2], trailing_positionals: params[3], required_keywords: params[4], optional_keywords: params[5], rest_keywords: params[6], return_type: val[5] ) block = val[3]&.value result = MethodType.new(type_params: type_params, type: type, block: block, location: location) result end .,., module_eval(<<'.,.,', 'parser.y', 511) def _reduce_82(val, _values, result) result = nil result end .,., module_eval(<<'.,.,', 'parser.y', 513) def _reduce_83(val, _values, result) result = LocatedValue.new(value: val[1], location: val[0].location + val[2].location) result end .,., module_eval(<<'.,.,', 'parser.y', 517) def _reduce_84(val, _values, result) result = nil result end .,., module_eval(<<'.,.,', 'parser.y', 519) def _reduce_85(val, _values, result) block = MethodType::Block.new(type: val[1].value, required: true) result = LocatedValue.new(value: block, location: val[0].location + val[2].location) result end .,., module_eval(<<'.,.,', 'parser.y', 523) def _reduce_86(val, _values, result) block = MethodType::Block.new(type: val[2].value, required: false) result = LocatedValue.new(value: block, location: val[0].location + val[3].location) result end .,., # reduce 87 omitted module_eval(<<'.,.,', 'parser.y', 530) def _reduce_88(val, _values, result) result = LocatedValue.new(value: val[0].value.to_sym, location: val[0].location + val[1].location) result end .,., # reduce 89 omitted # reduce 90 omitted # reduce 91 omitted # reduce 92 omitted # reduce 93 omitted # reduce 94 omitted # reduce 95 omitted # reduce 96 omitted # reduce 97 omitted module_eval(<<'.,.,', 'parser.y', 539) def _reduce_98(val, _values, result) unless val[0].location.pred?(val[1].location) raise SyntaxError.new(token_str: "kQUESTION", error_value: val[1]) end result = LocatedValue.new(value: "#{val[0].value}?", location: val[0].location + val[1].location) result end .,., module_eval(<<'.,.,', 'parser.y', 547) def _reduce_99(val, _values, result) unless val[0].location.pred?(val[1].location) raise SyntaxError.new(token_str: "kEXCLAMATION", error_value: val[1]) end result = LocatedValue.new(value: "#{val[0].value}!", location: val[0].location + val[1].location) result end .,., # reduce 100 omitted # reduce 101 omitted # reduce 102 omitted # reduce 103 omitted # reduce 104 omitted # reduce 105 omitted # reduce 106 omitted # reduce 107 omitted # reduce 108 omitted # reduce 109 omitted # reduce 110 omitted # reduce 111 omitted # reduce 112 omitted # reduce 113 omitted # reduce 114 omitted # reduce 115 omitted # reduce 116 omitted # reduce 117 omitted # reduce 118 omitted # reduce 119 omitted # reduce 120 omitted # reduce 121 omitted # reduce 122 omitted # reduce 123 omitted # reduce 124 omitted # reduce 125 omitted # reduce 126 omitted # reduce 127 omitted # reduce 128 omitted # reduce 129 omitted # reduce 130 omitted # reduce 131 omitted # reduce 132 omitted # reduce 133 omitted # reduce 134 omitted # reduce 135 omitted # reduce 136 omitted # reduce 137 omitted # reduce 138 omitted # reduce 139 omitted module_eval(<<'.,.,', 'parser.y', 567) def _reduce_140(val, _values, result) result = nil result end .,., module_eval(<<'.,.,', 'parser.y', 569) def _reduce_141(val, _values, result) val[1].each {|p| insert_bound_variable(p.name) } result = LocatedValue.new(value: val[1], location: val[0].location + val[2].location) result end .,., module_eval(<<'.,.,', 'parser.y', 576) def _reduce_142(val, _values, result) result = Declarations::ModuleTypeParams.new() result.add(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 580) def _reduce_143(val, _values, result) result = val[0].add(val[2]) result end .,., module_eval(<<'.,.,', 'parser.y', 585) def _reduce_144(val, _values, result) result = Declarations::ModuleTypeParams::TypeParam.new(name: val[2].value.to_sym, variance: val[1], skip_validation: val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 591) def _reduce_145(val, _values, result) result = :invariant result end .,., module_eval(<<'.,.,', 'parser.y', 592) def _reduce_146(val, _values, result) result = :covariant result end .,., module_eval(<<'.,.,', 'parser.y', 593) def _reduce_147(val, _values, result) result = :contravariant result end .,., module_eval(<<'.,.,', 'parser.y', 596) def _reduce_148(val, _values, result) result = false result end .,., module_eval(<<'.,.,', 'parser.y', 597) def _reduce_149(val, _values, result) result = true result end .,., module_eval(<<'.,.,', 'parser.y', 600) def _reduce_150(val, _values, result) result = nil result end .,., module_eval(<<'.,.,', 'parser.y', 602) def _reduce_151(val, _values, result) val[1].each {|var| insert_bound_variable(var) } result = LocatedValue.new(value: val[1], location: val[0].location + val[2].location) result end .,., module_eval(<<'.,.,', 'parser.y', 610) def _reduce_152(val, _values, result) result = [val[0].value.to_sym] result end .,., module_eval(<<'.,.,', 'parser.y', 613) def _reduce_153(val, _values, result) result = val[0].push(val[2].value.to_sym) result end .,., module_eval(<<'.,.,', 'parser.y', 618) def _reduce_154(val, _values, result) location = val[1].location + val[3].location result = Members::Alias.new( new_name: val[2].value.to_sym, old_name: val[3].value.to_sym, kind: :instance, annotations: val[0], location: location, comment: leading_comment(val[0].first&.location || location) ) result end .,., module_eval(<<'.,.,', 'parser.y', 629) def _reduce_155(val, _values, result) location = val[1].location + val[7].location result = Members::Alias.new( new_name: val[4].value.to_sym, old_name: val[7].value.to_sym, kind: :singleton, annotations: val[0], location: location, comment: leading_comment(val[0].first&.location || location) ) result end .,., module_eval(<<'.,.,', 'parser.y', 642) def _reduce_156(val, _values, result) location = val[1].location + val[4].location result = Declarations::Alias.new(name: val[2].value, type: val[4], annotations: val[0], location: location, comment: leading_comment(val[0].first&.location || location)) result end .,., module_eval(<<'.,.,', 'parser.y', 652) def _reduce_157(val, _values, result) location = val[0].location + val[2].location result = Declarations::Constant.new(name: val[0].value, type: val[2], location: location, comment: leading_comment(location)) result end .,., module_eval(<<'.,.,', 'parser.y', 659) def _reduce_158(val, _values, result) location = (val[0] || val[1]).location + val[2].location name = TypeName.new(name: val[1].value, namespace: val[0]&.value || Namespace.empty) result = Declarations::Constant.new(name: name, type: val[2], location: location, comment: leading_comment(location)) result end .,., module_eval(<<'.,.,', 'parser.y', 669) def _reduce_159(val, _values, result) location = val[0].location + val[2].location result = Declarations::Global.new(name: val[0].value.to_sym, type: val[2], location: location, comment: leading_comment(location)) result end .,., # reduce 160 omitted module_eval(<<'.,.,', 'parser.y', 679) def _reduce_161(val, _values, result) types = case l = val[0] when Types::Union l.types + [val[2]] else [l, val[2]] end result = Types::Union.new(types: types, location: val[0].location + val[2].location) result end .,., module_eval(<<'.,.,', 'parser.y', 689) def _reduce_162(val, _values, result) types = case l = val[0] when Types::Intersection l.types + [val[2]] else [l, val[2]] end result = Types::Intersection.new(types: types, location: val[0].location + val[2].location) result end .,., module_eval(<<'.,.,', 'parser.y', 702) def _reduce_163(val, _values, result) result = Types::Bases::Void.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 705) def _reduce_164(val, _values, result) RBS.logger.warn "`any` type is deprecated. Use `untyped` instead. (#{val[0].location.to_s})" result = Types::Bases::Any.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 709) def _reduce_165(val, _values, result) result = Types::Bases::Any.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 712) def _reduce_166(val, _values, result) result = Types::Bases::Bool.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 715) def _reduce_167(val, _values, result) result = Types::Bases::Nil.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 718) def _reduce_168(val, _values, result) result = Types::Bases::Top.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 721) def _reduce_169(val, _values, result) result = Types::Bases::Bottom.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 724) def _reduce_170(val, _values, result) result = Types::Bases::Self.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 727) def _reduce_171(val, _values, result) result = Types::Optional.new(type: Types::Bases::Self.new(location: val[0].location), location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 731) def _reduce_172(val, _values, result) result = Types::Bases::Instance.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 734) def _reduce_173(val, _values, result) result = Types::Bases::Class.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 737) def _reduce_174(val, _values, result) result = Types::Literal.new(literal: true, location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 740) def _reduce_175(val, _values, result) result = Types::Literal.new(literal: false, location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 743) def _reduce_176(val, _values, result) result = Types::Literal.new(literal: val[0].value, location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 746) def _reduce_177(val, _values, result) result = Types::Literal.new(literal: val[0].value, location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 749) def _reduce_178(val, _values, result) result = Types::Literal.new(literal: val[0].value, location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 752) def _reduce_179(val, _values, result) name = val[0].value args = [] location = val[0].location case when name.class? if is_bound_variable?(name.name) result = Types::Variable.new(name: name.name, location: location) else result = Types::ClassInstance.new(name: name, args: args, location: location) end when name.alias? result = Types::Alias.new(name: name, location: location) when name.interface? result = Types::Interface.new(name: name, args: args, location: location) end result end .,., module_eval(<<'.,.,', 'parser.y', 770) def _reduce_180(val, _values, result) name = val[0].value args = val[2] location = val[0].location + val[3].location case when name.class? if is_bound_variable?(name.name) raise SemanticsError.new("#{name.name} is type variable and cannot be applied", subject: name, location: location) end result = Types::ClassInstance.new(name: name, args: args, location: location) when name.interface? result = Types::Interface.new(name: name, args: args, location: location) else raise SyntaxError.new(token_str: "kLBRACKET", error_value: val[1]) end result end .,., module_eval(<<'.,.,', 'parser.y', 787) def _reduce_181(val, _values, result) location = val[0].location + val[1].location result = Types::Tuple.new(types: [], location: location) result end .,., module_eval(<<'.,.,', 'parser.y', 791) def _reduce_182(val, _values, result) location = val[0].location + val[2].location types = val[1] result = Types::Tuple.new(types: types, location: location) result end .,., module_eval(<<'.,.,', 'parser.y', 796) def _reduce_183(val, _values, result) type = val[1].dup type.instance_eval do @location = val[0].location + val[2].location end result = type result end .,., module_eval(<<'.,.,', 'parser.y', 803) def _reduce_184(val, _values, result) result = Types::ClassSingleton.new(name: val[2].value, location: val[0].location + val[3].location) result end .,., module_eval(<<'.,.,', 'parser.y', 807) def _reduce_185(val, _values, result) result = Types::Proc.new(type: val[1].value, location: val[0].location + val[1].location) result end .,., module_eval(<<'.,.,', 'parser.y', 810) def _reduce_186(val, _values, result) result = Types::Optional.new(type: val[0], location: val[0].location + val[1].location) result end .,., # reduce 187 omitted module_eval(<<'.,.,', 'parser.y', 816) def _reduce_188(val, _values, result) result = [val[0]] result end .,., module_eval(<<'.,.,', 'parser.y', 819) def _reduce_189(val, _values, result) result = val[0] + [val[2]] result end .,., module_eval(<<'.,.,', 'parser.y', 824) def _reduce_190(val, _values, result) result = Types::Record.new( fields: val[1], location: val[0].location + val[2].location ) result end .,., module_eval(<<'.,.,', 'parser.y', 832) def _reduce_191(val, _values, result) result = val[0] result end .,., module_eval(<<'.,.,', 'parser.y', 835) def _reduce_192(val, _values, result) result = val[0].merge!(val[2]) result end .,., module_eval(<<'.,.,', 'parser.y', 840) def _reduce_193(val, _values, result) result = { val[0].value => val[2] } result end .,., module_eval(<<'.,.,', 'parser.y', 843) def _reduce_194(val, _values, result) result = { val[0].value => val[2] } result end .,., module_eval(<<'.,.,', 'parser.y', 846) def _reduce_195(val, _values, result) result = { val[0].value => val[2] } result end .,., module_eval(<<'.,.,', 'parser.y', 849) def _reduce_196(val, _values, result) result = { val[0].value => val[1] } result end .,., # reduce 197 omitted module_eval(<<'.,.,', 'parser.y', 855) def _reduce_198(val, _values, result) result = val[0] result end .,., # reduce 199 omitted # reduce 200 omitted module_eval(<<'.,.,', 'parser.y', 862) def _reduce_201(val, _values, result) location = val[0].location + val[4].location type = Types::Function.new( required_positionals: val[1][0], optional_positionals: val[1][1], rest_positionals: val[1][2], trailing_positionals: val[1][3], required_keywords: val[1][4], optional_keywords: val[1][5], rest_keywords: val[1][6], return_type: val[4], ) result = LocatedValue.new(value: type, location: location) result end .,., module_eval(<<'.,.,', 'parser.y', 877) def _reduce_202(val, _values, result) location = val[0].location + val[1].location type = Types::Function.new( required_positionals: [], optional_positionals: [], rest_positionals: nil, trailing_positionals: [], required_keywords: {}, optional_keywords: {}, rest_keywords: nil, return_type: val[2] ) result = LocatedValue.new(value: type, location: location) result end .,., module_eval(<<'.,.,', 'parser.y', 894) def _reduce_203(val, _values, result) result = val[2] result[0].unshift(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 898) def _reduce_204(val, _values, result) result = empty_params_result result[0].unshift(val[0]) result end .,., # reduce 205 omitted module_eval(<<'.,.,', 'parser.y', 905) def _reduce_206(val, _values, result) result = val[2] result[1].unshift(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 909) def _reduce_207(val, _values, result) result = empty_params_result result[1].unshift(val[0]) result end .,., # reduce 208 omitted module_eval(<<'.,.,', 'parser.y', 916) def _reduce_209(val, _values, result) result = val[2] result[2] = val[0] result end .,., module_eval(<<'.,.,', 'parser.y', 920) def _reduce_210(val, _values, result) result = empty_params_result result[2] = val[0] result end .,., # reduce 211 omitted module_eval(<<'.,.,', 'parser.y', 927) def _reduce_212(val, _values, result) result = val[2] result[3].unshift(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 931) def _reduce_213(val, _values, result) result = empty_params_result result[3].unshift(val[0]) result end .,., # reduce 214 omitted module_eval(<<'.,.,', 'parser.y', 938) def _reduce_215(val, _values, result) result = empty_params_result result end .,., module_eval(<<'.,.,', 'parser.y', 941) def _reduce_216(val, _values, result) result = val[2] result[4].merge!(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 945) def _reduce_217(val, _values, result) result = empty_params_result result[4].merge!(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 949) def _reduce_218(val, _values, result) result = val[2] result[5].merge!(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 953) def _reduce_219(val, _values, result) result = empty_params_result result[5].merge!(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 957) def _reduce_220(val, _values, result) result = empty_params_result result[6] = val[0] result end .,., module_eval(<<'.,.,', 'parser.y', 963) def _reduce_221(val, _values, result) result = Types::Function::Param.new(type: val[0], name: val[1]&.value&.to_sym) result end .,., module_eval(<<'.,.,', 'parser.y', 969) def _reduce_222(val, _values, result) result = Types::Function::Param.new(type: val[1], name: val[2]&.value&.to_sym) result end .,., module_eval(<<'.,.,', 'parser.y', 975) def _reduce_223(val, _values, result) result = Types::Function::Param.new(type: val[1], name: val[2]&.value&.to_sym) result end .,., module_eval(<<'.,.,', 'parser.y', 981) def _reduce_224(val, _values, result) param = Types::Function::Param.new(type: val[1], name: val[2]&.value&.to_sym) result = { val[0].value => param } result end .,., module_eval(<<'.,.,', 'parser.y', 988) def _reduce_225(val, _values, result) param = Types::Function::Param.new(type: val[2], name: val[3]&.value&.to_sym) result = { val[1].value => param } result end .,., module_eval(<<'.,.,', 'parser.y', 995) def _reduce_226(val, _values, result) result = Types::Function::Param.new(type: val[1], name: val[2]&.value&.to_sym) result end .,., # reduce 227 omitted # reduce 228 omitted # reduce 229 omitted # reduce 230 omitted module_eval(<<'.,.,', 'parser.y', 1004) def _reduce_231(val, _values, result) namespace = val[0]&.value || Namespace.empty name = val[1].value.to_sym type_name = TypeName.new(namespace: namespace, name: name) location = (loc0 = val[0]&.location) ? loc0 + val[1].location : val[1].location result = LocatedValue.new(value: type_name, location: location) result end .,., # reduce 232 omitted # reduce 233 omitted # reduce 234 omitted module_eval(<<'.,.,', 'parser.y', 1016) def _reduce_235(val, _values, result) namespace = val[0]&.value || Namespace.empty name = val[1].value.to_sym type_name = TypeName.new(namespace: namespace, name: name) location = (loc0 = val[0]&.location) ? loc0 + val[1].location : val[1].location result = LocatedValue.new(value: type_name, location: location) result end .,., module_eval(<<'.,.,', 'parser.y', 1025) def _reduce_236(val, _values, result) namespace = val[0]&.value || Namespace.empty name = val[1].value.to_sym type_name = TypeName.new(namespace: namespace, name: name) location = (loc0 = val[0]&.location) ? loc0 + val[1].location : val[1].location result = LocatedValue.new(value: type_name, location: location) result end .,., module_eval(<<'.,.,', 'parser.y', 1034) def _reduce_237(val, _values, result) result = nil result end .,., module_eval(<<'.,.,', 'parser.y', 1037) def _reduce_238(val, _values, result) result = LocatedValue.new(value: Namespace.root, location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 1040) def _reduce_239(val, _values, result) namespace = Namespace.parse(val[1].value).absolute! result = LocatedValue.new(value: namespace, location: val[0].location + val[1].location) result end .,., module_eval(<<'.,.,', 'parser.y', 1044) def _reduce_240(val, _values, result) namespace = Namespace.parse(val[0].value) result = LocatedValue.new(value: namespace, location: val[0].location) result end .,., def _reduce_none(val, _values, result) val[0] end end # class Parser end # module RBS