# # 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', 1037) 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) new_comment = AST::Comment.new(string: string+"\n", location: location) if (prev_comment = leading_comment(location)) && prev_comment.location.start_column == location.start_column @comments.delete prev_comment.location.end_line new_comment = AST::Comment.new(string: prev_comment.string + new_comment.string, location: prev_comment.location + new_comment.location) end @comments[new_comment.location.end_line] = new_comment 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, "super" => :kSUPER, "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, "." => :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 = [ '340,341,33,342,74,278,279,33,33,353,379,195,405,339,33,40,41,351,378', '5,208,209,210,211,212,213,214,215,219,33,216,207,217,218,102,113,103', '119,104,105,120,196,32,33,335,329,330,32,32,333,331,334,300,33,32,332', '118,106,107,108,110,112,111,328,337,338,109,114,116,32,198,271,272,121', '122,117,123,340,341,33,342,58,59,32,33,33,37,230,319,33,339,33,42,32', '85,43,199,208,209,210,211,212,213,214,215,219,315,216,207,217,218,102', '113,103,119,104,105,120,33,32,86,335,329,330,32,32,333,331,334,32,50', '32,332,118,106,107,108,110,112,111,328,337,338,109,114,116,340,341,48', '342,121,122,117,123,50,50,40,41,32,339,157,40,41,51,87,156,208,209,210', '211,212,213,214,215,354,64,216,207,217,218,102,113,103,119,104,105,120', '51,51,39,335,329,330,40,41,333,331,334,39,360,81,332,118,106,107,108', '110,112,111,328,337,338,109,114,116,323,394,40,41,121,122,117,123,340', '341,86,342,58,59,61,62,143,63,2,3,4,339,144,275,163,396,86,86,208,209', '210,211,212,213,214,215,219,145,216,207,217,218,102,113,103,119,104', '105,120,276,86,86,335,329,330,40,41,333,331,334,395,40,41,332,118,106', '107,108,110,112,111,328,337,338,109,114,116,340,341,146,342,121,122', '117,123,147,86,58,59,74,339,386,387,55,54,56,155,208,209,210,211,212', '213,214,215,219,158,216,207,217,218,102,113,103,119,104,105,120,40,41', '160,335,329,330,40,41,333,331,334,40,41,162,332,118,106,107,108,110', '112,111,328,337,338,109,114,116,40,41,40,41,121,122,117,123,340,341', '41,342,58,59,40,41,58,59,40,41,165,339,55,54,56,40,41,157,208,209,210', '211,212,213,214,215,219,-107,216,207,217,218,102,113,103,119,104,105', '120,40,41,-108,335,329,330,40,41,333,331,334,40,41,-109,332,118,106', '107,108,110,112,111,328,337,338,109,114,116,340,341,-110,342,121,122', '117,123,40,41,364,365,-111,339,40,41,40,41,-112,-113,208,209,210,211', '212,213,214,215,219,-114,216,207,217,218,102,113,103,119,104,105,120', '-115,-116,-117,335,329,330,48,-132,333,331,334,170,171,172,332,118,106', '107,108,110,112,111,328,337,338,109,114,116,173,174,175,176,121,122', '117,123,340,341,42,342,58,59,200,233,234,236,237,238,240,339,81,244', '244,244,250,253,208,209,210,211,212,213,214,215,219,42,216,207,217,218', '102,113,103,119,104,105,120,256,258,262,335,329,330,264,266,333,331', '334,267,42,269,332,118,106,107,108,110,112,111,328,337,338,109,114,116', '33,306,58,59,121,122,117,123,22,23,21,308,26,-216,25,262,30,310,91,92', '93,94,95,96,97,98,115,16,99,90,100,101,102,113,103,119,104,105,120,266', '32,320,321,322,28,358,138,363,139,141,363,363,370,371,118,106,107,108', '110,112,111,372,373,374,109,114,116,33,376,58,59,121,122,117,123,22', '23,21,377,26,380,25,381,30,391,91,92,93,94,95,96,97,98,115,16,99,90', '100,101,102,113,103,119,104,105,120,400,32,401,402,405,28,406,407,408', ',,,,,,118,106,107,108,110,112,111,,,,109,114,116,33,,58,59,121,122,117', '123,22,23,21,,26,-216,25,,30,,91,92,93,94,95,96,97,98,115,16,99,90,100', '101,102,113,103,119,104,105,120,,32,,,,28,,206,,,141,,,,,118,106,107', '108,110,112,111,,,,109,114,116,33,,58,59,121,122,117,123,22,23,21,,26', '-216,25,,30,,91,92,93,94,95,96,97,98,115,16,99,90,100,101,102,113,103', '119,104,105,120,,32,,,,28,,206,,,141,,,,,118,106,107,108,110,112,111', ',,,109,114,116,33,,58,59,121,122,117,123,22,23,21,,26,-216,25,,30,,91', '92,93,94,95,96,97,98,115,16,99,90,100,101,102,113,103,119,104,105,120', ',32,,,,28,,138,,139,141,,,,,118,106,107,108,110,112,111,,,,109,114,116', '33,,58,59,121,122,117,123,22,23,21,,26,-216,25,,30,,91,92,93,94,95,96', '97,98,115,16,99,90,100,101,102,113,103,119,104,105,120,,32,,,,28,167', '138,168,139,141,,,,,118,106,107,108,110,112,111,,,,109,114,116,,,,,121', '122,117,123,-4,,-238,,33,,,-238,78,,,74,,40,41,,,,,,,,,,,,167,33,168', '58,59,,,,169,22,23,21,,26,-216,25,,30,32,91,92,93,94,95,96,97,98,115', '16,99,90,100,101,102,113,103,119,104,105,120,,32,,40,41,28,,138,39,139', '141,,,,,118,106,107,108,110,112,111,58,59,169,109,114,116,,,,,121,122', '117,123,,,208,209,210,211,212,213,214,215,219,,216,207,217,218,102,113', '103,119,104,105,120,,,,,,,,206,,,141,,,,,118,106,107,108,110,112,111', '58,59,,109,114,116,,,,,121,122,117,123,,,208,209,210,211,212,213,214', '215,219,,216,207,217,218,102,113,103,119,104,105,120,,,,,,,,206,,,141', ',,,,118,106,107,108,110,112,111,58,59,,109,114,116,,,,,121,122,117,123', ',,208,209,210,211,212,213,214,215,219,,216,207,217,218,102,113,103,119', '104,105,120,167,,168,167,,168,167,,168,167,,168,,,,118,106,107,108,110', '112,111,,,,109,114,116,,,,,121,122,117,123,,,,,,,,40,41,,40,41,,40,41', ',40,41,-238,,33,,,-238,78,295,296,74,169,,,169,,151,169,,154,169,152', ',,,-238,,33,,297,-238,78,295,296,74,,,,,292,291,153,-238,32,33,,,-238', '78,295,296,74,150,297,,,,,283,,,,,292,291,,-238,32,33,,297,-238,78,295', '296,74,,,,,292,291,311,,32,,,,,,,,,,297,,,,,359,,,,,292,291,33,,32,', ',,,,22,23,21,,26,,25,,30,307,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,151,,,154,,152,,,32,319,,,28,,,,,,,,,,,,', '153,,315,316,312,313,314,,,,317,150' ] racc_action_table = arr = ::Array.new(2620, 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 = [ '374,374,316,374,268,261,261,258,266,318,363,159,408,374,264,251,251', '318,363,1,374,374,374,374,374,374,374,374,374,230,374,374,374,374,374', '374,374,374,374,374,374,159,316,317,374,374,374,258,266,374,374,374', '268,315,264,374,374,374,374,374,374,374,374,374,374,374,374,374,374', '230,161,256,256,374,374,374,374,313,313,189,313,313,313,317,188,187', '5,188,305,186,313,48,7,315,46,24,161,313,313,313,313,313,313,313,313', '313,305,313,313,313,313,313,313,313,313,313,313,313,154,189,46,313,313', '313,188,187,313,313,313,186,28,48,313,313,313,313,313,313,313,313,313', '313,313,313,313,313,319,319,27,319,313,313,313,313,195,236,148,148,154', '319,77,6,6,28,47,77,319,319,319,319,319,319,319,319,319,32,319,319,319', '319,319,319,319,319,319,319,319,195,236,6,319,319,319,47,47,319,319', '319,35,325,36,319,319,319,319,319,319,319,319,319,319,319,319,319,319', '299,382,390,390,319,319,319,319,385,385,325,385,385,385,31,31,52,31', '0,0,0,385,53,259,84,384,299,382,385,385,385,385,385,385,385,385,385', '54,385,385,385,385,385,385,385,385,385,385,385,259,84,384,385,385,385', '392,392,385,385,385,383,393,393,385,385,385,385,385,385,385,385,385', '385,385,385,385,385,407,407,55,407,385,385,385,385,56,383,30,30,74,407', '373,373,30,30,30,76,407,407,407,407,407,407,407,407,407,78,407,407,407', '407,407,407,407,407,407,407,407,368,368,80,407,407,407,366,366,407,407', '407,183,183,81,407,407,407,407,407,407,407,407,407,407,407,407,407,407', '184,184,185,185,407,407,407,407,314,314,82,314,314,314,361,361,144,144', '164,164,88,314,144,144,144,357,357,89,314,314,314,314,314,314,314,314', '314,90,314,314,314,314,314,314,314,314,314,314,314,191,191,91,314,314', '314,192,192,314,314,314,193,193,92,314,314,314,314,314,314,314,314,314', '314,314,314,314,314,355,355,93,355,314,314,314,314,356,356,336,336,94', '355,389,389,44,44,95,96,355,355,355,355,355,355,355,355,355,97,355,355', '355,355,355,355,355,355,355,355,355,98,99,100,355,355,355,101,115,355', '355,355,126,127,128,355,355,355,355,355,355,355,355,355,355,355,355', '355,355,130,132,135,136,355,355,355,355,312,312,142,312,312,312,171', '190,194,196,197,199,204,312,227,228,229,231,232,235,312,312,312,312', '312,312,312,312,312,239,312,312,312,312,312,312,312,312,312,312,312', '242,243,244,312,312,312,245,246,312,312,312,248,252,254,312,312,312', '312,312,312,312,312,312,312,312,312,312,312,173,270,173,173,312,312', '312,312,173,173,173,274,173,173,173,276,173,277,173,173,173,173,173', '173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,281', '173,295,296,297,173,322,173,327,173,173,345,347,348,349,173,173,173', '173,173,173,173,350,352,354,173,173,173,138,358,138,138,173,173,173', '173,138,138,138,362,138,367,138,369,138,379,138,138,138,138,138,138', '138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,386,138', '387,388,397,138,399,402,404,,,,,,,138,138,138,138,138,138,138,,,,138', '138,138,240,,240,240,138,138,138,138,240,240,240,,240,240,240,,240,', '240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240', '240,240,240,240,,240,,,,240,,240,,,240,,,,,240,240,240,240,240,240,240', ',,,240,240,240,174,,174,174,240,240,240,240,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,,174,,,,174,,174,,,174,,,,,174,174,174,174,174,174', '174,,,,174,174,174,160,,160,160,174,174,174,174,160,160,160,,160,160', '160,,160,,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160', '160,160,160,160,160,160,,160,,,,160,,160,,160,160,,,,,160,160,160,160', '160,160,160,,,,160,160,160,172,,172,172,160,160,160,160,172,172,172', ',172,172,172,,172,,172,172,172,172,172,172,172,172,172,172,172,172,172', '172,172,172,172,172,172,172,172,,172,,,,172,179,172,179,172,172,,,,', '172,172,172,172,172,172,172,,,,172,172,172,,,,,172,172,172,172,34,,34', ',34,,,34,34,,,34,,179,179,,,,,,,,,,,,180,50,180,50,50,,,,179,50,50,50', ',50,50,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,,180,180,50,,50,34,50,50,,,,,50,50,50,50,50,50,50,176', '176,180,50,50,50,,,,,50,50,50,50,,,176,176,176,176,176,176,176,176,176', ',176,176,176,176,176,176,176,176,176,176,176,,,,,,,,176,,,176,,,,,176', '176,176,176,176,176,176,175,175,,176,176,176,,,,,176,176,176,176,,,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,175,206,206,,175', '175,175,,,,,175,175,175,175,,,206,206,206,206,206,206,206,206,206,,206', '206,206,206,206,206,206,206,206,206,206,223,,223,124,,124,177,,177,181', ',181,,,,206,206,206,206,206,206,206,,,,206,206,206,,,,,206,206,206,206', ',,,,,,,223,223,,124,124,,177,177,,181,181,265,,265,,,265,265,265,265', '265,223,,,124,,75,177,,75,181,75,,,,280,,280,,265,280,280,280,280,280', ',,,,265,265,75,324,265,324,,,324,324,324,324,324,75,280,,,,,265,,,,', '280,280,,273,280,273,,324,273,273,273,273,273,,,,,324,324,280,,324,', ',,,,,,,,273,,,,,324,,,,,273,273,155,,273,,,,,,155,155,155,,155,,155', ',155,273,155,155,155,155,155,155,155,155,155,155,155,155,155,155,,26', ',,,,,,155,26,26,26,155,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,,234,,,,', ',,25,234,234,234,25,234,,234,,234,,234,234,234,234,234,234,234,234,234', '234,234,234,234,234,,267,,,,,,,234,267,267,267,234,267,,267,,267,,267', '267,267,267,267,267,267,267,267,267,267,267,267,267,,139,,,,,,,267,139', '139,139,267,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,,141,,,,,,,140,141,141,141', '140,141,,141,,141,,141,141,141,141,141,141,141,141,141,141,141,141,141', '141,,233,,,,,,,141,233,233,233,141,233,,233,,233,,233,233,233,233,233', '233,233,233,233,233,233,233,233,233,,145,,,,,,,233,145,145,145,233,145', ',145,,145,,145,145,145,145,145,145,145,145,145,145,145,145,145,145,', '146,,,,,,,145,146,146,146,145,146,,146,,146,,146,146,146,146,146,146', '146,146,146,146,146,146,146,146,,57,,,,,,,146,57,57,57,146,57,,57,,57', ',57,57,57,57,57,57,57,57,57,57,57,57,57,57,,308,,,,,,,57,308,308,308', '57,308,,308,,308,,308,308,308,308,308,308,308,308,308,308,308,308,308', '308,,320,,,,,,,308,320,320,320,308,320,,320,,320,,320,320,320,320,320', '320,320,320,320,320,320,320,320,320,,321,,,,,,,320,321,321,321,320,321', ',321,,321,,321,321,321,321,321,321,321,321,321,321,321,321,321,321,', '147,,,,,,,321,147,147,147,321,147,,147,,147,,147,147,147,147,147,147', '147,147,147,147,147,147,147,147,,326,,,,,,,147,326,326,326,147,326,', '326,,326,,326,326,326,326,326,326,326,326,326,326,326,326,326,326,,200', ',,,,,,326,200,200,200,326,200,,200,,200,,200,200,200,200,200,200,200', '200,200,200,200,200,200,200,,2,,,,,,,200,2,2,2,200,2,,2,,2,,2,2,2,2', '2,2,2,2,2,2,2,2,2,2,,344,,,,,,,2,344,344,344,2,344,,344,,344,,344,344', '344,344,344,344,344,344,344,344,344,344,344,344,,346,,,,,,,344,346,346', '346,344,346,,346,,346,,346,346,346,346,346,346,346,346,346,346,346,346', '346,346,,156,,,,,,,346,156,156,156,346,156,,156,,156,,156,156,156,156', '156,156,156,156,156,156,156,156,156,156,,158,,,,,,,156,158,158,158,156', '158,,158,,158,,158,158,158,158,158,158,158,158,158,158,158,158,158,158', ',51,,,,,,,158,51,51,51,158,51,,51,,51,,51,51,51,51,51,51,51,51,51,51', '51,51,51,51,,370,,,,,,,51,370,370,370,51,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,,372,,,,,,,371,372,372,372,371,372,,372,,372,,372,372,372,372,372', '372,372,372,372,372,372,372,372,372,,376,,,,,,,372,376,376,376,372,376', ',376,,376,,376,376,376,376,376,376,376,376,376,376,376,376,376,376,', '377,,,,,,,376,377,377,377,376,377,,377,,377,,377,377,377,377,377,377', '377,377,377,377,377,377,377,377,,380,,,,,,,377,380,380,380,377,380,', '380,,380,,380,380,380,380,380,380,380,380,380,380,380,380,380,380,,381', ',,,,,,380,381,381,381,380,381,,381,,381,,381,381,381,381,381,381,381', '381,381,381,381,381,381,381,,178,,,,,,,381,178,178,178,381,178,,178', ',178,,178,178,178,178,178,178,178,178,178,178,178,178,178,178,282,,', '282,,282,,,178,282,,,178,,,,,,,,,,,,,282,,282,282,282,282,282,,,,282', '282' ] racc_action_check = arr = ::Array.new(2620, 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 = [ 162, 19, 2118, nil, nil, 86, 115, 42, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 77, 1590, 1425, 132, 114, nil, 296, 227, 171, nil, 994, 124, 182, nil, nil, nil, 1458, 1491, nil, 1524, 408, nil, 75, 147, 87, nil, 1017, 2283, 210, 192, 198, 240, 246, 1887, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 293, 1273, 268, 158, 278, nil, 319, 344, 324, nil, 220, nil, 1557, nil, 364, 386, 355, 369, 380, 397, 407, 413, 414, 424, 436, 437, 438, 469, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 443, nil, nil, nil, nil, nil, nil, nil, nil, 1237, nil, 447, 474, 447, nil, 462, nil, 463, nil, nil, 464, 465, nil, 647, 1689, 1722, 1755, 467, nil, 371, 1821, 1854, 2019, 110, nil, nil, nil, nil, nil, 114, 1392, 2217, nil, 2250, -9, 848, 51, nil, nil, 333, nil, nil, nil, nil, nil, nil, 472, 915, 580, 781, 1135, 1076, 1240, 2547, 961, 1017, 1243, nil, 298, 315, 317, 85, 81, 80, 75, 467, 364, 370, 375, 474, 138, 504, 508, nil, 524, 2085, nil, nil, nil, 482, nil, 1194, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1234, nil, nil, nil, 511, 512, 513, 25, 514, 528, 1788, 1623, 513, 139, nil, nil, 494, 714, nil, 540, 500, 481, 519, 518, nil, 549, nil, nil, -31, 518, nil, 548, nil, 69, nil, 3, 219, nil, -70, nil, nil, 10, 1289, 4, 1656, -7, nil, 568, nil, nil, 1354, 577, nil, 522, 599, nil, nil, 1313, 578, 2550, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 582, 583, 571, nil, 196, nil, nil, nil, nil, nil, 46, nil, nil, 1920, nil, nil, nil, 513, 75, 367, 49, -2, 39, -61, 144, 1953, 1986, 620, nil, 1330, 180, 2052, 615, nil, nil, nil, nil, nil, nil, nil, nil, 398, nil, nil, nil, nil, nil, nil, nil, 2151, 618, 2184, 619, 618, 619, 627, nil, 609, nil, 591, 436, 400, 340, 609, nil, nil, 329, 619, 1, nil, nil, 293, 621, 287, 623, 2316, 2349, 2382, 276, -2, nil, 2415, 2448, nil, 651, 2481, 2514, 197, 256, 221, 221, 634, 636, 663, 406, 171, nil, 224, 230, nil, nil, nil, 655, nil, 653, nil, nil, 641, nil, 652, nil, nil, 290, -27, nil, nil ] racc_action_default = [ -242, -242, -238, -6, -16, -242, -4, -161, -164, -165, -166, -167, -168, -169, -170, -171, -172, -173, -174, -175, -176, -177, -178, -179, -180, -238, -238, -242, -242, -188, -242, -242, -239, -241, -17, -4, -151, 411, -1, -5, -238, -238, -187, -238, -189, -182, -242, -242, -238, -186, -238, -238, -242, -192, -242, -242, -242, -238, -200, -201, -232, -233, -234, -235, -240, -2, -7, -8, -9, -10, -11, -12, -13, -14, -17, -242, -242, -242, -242, -3, -82, -242, -162, -163, -242, -183, -238, -184, -242, -242, -174, -164, -168, -175, -176, -165, -166, -169, -170, -173, -167, -118, -119, -120, -121, -122, -123, -124, -125, -126, -127, -128, -129, -130, -131, -171, -133, -134, -135, -136, -137, -138, -139, -140, -228, -198, -242, -242, -205, -206, -208, -209, -211, -212, -215, -218, -220, -221, -238, -238, -238, -238, -203, -191, -242, -238, -238, -238, -197, -18, -15, -15, -15, -15, -238, -238, -238, -237, -238, -84, -238, -242, -153, -181, -190, -185, -222, -229, -230, -231, -199, -242, -238, -238, -238, -216, -216, -228, -238, -228, -228, -228, -193, -194, -195, -196, -238, -238, -238, -238, -242, -158, -159, -160, -242, -242, -242, -242, -152, -242, -238, -204, -212, -207, -214, -210, -242, -107, -108, -109, -110, -111, -112, -113, -114, -115, -116, -117, -118, -132, -217, -219, -223, -228, -224, -225, -227, -151, -141, -141, -238, -141, -242, -238, -238, -242, -242, -83, -154, -202, -238, -226, -242, -23, -149, -28, -34, -30, -33, -59, -236, -157, -81, -85, -242, -213, -242, -34, -238, -242, -143, -146, -150, -34, -238, -17, -238, -238, -17, -86, -242, -20, -21, -17, -24, -142, -149, -242, -147, -148, -17, -29, -73, -27, -35, -36, -37, -38, -39, -40, -41, -42, -43, -44, -45, -242, -242, -242, -31, -242, -58, -60, -61, -62, -63, -73, -34, -22, -238, -144, -145, -26, -242, -242, -242, -238, -238, -238, -70, -242, -238, -238, -242, -32, -17, -242, -238, -52, -89, -90, -91, -92, -93, -94, -95, -96, -97, -100, -101, -102, -103, -104, -105, -106, -238, -52, -238, -52, -64, -66, -68, -71, -242, -74, -132, -242, -55, -56, -242, -19, -25, -46, -242, -242, -98, -99, -48, -242, -50, -242, -238, -238, -238, -75, -242, -155, -238, -238, -53, -242, -238, -238, -242, -242, -242, -242, -242, -242, -242, -57, -47, -54, -49, -51, -65, -67, -69, -16, -87, -242, -76, -77, -242, -72, -78, -79, -88, -242, -16, -156, -80 ] racc_goto_table = [ 6, 57, 75, 46, 80, 52, 49, 127, 77, 88, 142, 166, 178, 343, 343, 343, 190, 202, 246, 205, 343, 84, 89, 265, 47, 260, 327, 345, 347, 204, 204, 38, 60, 355, 273, 403, 220, 221, 82, 83, 280, 34, 149, 362, 243, 245, 410, 249, 124, 35, 66, 270, 281, 257, 263, 148, 343, 309, 298, 65, 79, 367, 302, 369, 222, 303, 224, 225, 226, 375, 186, 187, 188, 189, 304, 343, 231, 268, 301, 352, 178, 385, 397, 324, 164, 255, 343, 159, 388, 194, 259, 277, 248, 161, 203, 1, 204, nil, nil, 399, nil, nil, nil, nil, nil, nil, nil, nil, 343, nil, 241, nil, nil, nil, nil, 57, nil, 197, nil, 182, nil, 409, nil, nil, nil, nil, 248, nil, 248, 201, nil, nil, nil, nil, nil, nil, 177, 179, 180, 181, nil, nil, nil, 183, 184, 185, nil, 227, 228, 229, nil, nil, nil, 191, 192, nil, 193, nil, 124, 239, 89, 89, 89, 232, nil, nil, nil, nil, nil, nil, 124, 124, 124, 235, nil, nil, 223, 348, 349, 350, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 252, nil, 242, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 254, nil, nil, nil, nil, 274, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 251, 89, nil, nil, nil, 305, nil, 124, 77, nil, nil, nil, nil, nil, 299, 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, 326, 344, 346, 325, 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, 356, 357, nil, nil, nil, nil, 361, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 366, nil, 368, nil, nil, nil, 382, 383, 384, nil, nil, nil, nil, nil, 398, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 389, 390, nil, nil, 392, 393 ] racc_goto_check = [ 2, 36, 16, 23, 18, 61, 51, 50, 59, 17, 49, 74, 63, 53, 53, 53, 27, 69, 25, 69, 53, 23, 59, 20, 2, 55, 37, 37, 37, 64, 64, 3, 75, 37, 20, 46, 70, 70, 2, 2, 20, 4, 16, 38, 21, 21, 46, 21, 2, 5, 6, 19, 25, 22, 24, 2, 53, 55, 26, 3, 3, 38, 29, 38, 74, 30, 74, 74, 74, 37, 14, 14, 14, 14, 35, 53, 39, 40, 41, 42, 63, 44, 45, 20, 2, 69, 53, 47, 37, 48, 54, 57, 27, 58, 65, 1, 64, nil, nil, 37, nil, nil, nil, nil, nil, nil, nil, nil, 53, nil, 74, nil, nil, nil, nil, 36, nil, 50, nil, 61, nil, 37, nil, nil, nil, nil, 27, nil, 27, 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, nil, nil, nil, 2, 2, 2, 51, nil, nil, 2, 27, 27, 27, 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, 25, 38, 45, 16, nil, nil, nil, nil, nil, nil, nil, -80, nil, -32, -39, -32, -205, -223, -184, -190, -22, -191, -212, -208, -138, nil, -206, -203, nil, nil, nil, nil, -194, -29, -286, -284, -113, -172, -190, -239, nil, -292, -303, -362, 7, -70, -41, -43, -22, nil, -299, -154, -219, nil, -170, 12, -26, nil, -25, nil, -126, -144, -79, nil, nil, nil, -155, -139, nil, nil, nil, -113, 1 ] racc_goto_default = [ nil, nil, 44, nil, nil, 404, 294, 67, 68, 69, 70, 71, 72, 73, nil, 36, 282, 76, nil, nil, nil, nil, nil, nil, nil, nil, 247, 24, 284, 285, 286, 287, 288, 289, 290, 293, 125, nil, nil, nil, nil, nil, nil, 318, nil, nil, nil, nil, nil, 7, nil, nil, 336, 126, nil, nil, 261, nil, nil, 31, 29, nil, 53, 140, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 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_none, 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, 1, 132, :_reduce_none, 0, 100, :_reduce_141, 3, 100, :_reduce_142, 1, 133, :_reduce_143, 3, 133, :_reduce_144, 3, 134, :_reduce_145, 0, 136, :_reduce_146, 1, 136, :_reduce_147, 1, 136, :_reduce_148, 0, 135, :_reduce_149, 1, 135, :_reduce_150, 0, 97, :_reduce_151, 3, 97, :_reduce_152, 1, 137, :_reduce_153, 3, 137, :_reduce_154, 4, 114, :_reduce_155, 8, 114, :_reduce_156, 5, 86, :_reduce_157, 3, 87, :_reduce_158, 3, 87, :_reduce_159, 3, 88, :_reduce_160, 1, 81, :_reduce_none, 3, 81, :_reduce_162, 3, 81, :_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, 1, 128, :_reduce_180, 4, 128, :_reduce_181, 2, 128, :_reduce_182, 3, 128, :_reduce_183, 3, 128, :_reduce_184, 4, 128, :_reduce_185, 2, 128, :_reduce_186, 2, 128, :_reduce_187, 1, 128, :_reduce_none, 1, 102, :_reduce_189, 3, 102, :_reduce_190, 3, 139, :_reduce_191, 1, 140, :_reduce_192, 3, 140, :_reduce_193, 3, 141, :_reduce_194, 3, 141, :_reduce_195, 3, 141, :_reduce_196, 2, 141, :_reduce_197, 1, 142, :_reduce_none, 2, 142, :_reduce_199, 1, 115, :_reduce_none, 1, 115, :_reduce_none, 5, 130, :_reduce_202, 2, 130, :_reduce_203, 3, 129, :_reduce_204, 1, 129, :_reduce_205, 1, 129, :_reduce_none, 3, 144, :_reduce_207, 1, 144, :_reduce_208, 1, 144, :_reduce_none, 3, 146, :_reduce_210, 1, 146, :_reduce_211, 1, 146, :_reduce_none, 3, 148, :_reduce_213, 1, 148, :_reduce_214, 1, 148, :_reduce_none, 0, 149, :_reduce_216, 3, 149, :_reduce_217, 1, 149, :_reduce_218, 3, 149, :_reduce_219, 1, 149, :_reduce_220, 1, 149, :_reduce_221, 2, 143, :_reduce_222, 3, 145, :_reduce_223, 3, 147, :_reduce_224, 3, 150, :_reduce_225, 4, 151, :_reduce_226, 3, 152, :_reduce_227, 0, 153, :_reduce_none, 1, 153, :_reduce_none, 1, 153, :_reduce_none, 1, 153, :_reduce_none, 2, 106, :_reduce_232, 1, 154, :_reduce_none, 1, 154, :_reduce_none, 1, 154, :_reduce_none, 2, 118, :_reduce_236, 2, 96, :_reduce_237, 0, 138, :_reduce_238, 1, 138, :_reduce_239, 2, 138, :_reduce_240, 1, 138, :_reduce_241 ] racc_reduce_n = 242 racc_shift_n = 411 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, :kSUPER => 39, :kPRIVATE => 40, :kPUBLIC => 41, :kALIAS => 42, :kCOLON => 43, :kCOLON2 => 44, :kCOMMA => 45, :kBAR => 46, :kAMP => 47, :kHAT => 48, :kARROW => 49, :kQUESTION => 50, :kEXCLAMATION => 51, :kSTAR => 52, :kSTAR2 => 53, :kFATARROW => 54, :kEQ => 55, :kDOT => 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", "kSUPER", "kPRIVATE", "kPUBLIC", "kALIAS", "kCOLON", "kCOLON2", "kCOMMA", "kBAR", "kAMP", "kHAT", "kARROW", "kQUESTION", "kEXCLAMATION", "kSTAR", "kSTAR2", "kFATARROW", "kEQ", "kDOT", "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', 427) def _reduce_70(val, _values, result) result = nil result end .,., # reduce 71 omitted module_eval(<<'.,.,', 'parser.y', 431) 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 result = Members::MethodDefinition.new( name: val[5].value, kind: val[4], types: types, 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: !!val[2] ) result end .,., module_eval(<<'.,.,', 'parser.y', 453) def _reduce_73(val, _values, result) result = [] result end .,., module_eval(<<'.,.,', 'parser.y', 455) def _reduce_74(val, _values, result) result = val[0].push(val[1]) result end .,., module_eval(<<'.,.,', 'parser.y', 459) def _reduce_75(val, _values, result) result = :instance result end .,., module_eval(<<'.,.,', 'parser.y', 460) def _reduce_76(val, _values, result) result = :singleton result end .,., module_eval(<<'.,.,', 'parser.y', 461) def _reduce_77(val, _values, result) result = :singleton_instance result end .,., module_eval(<<'.,.,', 'parser.y', 464) def _reduce_78(val, _values, result) result = [val[0]] result end .,., module_eval(<<'.,.,', 'parser.y', 465) def _reduce_79(val, _values, result) result = [LocatedValue.new(value: :super, location: val[0].location)] result end .,., module_eval(<<'.,.,', 'parser.y', 467) def _reduce_80(val, _values, result) result = val[2].unshift(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 472) 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', 497) def _reduce_82(val, _values, result) result = nil result end .,., module_eval(<<'.,.,', 'parser.y', 499) 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', 503) def _reduce_84(val, _values, result) result = nil result end .,., module_eval(<<'.,.,', 'parser.y', 505) 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', 509) 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', 516) 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', 525) 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', 533) 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 # reduce 140 omitted module_eval(<<'.,.,', 'parser.y', 553) def _reduce_141(val, _values, result) result = nil result end .,., module_eval(<<'.,.,', 'parser.y', 555) def _reduce_142(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', 562) def _reduce_143(val, _values, result) result = Declarations::ModuleTypeParams.new() result.add(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 566) def _reduce_144(val, _values, result) result = val[0].add(val[2]) result end .,., module_eval(<<'.,.,', 'parser.y', 571) def _reduce_145(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', 577) def _reduce_146(val, _values, result) result = :invariant result end .,., module_eval(<<'.,.,', 'parser.y', 578) def _reduce_147(val, _values, result) result = :covariant result end .,., module_eval(<<'.,.,', 'parser.y', 579) def _reduce_148(val, _values, result) result = :contravariant result end .,., module_eval(<<'.,.,', 'parser.y', 582) def _reduce_149(val, _values, result) result = false result end .,., module_eval(<<'.,.,', 'parser.y', 583) def _reduce_150(val, _values, result) result = true result end .,., module_eval(<<'.,.,', 'parser.y', 586) def _reduce_151(val, _values, result) result = nil result end .,., module_eval(<<'.,.,', 'parser.y', 588) def _reduce_152(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', 596) def _reduce_153(val, _values, result) result = [val[0].value.to_sym] result end .,., module_eval(<<'.,.,', 'parser.y', 599) def _reduce_154(val, _values, result) result = val[0].push(val[2].value.to_sym) result end .,., module_eval(<<'.,.,', 'parser.y', 604) def _reduce_155(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', 615) def _reduce_156(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', 628) def _reduce_157(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', 638) def _reduce_158(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', 645) def _reduce_159(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', 655) def _reduce_160(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 161 omitted module_eval(<<'.,.,', 'parser.y', 665) def _reduce_162(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', 675) def _reduce_163(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', 688) def _reduce_164(val, _values, result) result = Types::Bases::Void.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 691) def _reduce_165(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', 695) def _reduce_166(val, _values, result) result = Types::Bases::Any.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 698) def _reduce_167(val, _values, result) result = Types::Bases::Bool.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 701) def _reduce_168(val, _values, result) result = Types::Bases::Nil.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 704) def _reduce_169(val, _values, result) result = Types::Bases::Top.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 707) def _reduce_170(val, _values, result) result = Types::Bases::Bottom.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 710) def _reduce_171(val, _values, result) result = Types::Bases::Self.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 713) def _reduce_172(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', 717) def _reduce_173(val, _values, result) result = Types::Bases::Instance.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 720) def _reduce_174(val, _values, result) result = Types::Bases::Class.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 723) def _reduce_175(val, _values, result) result = Types::Literal.new(literal: true, location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 726) def _reduce_176(val, _values, result) result = Types::Literal.new(literal: false, location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 729) def _reduce_177(val, _values, result) result = Types::Literal.new(literal: val[0].value, location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 732) def _reduce_178(val, _values, result) result = Types::Literal.new(literal: val[0].value, location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 735) def _reduce_179(val, _values, result) result = Types::Literal.new(literal: val[0].value, location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 738) def _reduce_180(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', 756) def _reduce_181(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', 773) def _reduce_182(val, _values, result) location = val[0].location + val[1].location result = Types::Tuple.new(types: [], location: location) result end .,., module_eval(<<'.,.,', 'parser.y', 777) def _reduce_183(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', 782) def _reduce_184(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', 789) def _reduce_185(val, _values, result) result = Types::ClassSingleton.new(name: val[2].value, location: val[0].location + val[3].location) result end .,., module_eval(<<'.,.,', 'parser.y', 793) def _reduce_186(val, _values, result) result = Types::Proc.new(type: val[1].value, location: val[0].location + val[1].location) result end .,., module_eval(<<'.,.,', 'parser.y', 796) def _reduce_187(val, _values, result) result = Types::Optional.new(type: val[0], location: val[0].location + val[1].location) result end .,., # reduce 188 omitted module_eval(<<'.,.,', 'parser.y', 802) def _reduce_189(val, _values, result) result = [val[0]] result end .,., module_eval(<<'.,.,', 'parser.y', 805) def _reduce_190(val, _values, result) result = val[0] + [val[2]] result end .,., module_eval(<<'.,.,', 'parser.y', 810) def _reduce_191(val, _values, result) result = Types::Record.new( fields: val[1], location: val[0].location + val[2].location ) result end .,., module_eval(<<'.,.,', 'parser.y', 818) def _reduce_192(val, _values, result) result = val[0] result end .,., module_eval(<<'.,.,', 'parser.y', 821) def _reduce_193(val, _values, result) result = val[0].merge!(val[2]) result end .,., module_eval(<<'.,.,', 'parser.y', 826) def _reduce_194(val, _values, result) result = { val[0].value => val[2] } result end .,., module_eval(<<'.,.,', 'parser.y', 829) def _reduce_195(val, _values, result) result = { val[0].value => val[2] } result end .,., module_eval(<<'.,.,', 'parser.y', 832) def _reduce_196(val, _values, result) result = { val[0].value => val[2] } result end .,., module_eval(<<'.,.,', 'parser.y', 835) def _reduce_197(val, _values, result) result = { val[0].value => val[1] } result end .,., # reduce 198 omitted module_eval(<<'.,.,', 'parser.y', 841) def _reduce_199(val, _values, result) result = val[0] result end .,., # reduce 200 omitted # reduce 201 omitted module_eval(<<'.,.,', 'parser.y', 848) def _reduce_202(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', 863) def _reduce_203(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', 880) def _reduce_204(val, _values, result) result = val[2] result[0].unshift(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 884) def _reduce_205(val, _values, result) result = empty_params_result result[0].unshift(val[0]) result end .,., # reduce 206 omitted module_eval(<<'.,.,', 'parser.y', 891) def _reduce_207(val, _values, result) result = val[2] result[1].unshift(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 895) def _reduce_208(val, _values, result) result = empty_params_result result[1].unshift(val[0]) result end .,., # reduce 209 omitted module_eval(<<'.,.,', 'parser.y', 902) def _reduce_210(val, _values, result) result = val[2] result[2] = val[0] result end .,., module_eval(<<'.,.,', 'parser.y', 906) def _reduce_211(val, _values, result) result = empty_params_result result[2] = val[0] result end .,., # reduce 212 omitted module_eval(<<'.,.,', 'parser.y', 913) def _reduce_213(val, _values, result) result = val[2] result[3].unshift(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 917) def _reduce_214(val, _values, result) result = empty_params_result result[3].unshift(val[0]) result end .,., # reduce 215 omitted module_eval(<<'.,.,', 'parser.y', 924) def _reduce_216(val, _values, result) result = empty_params_result result end .,., module_eval(<<'.,.,', 'parser.y', 927) def _reduce_217(val, _values, result) result = val[2] result[4].merge!(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 931) def _reduce_218(val, _values, result) result = empty_params_result result[4].merge!(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 935) def _reduce_219(val, _values, result) result = val[2] result[5].merge!(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 939) def _reduce_220(val, _values, result) result = empty_params_result result[5].merge!(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 943) def _reduce_221(val, _values, result) result = empty_params_result result[6] = val[0] result end .,., module_eval(<<'.,.,', 'parser.y', 949) def _reduce_222(val, _values, result) result = Types::Function::Param.new(type: val[0], name: val[1]&.value&.to_sym) result end .,., module_eval(<<'.,.,', 'parser.y', 955) 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', 961) def _reduce_224(val, _values, result) result = Types::Function::Param.new(type: val[1], name: val[2]&.value&.to_sym) result end .,., module_eval(<<'.,.,', 'parser.y', 967) def _reduce_225(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', 974) def _reduce_226(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', 981) def _reduce_227(val, _values, result) result = Types::Function::Param.new(type: val[1], name: val[2]&.value&.to_sym) result end .,., # reduce 228 omitted # reduce 229 omitted # reduce 230 omitted # reduce 231 omitted module_eval(<<'.,.,', 'parser.y', 990) def _reduce_232(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 233 omitted # reduce 234 omitted # reduce 235 omitted module_eval(<<'.,.,', 'parser.y', 1002) 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', 1011) def _reduce_237(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', 1020) def _reduce_238(val, _values, result) result = nil result end .,., module_eval(<<'.,.,', 'parser.y', 1023) def _reduce_239(val, _values, result) result = LocatedValue.new(value: Namespace.root, location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 1026) def _reduce_240(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', 1030) def _reduce_241(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