# # DO NOT MODIFY!!!! # This file is automatically generated by Racc 1.4.16 # from Racc grammar file "". # require 'racc/parser.rb' module RBS class Parser < Racc::Parser module_eval(<<'...end parser.y/module_eval...', 'parser.y', 995) 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 = {} 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) start_index = input.charpos - input.matched.size end_index = input.charpos location = RBS::Location.new(buffer: buffer, start_pos: start_index, end_pos: end_index) [type, LocatedValue.new(location: location, value: value)] 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, "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/) start_index = input.charpos - input.matched.size end_index = input.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 = [ '328,329,33,259,-4,74,-226,33,33,-107,189,-226,78,327,33,74,33,224,40', '41,202,203,204,205,206,207,208,209,213,33,210,201,211,212,102,113,103', '338,104,105,190,161,32,162,321,315,316,32,32,319,317,320,33,287,32,318', '32,106,107,108,110,112,111,314,325,326,109,114,116,32,339,40,41,322', '323,117,328,329,39,33,58,59,-106,33,40,41,367,87,33,327,33,50,32,-105', '366,306,202,203,204,205,206,207,208,209,213,163,210,201,211,212,102', '113,103,302,104,105,40,41,-104,32,321,315,316,32,51,319,317,320,32,192', '32,318,293,106,107,108,110,112,111,314,325,326,109,114,116,328,329,-103', '85,322,323,117,50,295,50,193,151,145,327,254,148,150,146,261,262,202', '203,204,205,206,207,208,209,213,86,210,201,211,212,102,113,103,147,104', '105,51,161,51,162,321,315,316,297,144,319,317,320,157,265,-102,318,346', '106,107,108,110,112,111,314,325,326,109,114,116,384,2,3,4,322,323,117', '328,329,86,266,58,59,86,307,40,41,308,385,309,327,40,41,40,41,-101,86', '202,203,204,205,206,207,208,209,213,163,210,201,211,212,102,113,103', '86,104,105,151,161,39,162,321,315,316,40,41,319,317,320,386,61,62,318', '63,106,107,108,110,112,111,314,325,326,109,114,116,40,41,360,361,322', '323,117,328,329,86,159,58,59,40,41,40,41,58,59,41,327,40,41,55,54,56', '156,202,203,204,205,206,207,208,209,213,163,210,201,211,212,102,113', '103,154,104,105,152,161,149,162,321,315,316,40,41,319,317,320,40,41', '74,318,141,106,107,108,110,112,111,314,325,326,109,114,116,268,269,40', '41,322,323,117,328,329,40,41,58,59,40,41,40,41,58,59,344,327,40,41,55', '54,56,140,202,203,204,205,206,207,208,209,213,163,210,201,211,212,102', '113,103,392,104,105,40,41,40,41,321,315,316,40,41,319,317,320,40,41', '139,318,349,106,107,108,110,112,111,314,325,326,109,114,116,328,329', '40,41,322,323,117,40,41,40,41,40,41,327,350,351,138,349,137,349,202', '203,204,205,206,207,208,209,340,356,210,201,211,212,102,113,103,357', '104,105,358,362,364,365,321,315,316,368,369,319,317,320,81,39,64,318', '376,106,107,108,110,112,111,314,325,326,109,114,116,328,329,377,48,322', '323,117,43,381,42,37,393,389,327,5,389,390,391,194,42,202,203,204,205', '206,207,208,209,213,170,210,201,211,212,102,113,103,169,104,105,168', '167,227,228,321,315,316,166,230,319,317,320,231,232,165,318,234,106', '107,108,110,112,111,314,325,326,109,114,116,33,164,58,59,322,323,117', '-126,22,23,21,81,26,-204,25,238,30,238,91,92,93,94,95,96,97,98,115,16', '99,90,100,101,102,113,103,48,104,105,238,242,32,-111,-110,245,28,-109', '132,42,133,135,-108,248,250,254,256,106,107,108,110,112,111,42,,,109', '114,116,33,,58,59,,,117,,22,23,21,,26,,25,,30,,91,92,93,94,95,96,97', '98,115,16,99,90,100,101,102,113,103,,104,105,,,32,,,,28,,,,,,,,,,,106', '107,108,110,112,111,,,,109,114,116,33,,58,59,,,117,,22,23,21,,26,-204', '25,,30,,91,92,93,94,95,96,97,98,115,16,99,90,100,101,102,113,103,,104', '105,,,32,,,,28,,132,,133,135,,,,,,106,107,108,110,112,111,,,,109,114', '116,33,,58,59,,,117,,22,23,21,,26,-204,25,,30,,91,92,93,94,95,96,97', '98,115,16,99,90,100,101,102,113,103,,104,105,,,32,,,,28,,132,,133,135', ',,,,,106,107,108,110,112,111,,,,109,114,116,33,,58,59,,,117,,22,23,21', ',26,-204,25,,30,,91,92,93,94,95,96,97,98,115,16,99,90,100,101,102,113', '103,,104,105,,,32,,,,28,,200,,,135,,,,,,106,107,108,110,112,111,,,,109', '114,116,33,,58,59,,,117,,22,23,21,,26,-204,25,,30,,91,92,93,94,95,96', '97,98,115,16,99,90,100,101,102,113,103,,104,105,,,32,,,,28,,132,,133', '135,,,,,,106,107,108,110,112,111,,,,109,114,116,33,,58,59,,,117,,22', '23,21,,26,-204,25,,30,,91,92,93,94,95,96,97,98,115,16,99,90,100,101', '102,113,103,,104,105,,,32,,,,28,,200,,,135,,,,,,106,107,108,110,112', '111,58,59,,109,114,116,161,,162,,,,117,,,,202,203,204,205,206,207,208', '209,213,,210,201,211,212,102,113,103,,104,105,,,,,,,,,200,,,135,,40', '41,,,106,107,108,110,112,111,58,59,,109,114,116,161,,162,,,163,117,', ',,202,203,204,205,206,207,208,209,213,306,210,201,211,212,102,113,103', ',104,105,,,,,,,,302,303,299,300,301,,40,41,304,,106,107,108,110,112', '111,58,59,,109,114,116,,,,,,163,117,,,,202,203,204,205,206,207,208,209', '213,,210,201,211,212,102,113,103,,104,105,,,284,285,74,,,,200,,,135', ',,,,,106,107,108,110,112,111,286,,,109,114,116,284,285,74,,281,280,117', '284,285,74,,,284,285,74,,,,,,,286,,272,,,,,286,,,281,280,286,,,,,281', '280,,,,281,280,,,,,,345,33,,,,,,294,,22,23,21,298,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,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', ',,,,,,,,32,,,,28' ] racc_action_table = arr = ::Array.new(2510, 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 = [ '341,341,183,246,34,258,34,250,34,96,153,34,34,341,182,34,181,182,179', '179,341,341,341,341,341,341,341,341,341,48,341,341,341,341,341,341,341', '305,341,341,153,173,183,173,341,341,341,250,34,341,341,341,148,258,182', '341,181,341,341,341,341,341,341,341,341,341,341,341,341,48,305,178,178', '341,341,341,299,299,34,180,299,299,95,303,173,173,349,47,304,299,302', '28,148,94,349,292,299,299,299,299,299,299,299,299,299,173,299,299,299', '299,299,299,299,292,299,299,47,47,93,180,299,299,299,303,28,299,299', '299,304,155,302,299,260,299,299,299,299,299,299,299,299,299,299,299', '299,362,362,92,46,299,299,299,189,264,230,155,77,75,362,266,75,77,75', '248,248,362,362,362,362,362,362,362,362,362,46,362,362,362,362,362,362', '362,75,362,362,189,217,230,217,362,362,362,267,75,362,362,362,84,251', '91,362,311,362,362,362,362,362,362,362,362,362,362,362,362,370,0,0,0', '362,362,362,359,359,84,251,359,359,311,284,217,217,285,371,286,359,6', '6,185,185,90,370,359,359,359,359,359,359,359,359,359,217,359,359,359', '359,359,359,359,371,359,359,89,118,6,118,359,359,359,382,382,359,359', '359,372,31,31,359,31,359,359,359,359,359,359,359,359,359,359,359,359', '271,271,338,338,359,359,359,300,300,372,88,300,300,383,383,118,118,30', '30,82,300,44,44,30,30,30,81,300,300,300,300,300,300,300,300,300,118', '300,300,300,300,300,300,300,80,300,300,78,175,76,175,300,300,300,342', '342,300,300,300,343,343,74,300,56,300,300,300,300,300,300,300,300,300', '300,300,300,253,253,379,379,300,300,300,301,301,380,380,301,301,347', '347,175,175,138,138,309,301,158,158,138,138,138,55,301,301,301,301,301', '301,301,301,301,175,301,301,301,301,301,301,301,388,301,301,142,142', '186,186,301,301,301,177,177,301,301,301,352,352,54,301,313,301,301,301', '301,301,301,301,301,301,301,301,301,306,306,187,187,301,301,301,354', '354,240,240,243,243,306,324,324,53,332,52,334,306,306,306,306,306,306', '306,306,306,335,306,306,306,306,306,306,306,336,306,306,337,340,344', '348,306,306,306,353,355,306,306,306,36,35,32,306,360,306,306,306,306', '306,306,306,306,306,306,306,306,393,393,361,27,306,306,306,24,367,7', '5,391,392,393,1,373,375,378,165,136,393,393,393,393,393,393,393,393', '393,130,393,393,393,393,393,393,393,129,393,393,126,124,184,188,393', '393,393,122,190,393,393,393,191,193,121,393,198,393,393,393,393,393', '393,393,393,393,393,393,393,167,120,167,167,393,393,393,115,167,167', '167,221,167,167,167,222,167,223,167,167,167,167,167,167,167,167,167', '167,167,167,167,167,167,167,167,101,167,167,225,226,167,100,99,229,167', '98,167,233,167,167,97,236,237,238,239,167,167,167,167,167,167,244,,', '167,167,167,132,,132,132,,,167,,132,132,132,,132,,132,,132,,132,132', '132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,,132,132', ',,132,,,,132,,,,,,,,,,,132,132,132,132,132,132,,,,132,132,132,50,,50', '50,,,132,,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,,,,50,,50,,50,50,,,,,,50,50,50,50,50,50,', ',,50,50,50,154,,154,154,,,50,,154,154,154,,154,154,154,,154,,154,154', '154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,,154,154', ',,154,,,,154,,154,,154,154,,,,,,154,154,154,154,154,154,,,,154,154,154', '234,,234,234,,,154,,234,234,234,,234,234,234,,234,,234,234,234,234,234', '234,234,234,234,234,234,234,234,234,234,234,234,,234,234,,,234,,,,234', ',234,,,234,,,,,,234,234,234,234,234,234,,,,234,234,234,166,,166,166', ',,234,,166,166,166,,166,166,166,,166,,166,166,166,166,166,166,166,166', '166,166,166,166,166,166,166,166,166,,166,166,,,166,,,,166,,166,,166', '166,,,,,,166,166,166,166,166,166,,,,166,166,166,168,,168,168,,,166,', '168,168,168,,168,168,168,,168,,168,168,168,168,168,168,168,168,168,168', '168,168,168,168,168,168,168,,168,168,,,168,,,,168,,168,,,168,,,,,,168', '168,168,168,168,168,169,169,,168,168,168,174,,174,,,,168,,,,169,169', '169,169,169,169,169,169,169,,169,169,169,169,169,169,169,,169,169,,', ',,,,,,169,,,169,,174,174,,,169,169,169,169,169,169,200,200,,169,169', '169,171,,171,,,174,169,,,,200,200,200,200,200,200,200,200,200,283,200', '200,200,200,200,200,200,,200,200,,,,,,,,283,283,283,283,283,,171,171', '283,,200,200,200,200,200,200,170,170,,200,200,200,,,,,,171,200,,,,170', '170,170,170,170,170,170,170,170,,170,170,170,170,170,170,170,,170,170', ',,257,257,257,,,,170,,,170,,,,,,170,170,170,170,170,170,257,,,170,170', '170,310,310,310,,257,257,170,263,263,263,,,270,270,270,,,,,,,310,,257', ',,,,263,,,310,310,270,,,,,263,263,,,,270,270,,,,,,310,57,,,,,,263,,57', '57,57,270,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,,356,,,,,,,307,356,356,356,307,356,,356,,356', ',356,356,356,356,356,356,356,356,356,356,356,356,356,356,,40,,,,,,,356', '40,40,40,356,40,,40,,40,,40,40,40,40,40,40,40,40,40,40,40,40,40,40,', '333,,,,,,,40,333,333,333,40,333,,333,,333,,333,333,333,333,333,333,333', '333,333,333,333,333,333,333,,331,,,,,,,333,331,331,331,333,331,,331', ',331,,331,331,331,331,331,331,331,331,331,331,331,331,331,331,,312,', ',,,,,331,312,312,312,331,312,,312,,312,,312,312,312,312,312,312,312', '312,312,312,312,312,312,312,,308,,,,,,,312,308,308,308,312,308,,308', ',308,,308,308,308,308,308,308,308,308,308,308,308,308,308,308,,172,', ',,,,,308,172,172,172,308,172,,172,,172,,172,172,172,172,172,172,172', '172,172,172,172,172,172,172,,26,,,,,,,172,26,26,26,172,26,,26,,26,,26', '26,26,26,26,26,26,26,26,26,26,26,26,26,,194,,,,,,,26,194,194,194,26', '194,,194,,194,,194,194,194,194,194,194,194,194,194,194,194,194,194,194', ',25,,,,,,,194,25,25,25,194,25,,25,25,25,,25,25,25,25,25,25,25,25,25', '25,25,25,25,25,,133,,,,,,,25,133,133,133,25,133,,133,,133,,133,133,133', '133,133,133,133,133,133,133,133,133,133,133,,134,,,,,,,133,134,134,134', '133,134,,134,,134,,134,134,134,134,134,134,134,134,134,134,134,134,134', '134,,135,,,,,,,134,135,135,135,134,135,,135,,135,,135,135,135,135,135', '135,135,135,135,135,135,135,135,135,,369,,,,,,,135,369,369,369,135,369', ',369,,369,,369,369,369,369,369,369,369,369,369,369,369,369,369,369,', '139,,,,,,,369,139,139,139,369,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,,365,,,,,,,141,365,365,365,141,365,,365', ',365,,365,365,365,365,365,365,365,365,365,365,365,365,365,365,,149,', ',,,,,365,149,149,149,365,149,,149,,149,,149,149,149,149,149,149,149', '149,149,149,149,149,149,149,,150,,,,,,,149,150,150,150,149,150,,150', ',150,,150,150,150,150,150,150,150,150,150,150,150,150,150,150,,152,', ',,,,,150,152,152,152,150,152,,152,,152,,152,152,152,152,152,152,152', '152,152,152,152,152,152,152,,43,,,,,,,152,43,43,43,152,43,,43,,43,,43', '43,43,43,43,43,43,43,43,43,43,43,43,43,,41,,,,,,,43,41,41,41,43,41,', '41,,41,,41,41,41,41,41,41,41,41,41,41,41,41,41,41,,51,,,,,,,41,51,51', '51,41,51,,51,,51,,51,51,51,51,51,51,51,51,51,51,51,51,51,51,,357,,,', ',,,51,357,357,357,51,357,,357,,357,,357,357,357,357,357,357,357,357', '357,357,357,357,357,357,,2,,,,,,,357,2,2,2,357,2,,2,,2,,2,2,2,2,2,2', '2,2,2,2,2,2,2,2,,86,,,,,,,2,86,86,86,2,86,,86,,86,,86,86,86,86,86,86', '86,86,86,86,86,86,86,86,,358,,,,,,,86,358,358,358,86,358,,358,,358,', '358,358,358,358,358,358,358,358,358,358,358,358,358,358,,295,,,,,,,358', '295,295,295,358,295,,295,,295,,295,295,295,295,295,295,295,295,295,295', '295,295,295,295,,256,,,,,,,295,256,256,256,295,256,,256,,256,,256,256', '256,256,256,256,256,256,256,256,256,256,256,256,,364,,,,,,,256,364,364', '364,256,364,,364,,364,,364,364,364,364,364,364,364,364,364,364,364,364', '364,364,,228,,,,,,,364,228,228,228,364,228,,228,,228,,228,228,228,228', '228,228,228,228,228,228,228,228,228,228,,227,,,,,,,228,227,227,227,228', '227,,227,,227,,227,227,227,227,227,227,227,227,227,227,227,227,227,227', ',224,,,,,,,227,224,224,224,227,224,,224,,224,,224,224,224,224,224,224', '224,224,224,224,224,224,224,224,,368,,,,,,,224,368,368,368,224,368,', '368,,368,,368,368,368,368,368,368,368,368,368,368,368,368,368,368,,', ',,,,,,368,,,,368' ] racc_action_check = arr = ::Array.new(2510, 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 = [ 144, 525, 2164, nil, nil, 521, 189, 470, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 500, 1636, 1570, 498, 75, nil, 301, 272, 492, nil, 4, 421, 476, nil, nil, nil, 1372, 2065, nil, 2032, 265, nil, 129, 70, 25, nil, 710, 2098, 439, 413, 373, 338, 299, 1273, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 340, 124, 296, 154, 294, nil, 318, 314, 262, nil, 178, nil, 2197, nil, 283, 259, 196, 156, 104, 75, 50, 39, -34, 587, 582, 579, 578, 599, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 544, nil, nil, 259, nil, 538, 548, 513, nil, 507, nil, 506, nil, nil, 503, 495, nil, 643, 1669, 1702, 1735, 480, nil, 377, 1801, 1834, 1867, 367, nil, nil, nil, nil, nil, 48, 1933, 1966, nil, 1999, -10, 777, 110, nil, nil, 341, nil, nil, nil, nil, nil, nil, 480, 911, 576, 978, 1037, 1155, 1105, 1537, 38, 1046, 335, nil, 374, 25, -28, 75, 12, 10, -2, 498, 191, 369, 398, 505, 136, 539, 546, nil, 562, 1603, nil, nil, nil, 522, nil, 1096, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 183, nil, nil, nil, 573, 577, 579, 2428, 600, 614, 2395, 2362, 602, 138, nil, nil, 577, 844, nil, 615, 575, 556, 591, 405, nil, nil, 407, 591, nil, -18, nil, 161, nil, 3, 179, nil, 291, nil, nil, 2296, 1190, -6, nil, 115, nil, nil, 1224, 135, nil, 82, 190, nil, nil, 1229, 244, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1085, 185, 188, 177, nil, nil, nil, nil, nil, 53, nil, nil, 2263, nil, nil, nil, 74, 295, 371, 86, 79, 84, 0, 440, 1306, 1504, 376, 1217, 182, 1471, 413, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 406, nil, nil, nil, nil, nil, nil, 1438, 443, 1405, 445, 453, 461, 464, 262, nil, 427, -2, 298, 303, 441, nil, nil, 333, 442, 77, nil, nil, 379, 446, 403, 447, 1339, 2131, 2230, 219, 442, 457, 143, nil, 2329, 1900, nil, 502, 2461, 1768, 195, 213, 254, 487, nil, 484, nil, nil, 498, 322, 329, nil, 222, 257, nil, nil, nil, nil, 364, nil, nil, 466, 484, 509, nil, nil ] racc_action_default = [ -230, -230, -226, -6, -16, -230, -4, -149, -152, -153, -154, -155, -156, -157, -158, -159, -160, -161, -162, -163, -164, -165, -166, -167, -168, -226, -226, -230, -230, -176, -230, -230, -227, -229, -17, -4, -139, 396, -1, -5, -226, -226, -175, -226, -177, -170, -230, -230, -226, -174, -226, -226, -230, -180, -230, -230, -230, -226, -188, -189, -220, -221, -222, -223, -228, -2, -7, -8, -9, -10, -11, -12, -13, -14, -17, -230, -230, -230, -230, -3, -75, -230, -150, -151, -230, -171, -226, -172, -230, -230, -162, -152, -156, -163, -164, -153, -154, -157, -158, -161, -155, -112, -113, -114, -115, -116, -117, -118, -119, -120, -121, -122, -123, -124, -125, -159, -127, -128, -216, -186, -230, -230, -193, -194, -196, -197, -199, -200, -203, -206, -208, -209, -226, -226, -226, -226, -191, -179, -230, -226, -226, -226, -185, -18, -15, -15, -15, -15, -226, -226, -226, -225, -226, -77, -226, -230, -141, -169, -178, -173, -210, -217, -218, -219, -187, -230, -226, -226, -226, -204, -204, -216, -226, -216, -216, -216, -181, -182, -183, -184, -226, -226, -226, -226, -230, -146, -147, -148, -230, -230, -230, -230, -140, -230, -226, -192, -200, -195, -202, -198, -230, -101, -102, -103, -104, -105, -106, -107, -108, -109, -110, -111, -112, -126, -205, -207, -211, -216, -212, -213, -215, -139, -129, -129, -226, -129, -230, -226, -226, -230, -230, -76, -142, -190, -226, -214, -230, -23, -137, -28, -30, -54, -224, -145, -74, -78, -230, -201, -230, -30, -226, -230, -131, -134, -138, -30, -226, -17, -17, -79, -230, -20, -21, -17, -24, -130, -137, -230, -135, -136, -17, -29, -27, -31, -32, -33, -34, -35, -36, -37, -38, -39, -40, -66, -230, -230, -230, -53, -55, -56, -57, -58, -66, -30, -22, -226, -132, -133, -26, -230, -230, -230, -226, -226, -226, -230, -230, -226, -226, -230, -17, -230, -226, -47, -82, -83, -84, -85, -86, -87, -88, -89, -90, -91, -92, -95, -96, -97, -98, -99, -100, -226, -47, -226, -47, -59, -61, -63, -68, -67, -126, -230, -50, -51, -230, -19, -25, -41, -230, -230, -93, -94, -43, -230, -45, -230, -226, -226, -226, -230, -230, -230, -230, -143, -226, -226, -48, -230, -226, -226, -230, -230, -230, -16, -80, -230, -69, -70, -230, -52, -42, -49, -44, -46, -60, -62, -64, -65, -71, -72, -81, -230, -16, -230, -73, -144 ] racc_goto_table = [ 6, 46, 75, 80, 121, 52, 57, 76, 49, 172, 160, 77, 196, 136, 199, 198, 198, 184, 38, 84, 155, 88, 257, 252, 47, 89, 387, 330, 330, 330, 197, 263, 237, 239, 330, 241, 1, 270, 82, 83, 60, 348, 143, 214, 215, 394, 65, 79, 118, 34, 35, 296, 313, 332, 334, 142, 66, 67, 68, 341, 353, 69, 355, 216, 70, 218, 219, 220, 71, 330, 180, 181, 182, 183, 72, 310, 73, 172, 260, 249, 247, 255, 198, 289, 158, 290, 291, 330, 225, 258, 330, 288, 359, 373, 363, 153, 188, 251, 267, nil, nil, nil, nil, nil, nil, nil, nil, nil, 191, 235, nil, nil, 375, 176, 57, 378, nil, nil, nil, nil, 195, 330, nil, nil, nil, nil, nil, nil, nil, nil, 171, 173, 174, 175, nil, nil, nil, 177, 178, 179, nil, nil, nil, nil, nil, nil, 395, 185, 186, nil, 187, nil, 118, 221, 222, 223, 233, 89, 89, 89, 226, nil, nil, nil, 118, 118, 118, nil, nil, 229, 217, 335, 336, 337, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 236, nil, 244, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 246, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 240, 264, nil, 243, 292, 89, nil, nil, nil, nil, 118, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 271, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 311, nil, nil, nil, 312, 331, 333, 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, 342, 343, nil, nil, nil, 347, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 352, nil, 354, 370, 371, 372, 374, 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, 379, 380, nil, nil, 382, 383 ] racc_goto_check = [ 2, 23, 16, 18, 47, 58, 33, 17, 48, 60, 71, 56, 66, 46, 66, 61, 61, 39, 3, 23, 55, 17, 20, 52, 2, 56, 43, 50, 50, 50, 62, 20, 21, 21, 50, 21, 1, 20, 2, 2, 72, 35, 16, 67, 67, 43, 3, 3, 2, 4, 5, 52, 34, 34, 34, 2, 6, 7, 8, 34, 35, 9, 35, 71, 10, 71, 71, 71, 11, 50, 14, 14, 14, 14, 12, 20, 13, 60, 19, 22, 66, 24, 61, 26, 2, 27, 32, 50, 36, 37, 50, 38, 41, 42, 34, 44, 45, 51, 54, nil, nil, nil, nil, nil, nil, nil, nil, nil, 47, 71, nil, nil, 34, 58, 33, 34, nil, nil, nil, nil, 47, 50, nil, nil, nil, nil, nil, nil, nil, nil, 2, 2, 2, 2, nil, nil, nil, 2, 2, 2, nil, nil, nil, nil, nil, nil, 34, 2, 2, nil, 2, nil, 2, 17, 17, 17, 46, 56, 56, 56, 56, nil, nil, nil, 2, 2, 2, nil, nil, 48, 2, 39, 39, 39, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 18, nil, 46, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 48, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 2, 17, nil, 2, 16, 56, nil, nil, nil, nil, 2, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 2, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 23, nil, nil, nil, 33, 33, 33, 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, 2, 2, nil, nil, nil, 2, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 2, nil, 2, 23, 23, 23, 33, 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, 2, 2, nil, nil, 2, 2 ] racc_goto_pointer = [ nil, 36, -2, 12, 46, 46, 22, 23, 24, 27, 30, 34, 40, 42, -74, nil, -32, -27, -33, -170, -218, -190, -158, -24, -158, nil, -175, -173, nil, nil, nil, nil, -172, -24, -247, -272, -95, -152, -167, -131, nil, -246, -266, -347, 15, -57, -38, -46, -20, nil, -272, -141, -215, nil, -155, -61, -23, nil, -25, nil, -123, -152, -137, nil, nil, nil, -154, -126, nil, nil, nil, -108, 9 ] racc_goto_default = [ nil, nil, 44, nil, nil, 388, nil, nil, nil, nil, nil, nil, nil, nil, nil, 36, 283, nil, nil, nil, nil, nil, nil, nil, nil, 273, 274, 275, 276, 277, 278, 279, 282, 119, nil, nil, nil, nil, nil, 24, 305, nil, nil, nil, nil, nil, 7, nil, nil, 324, 120, nil, nil, 253, nil, nil, 31, 29, nil, 53, 134, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, nil, nil ] racc_reduce_table = [ 0, 0, :racc_error, 3, 79, :_reduce_1, 3, 79, :_reduce_2, 3, 79, :_reduce_3, 0, 81, :_reduce_none, 1, 81, :_reduce_none, 0, 82, :_reduce_6, 2, 82, :_reduce_7, 1, 84, :_reduce_none, 1, 84, :_reduce_none, 1, 84, :_reduce_none, 1, 84, :_reduce_none, 1, 84, :_reduce_none, 1, 84, :_reduce_none, 1, 84, :_reduce_none, 0, 92, :_reduce_15, 0, 93, :_reduce_16, 0, 94, :_reduce_17, 2, 94, :_reduce_18, 10, 91, :_reduce_19, 1, 97, :_reduce_none, 1, 97, :_reduce_none, 8, 90, :_reduce_22, 0, 100, :_reduce_23, 2, 100, :_reduce_24, 5, 100, :_reduce_25, 8, 89, :_reduce_26, 7, 89, :_reduce_27, 0, 102, :_reduce_28, 2, 102, :_reduce_29, 0, 98, :_reduce_30, 2, 98, :_reduce_31, 1, 103, :_reduce_none, 1, 103, :_reduce_none, 1, 103, :_reduce_none, 1, 103, :_reduce_none, 1, 103, :_reduce_none, 1, 103, :_reduce_none, 1, 103, :_reduce_38, 1, 103, :_reduce_39, 1, 103, :_reduce_none, 4, 109, :_reduce_41, 6, 109, :_reduce_42, 4, 109, :_reduce_43, 6, 109, :_reduce_44, 4, 109, :_reduce_45, 6, 109, :_reduce_46, 0, 113, :_reduce_47, 2, 113, :_reduce_48, 3, 113, :_reduce_49, 3, 108, :_reduce_50, 3, 108, :_reduce_51, 5, 108, :_reduce_52, 7, 88, :_reduce_53, 0, 115, :_reduce_54, 2, 115, :_reduce_55, 1, 116, :_reduce_56, 1, 116, :_reduce_57, 1, 116, :_reduce_none, 3, 105, :_reduce_59, 6, 105, :_reduce_60, 3, 106, :_reduce_61, 6, 106, :_reduce_62, 3, 107, :_reduce_63, 6, 107, :_reduce_64, 6, 104, :_reduce_65, 0, 118, :_reduce_66, 2, 118, :_reduce_67, 0, 119, :_reduce_68, 2, 119, :_reduce_69, 2, 119, :_reduce_70, 1, 121, :_reduce_71, 1, 121, :_reduce_72, 3, 121, :_reduce_73, 6, 83, :_reduce_74, 0, 122, :_reduce_75, 3, 122, :_reduce_76, 0, 123, :_reduce_77, 3, 123, :_reduce_78, 4, 123, :_reduce_79, 1, 120, :_reduce_none, 2, 120, :_reduce_81, 1, 112, :_reduce_none, 1, 112, :_reduce_none, 1, 112, :_reduce_none, 1, 112, :_reduce_none, 1, 112, :_reduce_none, 1, 112, :_reduce_none, 1, 112, :_reduce_none, 1, 112, :_reduce_none, 1, 112, :_reduce_none, 1, 112, :_reduce_none, 1, 112, :_reduce_none, 2, 112, :_reduce_93, 2, 112, :_reduce_94, 1, 112, :_reduce_none, 1, 112, :_reduce_none, 1, 112, :_reduce_none, 1, 127, :_reduce_none, 1, 127, :_reduce_none, 1, 127, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 0, 99, :_reduce_129, 3, 99, :_reduce_130, 1, 129, :_reduce_131, 3, 129, :_reduce_132, 3, 130, :_reduce_133, 0, 132, :_reduce_134, 1, 132, :_reduce_135, 1, 132, :_reduce_136, 0, 131, :_reduce_137, 1, 131, :_reduce_138, 0, 96, :_reduce_139, 3, 96, :_reduce_140, 1, 133, :_reduce_141, 3, 133, :_reduce_142, 4, 110, :_reduce_143, 8, 110, :_reduce_144, 5, 85, :_reduce_145, 3, 86, :_reduce_146, 3, 86, :_reduce_147, 3, 87, :_reduce_148, 1, 80, :_reduce_none, 3, 80, :_reduce_150, 3, 80, :_reduce_151, 1, 124, :_reduce_152, 1, 124, :_reduce_153, 1, 124, :_reduce_154, 1, 124, :_reduce_155, 1, 124, :_reduce_156, 1, 124, :_reduce_157, 1, 124, :_reduce_158, 1, 124, :_reduce_159, 1, 124, :_reduce_160, 1, 124, :_reduce_161, 1, 124, :_reduce_162, 1, 124, :_reduce_163, 1, 124, :_reduce_164, 1, 124, :_reduce_165, 1, 124, :_reduce_166, 1, 124, :_reduce_167, 1, 124, :_reduce_168, 4, 124, :_reduce_169, 2, 124, :_reduce_170, 3, 124, :_reduce_171, 3, 124, :_reduce_172, 4, 124, :_reduce_173, 2, 124, :_reduce_174, 2, 124, :_reduce_175, 1, 124, :_reduce_none, 1, 101, :_reduce_177, 3, 101, :_reduce_178, 3, 135, :_reduce_179, 1, 136, :_reduce_180, 3, 136, :_reduce_181, 3, 137, :_reduce_182, 3, 137, :_reduce_183, 3, 137, :_reduce_184, 2, 137, :_reduce_185, 1, 138, :_reduce_none, 2, 138, :_reduce_187, 1, 111, :_reduce_none, 1, 111, :_reduce_none, 5, 126, :_reduce_190, 2, 126, :_reduce_191, 3, 125, :_reduce_192, 1, 125, :_reduce_193, 1, 125, :_reduce_none, 3, 140, :_reduce_195, 1, 140, :_reduce_196, 1, 140, :_reduce_none, 3, 142, :_reduce_198, 1, 142, :_reduce_199, 1, 142, :_reduce_none, 3, 144, :_reduce_201, 1, 144, :_reduce_202, 1, 144, :_reduce_none, 0, 145, :_reduce_204, 3, 145, :_reduce_205, 1, 145, :_reduce_206, 3, 145, :_reduce_207, 1, 145, :_reduce_208, 1, 145, :_reduce_209, 2, 139, :_reduce_210, 3, 141, :_reduce_211, 3, 143, :_reduce_212, 3, 146, :_reduce_213, 4, 147, :_reduce_214, 3, 148, :_reduce_215, 0, 149, :_reduce_none, 1, 149, :_reduce_none, 1, 149, :_reduce_none, 1, 149, :_reduce_none, 2, 117, :_reduce_220, 1, 150, :_reduce_none, 1, 150, :_reduce_none, 1, 150, :_reduce_none, 2, 114, :_reduce_224, 2, 95, :_reduce_225, 0, 134, :_reduce_226, 1, 134, :_reduce_227, 2, 134, :_reduce_228, 1, 134, :_reduce_229 ] racc_reduce_n = 230 racc_shift_n = 396 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 } racc_nt_base = 78 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", "$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", "module_self_type", "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", "qualified_name", "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_type: 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_type: 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 = nil result end .,., module_eval(<<'.,.,', 'parser.y', 140) def _reduce_29(val, _values, result) result = val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 144) def _reduce_30(val, _values, result) result = [] result end .,., module_eval(<<'.,.,', 'parser.y', 146) def _reduce_31(val, _values, result) result = val[0].push(val[1]) result end .,., # reduce 32 omitted # reduce 33 omitted # reduce 34 omitted # reduce 35 omitted # reduce 36 omitted # reduce 37 omitted module_eval(<<'.,.,', 'parser.y', 157) def _reduce_38(val, _values, result) result = Members::Public.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 160) def _reduce_39(val, _values, result) result = Members::Private.new(location: val[0].location) result end .,., # reduce 40 omitted module_eval(<<'.,.,', 'parser.y', 166) def _reduce_41(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', 175) def _reduce_42(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', 184) def _reduce_43(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', 193) def _reduce_44(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', 202) def _reduce_45(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', 211) def _reduce_46(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', 221) def _reduce_47(val, _values, result) result = nil result end .,., module_eval(<<'.,.,', 'parser.y', 222) def _reduce_48(val, _values, result) result = false result end .,., module_eval(<<'.,.,', 'parser.y', 223) def _reduce_49(val, _values, result) result = val[1].value result end .,., module_eval(<<'.,.,', 'parser.y', 227) def _reduce_50(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', 236) def _reduce_51(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', 255) def _reduce_52(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', 276) def _reduce_53(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', 290) def _reduce_54(val, _values, result) result = [] result end .,., module_eval(<<'.,.,', 'parser.y', 292) def _reduce_55(val, _values, result) result = val[0].push(val[1]) result end .,., module_eval(<<'.,.,', 'parser.y', 297) def _reduce_56(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', 308) def _reduce_57(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 58 omitted module_eval(<<'.,.,', 'parser.y', 318) def _reduce_59(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', 329) def _reduce_60(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', 342) def _reduce_61(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', 353) def _reduce_62(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', 366) def _reduce_63(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', 377) def _reduce_64(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', 390) def _reduce_65(val, _values, result) location = val[2].location + val[5].last.location types = val[5].map do |type| case type when LocatedValue type.value else type end end result = Members::MethodDefinition.new( name: val[4].value, kind: val[3], types: types, annotations: val[0], location: location, comment: leading_comment(val[0].first&.location || val[1].first&.location || val[2].location), attributes: val[1].map(&:value) ) result end .,., module_eval(<<'.,.,', 'parser.y', 411) def _reduce_66(val, _values, result) result = [] result end .,., module_eval(<<'.,.,', 'parser.y', 413) def _reduce_67(val, _values, result) result = val[0].push(val[1]) result end .,., module_eval(<<'.,.,', 'parser.y', 417) def _reduce_68(val, _values, result) result = :instance result end .,., module_eval(<<'.,.,', 'parser.y', 418) def _reduce_69(val, _values, result) result = :singleton result end .,., module_eval(<<'.,.,', 'parser.y', 419) def _reduce_70(val, _values, result) result = :singleton_instance result end .,., module_eval(<<'.,.,', 'parser.y', 422) def _reduce_71(val, _values, result) result = [val[0]] result end .,., module_eval(<<'.,.,', 'parser.y', 423) def _reduce_72(val, _values, result) result = [LocatedValue.new(value: :super, location: val[0].location)] result end .,., module_eval(<<'.,.,', 'parser.y', 425) def _reduce_73(val, _values, result) result = val[2].unshift(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 430) def _reduce_74(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', 455) def _reduce_75(val, _values, result) result = nil result end .,., module_eval(<<'.,.,', 'parser.y', 457) def _reduce_76(val, _values, result) result = LocatedValue.new(value: val[1], location: val[0].location + val[2].location) result end .,., module_eval(<<'.,.,', 'parser.y', 461) def _reduce_77(val, _values, result) result = nil result end .,., module_eval(<<'.,.,', 'parser.y', 463) def _reduce_78(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', 467) def _reduce_79(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 80 omitted module_eval(<<'.,.,', 'parser.y', 474) def _reduce_81(val, _values, result) result = LocatedValue.new(value: val[0].value.to_sym, location: val[0].location + val[1].location) result end .,., # reduce 82 omitted # reduce 83 omitted # reduce 84 omitted # reduce 85 omitted # reduce 86 omitted # reduce 87 omitted # reduce 88 omitted # reduce 89 omitted # reduce 90 omitted # reduce 91 omitted # reduce 92 omitted module_eval(<<'.,.,', 'parser.y', 483) def _reduce_93(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', 491) def _reduce_94(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 95 omitted # reduce 96 omitted # reduce 97 omitted # reduce 98 omitted # reduce 99 omitted # 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 module_eval(<<'.,.,', 'parser.y', 511) def _reduce_129(val, _values, result) result = nil result end .,., module_eval(<<'.,.,', 'parser.y', 513) def _reduce_130(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', 520) def _reduce_131(val, _values, result) result = Declarations::ModuleTypeParams.new() result.add(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 524) def _reduce_132(val, _values, result) result = val[0].add(val[2]) result end .,., module_eval(<<'.,.,', 'parser.y', 529) def _reduce_133(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', 535) def _reduce_134(val, _values, result) result = :invariant result end .,., module_eval(<<'.,.,', 'parser.y', 536) def _reduce_135(val, _values, result) result = :covariant result end .,., module_eval(<<'.,.,', 'parser.y', 537) def _reduce_136(val, _values, result) result = :contravariant result end .,., module_eval(<<'.,.,', 'parser.y', 540) def _reduce_137(val, _values, result) result = false result end .,., module_eval(<<'.,.,', 'parser.y', 541) def _reduce_138(val, _values, result) result = true result end .,., module_eval(<<'.,.,', 'parser.y', 544) def _reduce_139(val, _values, result) result = nil result end .,., module_eval(<<'.,.,', 'parser.y', 546) def _reduce_140(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', 554) def _reduce_141(val, _values, result) result = [val[0].value.to_sym] result end .,., module_eval(<<'.,.,', 'parser.y', 557) def _reduce_142(val, _values, result) result = val[0].push(val[2].value.to_sym) result end .,., module_eval(<<'.,.,', 'parser.y', 562) def _reduce_143(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', 573) def _reduce_144(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', 586) def _reduce_145(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', 596) def _reduce_146(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', 603) def _reduce_147(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', 613) def _reduce_148(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 149 omitted module_eval(<<'.,.,', 'parser.y', 623) def _reduce_150(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', 633) def _reduce_151(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', 646) def _reduce_152(val, _values, result) result = Types::Bases::Void.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 649) def _reduce_153(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', 653) def _reduce_154(val, _values, result) result = Types::Bases::Any.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 656) def _reduce_155(val, _values, result) result = Types::Bases::Bool.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 659) def _reduce_156(val, _values, result) result = Types::Bases::Nil.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 662) def _reduce_157(val, _values, result) result = Types::Bases::Top.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 665) def _reduce_158(val, _values, result) result = Types::Bases::Bottom.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 668) def _reduce_159(val, _values, result) result = Types::Bases::Self.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 671) def _reduce_160(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', 675) def _reduce_161(val, _values, result) result = Types::Bases::Instance.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 678) def _reduce_162(val, _values, result) result = Types::Bases::Class.new(location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 681) def _reduce_163(val, _values, result) result = Types::Literal.new(literal: true, location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 684) def _reduce_164(val, _values, result) result = Types::Literal.new(literal: false, location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 687) def _reduce_165(val, _values, result) result = Types::Literal.new(literal: val[0].value, location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 690) def _reduce_166(val, _values, result) result = Types::Literal.new(literal: val[0].value, location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 693) def _reduce_167(val, _values, result) result = Types::Literal.new(literal: val[0].value, location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 696) def _reduce_168(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', 714) def _reduce_169(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', 731) def _reduce_170(val, _values, result) location = val[0].location + val[1].location result = Types::Tuple.new(types: [], location: location) result end .,., module_eval(<<'.,.,', 'parser.y', 735) def _reduce_171(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', 740) def _reduce_172(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', 747) def _reduce_173(val, _values, result) result = Types::ClassSingleton.new(name: val[2].value, location: val[0].location + val[3].location) result end .,., module_eval(<<'.,.,', 'parser.y', 751) def _reduce_174(val, _values, result) result = Types::Proc.new(type: val[1].value, location: val[0].location + val[1].location) result end .,., module_eval(<<'.,.,', 'parser.y', 754) def _reduce_175(val, _values, result) result = Types::Optional.new(type: val[0], location: val[0].location + val[1].location) result end .,., # reduce 176 omitted module_eval(<<'.,.,', 'parser.y', 760) def _reduce_177(val, _values, result) result = [val[0]] result end .,., module_eval(<<'.,.,', 'parser.y', 763) def _reduce_178(val, _values, result) result = val[0] + [val[2]] result end .,., module_eval(<<'.,.,', 'parser.y', 768) def _reduce_179(val, _values, result) result = Types::Record.new( fields: val[1], location: val[0].location + val[2].location ) result end .,., module_eval(<<'.,.,', 'parser.y', 776) def _reduce_180(val, _values, result) result = val[0] result end .,., module_eval(<<'.,.,', 'parser.y', 779) def _reduce_181(val, _values, result) result = val[0].merge!(val[2]) result end .,., module_eval(<<'.,.,', 'parser.y', 784) def _reduce_182(val, _values, result) result = { val[0].value => val[2] } result end .,., module_eval(<<'.,.,', 'parser.y', 787) def _reduce_183(val, _values, result) result = { val[0].value => val[2] } result end .,., module_eval(<<'.,.,', 'parser.y', 790) def _reduce_184(val, _values, result) result = { val[0].value => val[2] } result end .,., module_eval(<<'.,.,', 'parser.y', 793) def _reduce_185(val, _values, result) result = { val[0].value => val[1] } result end .,., # reduce 186 omitted module_eval(<<'.,.,', 'parser.y', 799) def _reduce_187(val, _values, result) result = val[0] result end .,., # reduce 188 omitted # reduce 189 omitted module_eval(<<'.,.,', 'parser.y', 806) def _reduce_190(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', 821) def _reduce_191(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', 838) def _reduce_192(val, _values, result) result = val[2] result[0].unshift(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 842) def _reduce_193(val, _values, result) result = empty_params_result result[0].unshift(val[0]) result end .,., # reduce 194 omitted module_eval(<<'.,.,', 'parser.y', 849) def _reduce_195(val, _values, result) result = val[2] result[1].unshift(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 853) def _reduce_196(val, _values, result) result = empty_params_result result[1].unshift(val[0]) result end .,., # reduce 197 omitted module_eval(<<'.,.,', 'parser.y', 860) def _reduce_198(val, _values, result) result = val[2] result[2] = val[0] result end .,., module_eval(<<'.,.,', 'parser.y', 864) def _reduce_199(val, _values, result) result = empty_params_result result[2] = val[0] result end .,., # reduce 200 omitted module_eval(<<'.,.,', 'parser.y', 871) def _reduce_201(val, _values, result) result = val[2] result[3].unshift(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 875) def _reduce_202(val, _values, result) result = empty_params_result result[3].unshift(val[0]) result end .,., # reduce 203 omitted module_eval(<<'.,.,', 'parser.y', 882) def _reduce_204(val, _values, result) result = empty_params_result result end .,., module_eval(<<'.,.,', 'parser.y', 885) def _reduce_205(val, _values, result) result = val[2] result[4].merge!(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 889) def _reduce_206(val, _values, result) result = empty_params_result result[4].merge!(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 893) def _reduce_207(val, _values, result) result = val[2] result[5].merge!(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 897) def _reduce_208(val, _values, result) result = empty_params_result result[5].merge!(val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 901) def _reduce_209(val, _values, result) result = empty_params_result result[6] = val[0] result end .,., module_eval(<<'.,.,', 'parser.y', 907) def _reduce_210(val, _values, result) result = Types::Function::Param.new(type: val[0], name: val[1]&.value&.to_sym) result end .,., module_eval(<<'.,.,', 'parser.y', 913) def _reduce_211(val, _values, result) result = Types::Function::Param.new(type: val[1], name: val[2]&.value&.to_sym) result end .,., module_eval(<<'.,.,', 'parser.y', 919) def _reduce_212(val, _values, result) result = Types::Function::Param.new(type: val[1], name: val[2]&.value&.to_sym) result end .,., module_eval(<<'.,.,', 'parser.y', 925) def _reduce_213(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', 932) def _reduce_214(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', 939) def _reduce_215(val, _values, result) result = Types::Function::Param.new(type: val[1], name: val[2]&.value&.to_sym) result end .,., # reduce 216 omitted # reduce 217 omitted # reduce 218 omitted # reduce 219 omitted module_eval(<<'.,.,', 'parser.y', 948) def _reduce_220(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 221 omitted # reduce 222 omitted # reduce 223 omitted module_eval(<<'.,.,', 'parser.y', 960) def _reduce_224(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', 969) def _reduce_225(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', 978) def _reduce_226(val, _values, result) result = nil result end .,., module_eval(<<'.,.,', 'parser.y', 981) def _reduce_227(val, _values, result) result = LocatedValue.new(value: Namespace.root, location: val[0].location) result end .,., module_eval(<<'.,.,', 'parser.y', 984) def _reduce_228(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', 988) def _reduce_229(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