query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
REF_A = 10pF REF_B = 56pF
def readReferences @refA = readRawChannelLevel(REF_A) @refB = readRawChannelLevel(REF_B) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ref_xy(); @ref_xy; end", "def full_ref # rubocop:disable Metrics/AbcSize\n @full_ref ||= begin\n ref = \"#{refparts[:perfix]}#{refparts[:series]} #{refparts[:code]}\"\n ref += \"pt#{refparts[:prt]}\" if refparts[:prt] # long_to_short(refparts, \"prt\").to_s\n ref += \"ver#{refparts[:ver]}\" if refparts[:ver] # long_to_short(refparts, \"vol\").to_s\n ref += \"v#{refparts[:vol]}\" if refparts[:vol]\n ref\n end\n end", "def references; end", "def references; end", "def is_aref?(); @type == GRT_AREF; end", "def ref; end", "def format_ref(ref, type)\n len = ref.length\n case type\n when \"soybase\"\n if len < 4\n chr = ref.slice(2, len)\n return \"gm0#{chr}\"\n end\n when \"jcvi\"\n if len < 5\n chr = ref.slice(3, len)\n return \"chr0#{chr}\"\n end\n when \"medicago\"\n if ref =~ /chr[0-9]/\n return \"Mt#{ref.slice(/[0-9]/)}\"\n else\n return ref\n end\n when \"hapmap\"\n return ref.gsub(/0/, '')\n when \"cajca\"\n if ref =~ /CcLG[0-9]+/\n return \"Cc#{ref.slice(/[0-9]+/)}\"\n else\n return ref\n end\n end\n ref\n end", "def test_plygpx\n #25001 - different REF points\n k = KAPHeader.new\n k.bsb_ra = [7360, 5699]\n r = REF.new\n r.x = 1379\n r.y = 1058\n r.latitude = 18.000000000000\n r.longitude = -70.000000000000\n k.ref << r\n r = REF.new\n r.x = 2244\n r.y = 2676\n r.latitude = 14.999980000000\n r.longitude = -68.336641666667\n k.ref << r\n r = REF.new\n r.x = 4844\n r.y = 1056\n r.latitude = 18.003328333333\n r.longitude = -63.331441666667\n k.ref << r\n r = REF.new\n r.x = 4844\n r.y = 2672\n r.latitude = 15.007310000000\n r.longitude = -63.331690000000\n k.ref << r\n k.compute_dxdy\n puts k.inspect\n k.ply_to_gpx('/tmp/test.gpx')\nend", "def to_ref(value)\n result = nil\n if uom_type == 'ref'\n result = value\n elsif uom_type == 'big'\n result = value * ratio\n elsif uom_type == 'small'\n result = value/ratio\n end\n result.to_f\n end", "def two_pt_a\n fga - three_p_a\n end", "def resolve_if_ref(if_ref)\n result = nil\n\n speeds = [\"10m\", \"100m\", \"1g\", \"10g\", \"20g\", \"40g\", \"56g\"]\n m = /^([-+?]?)(\\d{1,3}[mg])(\\d+)$/.match(if_ref) # [1]=sign, [2]=speed, [3]=count\n\n return result if m.nil?\n\n requested_speed_index = speeds.index(m[2])\n\n unless requested_speed_index.nil?\n sign = m[1]\n if_bus_index = m[3]\n\n resolve_with_speed_index = lambda do |x|\n result = if_speed_remap[\"#{speeds[x]}#{if_bus_index}\"] unless result\n end\n\n case sign\n when \"+\"\n (requested_speed_index..speeds.length - 1).each(&resolve_with_speed_index)\n when \"-\"\n requested_speed_index.downto(0, &resolve_with_speed_index)\n when \"?\"\n (requested_speed_index..speeds.length - 1).each(&resolve_with_speed_index)\n requested_speed_index.downto(0, &resolve_with_speed_index) unless result\n else\n result = if_speed_remap[if_ref]\n end\n end\n result\n end", "def two_pt\n fg - three_p\n end", "def adc_a_b\n end", "def unify_references(ref1, ref2, ctx)\n return ctx.succeeded! if ref1.name == ref2.name\n\n if ref1.unbound?(ctx) || ref2.unbound?(ctx)\n ctx.fuse([ref1.name, ref2.name])\n ctx.succeeded!\n elsif ref1.floating?(ctx) && ref2.floating?(ctx)\n raise StandarrError if ctx.associations_for(ref1.name).size > 1\n val1 = ctx.associations_for(ref1.name)[0].value\n raise StandarrError if ctx.associations_for(ref2.name).size > 1 \n val2 = ctx.associations_for(ref2.name)[0].value\n unification(val1, val2, ctx)\n ctx.fuse([ref1.name, ref2.name]) if ctx.success?\n else\n raise NotImplementedError\n end\n # if both refs are fresh, fuse them\n # if one ref is fresh & the other one isn't then bind fresh one (occurs check)\n # More cases...\n\n ctx\n end", "def approxmatching(a,b)\n\treturn (a==b)\nend", "def resolveXCH\r\n puts \"Before Swap, Register A: \" + @RegA.to_s + \"\\tRegister B: \" + @RegB.to_s\r\n temp = @RegA\r\n @RegA = @RegB\r\n @RegB = temp\r\n puts \"After Swap, Register A: \" + @RegA.to_s + \"\\tRegister B: \" + @RegB.to_s\r\n end", "def resolve_reference; end", "def GF_product_p(a, b)\n (a.polynomial * b.polynomial).to_byte\nend", "def refs_at; end", "def link(p1, p2)\n return [1, 0, p1.first] if p1.first == p2.first\n k = (p2.last - p1.last) * 1.0 / (p2.first - p1.first)\n [-k, 1, p1.last - k * p1.first]\nend", "def ref\n Coord.rel( self )\n end", "def implicit_reference(b)\n false\n end", "def reactive_pair?(a, b)\n (a.ord - b.ord).abs == MATCH_DIFF\n end", "def test_getxy\n k = KAPHeader.new\n k.bsb_ra = [40, 40]\n r = REF.new\n r.x = 10\n r.y = 30\n r.latitude = -10\n r.longitude = 170\n k.ref << r\n r = REF.new\n r.x = 10\n r.y = 10\n r.latitude = 10\n r.longitude = 170\n k.ref << r\n r = REF.new\n r.x = 30\n r.y = 10\n r.latitude = 10\n r.longitude = -170\n k.ref << r\n r = REF.new\n r.x = 30\n r.y = 30\n r.latitude = -10\n r.longitude = -170\n k.ref << r\n k.compute_dxdy\n puts k.inspect\n puts k.x_at (179.9)\n puts k.y_at (0)\n puts k.x_at (-179.99999)\n puts k.y_at (0)\n \n k = KAPHeader.new\n k.bsb_ra = [40000, 40000]\n r = REF.new\n r.x = 10000\n r.y = 30000\n r.latitude = 0.0\n r.longitude = 0.0\n k.ref << r\n r = REF.new\n r.x = 10000\n r.y = 10000\n r.latitude = 20.0\n r.longitude = 0.0\n k.ref << r\n r = REF.new\n r.x = 30000\n r.y = 10000\n r.latitude = 20.0\n r.longitude = 20.0\n k.ref << r\n r = REF.new\n r.x = 30000\n r.y = 30000\n r.latitude = 0.0\n r.longitude = 20.0\n k.ref << r\n k.compute_dxdy\n puts k.inspect\n puts k.x_at (0)\n puts k.y_at (0)\n puts k.x_at (10)\n puts k.y_at (-10)\n\n #25001\n k = KAPHeader.new\n k.bsb_ra = [7360, 5699]\n r = REF.new\n r.x = 168\n r.y = 640\n r.latitude = 18.766666666667\n r.longitude = -72.333333333333\n k.ref << r\n r = REF.new\n r.x = 171\n r.y = 5325\n r.latitude = 10.000000000000\n r.longitude = -72.333333333333\n k.ref << r\n r = REF.new\n r.x = 7094\n r.y = 5325\n r.latitude = 10.000000000000\n r.longitude = -59.000000000000\n k.ref << r\n r = REF.new\n r.x = 7094\n r.y = 640\n r.latitude = 18.766666666667\n r.longitude = -59.000000000000\n k.ref << r\n k.compute_dxdy\n puts k.inspect\n Util.print_lon k.lon_at (1379)\n Util.print_lat k.lat_at (1057)\n \n #25001 - different REF points\n k = KAPHeader.new\n k.bsb_ra = [7360, 5699]\n r = REF.new\n r.x = 1379\n r.y = 1058\n r.latitude = 18.000000000000\n r.longitude = -70.000000000000\n k.ref << r\n r = REF.new\n r.x = 2244\n r.y = 2676\n r.latitude = 14.999980000000\n r.longitude = -68.336641666667\n k.ref << r\n r = REF.new\n r.x = 4844\n r.y = 1056\n r.latitude = 18.003328333333\n r.longitude = -63.331441666667\n k.ref << r\n r = REF.new\n r.x = 4844\n r.y = 2672\n r.latitude = 15.007310000000\n r.longitude = -63.331690000000\n k.ref << r\n k.compute_dxdy\n puts k.inspect\n Util.print_lon k.lon_at (168)\n Util.print_lat k.lat_at (641)\n \n #43342 - TMERC\n k = KAPHeader.new\n k.projection = TransverseMercator.new\n k.bsb_ra = [6640, 5760]\n r = REF.new\n r.x = 6238\n r.y = 618\n r.latitude = 59.094445000000\n r.longitude = 5.916666666667\n k.ref << r\n r = REF.new\n r.x = 311\n r.y = 5384\n r.latitude = 58.924666666667\n r.longitude = 5.507500000000\n k.ref << r\n k.compute_dxdy\n puts k.inspect\n \n Util.print_lon (k.lon_at(3272, 2620))\n Util.print_lat (k.lat_at(3272, 2620))\n puts k.x_at(59.0, 5.66666666666666)\n puts k.y_at(59.0, 5.66666666666666)\nend", "def sqref(io)\n cref = io.read(2).unpack('v').first\n\n {\n cref: cref, # cref (2 bytes): An unsigned integer that specifies the number of elements in rgrefs. MUST be less than or equal to 0x2000.\n rgrefs: cref.times.map { ref8u(io.read(8)) } # rgrefs (variable): An array of Ref8 structures. The number of elements in the array MUST be equal to cref.\n }\n end", "def refseq_sequence\n \"NC_0000\" + chrom.sub(/X/, \"23\").sub(/Y/, \"24\")\n end", "def _ReferenceLink\n\n _save = self.pos\n while true # choice\n _tmp = apply(:_ReferenceLinkDouble)\n break if _tmp\n self.pos = _save\n _tmp = apply(:_ReferenceLinkSingle)\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_ReferenceLink unless _tmp\n return _tmp\n end", "def test_F_2\n\t\[email protected] 2, 1, 3, 'A'\n\t\[email protected] 1, 3, 2, 'A'\n\t\[email protected] 2, 2, 'F'\n\t\tcoordinates = @bitmap.instance_variable_get(:@coordinates)\n\t\tassert_equal coordinates[0][0], 'O'\n\t\tassert_equal coordinates[0][1], 'F'\n\t\tassert_equal coordinates[0][2], 'O'\n\t\tassert_equal coordinates[1][0], 'F'\n\t\tassert_equal coordinates[1][1], 'F'\n\t\tassert_equal coordinates[1][2], 'F'\n\t\tassert_equal coordinates[2][0], 'O'\n\t\tassert_equal coordinates[2][1], 'F'\n\t\tassert_equal coordinates[2][2], 'O'\n\tend", "def parts_of_reference (docset, ref_str)\n\tref = ref_str.split\n\tif ref.length != 2\n\t\tTextMate.exit_show_tool_tip \"Cannot parse reference: #{str}\"\n\tend\n\n\tlanguage, type, klass, thing = ref[0].split('/')\n\tRef.new(docset, language, type, klass, thing, ref[1])\nend", "def test_getlatlon\n k = KAPHeader.new\n k.bsb_ra = [40, 40]\n r = REF.new\n r.x = 10\n r.y = 30\n r.latitude = -10\n r.longitude = 170\n k.ref << r\n r = REF.new\n r.x = 10\n r.y = 10\n r.latitude = 10\n r.longitude = 170\n k.ref << r\n r = REF.new\n r.x = 30\n r.y = 10\n r.latitude = 10\n r.longitude = -170\n k.ref << r\n r = REF.new\n r.x = 30\n r.y = 30\n r.latitude = -10\n r.longitude = -170\n k.ref << r\n puts k.inspect\n puts k.lat_at_y (11)\n puts k.lon_at_x (11)\n puts k.lat_at_y (21)\n puts k.lon_at_x (21)\n \n k = KAPHeader.new\n k.bsb_ra = [40, 40]\n r = REF.new\n r.x = 10\n r.y = 30\n r.latitude = -10\n r.longitude = -10\n k.ref << r\n r = REF.new\n r.x = 10\n r.y = 10\n r.latitude = 10\n r.longitude = -10\n k.ref << r\n r = REF.new\n r.x = 30\n r.y = 10\n r.latitude = 10\n r.longitude = 10\n k.ref << r\n r = REF.new\n r.x = 30\n r.y = 30\n r.latitude = -10\n r.longitude = 10\n k.ref << r\n puts k.inspect\n puts k.lat_at_y (11)\n puts k.lon_at_x (11)\n puts k.lat_at_y (21)\n puts k.lon_at_x (21)\nend", "def orchestrate_ref_value\n __ref_value__\n end", "def orchestrate_ref_value\n __ref_value__\n end", "def b\n @b ||= self.p2.x - self.p1.x\n end", "def macro\n :references_one\n end", "def determinant(ref, a, b)\n (a.y - ref.y) * (b.x - a.x) - (b.y - a.y) * (a.x - ref.x) <=> 0\n end", "def defp &p\r\n $p = p\r\n g2 &p # this is ok\r\nend", "def ref_params\n params.fetch(:ref, {})\n end", "def reference\n @refs ||= strip(:reference)\n end", "def &(p0) end", "def &(p0) end", "def absorption_references\n @references.inject([]) do |array, ref|\n array << ref\n # puts \"Column #{name} spans #{ref}, #{ref.is_absorbing ? \"\" : \"not \"} absorbing (#{ref.to.name} absorbs via #{ref.to.absorbed_via.inspect})\"\n break array unless ref.is_absorbing\n array\n end\n end", "def getbroff(pc, op)\n # o is sign extended to 18 bits\n\n o = field_o(op) << 2\n m = 1 << (18 - 1)\n r = (o ^ m) - m;\n\n (pc + 4) + r\nend", "def replace_symbols_with_refs\n symbol_defs = symbols_first_pass\n symbols_second_pass symbol_defs\n end", "def verify_ref_1l_condition\n Unified835Output::BenignNull.new\n end", "def macro\n :references_one\n end", "def chain_link_percent\n product = 1.0\n self.map(&:link_percent).each do |i|\n product = product*i\n end\n product\n end", "def test_decode_reference()\n input = [\n 131, 101, 100, 0, 9, 105, 108, 105, 97, 95, 97, 116, 111, 109, 1,\n 1, 1, 1, 42]\n expected = Erlang::Reference.new(\n Erlang::Atom.new('ilia_atom'), 16843009, 42)\n\n stream = Erlang::StreamEmulator.new(input)\n actual = Erlang::decode(stream)\n\n assert_equal(expected, actual)\n end", "def test_F_3\n\t\[email protected] 2, 2, 'A'\n\t\[email protected] 2, 1, 'A'\n\t\[email protected] 1, 2, 'A'\n\t\[email protected] 2, 2, 'F'\n\t\tcoordinates = @bitmap.instance_variable_get(:@coordinates)\n\t\tassert_equal coordinates[0][0], 'O'\n\t\tassert_equal coordinates[0][1], 'F'\n\t\tassert_equal coordinates[0][2], 'O'\n\t\tassert_equal coordinates[1][0], 'F'\n\t\tassert_equal coordinates[1][1], 'F'\n\t\tassert_equal coordinates[1][2], 'O'\n\t\tassert_equal coordinates[2][0], 'O'\n\t\tassert_equal coordinates[2][1], 'O'\n\t\tassert_equal coordinates[2][2], 'O'\n\tend", "def cross_reference(aspect1, name1, aspect2, name2)\n self.search_by(aspect1, name1) & self.search_by(aspect2, name2)\n end", "def second_reference_id\n nil\n end", "def == other\n @ref == other.instance_variable_get(:@ref)\n end", "def == other\n @ref == other.instance_variable_get(:@ref)\n end", "def == other\n @ref == other.instance_variable_get(:@ref)\n end", "def link(ref)\n if ref.kind_of? Range\n \"@see - \" + \"https://github.com/dbgrandi/danger-prose/blob/v2.0.0/lib/danger_plugin.rb#L#{ref.min}#-L#{ref.max}\".blue\n elsif ref.kind_of? Fixnum\n \"@see - \" + \"https://github.com/dbgrandi/danger-prose/blob/v2.0.0/lib/danger_plugin.rb#L#{ref}\".blue\n else\n \"@see - \" + \"https://github.com/dbgrandi/danger-prose/blob/v2.0.0/lib/danger_plugin.rb\".blue\n end\n end", "def fr_to_br\n a = 0\n x = 0\n edge4 = [nil] * 4\n\n BR.downto(UR).each do |j|\n ep = edge_permutation[j]\n if FR <= ep && ep <= BR # use range? faster?\n a += n_choose_k(11 - j, x + 1)\n edge4[3 - x] = edge_permutation[j] # CORNER_SIZE?\n x += 1\n end\n end\n\n b = 0\n 3.downto(1).each do |j| # range? CORNER_SIZE?\n k = 0\n while edge4[j] != (j + 8) # ????\n edge4 = rotateLeft(edge4, 0, j) # BLAAAAA\n k += 1\n end\n b = (j + 1) * b + k\n end\n\n (24 * a + b) & 0xffff # where does 24 come from?\n end", "def field_bc2(op)\n (op & 0x0000ffc0) >> 6\nend", "def diff(a_in, b_in)\r\n result = a_in.diff(b_in)\r\n \r\n p [a_in, b_in]\r\n \r\n # create an array of pairs of matches: [ [a,b], [a,b], ... ]\r\n sames = result[:matched_old].zip(result[:matched_new]).sort_by{|a,b| p [a,b] ; a.first }\r\n \r\n # create a null range as an endpoint\r\n sames = [ [-1...0, -1...0] ] + sames\r\n \r\n last_a, last_b = sames.last\r\n add_to_a = last_a.last < (a_in.size) ? (a_in.size...a_in.size) : nil\r\n add_to_b = last_b.last < (b_in.size) ? (b_in.size...b_in.size) : nil\r\n \r\n if add_to_a or add_to_b\r\n sames << [add_to_a, add_to_b]\r\n end\r\n \r\n a_stream = []\r\n b_stream = []\r\n \r\n puts \"sames: #{sames.inspect}\"\r\n \r\n sames.each_cons(2) do |pair_1, pair_2|\r\n a1, b1 = pair_1\r\n a2, b2 = pair_2\r\n \r\n a_gap = gap(a1, a2)\r\n b_gap = gap(b1, b2)\r\n\r\n p [:pair_1, pair_1]\r\n p [:pair_2, pair_2]\r\n p [:a_gap, a_gap]\r\n p [:b_gap, b_gap]\r\n \r\n if a_gap and !b_gap\r\n # deletion from A\r\n a_stream << [a_gap, :deleted]\r\n elsif b_gap and !a_gap\r\n # addition to B\r\n b_stream << [b_gap, :added]\r\n elsif a_gap and b_gap\r\n # change from A to B\r\n a_stream << [a_gap, :changed]\r\n b_stream << [b_gap, :changed]\r\n else\r\n # no gap!\r\n p [:no_gap]\r\n end\r\n \r\n a_stream << [a2, :same] if a_gap and a_in[a2] != \"\"\r\n b_stream << [b2, :same] if b_gap and b_in[b2] != \"\"\r\n end\r\n \r\n [a_stream, b_stream] \r\nend", "def xref() @x end", "def common_face(edge2)\n end", "def common_face(edge2)\n end", "def GF_product_t_i(a, b)\n t = GF_tables()\n t[:exponential][(t[:logarithmic][a] + t[:logarithmic][b]) % 255]\nend", "def field_bc1(op)\n (op & 0x03ff0000) >> 16\nend", "def ref_seq\n\n if _ref_seq\n _ref_seq\n else\n seq = Reference.ref_seq(chromosome, start, stop, strand)\n update_attributes(:_ref_seq => seq)\n seq\n end\n\n end", "def resolved_ref\n \"resolved-#{ref}\"\n end", "def __drbref\n @ref\n end", "def crossref_query\n CrossrefQuery.generate_query_from_text( ref_apa_6 )\n end", "def tr(p0, p1) end", "def is_sref?(); @type == GRT_SREF; end", "def compose_ems_ref(*keys)\n keys.join('_')\n end", "def test_decode_new_reference()\n input = [\n 131, 114, 0, 3, 100, 0, 13, 110, 111, 110, 111, 100, 101, 64, 110,\n 111, 104, 111, 115, 116, 0, 0, 0, 0, 94, 0, 0, 0, 0, 0, 0, 0, 0]\n expected = Erlang::NewReference.new(\n Erlang::Atom.new('nonode@nohost'), 0, [0, 0, 94])\n\n stream = Erlang::StreamEmulator.new(input)\n actual = Erlang::decode(stream)\n\n assert_equal(expected, actual)\n end", "def lookup_ref (workitem, prefix='')\n\n ref = lookup_vf_attribute(workitem, 'ref', :prefix => prefix)\n ref ? ref.to_s : nil\n end", "def we pts1, pts2\n (1 / ( 10 ** ( - (pts1 - pts2) / 400.0) + 1)).round(3)\n end", "def grid_ref(digits = 8)\n return @grid_ref if @grid_ref\n #get the 100km-grid indices\n e100k = (easting / 100000).floor\n n100k = (northing / 100000).floor\n\n return '' if (e100k < 0 or e100k > 6 or n100k < 0 or n100k > 12)\n\n #translate those into numeric equivalents of the grid letters\n first_letter = (19 - n100k) - (19 - n100k) % 5 + ((e100k + 10) / 5).floor;\n second_letter = (19 - n100k) * 5 % 25 + e100k % 5;\n\n # letter - 1 to ensure we have 0-indexed the array and aren't off-by-one\n grid_name = GRID_LETTERS[first_letter - 1] + GRID_LETTERS[second_letter - 1]\n\n # strip 100km-grid indices from easting & northing, and reduce precision\n reduced_precision_easting = ( (easting % 100000) / (10 ** (5 - digits / 2)) ).floor\n reduced_precision_northing = ( (northing % 100000) / (10 ** (5 - digits / 2)) ).floor\n\n @grid_ref = grid_name + reduced_precision_easting.to_s.rjust(digits / 2) + reduced_precision_northing.to_s.rjust(digits / 2)\n end", "def reference\n value_for('reference')\n end", "def rela\n addr :off #Location to be relocated.\n xword :info #Relocation type and symbol index.\n sxword :addend #Addend.\n rel_common\n end", "def calculate_road p0, p1\n # unit vector pointing from p0 to p1\n n = (p1 - p0).normalize.normal_vector * ROAD_WIDTH\n \n a = p0 + n\n b = p0 - n\n c = p1 + n\n d = p1 - n\n [a, b, c, d]\n end", "def eq_for_coordinates(p, s, t)\n q, r = first_point, second_point\n s, t = s.to_s+\"_to\", t.to_s + \"_to\"\n p.send(t,q)+r.send(s,q)+\"-\"+p.send(s,q)+r.send(t,q)\n end", "def ref(logical_id)\n {\"Ref\" => xref(logical_id)}\n end", "def adc_a_d8\n end", "def cfn_ref(s)\n\t\t\treturn cfn_raw({ \"Ref\" => s })\n\t\tend", "def surrounding_hexes\n # puts self.inspect, self.q.inspect, self.r.inspect\n DIRECTIONS.map{ |e| AxialHex.new( @q+e[0], @r+e[1] ) }\n end", "def surrounding_hexes\n # puts self.inspect, self.q.inspect, self.r.inspect\n DIRECTIONS.map{ |e| AxialHex.new( @q+e[0], @r+e[1] ) }\n end", "def reference(absolute = true)\n absolute ? r_abs : r\n end", "def latbc(phi)\n=begin\n # not so good\n pi2 = Math::PI/2\n eps = 0.1\n xs = phi[0..1].val \n xe = phi[-2..-1].val\n if (pi2-xs[0].abs) / (xs[0]-xs[1]).abs < eps and\n (pi2-xe[-1].abs) / (xe[-1]-xe[-2]).abs < eps \n GPhys::Derivative::MIRROR_B\n else\n GPhys::Derivative::LINEAR_EXT\n end\n=end\n GPhys::Derivative::LINEAR_EXT\n end", "def frtrefheader(io)\n result = frtheader(io.read(4)) # rt, grbitFrt\n result[:ref8] = ref8u(io.read(8)) # ref8 (8 bytes): A Ref8U that references the range of cells associated with the containing record.\n result\n end", "def aref\n type = singleton ? 'c' : 'i'\n # % characters are not allowed in html names => dash instead\n \"#{aref_prefix}-#{type}-#{html_name}\"\n end", "def map_range(a, b, s)\n af, al, bf, bl = a.first, a.last, b.first, b.last\n bf + (s - af)*(bl - bf).quo(al - af)\n end", "def NL43_locator(seq=\"\",temp_dir=File.dirname($0))\n hxb2_ref = \"TGGAAGGGCTAATTTGGTCCCAAAAAAGACAAGAGATCCTTGATCTGTGGATCTACCACACACAAGGCTACTTCCCTGATTGGCAGAACTACACACCAGGGCCAGGGATCAGATATCCACTGACCTTTGGATGGTGCTTCAAGTTAGTACCAGTTGAACCAGAGCAAGTAGAAGAGGCCAAATAAGGAGAGAAGAACAGCTTGTTACACCCTATGAGCCAGCATGGGATGGAGGACCCGGAGGGAGAAGTATTAGTGTGGAAGTTTGACAGCCTCCTAGCATTTCGTCACATGGCCCGAGAGCTGCATCCGGAGTACTACAAAGACTGCTGACATCGAGCTTTCTACAAGGGACTTTCCGCTGGGGACTTTCCAGGGAGGTGTGGCCTGGGCGGGACTGGGGAGTGGCGAGCCCTCAGATGCTACATATAAGCAGCTGCTTTTTGCCTGTACTGGGTCTCTCTGGTTAGACCAGATCTGAGCCTGGGAGCTCTCTGGCTAACTAGGGAACCCACTGCTTAAGCCTCAATAAAGCTTGCCTTGAGTGCTCAAAGTAGTGTGTGCCCGTCTGTTGTGTGACTCTGGTAACTAGAGATCCCTCAGACCCTTTTAGTCAGTGTGGAAAATCTCTAGCAGTGGCGCCCGAACAGGGACTTGAAAGCGAAAGTAAAGCCAGAGGAGATCTCTCGACGCAGGACTCGGCTTGCTGAAGCGCGCACGGCAAGAGGCGAGGGGCGGCGACTGGTGAGTACGCCAAAAATTTTGACTAGCGGAGGCTAGAAGGAGAGAGATGGGTGCGAGAGCGTCGGTATTAAGCGGGGGAGAATTAGATAAATGGGAAAAAATTCGGTTAAGGCCAGGGGGAAAGAAACAATATAAACTAAAACATATAGTATGGGCAAGCAGGGAGCTAGAACGATTCGCAGTTAATCCTGGCCTTTTAGAGACATCAGAAGGCTGTAGACAAATACTGGGACAGCTACAACCATCCCTTCAGACAGGATCAGAAGAACTTAGATCATTATATAATACAATAGCAGTCCTCTATTGTGTGCATCAAAGGATAGATGTAAAAGACACCAAGGAAGCCTTAGATAAGATAGAGGAAGAGCAAAACAAAAGTAAGAAAAAGGCACAGCAAGCAGCAGCTGACACAGGAAACAACAGCCAGGTCAGCCAAAATTACCCTATAGTGCAGAACCTCCAGGGGCAAATGGTACATCAGGCCATATCACCTAGAACTTTAAATGCATGGGTAAAAGTAGTAGAAGAGAAGGCTTTCAGCCCAGAAGTAATACCCATGTTTTCAGCATTATCAGAAGGAGCCACCCCACAAGATTTAAATACCATGCTAAACACAGTGGGGGGACATCAAGCAGCCATGCAAATGTTAAAAGAGACCATCAATGAGGAAGCTGCAGAATGGGATAGATTGCATCCAGTGCATGCAGGGCCTATTGCACCAGGCCAGATGAGAGAACCAAGGGGAAGTGACATAGCAGGAACTACTAGTACCCTTCAGGAACAAATAGGATGGATGACACATAATCCACCTATCCCAGTAGGAGAAATCTATAAAAGATGGATAATCCTGGGATTAAATAAAATAGTAAGAATGTATAGCCCTACCAGCATTCTGGACATAAGACAAGGACCAAAGGAACCCTTTAGAGACTATGTAGACCGATTCTATAAAACTCTAAGAGCCGAGCAAGCTTCACAAGAGGTAAAAAATTGGATGACAGAAACCTTGTTGGTCCAAAATGCGAACCCAGATTGTAAGACTATTTTAAAAGCATTGGGACCAGGAGCGACACTAGAAGAAATGATGACAGCATGTCAGGGAGTGGGGGGACCCGGCCATAAAGCAAGAGTTTTGGCTGAAGCAATGAGCCAAGTAACAAATCCAGCTACCATAATGATACAGAAAGGCAATTTTAGGAACCAAAGAAAGACTGTTAAGTGTTTCAATTGTGGCAAAGAAGGGCACATAGCCAAAAATTGCAGGGCCCCTAGGAAAAAGGGCTGTTGGAAATGTGGAAAGGAAGGACACCAAATGAAAGATTGTACTGAGAGACAGGCTAATTTTTTAGGGAAGATCTGGCCTTCCCACAAGGGAAGGCCAGGGAATTTTCTTCAGAGCAGACCAGAGCCAACAGCCCCACCAGAAGAGAGCTTCAGGTTTGGGGAAGAGACAACAACTCCCTCTCAGAAGCAGGAGCCGATAGACAAGGAACTGTATCCTTTAGCTTCCCTCAGATCACTCTTTGGCAGCGACCCCTCGTCACAATAAAGATAGGGGGGCAATTAAAGGAAGCTCTATTAGATACAGGAGCAGATGATACAGTATTAGAAGAAATGAATTTGCCAGGAAGATGGAAACCAAAAATGATAGGGGGAATTGGAGGTTTTATCAAAGTAAGACAGTATGATCAGATACTCATAGAAATCTGCGGACATAAAGCTATAGGTACAGTATTAGTAGGACCTACACCTGTCAACATAATTGGAAGAAATCTGTTGACTCAGATTGGCTGCACTTTAAATTTTCCCATTAGTCCTATTGAGACTGTACCAGTAAAATTAAAGCCAGGAATGGATGGCCCAAAAGTTAAACAATGGCCATTGACAGAAGAAAAAATAAAAGCATTAGTAGAAATTTGTACAGAAATGGAAAAGGAAGGAAAAATTTCAAAAATTGGGCCTGAAAATCCATACAATACTCCAGTATTTGCCATAAAGAAAAAAGACAGTACTAAATGGAGAAAATTAGTAGATTTCAGAGAACTTAATAAGAGAACTCAAGATTTCTGGGAAGTTCAATTAGGAATACCACATCCTGCAGGGTTAAAACAGAAAAAATCAGTAACAGTACTGGATGTGGGCGATGCATATTTTTCAGTTCCCTTAGATAAAGACTTCAGGAAGTATACTGCATTTACCATACCTAGTATAAACAATGAGACACCAGGGATTAGATATCAGTACAATGTGCTTCCACAGGGATGGAAAGGATCACCAGCAATATTCCAGTGTAGCATGACAAAAATCTTAGAGCCTTTTAGAAAACAAAATCCAGACATAGTCATCTATCAATACATGGATGATTTGTATGTAGGATCTGACTTAGAAATAGGGCAGCATAGAACAAAAATAGAGGAACTGAGACAACATCTGTTGAGGTGGGGATTTACCACACCAGACAAAAAACATCAGAAAGAACCTCCATTCCTTTGGATGGGTTATGAACTCCATCCTGATAAATGGACAGTACAGCCTATAGTGCTGCCAGAAAAGGACAGCTGGACTGTCAATGACATACAGAAATTAGTGGGAAAATTGAATTGGGCAAGTCAGATTTATGCAGGGATTAAAGTAAGGCAATTATGTAAACTTCTTAGGGGAACCAAAGCACTAACAGAAGTAGTACCACTAACAGAAGAAGCAGAGCTAGAACTGGCAGAAAACAGGGAGATTCTAAAAGAACCGGTACATGGAGTGTATTATGACCCATCAAAAGACTTAATAGCAGAAATACAGAAGCAGGGGCAAGGCCAATGGACATATCAAATTTATCAAGAGCCATTTAAAAATCTGAAAACAGGAAAATATGCAAGAATGAAGGGTGCCCACACTAATGATGTGAAACAATTAACAGAGGCAGTACAAAAAATAGCCACAGAAAGCATAGTAATATGGGGAAAGACTCCTAAATTTAAATTACCCATACAAAAGGAAACATGGGAAGCATGGTGGACAGAGTATTGGCAAGCCACCTGGATTCCTGAGTGGGAGTTTGTCAATACCCCTCCCTTAGTGAAGTTATGGTACCAGTTAGAGAAAGAACCCATAATAGGAGCAGAAACTTTCTATGTAGATGGGGCAGCCAATAGGGAAACTAAATTAGGAAAAGCAGGATATGTAACTGACAGAGGAAGACAAAAAGTTGTCCCCCTAACGGACACAACAAATCAGAAGACTGAGTTACAAGCAATTCATCTAGCTTTGCAGGATTCGGGATTAGAAGTAAACATAGTGACAGACTCACAATATGCATTGGGAATCATTCAAGCACAACCAGATAAGAGTGAATCAGAGTTAGTCAGTCAAATAATAGAGCAGTTAATAAAAAAGGAAAAAGTCTACCTGGCATGGGTACCAGCACACAAAGGAATTGGAGGAAATGAACAAGTAGATGGGTTGGTCAGTGCTGGAATCAGGAAAGTACTATTTTTAGATGGAATAGATAAGGCCCAAGAAGAACATGAGAAATATCACAGTAATTGGAGAGCAATGGCTAGTGATTTTAACCTACCACCTGTAGTAGCAAAAGAAATAGTAGCCAGCTGTGATAAATGTCAGCTAAAAGGGGAAGCCATGCATGGACAAGTAGACTGTAGCCCAGGAATATGGCAGCTAGATTGTACACATTTAGAAGGAAAAGTTATCTTGGTAGCAGTTCATGTAGCCAGTGGATATATAGAAGCAGAAGTAATTCCAGCAGAGACAGGGCAAGAAACAGCATACTTCCTCTTAAAATTAGCAGGAAGATGGCCAGTAAAAACAGTACATACAGACAATGGCAGCAATTTCACCAGTACTACAGTTAAGGCCGCCTGTTGGTGGGCGGGGATCAAGCAGGAATTTGGCATTCCCTACAATCCCCAAAGTCAAGGAGTAATAGAATCTATGAATAAAGAATTAAAGAAAATTATAGGACAGGTAAGAGATCAGGCTGAACATCTTAAGACAGCAGTACAAATGGCAGTATTCATCCACAATTTTAAAAGAAAAGGGGGGATTGGGGGGTACAGTGCAGGGGAAAGAATAGTAGACATAATAGCAACAGACATACAAACTAAAGAATTACAAAAACAAATTACAAAAATTCAAAATTTTCGGGTTTATTACAGGGACAGCAGAGATCCAGTTTGGAAAGGACCAGCAAAGCTCCTCTGGAAAGGTGAAGGGGCAGTAGTAATACAAGATAATAGTGACATAAAAGTAGTGCCAAGAAGAAAAGCAAAGATCATCAGGGATTATGGAAAACAGATGGCAGGTGATGATTGTGTGGCAAGTAGACAGGATGAGGATTAACACATGGAAAAGATTAGTAAAACACCATATGTATATTTCAAGGAAAGCTAAGGACTGGTTTTATAGACATCACTATGAAAGTACTAATCCAAAAATAAGTTCAGAAGTACACATCCCACTAGGGGATGCTAAATTAGTAATAACAACATATTGGGGTCTGCATACAGGAGAAAGAGACTGGCATTTGGGTCAGGGAGTCTCCATAGAATGGAGGAAAAAGAGATATAGCACACAAGTAGACCCTGACCTAGCAGACCAACTAATTCATCTGCACTATTTTGATTGTTTTTCAGAATCTGCTATAAGAAATACCATATTAGGACGTATAGTTAGTCCTAGGTGTGAATATCAAGCAGGACATAACAAGGTAGGATCTCTACAGTACTTGGCACTAGCAGCATTAATAAAACCAAAACAGATAAAGCCACCTTTGCCTAGTGTTAGGAAACTGACAGAGGACAGATGGAACAAGCCCCAGAAGACCAAGGGCCACAGAGGGAGCCATACAATGAATGGACACTAGAGCTTTTAGAGGAACTTAAGAGTGAAGCTGTTAGACATTTTCCTAGGATATGGCTCCATAACTTAGGACAACATATCTATGAAACTTACGGGGATACTTGGGCAGGAGTGGAAGCCATAATAAGAATTCTGCAACAACTGCTGTTTATCCATTTCAGAATTGGGTGTCGACATAGCAGAATAGGCGTTACTCGACAGAGGAGAGCAAGAAATGGAGCCAGTAGATCCTAGACTAGAGCCCTGGAAGCATCCAGGAAGTCAGCCTAAAACTGCTTGTACCAATTGCTATTGTAAAAAGTGTTGCTTTCATTGCCAAGTTTGTTTCATGACAAAAGCCTTAGGCATCTCCTATGGCAGGAAGAAGCGGAGACAGCGACGAAGAGCTCATCAGAACAGTCAGACTCATCAAGCTTCTCTATCAAAGCAGTAAGTAGTACATGTAATGCAACCTATAATAGTAGCAATAGTAGCATTAGTAGTAGCAATAATAATAGCAATAGTTGTGTGGTCCATAGTAATCATAGAATATAGGAAAATATTAAGACAAAGAAAAATAGACAGGTTAATTGATAGACTAATAGAAAGAGCAGAAGACAGTGGCAATGAGAGTGAAGGAGAAGTATCAGCACTTGTGGAGATGGGGGTGGAAATGGGGCACCATGCTCCTTGGGATATTGATGATCTGTAGTGCTACAGAAAAATTGTGGGTCACAGTCTATTATGGGGTACCTGTGTGGAAGGAAGCAACCACCACTCTATTTTGTGCATCAGATGCTAAAGCATATGATACAGAGGTACATAATGTTTGGGCCACACATGCCTGTGTACCCACAGACCCCAACCCACAAGAAGTAGTATTGGTAAATGTGACAGAAAATTTTAACATGTGGAAAAATGACATGGTAGAACAGATGCATGAGGATATAATCAGTTTATGGGATCAAAGCCTAAAGCCATGTGTAAAATTAACCCCACTCTGTGTTAGTTTAAAGTGCACTGATTTGAAGAATGATACTAATACCAATAGTAGTAGCGGGAGAATGATAATGGAGAAAGGAGAGATAAAAAACTGCTCTTTCAATATCAGCACAAGCATAAGAGATAAGGTGCAGAAAGAATATGCATTCTTTTATAAACTTGATATAGTACCAATAGATAATACCAGCTATAGGTTGATAAGTTGTAACACCTCAGTCATTACACAGGCCTGTCCAAAGGTATCCTTTGAGCCAATTCCCATACATTATTGTGCCCCGGCTGGTTTTGCGATTCTAAAATGTAATAATAAGACGTTCAATGGAACAGGACCATGTACAAATGTCAGCACAGTACAATGTACACATGGAATCAGGCCAGTAGTATCAACTCAACTGCTGTTAAATGGCAGTCTAGCAGAAGAAGATGTAGTAATTAGATCTGCCAATTTCACAGACAATGCTAAAACCATAATAGTACAGCTGAACACATCTGTAGAAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATCCGTATCCAGAGGGGACCAGGGAGAGCATTTGTTACAATAGGAAAAATAGGAAATATGAGACAAGCACATTGTAACATTAGTAGAGCAAAATGGAATGCCACTTTAAAACAGATAGCTAGCAAATTAAGAGAACAATTTGGAAATAATAAAACAATAATCTTTAAGCAATCCTCAGGAGGGGACCCAGAAATTGTAACGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATTCAACACAACTGTTTAATAGTACTTGGTTTAATAGTACTTGGAGTACTGAAGGGTCAAATAACACTGAAGGAAGTGACACAATCACACTCCCATGCAGAATAAAACAATTTATAAACATGTGGCAGGAAGTAGGAAAAGCAATGTATGCCCCTCCCATCAGTGGACAAATTAGATGTTCATCAAATATTACTGGGCTGCTATTAACAAGAGATGGTGGTAATAACAACAATGGGTCCGAGATCTTCAGACCTGGAGGAGGCGATATGAGGGACAATTGGAGAAGTGAATTATATAAATATAAAGTAGTAAAAATTGAACCATTAGGAGTAGCACCCACCAAGGCAAAGAGAAGAGTGGTGCAGAGAGAAAAAAGAGCAGTGGGAATAGGAGCTTTGTTCCTTGGGTTCTTGGGAGCAGCAGGAAGCACTATGGGCTGCACGTCAATGACGCTGACGGTACAGGCCAGACAATTATTGTCTGATATAGTGCAGCAGCAGAACAATTTGCTGAGGGCTATTGAGGCGCAACAGCATCTGTTGCAACTCACAGTCTGGGGCATCAAACAGCTCCAGGCAAGAATCCTGGCTGTGGAAAGATACCTAAAGGATCAACAGCTCCTGGGGATTTGGGGTTGCTCTGGAAAACTCATTTGCACCACTGCTGTGCCTTGGAATGCTAGTTGGAGTAATAAATCTCTGGAACAGATTTGGAATAACATGACCTGGATGGAGTGGGACAGAGAAATTAACAATTACACAAGCTTAATACACTCCTTAATTGAAGAATCGCAAAACCAGCAAGAAAAGAATGAACAAGAATTATTGGAATTAGATAAATGGGCAAGTTTGTGGAATTGGTTTAACATAACAAATTGGCTGTGGTATATAAAATTATTCATAATGATAGTAGGAGGCTTGGTAGGTTTAAGAATAGTTTTTGCTGTACTTTCTATAGTGAATAGAGTTAGGCAGGGATATTCACCATTATCGTTTCAGACCCACCTCCCAATCCCGAGGGGACCCGACAGGCCCGAAGGAATAGAAGAAGAAGGTGGAGAGAGAGACAGAGACAGATCCATTCGATTAGTGAACGGATCCTTAGCACTTATCTGGGACGATCTGCGGAGCCTGTGCCTCTTCAGCTACCACCGCTTGAGAGACTTACTCTTGATTGTAACGAGGATTGTGGAACTTCTGGGACGCAGGGGGTGGGAAGCCCTCAAATATTGGTGGAATCTCCTACAGTATTGGAGTCAGGAACTAAAGAATAGTGCTGTTAACTTGCTCAATGCCACAGCCATAGCAGTAGCTGAGGGGACAGATAGGGTTATAGAAGTATTACAAGCAGCTTATAGAGCTATTCGCCACATACCTAGAAGAATAAGACAGGGCTTGGAAAGGATTTTGCTATAAGATGGGTGGCAAGTGGTCAAAAAGTAGTGTGATTGGATGGCCTGCTGTAAGGGAAAGAATGAGACGAGCTGAGCCAGCAGCAGATGGGGTGGGAGCAGTATCTCGAGACCTAGAAAAACATGGAGCAATCACAAGTAGCAATACAGCAGCTAACAATGCTGCTTGTGCCTGGCTAGAAGCACAAGAGGAGGAAGAGGTGGGTTTTCCAGTCACACCTCAGGTACCTTTAAGACCAATGACTTACAAGGCAGCTGTAGATCTTAGCCACTTTTTAAAAGAAAAGGGGGGACTGGAAGGGCTAATTCACTCCCAAAGAAGACAAGATATCCTTGATCTGTGGATCTACCACACACAAGGCTACTTCCCTGATTGGCAGAACTACACACCAGGGCCAGGGGTCAGATATCCACTGACCTTTGGATGGTGCTACAAGCTAGTACCAGTTGAGCCAGATAAGGTAGAAGAGGCCAATAAAGGAGAGAACACCAGCTTGTTACACCCTGTGAGCCTGCATGGAATGGATGACCCTGAGAGAGAAGTGTTAGAGTGGAGGTTTGACAGCCGCCTAGCATTTCATCACGTGGCCCGAGAGCTGCATCCGGAGTACTTCAAGAACTGCTGACATCGAGCTTGCTACAAGGGACTTTCCGCTGGGGACTTTCCAGGGAGGCGTGGCCTGGGCGGGACTGGGGAGTGGCGAGCCCTCAGATGCTGCATATAAGCAGCTGCTTTTTGCCTGTACTGGGTCTCTCTGGTTAGACCAGATCTGAGCCTGGGAGCTCTCTGGCTAACTAGGGAACCCACTGCTTAAGCCTCAATAAAGCTTGCCTTGAGTGCTTCAAGTAGTGTGTGCCCGTCTGTTGTGTGACTCTGGTAACTAGAGATCCCTCAGACCCTTTTAGTCAGTGTGGAAAATCTCTAGCACCCAGGAGGTAGAGGTTGCAGTGAGCCAAGATCGCGCCACTGCATTCCAGCCTGGGCAAGAAAACAAGACTGTCTAAAATAATAATAATAAGTTAAGGGTATTAAATATATTTATACATGGAGGTCATAAAAATATATATATTTGGGCTGGGCGCAGTGGCTCACACCTGCGCCCGGCCCTTTGGGAGGCCGAGGCAGGTGGATCACCTGAGTTTGGGAGTTCCAGACCAGCCTGACCAACATGGAGAAACCCCTTCTCTGTGTATTTTTAGTAGATTTTATTTTATGTGTATTTTATTCACAGGTATTTCTGGAAAACTGAAACTGTTTTTCCTCTACTCTGATACCACAAGAATCATCAGCACAGAGGAAGACTTCTGTGATCAAATGTGGTGGGAGAGGGAGGTTTTCACCAGCACATGAGCAGTCAGTTCTGCCGCAGACTCGGCGGGTGTCCTTCGGTTCAGTTCCAACACCGCCTGCCTGGAGAGAGGTCAGACCACAGGGTGAGGGCTCAGTCCCCAAGACATAAACACCCAAGACATAAACACCCAACAGGTCCACCCCGCCTGCTGCCCAGGCAGAGCCGATTCACCAAGACGGGAATTAGGATAGAGAAAGAGTAAGTCACACAGAGCCGGCTGTGCGGGAGAACGGAGTTCTATTATGACTCAAATCAGTCTCCCCAAGCATTCGGGGATCAGAGTTTTTAAGGATAACTTAGTGTGTAGGGGGCCAGTGAGTTGGAGATGAAAGCGTAGGGAGTCGAAGGTGTCCTTTTGCGCCGAGTCAGTTCCTGGGTGGGGGCCACAAGATCGGATGAGCCAGTTTATCAATCCGGGGGTGCCAGCTGATCCATGGAGTGCAGGGTCTGCAAAATATCTCAAGCACTGATTGATCTTAGGTTTTACAATAGTGATGTTACCCCAGGAACAATTTGGGGAAGGTCAGAATCTTGTAGCCTGTAGCTGCATGACTCCTAAACCATAATTTCTTTTTTGTTTTTTTTTTTTTATTTTTGAGACAGGGTCTCACTCTGTCACCTAGGCTGGAGTGCAGTGGTGCAATCACAGCTCACTGCAGCCTCAACGTCGTAAGCTCAAGCGATCCTCCCACCTCAGCCTGCCTGGTAGCTGAGACTACAAGCGACGCCCCAGTTAATTTTTGTATTTTTGGTAGAGGCAGCGTTTTGCCGTGTGGCCCTGGCTGGTCTCGAACTCCTGGGCTCAAGTGATCCAGCCTCAGCCTCCCAAAGTGCTGGGACAACCGGGCCCAGTCACTGCACCTGGCCCTAAACCATAATTTCTAATCTTTTGGCTAATTTGTTAGTCCTACAAAGGCAGTCTAGTCCCCAGCAAAAAGGGGGTTTGTTTCGGGAAAGGGCTGTTACTGTCTTTGTTTCAAACTATAAACTAAGTTCCTCCTAAACTTAGTTCGGCCTACACCCAGGAATGAACAAGGAGAGCTTGGAGGTTAGAAGCACGATGGAATTGGTTAGGTCAGATCTCTTTCACTGTCTGAGTTATAATTTTGCAATGGTGGTTCAAAGACTGCCCGCTTCTGACACCAGTCGCTGCATTAATGAATCGGCCAACGCGCGGGGAGAGGCGGTTTGCGTATTGGGCGCTCTTCCGCTTCCTCGCTCACTGACTCGCTGCGCTCGGTCGTTCGGCTGCGGCGAGCGGTATCAGCTCACTCAAAGGCGGTAATACGGTTATCCACAGAATCAGGGGATAACGCAGGAAAGAACATGTGAGCAAAAGGCCAGCAAAAGGCCAGGAACCGTAAAAAGGCCGCGTTGCTGGCGTTTTTCCATAGGCTCCGCCCCCCTGACGAGCATCACAAAAATCGACGCTCAAGTCAGAGGTGGCGAAACCCGACAGGACTATAAAGATACCAGGCGTTTCCCCCTGGAAGCTCCCTCGTGCGCTCTCCTGTTCCGACCCTGCCGCTTACCGGATACCTGTCCGCCTTTCTCCCTTCGGGAAGCGTGGCGCTTTCTCATAGCTCACGCTGTAGGTATCTCAGTTCGGTGTAGGTCGTTCGCTCCAAGCTGGGCTGTGTGCACGAACCCCCCGTTCAGCCCGACCGCTGCGCCTTATCCGGTAACTATCGTCTTGAGTCCAACCCGGTAAGACACGACTTATCGCCACTGGCAGCAGCCACTGGTAACAGGATTAGCAGAGCGAGGTATGTAGGCGGTGCTACAGAGTTCTTGAAGTGGTGGCCTAACTACGGCTACACTAGAAGGACAGTATTTGGTATCTGCGCTCTGCTGAAGCCAGTTACCTTCGGAAAAAGAGTTGGTAGCTCTTGATCCGGCAAACAAACCACCGCTGGTAGCGGTGGTTTTTTTGTTTGCAAGCAGCAGATTACGCGCAGAAAAAAAGGATCTCAAGAAGATCCTTTGATCTTTTCTACGGGGTCTGACGCTCAGTGGAACGAAAACTCACGTTAAGGGATTTTGGTCATGAGATTATCAAAAAGGATCTTCACCTAGATCCTTTTAAATTAAAAATGAAGTTTTAAATCAATCTAAAGTATATATGAGTAAACTTGGTCTGACAGTTACCAATGCTTAATCAGTGAGGCACCTATCTCAGCGATCTGTCTATTTCGTTCATCCATAGTTGCCTGACTCCCCGTCGTGTAGATAACTACGATACGGGAGGGCTTACCATCTGGCCCCAGTGCTGCAATGATACCGCGAGACCCACGCTCACCGGCTCCAGATTTATCAGCAATAAACCAGCCAGCCGGAAGGGCCGAGCGCAGAAGTGGTCCTGCAACTTTATCCGCCTCCATCCAGTCTATTAATTGTTGCCGGGAAGCTAGAGTAAGTAGTTCGCCAGTTAATAGTTTGCGCAACGTTGTTGCCATTGCTACAGGCATCGTGGTGTCACGCTCGTCGTTTGGTATGGCTTCATTCAGCTCCGGTTCCCAACGATCAAGGCGAGTTACATGATCCCCCATGTTGTGCAAAAAAGCGGTTAGCTCCTTCGGTCCTCCGATCGTTGTCAGAAGTAAGTTGGCCGCAGTGTTATCACTCATGGTTATGGCAGCACTGCATAATTCTCTTACTGTCATGCCATCCGTAAGATGCTTTTCTGTGACTGGTGAGTACTCAACCAAGTCATTCTGAGAATAGTGTATGCGGCGACCGAGTTGCTCTTGCCCGGCGTCAATACGGGATAATACCGCGCCACATAGCAGAACTTTAAAAGTGCTCATCATTGGAAAACGTTCTTCGGGGCGAAAACTCTCAAGGATCTTACCGCTGTTGAGATCCAGTTCGATGTAACCCACTCGTGCACCCAACTGATCTTCAGCATCTTTTACTTTCACCAGCGTTTCTGGGTGAGCAAAAACAGGAAGGCAAAATGCCGCAAAAAAGGGAATAAGGGCGACACGGAAATGTTGAATACTCATACTCTTCCTTTTTCAATATTATTGAAGCATTTATCAGGGTTATTGTCTCATGAGCGGATACATATTTGAATGTATTTAGAAAAATAAACAAATAGGGGTTCCGCGCACATTTCCCCGAAAAGTGCCACCTGACGTCTAAGAAACCATTATTATCATGACATTAACCTATAAAAATAGGCGTATCACGAGGCCCTTTCGTCTCGCGCGTTTCGGTGATGACGGTGAAAACCTCTGACACATGCAGCTCCCGGAGACGGTCACAGCTTGTCTGTAAGCGGATGCCGGGAGCAGACAAGCCCGTCAGGGCGCGTCAGCGGGTGTTGGCGGGTGTCGGGGCTGGCTTAACTATGCGGCATCAGAGCAGATTGTACTGAGAGTGCACCATATGCGGTGTGAAATACCGCACAGATGCGTAAGGAGAAAATACCGCATCAGGCGCCATTCGCCATTCAGGCTGCGCAACTGTTGGGAAGGGCGATCGGTGCGGGCCTCTTCGCTATTACGCCAGGGGAGGCAGAGATTGCAGTAAGCTGAGATCGCAGCACTGCACTCCAGCCTGGGCGACAGAGTAAGACTCTGTCTCAAAAATAAAATAAATAAATCAATCAGATATTCCAATCTTTTCCTTTATTTATTTATTTATTTTCTATTTTGGAAACACAGTCCTTCCTTATTCCAGAATTACACATATATTCTATTTTTCTTTATATGCTCCAGTTTTTTTTAGACCTTCACCTGAAATGTGTGTATACAAAATCTAGGCCAGTCCAGCAGAGCCTAAAGGTAAAAAATAAAATAATAAAAAATAAATAAAATCTAGCTCACTCCTTCACATCAAAATGGAGATACAGCTGTTAGCATTAAATACCAAATAACCCATCTTGTCCTCAATAATTTTAAGCGCCTCTCTCCACCACATCTAACTCCTGTCAAAGGCATGTGCCCCTTCCGGGCGCTCTGCTGTGCTGCCAACCAACTGGCATGTGGACTCTGCAGGGTCCCTAACTGCCAAGCCCCACAGTGTGCCCTGAGGCTGCCCCTTCCTTCTAGCGGCTGCCCCCACTCGGCTTTGCTTTCCCTAGTTTCAGTTACTTGCGTTCAGCCAAGGTCTGAAACTAGGTGCGCACAGAGCGGTAAGACTGCGAGAGAAAGAGACCAGCTTTACAGGGGGTTTATCACAGTGCACCCTGACAGTCGTCAGCCTCACAGGGGGTTTATCACATTGCACCCTGACAGTCGTCAGCCTCACAGGGGGTTTATCACAGTGCACCCTTACAATCATTCCATTTGATTCACAATTTTTTTAGTCTCTACTGTGCCTAACTTGTAAGTTAAATTTGATCAGAGGTGTGTTCCCAGAGGGGAAAACAGTATATACAGGGTTCAGTACTATCGCATTTCAGGCCTCCACCTGGGTCTTGGAATGTGTCCCCCGAGGGGTGATGACTACCTCAGTTGGATCTCCACAGGTCACAGTGACACAAGATAACCAAGACACCTCCCAAGGCTACCACAATGGGCCGCCCTCCACGTGCACATGGCCGGAGGAACTGCCATGTCGGAGGTGCAAGCACACCTGCGCATCAGAGTCCTTGGTGTGGAGGGAGGGACCAGCGCAGCTTCCAGCCATCCACCTGATGAACAGAACCTAGGGAAAGCCCCAGTTCTACTTACACCAGGAAAGGC\"\n hxb2_l = hxb2_ref.size\n head = \"\"\n 8.times {head << (65 + rand(25)).chr}\n temp_file = temp_dir + \"/temp\"\n temp_aln = temp_dir + \"/temp_aln\"\n\n l1 = 0\n l2 = 0\n name = \">test\"\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts hxb2_ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n aln_test =~ /^(\\-*)(\\w.*\\w)(\\-*)$/\n gap_begin = $1.size\n gap_end = $3.size\n aln_test2 = $2\n ref = aln_seq[\">ref\"]\n ref = ref[gap_begin..(-gap_end-1)]\n ref_size = ref.size\n if ref_size > 1.3*(seq.size)\n l1 = l1 + gap_begin\n l2 = l2 + gap_end\n max_seq = aln_test2.scan(/[ACGT]+/).max_by(&:length)\n aln_test2 =~ /#{max_seq}/\n before_aln_seq = $`\n before_aln = $`.size\n post_aln_seq = $'\n post_aln = $'.size\n before_aln_seq_size = before_aln_seq.scan(/[ACGT]+/).join(\"\").size\n b1 = (1.3 * before_aln_seq_size).to_i\n post_aln_seq_size = post_aln_seq.scan(/[ACGT]+/).join(\"\").size\n b2 = (1.3 * post_aln_seq_size).to_i\n if (before_aln > seq.size) and (post_aln <= seq.size)\n ref = ref[(before_aln - b1)..(ref_size - post_aln - 1)]\n l1 = l1 + (before_aln - b1)\n elsif (post_aln > seq.size) and (before_aln <= seq.size)\n ref = ref[before_aln..(ref_size - post_aln - 1 + b2)]\n l2 = l2 + post_aln - b2\n elsif (post_aln > seq.size) and (before_aln > seq.size)\n ref = ref[(before_aln - b1)..(ref_size - post_aln - 1 + b2)]\n l1 = l1 + (before_aln - b1)\n l2 = l2 + (post_aln - b2)\n end\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n aln_test =~ /^(\\-*)(\\w.*\\w)(\\-*)$/\n gap_begin = $1.size\n gap_end = $3.size\n aln_test2 = $2\n ref = aln_seq[\">ref\"]\n ref = ref[gap_begin..(-gap_end-1)]\n ref_size = ref.size\n end\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n aln_test =~ /^(\\-*)(\\w.*\\w)(\\-*)$/\n gap_begin = $1.size\n gap_end = $3.size\n aln_test = $2\n aln_test =~ /^(\\w+)(\\-*)\\w/\n s1 = $1.size\n g1 = $2.size\n aln_test =~ /\\w(\\-*)(\\w+)$/\n s2 = $2.size\n g2 = $1.size\n ref = aln_seq[\">ref\"]\n ref = ref[gap_begin..(-gap_end-1)]\n\n l1 = l1 + gap_begin\n l2 = l2 + gap_end\n repeat = 0\n\n if g1 == g2 and (s1 + g1 + s2) == ref.size\n if s1 > s2 and g2 > 2*s2\n ref = ref[0..(-g2-1)]\n repeat = 1\n l2 = l2 + g2\n elsif s1 < s2 and g1 > 2*s1\n ref = ref[g1..-1]\n repeat = 1\n l1 = l1 + g1\n end\n else\n if g1 > 2*s1\n ref = ref[g1..-1]\n repeat = 1\n l1 = l1 + g1\n end\n if g2 > 2*s2\n ref = ref[0..(-g2 - 1)]\n repeat = 1\n l2 = l2 + g2\n end\n end\n\n while repeat == 1\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n aln_test =~ /^(\\-*)(\\w.*\\w)(\\-*)$/\n gap_begin = $1.size\n gap_end = $3.size\n aln_test = $2\n aln_test =~ /^(\\w+)(\\-*)\\w/\n s1 = $1.size\n g1 = $2.size\n aln_test =~ /\\w(\\-*)(\\w+)$/\n s2 = $2.size\n g2 = $1.size\n ref = aln_seq[\">ref\"]\n ref = ref[gap_begin..(-gap_end-1)]\n l1 = l1 + gap_begin\n l2 = l2 + gap_end\n repeat = 0\n if g1 > 2*s1\n ref = ref[g1..-1]\n repeat = 1\n l1 = l1 + g1\n end\n if g2 > 2*s2\n ref = ref[0..(-g2 - 1)]\n repeat = 1\n l2 = l2 + g2\n end\n end\n ref = hxb2_ref[l1..(hxb2_l - l2 - 1)]\n\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n ref = aln_seq[\">ref\"]\n\n #refine alignment\n\n if ref =~ /^(\\-+)/\n l1 = l1 - $1.size\n elsif ref =~ /(\\-+)$/\n l2 = l2 + $1.size\n end\n l1 = 0 if l1 < 0\n if (hxb2_l - l2 - 1) >= l1\n ref = hxb2_ref[l1..(hxb2_l - l2 - 1)]\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n ref = aln_seq[\">ref\"]\n\n ref_size = ref.size\n sim_count = 0\n (0..(ref_size-1)).each do |n|\n ref_base = ref[n]\n test_base = aln_test[n]\n sim_count += 1 if ref_base == test_base\n end\n similarity = (sim_count/ref_size.to_f*100).round(1)\n print `rm -f #{temp_file}`\n print `rm -f #{temp_aln}`\n loc_p1 = l1 + 1\n loc_p2 = hxb2_l - l2\n if seq.size != (loc_p2 - loc_p1 + 1)\n indel = true\n elsif aln_test.include?(\"-\")\n indel = true\n end\n return [loc_p1,loc_p2,similarity,indel,aln_test,ref]\n else\n return [0,0,0,0,0,0,0]\n end\nrescue\n return [0,0,0,0,\"N\",\"N\"]\nend", "def non_ref_ratio\n self.non_ref_count.to_f / self.coverage.to_f\n end", "def x_and_y\n x = @x.content\n y = @y.content\n z = Array.new @z.length, 0\n\n @z.length.times { |i| z[i] = x[i] & y[i] }\n\n @z.content = z\n end", "def correct_color_input?(input_ary, ref_ary)\n (input_ary - ref_ary).empty?\n end", "def abs2\n\t\[email protected] + @b.abs2\n\tend", "def dopri\n a21 = 1.0/5.0\n a31 = 3.0/40.0\n a32 = 9.0/40.0\n a41 = 44.0/45.0\n a42 = -56.0/15.0\n a43 = 32.0/9.0\n a51 = 19372.0/6561.0\n a52 = -25360.0/2187.0\n a53 = 64448.0/6561.0\n a54 = -212.0/729.0\n a61 = 9017.0/3168.0\n a62 = -355.0/33.0\n a63 = 46732.0/5247.0\n a64 = 49.0/176.0\n a65 = -5103.0/18656.0\n a71 = 35.0/384.0\n a72 = 0.0\n a73 = 500.0/1113.0\n a74 = 125.0/192.0\n a75 = -2187.0/6784.0\n a76 = 11.0/84.0\n\n c2 = 1.0 / 5.0\n c3 = 3.0 / 10.0\n c4 = 4.0 / 5.0\n c5 = 8.0 / 9.0\n c6 = 1.0\n c7 = 1.0\n\n b1order5 = 35.0/384.0\n b2order5 = 0.0\n b3order5 = 500.0/1113.0\n b4order5 = 125.0/192.0\n b5order5 = -2187.0/6784.0\n b6order5 = 11.0/84.0\n b7order5 = 0.0\n\n b1order4 = 5179.0/57600.0\n b2order4 = 0.0\n b3order4 = 7571.0/16695.0\n b4order4 = 393.0/640.0\n b5order4 = -92097.0/339200.0\n b6order4 = 187.0/2100.0\n b7order4 = 1.0/40.0\n\n @x[0] = @xmin\n @u[0] = @yini\n @fx[0] = self.f(@x[0], @u[0])\n h = @dx \n i = 0\n\n 0.upto(@maxiter) do |iter|\n # Compute the function values\n k1 = @fx[i] \n k2 = self.f(@x[i] + c2*h, @u[i] + h*(a21*k1))\n k3 = self.f(@x[i] + c3*h, @u[i] + h*(a31*k1+a32*k2))\n k4 = self.f(@x[i] + c4*h, @u[i] + h*(a41*k1+a42*k2+a43*k3))\n k5 = self.f(@x[i] + c5*h, @u[i] + h*(a51*k1+a52*k2+a53*k3+a54*k4))\n k6 = self.f(@x[i] + h, @u[i] + h*(a61*k1+a62*k2+a63*k3+a64*k4+a65*k5))\n k7 = self.f(@x[i] + h, @u[i] + h*(a71*k1+a72*k2+a73*k3+a74*k4+a75*k5+a76*k6))\n\n error = (b1order5 - b1order4)*k1 + (b3order5 - b3order4)*k3 + (b4order5 - b4order4)*k4 + \n (b5order5 - b5order4)*k5 + (b6order5 - b6order4)*k6 + (b7order5 - b7order4)*k7\n error = error.abs\n\n # error control\n if error < @tol then\n @x[i+1] = @x[i] + h\n @u[i+1] = @u[i] + h * (b1order5*k1 + b3order5*k3 + b4order5*k4 + b5order5*k5 + b6order5*k6)\n @fx[i+1] = self.f(@x[i+1], @u[i+1])\n i = i+1\n end\n\n delta = 0.84 * (@tol / error)**0.2\n if delta <= 0.1 then\n h = h * 0.1\n elsif delta >= 4.0 then\n h = h * 4.0\n else \n h = delta * h\n end\n\n # set h to the user specified maximal allowed value\n h = @dx if h > @dx \n\n if @x[i] >= @xmax then\n break\n elsif @x[i] + h > @xmax then\n h = @xmax - @x[i]\n end\n end\n\n @mx = @x.length # Number of x steps\n\n raise(RuntimeError, \"Maximal number of iterations reached \n before evaluation of the solution on the entire x interval \n was completed (try to increase maxiter or use a different method\") if @x.last < @xmax\n end", "def changes(_start_ref, _end_ref)\n fail 'Not implemented'\n end", "def look_ahead_for_support_both_sides\n look_ahead_for_support do |left, right|\n left & right\n end\n end", "def aref\n \"#{aref_prefix}-#{full_name}\"\n end", "def hash() source.hash ^ target.hash; end", "def eName2Exp(name)\n # puts \"eName2Exp with name=#{name}\"\n ref = $refs.find do |ref|\n if ref.ref.respond_to?(:name) then\n ref.ref.name == name.to_sym\n else\n ref.name == name.to_sym\n end\n end\n # puts \"ref=#{ref}\"\n unless ref\n return Value.new($bit8,name.to_i)\n end\n return ref\nend", "def yref() @y end", "def angle_diff(angle1, angle2)\n end" ]
[ "0.56888145", "0.5620184", "0.5342926", "0.5342926", "0.5250166", "0.52040523", "0.5176728", "0.5139128", "0.5113715", "0.5110821", "0.51065826", "0.5041224", "0.50389254", "0.50250906", "0.4976163", "0.49603662", "0.49588585", "0.49502245", "0.49425298", "0.49225518", "0.489355", "0.4881369", "0.48711053", "0.48613608", "0.48348227", "0.48246658", "0.4807498", "0.47969294", "0.47870848", "0.47789532", "0.47707304", "0.47707304", "0.4769126", "0.47687292", "0.47450554", "0.47437894", "0.47430143", "0.47328112", "0.47312126", "0.47312126", "0.47288868", "0.472662", "0.4722453", "0.47080782", "0.46906036", "0.46709105", "0.4670386", "0.4662246", "0.46530873", "0.46468964", "0.4642857", "0.4642857", "0.4642857", "0.4614378", "0.46116447", "0.4608635", "0.4604225", "0.4596219", "0.45905754", "0.45905754", "0.4589236", "0.45874733", "0.45818818", "0.45739743", "0.45737904", "0.457096", "0.4570305", "0.45702118", "0.45656577", "0.45648047", "0.45614645", "0.45592412", "0.4550088", "0.4531716", "0.45260382", "0.45170397", "0.45140412", "0.4514016", "0.45082042", "0.44996253", "0.44982976", "0.44982976", "0.44968084", "0.4494414", "0.4494412", "0.44931063", "0.44923878", "0.4486422", "0.44857243", "0.44793773", "0.44755843", "0.44701704", "0.4458157", "0.4455018", "0.4453124", "0.4451694", "0.44430304", "0.44400063", "0.44348434", "0.44325274" ]
0.5166628
7
channels: array of channel numbers scale: global scale factor to multiply by offsets: array of offsets to be subtracted before scaling
def readChannels(scale, offsets) return channels_collect { |cn| readRawChannelLevel(cn) }.zip(offsets).collect { |a| (a[0] - a[1]) * scale } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scales\n \n end", "def scale(*args, &block); end", "def scale(factor_x, factor_y=factor_x, &rendering_code); end", "def scale_mixes(mix_list, scl)\n as_one_edit_rb(get_func_name) do\n mix_list.each do |m|\n set_mix_amp(m, scl * mix_amp(m))\n end\n end\n end", "def scale(factor_x, factor_y, around_x, around_y, &rendering_code); end", "def scale pairs\n @scale.call pairs\n end", "def scale factor\n Vector.new factor * @x, factor * @y, factor * @z\n end", "def scale_fixed old_min, old_max, new_min, new_max\n self.map do |elem|\n Rya::ExtendedClasses::MATH.scale elem, old_min, old_max, new_min, new_max\n end\n end", "def scale(*amount)\n self.dup.scale! *amount\n end", "def zoom(factor = 5)\n upstream_slice = self.class.sketch.slices.select{|s| s.start_cumulative_bp < @start_cumulative_bp}.sort_by{|s| s.start_cumulative_bp}[-1]\n downstream_slice = self.class.sketch.slices.select{|s| s.start_cumulative_bp > @start_cumulative_bp}.sort_by{|s| s.start_cumulative_bp}[0]\n\n center_bp = (@start_cumulative_bp + @length_bp.to_f/2).round\n\n @length_bp = (@length_bp.to_f/factor).round\n @start_cumulative_bp = (center_bp - @length_bp.to_f/2).round\n @stop_cumulative_bp = (center_bp + @length_bp.to_f/2 - 1).round\n @resolution = @length_pixel.to_f/@length_bp\n self.fetch_sequence\n\n upstream_slice.stop_cumulative_bp = @start_cumulative_bp - 1\n downstream_slice.start_cumulative_bp = @stop_cumulative_bp + 1\n [upstream_slice, downstream_slice].each do |s|\n s.length_bp = s.stop_cumulative_bp - s.start_cumulative_bp + 1\n s.resolution = s.length_pixel.to_f/s.length_bp\n s.range_cumulative_bp = Range.new(s.start_cumulative_bp, s.stop_cumulative_bp)\n s.fetch_sequence\n end\n self.class.sketch.slices.each{|s| s.format_resolution}\n\n self.class.sketch.buffer_images[:zoomed] = self.class.sketch.draw_zoomed_buffer\n self.class.sketch.buffer_images[:information_panel] = self.class.sketch.draw_information_panel\n end", "def hscale(factor)\n @width *= factor\n @left *= factor\n self\n end", "def scale_up(scale)\n self.side_length *= scale\n end", "def scale(arr)\n arr.sum(0){ |e| e * e } if arr.is_a?(Array)\n end", "def rate_scale=(_arg0); end", "def update_scale\n heightpx = @board.height*@scale\n widthpx = @board.width*@scale\n # Gameboard\n @board_window.height = heightpx\n @board_window.width = widthpx\n # Clue windows\n @clues_windows[:rows].height = heightpx\n @clues_windows[:rows].width = (@scale*@board.clues[:rows].map { |row| row.length }.max)\n @clues_windows[:columns].height = (@scale*@board.clues[:columns].map { |column| column.length }.max)\n @clues_windows[:columns].width = widthpx\n # Clues\n @clues_list.each { |clue| clue[:text_object].delete() }\n @passing.each { |pass| pass.remove() }\n @passing = draw_passing(@board.clues)\n @clues_list = draw_clues(@board.clues)\n # Blocks\n @blocks.each do |block, cell|\n x = block.coords[:x]*@scale\n y = block.coords[:y]*@scale\n cell.coords = [x, y, x+@scale, y+@scale]\n end\n # Guide lines\n @guide_lines.each { |line| line.remove }\n @guide_lines = draw_guide_lines()\n update_highlight()\n end", "def vscale(factor)\n @height = @height * factor\n @top *= factor\n self\n end", "def transforms( inputs, type ) #:nodoc:\n nsamples = inputs.size\n result = [1.0]\n (nsamples-1).times do\n result << result[-1] / @factor\n end\n range = (1.0..result[-1])\n result = result.map {|v| range.abscissa( v )}\n return result\n end", "def rate_scale; end", "def scale\n root_degree, type = parse_chord @name\n scale_tonic = @key.scale[root_degree - 1]\n scale_mode = CHORDS_TO_SCALES[type]\n SCALES[scale_mode].map{|n| n + scale_tonic}\n end", "def sub_scale _value, _abs=0\n send_cmd(\"sub_scale #{_value} #{_abs}\")\n end", "def scale_by_pixels(dimensions)\n out_pixels = sqrt(options[:width] * options[:height]).truncate\n src_pixels = sqrt(dimensions[0] * dimensions[1]).truncate\n out_pixels / src_pixels.to_f\n end", "def scale(series, control, multiplier=1)\n map_over series, control, multiplier do |val,previous|\n [val * multiplier, val]\n end\n end", "def to_scale(*args)\n Statsample::Vector.new(self, *args)\n end", "def scale( scale_x, scale_y = scale_x )\n dup.scale!(scale_x, scale_y)\n end", "def channel_rms(frames, channel=0)\n Math.sqrt(frames.inject(0.0){ |sum, frame| sum += (frame ? Array(frame)[channel] ** 2 : 0) } / frames.size)\n end", "def voltage_conversion_factor(data_bits)\n max_channel_reading(data_bits)/max_channel_voltage\n end", "def normalize(inputs)\n return inputs.map{|pixel|\n pixel/256.0\n }\n end", "def scale(value)\r\n value * @height/2 + @height/4\r\n end", "def mul( val )\n @x.scale( val )\n @y.scale( val )\n self\n end", "def setscalefactors3d(*)\n super\n end", "def scale_bilinear(*args)\n @source = BilinearScaler.new(@source, *args)\n self\n end", "def post_scale diffs\n diffs.reduce(0, :+).to_f / diffs.size\n end", "def scale(sx,sy)\n set RGhost::Scale.new(sx,sy)\n \n end", "def scale(by)\n @x = @x * by\n @y = @y * by\n @z = @z * by\n self\n end", "def scale(range)\n u = uninterpolate\n i = interpolate(range[0], range[1])\n\n lambda do |x|\n x = ([0.0, x, (wrong + right).to_f].sort[1]).to_f\n i.call(u.call(x))\n end\n end", "def scale!( scale_x, scale_y = scale_x )\n raise \"can't modify frozen object\" if frozen?\n @x, @y = @x * scale_x, @y * scale_y\n @hash = nil\n self\n end", "def scale_factor(point, view)\n\n px_to_length(view)/view.pixels_to_model(1, point)\n\n end", "def ctrlSetScale _obj, _args\n \"_obj ctrlSetScale _args;\" \n end", "def scale_values(values)\n return values if values.length == Merit::POINTS\n\n raise IncorrectLoadProfileError, values.length unless (Merit::POINTS % values.length).zero?\n\n factor = Merit::POINTS / values.length\n\n values.each_with_object([]) do |value, scaled|\n factor.times { scaled.push(value) }\n end\n end", "def ctrlScale _args\n \"ctrlScale _args;\" \n end", "def setscale(*)\n super\n end", "def ctrlMapScale _args\n \"ctrlMapScale _args;\" \n end", "def scale_data\n n_bins = 6.0\n raw_min = Math.log(counts.values.min) rescue 0.0 # if min == 0, log(min) = -inf = BAD juju\n raw_max = Math.log(counts.values.max) rescue 0.0 # if max == 0, log(max) = -inf = BAD juju\n slope = n_bins / (raw_max - raw_min).to_f rescue 0.0 # wouldn't want inf here, zero is fine\n counts.each do |k, raw_value|\n @counts[k] = (slope*(Math.log(raw_value) - raw_min)).to_i # make it an integer bin\n end\n end", "def axis_inches axis, tile, pixel\n @offset[axis] + tile*@tile_interval[axis] + pixel*@scale[axis]\n end", "def axis_inches axis, tile, pixel\n @offset[axis] + tile*@tile_interval[axis] + pixel*@scale[axis]\n end", "def scale(name)\n \n end", "def scale= scale\n protected_use_method(MM::Scaling, :@scale, scale)\n end", "def scale( value )\n ( value - @min ) / ( @max - @min )\n end", "def scale\n raise NotImplementedError, \"Subclass responsibility\"\n end", "def update_channels(channels = [])\n @attributes[:channels] = Array(channels)\n end", "def get_scale\n runs = []\n 10.times do\n runs << measure(1, &@options[:fn])\n end\n runs.inject(:+) / 10\n end", "def draw_scale(data,data_description,scale_mode,r,g,b,draw_ticks=true,angle=0,decimals=1,with_margin=false,skip_labels=1,right_scale=false)\n # Validate the Data and DataDescription array\n self.validate_data(\"draw_scale\",data)\n #c_text_color = allocate_color(@picture,r,g,b)\n c_text_color = GD2::Color.new(r,g,b)\n self.draw_line(@g_area_x1,@g_area_y1,@g_area_x1,@g_area_y2,r,g,b)\n self.draw_line(@g_area_x1,@g_area_y2,@g_area_x2,@g_area_y2,r,g,b)\n if(@vmin.nil? && @vmax.nil?)\n if (!data_description[\"values\"][0].nil?)\n @vmin =data[0][data_description[\"values\"][0]]\n @vmax =data[0][data_description[\"values\"][0]]\n else\n @vmin = 2147483647\n @vmax = -2147483647\n end\n\n# /* Compute Min and Max values */\n if(scale_mode == SCALE_NORMAL || scale_mode == SCALE_START0)\n @vmin = 0 if (scale_mode == SCALE_START0 )\n \n data.each do |key|\n data_description[\"values\"].each do |col_name|\n if(!key[col_name].nil?)\n value = key[col_name]\n if (value.is_a?(Numeric))\n @vmax = value if ( @vmax < value)\n @vmin = value if ( @vmin > value)\n end\n end\n end\n end\n elsif ( scale_mode == SCALE_ADDALL || scale_mode == SCALE_ADDALLSTART0 ) # Experimental\n @vmin = 0 if (scale_mode == SCALE_ADDALLSTART0)\n data.each do |key|\n sum = 0\n data_description[\"values\"].each do|col_name|\n if (!key[col_name].nil?)\n value =key[col_name]\n sum += value if ((value).is_a?(Numeric))\n end\n end\n @vmax = sum if (@vmax < sum)\n @vmin = sum if (@vmin > sum)\n end\n end\n\n if(@vmax.is_a?(String))\n @vmax = @vmax.gsub(/\\.[0-9]+/,'')+1 if (@vmax > @vmax.gsub(/\\.[0-9]+/,'') )\n end\n\n # If all values are the same */\n if ( @vmax == @vmin )\n if ( @vmax >= 0 )\n @vmax = @vmax+1\n else\n @vmin = @vmin-1\n end\n end\n\n data_range = @vmax - @vmin\n data_range = 0.1 if (data_range == 0 )\n\n #Compute automatic scaling */\n scale_ok = false\n factor = 1\n min_div_height = 25\n max_divs = (@g_area_y2 - @g_area_y1) / min_div_height\n\n if ( @vmin == 0 && @vmax == 0 )\n @vmin = 0\n @vmax = 2\n scale = 1\n divisions = 2\n elsif (max_divs > 1)\n while(!scale_ok)\n scale1 = ( @vmax - @vmin ) / factor\n scale2 = ( @vmax - @vmin ) /factor / 2\n scale4 = ( @vmax - @vmin ) / factor / 4\n\n if ( scale1 > 1 && scale1 <= max_divs && !scale_ok)\n scale_ok = true\n divisions = (scale1).floor\n scale = 1\n end\n if (scale2 > 1 && scale2 <= max_divs && !scale_ok)\n scale_ok = true\n divisions = (scale2).floor\n scale = 2\n end\n if (!scale_ok)\n factor = factor * 10 if ( scale2 > 1 )\n factor = factor / 10 if ( scale2 < 1 )\n end\n end # while end\n\n if ( (@vmax / scale / factor).floor != @vmax / scale / factor)\n\n grid_id = ( @vmax / scale / factor).floor + 1\n @vmax = grid_id * scale * factor\n divisions = divisions+1\n end\n\n if ((@vmin / scale / factor).floor != @vmin / scale / factor)\n\n grid_id = ( @vmin / scale / factor).floor\n @vmin = grid_id * scale * factor\n divisions = divisions+1\n end\n\n else #/* Can occurs for small graphs */\n scale = 1\n end\n divisions = 2 if ( divisions.nil? )\n\n divisions = divisions -1 if (scale == 1 && divisions%2 == 1)\n\n else\n divisions = @divisions\n end\n @division_count = divisions\n data_range = @vmax - @vmin\n data_range = 0.1 if (data_range == 0 )\n @division_height = ( @g_area_y2 - @g_area_y1 ) / divisions\n @division_ratio = ( @g_area_y2 - @g_area_y1 ) /data_range\n @g_area_x_offset = 0\n if ( data.count > 1 )\n if ( decimals == false)\n @division_width = ( @g_area_x2 - @g_area_x1 ) / (data).count-1\n else\n @division_width = ( @g_area_x2 - @g_area_x1 ) / (data).count\n @g_area_x_offset = @division_width / 2\n end\n else\n @division_width = @g_area_x2 - @g_area_x1\n @g_area_x_offset = @division_width / 2\n end\n @data_count = (data).count\n return(0) if (draw_ticks == false )\n ypos = @g_area_y2\n xmin = 0.0\n i =1\n while(i<=divisions+1)\n if (right_scale )\n self.draw_line(@g_area_x2,ypos,@g_area_x2+5,ypos,r,g,b)\n else\n self.draw_line(@g_area_x1,ypos,@g_area_x1-5,ypos,r,g,b)\n end\n value = @vmin + (i-1) * (( @vmax - @vmin ) / divisions)\n value = (value * (10**decimals)).round / (10**decimals)\n \n value = \"#{value}.#{data_description['unit']['y']}.to_f\" if ( data_description[\"format\"][\"y\"]== \"number\") \n value = self.to_time(value) if ( data_description[\"format\"][\"y\"] == \"time\" )\n value = self.to_date(value) if ( data_description[\"format\"][\"y\"] == \"date\" )\n value = self.to_metric(value) if ( data_description[\"format\"][\"Y\"] == \"metric\" )\n value = self.to_currency(value) if ( data_description[\"format\"][\"Y\"] == \"currency\" )\n position = image_ftb_box(@font_size,0,@font_name,value)\n \n text_width =position[:lower_right][0]-position[:lower_left][0]\n if ( right_scale )\n image_ttf_text(@picture,@font_size,0,@g_area_x2+10,ypos+(@font_size/2),c_text_color,@font_name,value)\n xmin = @g_area_x2+15+text_width if ( xmin < @g_area_x2+15+text_width || xmin.nil? )\n else\n image_ttf_text(@picture,@font_size,0,@g_area_x1-10-text_width,ypos+(@font_size/2),c_text_color,@font_name,value)\n xmin = @g_area_x1-10-text_width if ( xmin > @g_area_x1-10-text_width || xmin.nil? )\n end\n ypos = ypos - @division_height\n i = i+1\n end\n # Write the Y Axis caption if set */\n\n if ( !data_description[\"axis\"].nil?&&!data_description[\"axis\"][\"y\"].nil? )\n position = image_ftb_box(@font_size,90,@font_name,data_description[\"axis\"][\"y\"])\n text_height = (position[:lower_left][1]).abs+(position[:lower_right][1]).abs\n text_top = ((@g_area_y2 - @g_area_y1) / 2) + @g_area_y1 + (text_height/2)\n if ( right_scale )\n image_ttf_text(@picture,@font_size,90,xmin+@font_size,text_top,c_text_color,@font_name,data_description[\"axis\"][\"y\"])\n else\n image_ttf_text(@picture,@font_size,90,xmin-@font_size,text_top,c_text_color,@font_name,data_description[\"axis\"][\"y\"])\n end\n end \n # Horizontal Axis */\n xpos = @g_area_x1 + @g_area_x_offset\n id = 1\n ymax = nil\n data.each do |key|\n if ( id % skip_labels == 0 )\n self.draw_line((xpos).floor,@g_area_y2,(xpos).floor,@g_area_y2+5,r,g,b)\n value =key[data_description[\"position\"]]\n value = value.data_description[\"unit\"][\"x\"] if ( data_description[\"format\"][\"x\"] == \"number\" )\n value = self.to_time(value) if ( data_description[\"format\"][\"x\"] == \"time\" )\n value = self.to_date(value) if ( data_description[\"format\"][\"x\"] == \"date\" )\n value = self.to_metric(value) if ( data_description[\"format\"][\"x\"] == \"metric\" )\n value = self.to_currency(value) if ( data_description[\"format\"][\"x\"] == \"currency\" )\n position = image_ftb_box(@font_size,angle,@font_name,value.to_s)\n text_width = (position[:lower_right][0]).abs+(position[:lower_left][0]).abs\n text_height = (position[:lower_left][1]).abs+(position[:lower_right][1]).abs\n if ( angle == 0 )\n ypos = @g_area_y2+18\n image_ttf_text(@picture,@font_size,angle,(xpos).floor-(text_width/2).floor,ypos,c_text_color,@font_name,value.to_s)\n else\n ypos = @g_area_y2+10+$TextHeight\n if ( angle <= 90 )\n image_ttf_text(@picture,@font_size,angle,(xpos).floor-text_width+5,ypos,c_text_color,@font_name,value.to_s)\n else\n image_ttf_text(@picture,@font_size,angle,(xpos).floor+text_width+5,ypos,c_text_color,@font_name,value.to_s)\n end \n end\n ymax = ypos if (ymax.nil? ||(!ymax.nil? && ymax < ypos))\n end\n xpos = xpos + @division_width\n id = id+1\n end #loop ended\n #Write the X Axis caption if set */\n if ((!data_description[\"axis\"].nil? && !data_description[\"axis\"][\"x\"].nil?) )\n position = image_ftb_box(@font_size,90,@font_name,data_description[\"axis\"][\"x\"])\n text_width = (position[:lower_right][0]).abs+(position[:lower_right][0]).abs\n text_left = ((@g_area_x2 - @g_area_x1) / 2) + @g_area_x1 + (text_width/2)\n image_ttf_text(@picture,@font_size,0,text_left,ymax+@font_size+5,c_text_color,@font_name,data_description[\"axis\"][\"x\"].to_s)\n end\n end", "def transform \n \n @pixel_location = get_pixel_points \n puts \"px loc : #{@pixel_location}\"\n \n while @pixel_location.size != 0 \n transform_pixel_points(@pixel_location)\n @pixel_location.shift\n @pixel_location.shift\n end\n end", "def scale_stack\n @scale_stack ||= MadStatter::Statistic::RATES.slice(0..MadStatter::Statistic::RATES.index(scale))\n end", "def f2c_x(x)\n (x - x_orig) * zoom\n end", "def [](index)\n return @scales[index]\n end", "def scale(scale_val, objectify = false)\n scaled = Array.new(@n) { Array.new(@m) }\n 0.upto(@n - 1) do |i|\n 0.upto(@m - 1) do |j|\n scaled[i][j] = scale_val * @matrix[i][j]\n end\n end\n return VectorMatrix.new(nil, nil, nil, scaled) if objectify\n scaled\n end", "def scale!(alpha, incx=1, n=nil)\n #FIXME\n # raise(DataTypeError, \"Incompatible data type for the scaling factor\") unless\n # NMatrix::upcast(self.dtype, NMatrix::min_dtype(alpha)) == self.dtype\n raise(DataTypeError, \"Incompatible data type for the scaling factor\") if\n self.dtype == :int8\n @s.mapMultiplyToSelf(alpha)\n return self\n end", "def scale!(*amount)\n x, y, z = amount.extract_vector3i!\n\n self.x, self.y, self.z = self.x*x, self.y*y, self.z*z\n self\n end", "def scale\n @data['scale']\n end", "def Range3dScaleAboutCenter(arg0, arg1)\n ret = _invoke(1610744095, [arg0, arg1], [VT_BYREF | VT_DISPATCH, VT_R8])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "def scale=(val)\n self['scale'] = val\n end", "def rescale_input(value, source_scaler, dest_scaler)\n if source_scaler\n descaled = source_scaler.descale(value)\n dest_scaler ? dest_scaler.scale(descaled) : descaled\n elsif dest_scaler\n dest_scaler.scale(value)\n end\n end", "def scale!(rhs)\n scale rhs, self\n end", "def any_env_channel(env, beg = 0, dur = false, snd = false, chn = false,\n edpos = false, origin = false, &func)\n if array?(env) and (not env.empty?)\n pts = env.length / 2\n if pts == 1\n scale_channel(env[0], beg, dur, snd, chn, edpos)\n else\n x0 = y0 = 0\n x1, y1 = env[0], env[1]\n xrange = (env[-2] - env[0]).to_f\n ramp_beg = beg\n dur = frames(snd, chn) unless number?(dur)\n as_one_edit_rb(origin) do | |\n 2.step(env.length - 1, 2) do |i|\n x0, y0, x1, y1 = x1, y1, env[i], env[i + 1]\n ramp_dur = (dur * ((x1 - x0) / xrange)).round\n if y0 == y1\n scale_channel(y0, ramp_beg, ramp_dur, snd, chn, edpos)\n else\n func.call(y0, y1, ramp_beg, ramp_dur, snd, chn, edpos)\n end\n ramp_beg += ramp_dur\n end\n end\n end\n end\n end", "def test_absolute_scaling\n @metric.scale = :absolute\n @exp = [\n [0.417, 0.333, 0.25, 0.5],\n [1.0, 0.167, 0.917, 0.583]\n ]\n actual = @metric.send :scale, @unscaled\n actual.each_with_index do |v, i|\n v.each_with_index do |w, j|\n assert_in_delta @exp[i][j], w, 0.001 \n end\n end\n end", "def scale(factor)\n Point.new(self.x * factor, self.y * factor)\n end", "def initialize(len, scale); @len = len; @scale = scale end", "def rescale\r\n unless self.is_si?\r\n return self.to_base_unit.rescale\r\n end\r\n scale=Math.log10(self.value)+self.unit.scale\r\n\r\n unit_scales=self.class.si_unit_scales.sort\r\n\r\n if scale<unit_scales[0][0]\r\n return self.send unit_scales[0][1].name\r\n end\r\n if scale>=unit_scales.last[0]\r\n return self.send unit_scales.last[1].name\r\n end\r\n unit_scales.each_cons(2) do |us|\r\n if us[0][0]<=scale && us[1][0]>scale\r\n return self.send us[0][1].name\r\n end\r\n end\r\n end", "def melody scales\n oct = rand(4) + 2\n scales.scale.map {|note|\n MidiCalc.new(Pitch.new(note, oct)).pc_to_midi\n }.shuffle\nend", "def scale(number, range, zero)\n if range.zero?\n # No scaling\n lambda do |scale|\n [number, scale, true]\n end\n else\n # Shrink range exponentially, and -1 + scale reduces the\n # rng_ to 0 when scale = 0, but rng_ = range when scale = 1.\n lambda do |scale|\n rng_ = (range ** scale) - 1 + scale\n pct = (number - zero) / range\n [zero + rng_ * pct, scale, true]\n end\n end\n end", "def channels; end", "def rms(frames, channels=1)\n rms_frame = []\n (0..channels-1).each do |channel|\n rms_frame << channel_rms(frames, channel)\n end\n rms_frame\n end", "def scaledRand(rand, scale)\n proc {\n rand.call() * scale\n }\nend", "def scale\n self['scale']\n end", "def get_other_scale(scale)\n if scale.downcase == 'c'\n 'f'\n else\n 'c'\n end\n end", "def scaleTo2 (target_dims_meters)\n bb = Sketchup.active_model.bounds \n car_height = bb.depth\n min_mirror_z = 0.50 * car_height # mirrors are definitely higher than this\n\n adjusted_car_width = 0 # init with large number\n adjusted_car_min = 0\n for part in Sketchup.active_model.definitions\n max_corner = part.bounds.max\n min_corner = part.bounds.min\n # \"max_corner.z > 0\" -- a hack to remove some exhilary shit\n if max_corner.z > 0 and max_corner.z < bb.depth * min_mirror_z\n adjusted_car_width = [max_corner.y.to_m, adjusted_car_width].max\n #puts part.name, max_corner, adjusted_car_width\n adjusted_car_min = [min_corner.y.to_m, adjusted_car_min].min\n #puts part.name, max_corner, adjusted_car_width\n end\n end\n raise 'adjusted_car_width < 0' if adjusted_car_width == 0\n puts \"adjusted max: #{adjusted_car_width}, min: #{adjusted_car_min}\"\n #puts \"car_width: #{bb.height.to_m}, adjusted: #{adjusted_car_width}\"\n\n # here's what we want to have\n target_car_width = target_dims_meters[1]\n # we only use car width (y) as the most reliable (no extra stuff on sides)\n scale = target_car_width / adjusted_car_width\n origin = Geom::Point3d.new 0,0,0\n transform = Geom::Transformation.scaling origin, scale\n entities = Sketchup.active_model.entities\n #entities.transform_entities(transform, entities.to_a)\n\nend", "def scaling\n @scaling || 0.0\n end", "def normalize(data)\n return [] if data.empty?\n min_power = max_power = data[0][:spectrum][0]\n data.each do |dp|\n min_power = [min_power, dp[:spectrum].min].min\n max_power = [max_power, dp[:spectrum].max].max\n end\n puts \"minmax #{min_power} #{max_power}\"\n #edited to * 10 instead of *100\n data.map{|dp| dp[:spectrum] = dp[:spectrum].map{|dsp| (10*(dsp - min_power)/max_power).round(1)}; dp}\nend", "def unscaleX(x)\n return @device.unscaleX(x) ;\n end", "def apply_unit(v, col_scale)\n\t\ta, b = /(.*\\d)\\s*_?\\s*([mnul]{,3})\\s*$/.match(v)[1..2]\n\t\t#raise \"invalid size unit\" unless b\n\t\ts = Dim_Hash[b] || col_scale\n\t\treturn Float(a) * s # may raise exception if a is not a valid float\n\tend", "def scale(*args)\n r = Rect.new x, y, w, h\n r.resolution = r.resolution * Vector2[args.singularize]\n r\n end", "def scaled_using(source, destination)\n Scale.transform(self).using(source, destination)\n end", "def update!(**args)\n @scale = args[:scale] if args.key?(:scale)\n @translate = args[:translate] if args.key?(:translate)\n end", "def scale(f)\n @x *= f\n @y *= f\n self\n end", "def peak(frames, channels=1)\n peak_frame = []\n (0..channels-1).each do |channel|\n peak_frame << channel_peak(frames, channel)\n end\n peak_frame\n end", "def transformed(p)\r\n (0..1).map do |i|\r\n (p[i] - @old_center[i])*@zoom + (@center[i] - @old_center[i])*@zoom + @old_center[i]\r\n end\r\n end", "def blend(c1, c2)\n (0..2).map{ |i| (c1[i]*(0xFF-c2[3]) + c2[i]*c2[3]) >> 8 }\n end", "def color_channels\n color == 2 ? 3 : 4\n end", "def transform(manHatDist)\r\n\t\tpixel_on = []\r\n\t\tmanHatDist.times do\r\n\t\[email protected]_index do |row, row_index|\r\n\t\t\trow.each.with_index do |pixel, col_index|\r\n\t\t\t\tif pixel == 1\r\n\t\t\t\t\tpixel_on.push [row_index, col_index]\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\tend\r\n\t\tpixel_on.each do |touple|\r\n\t\t\t#blur(*touple)\r\n\t\t\trow_index, col_index = touple\r\n\t\t\tblur(row_index, col_index)\r\n\t\tend\r\n\tend\r\n\tend", "def blur_pixel(ones_array)\n ones_array.each do |point_array|\n # => breaks the point_array inner arrays into its two parts --\n # => wouldn't work if there was stuff in the middle\n row = point_array.first\n col = point_array.last\n # => this is where the transformation happens\n @image_array[row - 1][col] = 1\n @image_array[row][col - 1] = 1 unless col == 0\n @image_array[row + 1][col] = 1 unless row >= @num_row - 1\n @image_array[row][col + 1] = 1 unless col >= @num_col - 1 \n\n end\n end", "def scale_by num\n min = 0.001\n num = min if num < min and num > -min\n self.x = self.x / num\n self.y = self.y / num\n self\n end", "def scale(key, value)\n (value - @smallest_seen_values[key]) / (@largest_seen_values[key] - @smallest_seen_values[key])\n end", "def normalize(data)\n return [] if data.empty?\n min_power = max_power = data[0][:spectrum][0]\n data.each do |dp|\n min_power = [min_power, dp[:spectrum].min].min\n max_power = [max_power, dp[:spectrum].max].max\n end\n\n data.map{|dp| dp[:spectrum] = dp[:spectrum].map{|dsp| (100*(dsp - min_power)/max_power).round(1)}; dp}\nend", "def scale_vertex(vertex, options = {})\n offset = options[:offset] || [0,0]\n [(vertex[0]+offset[0])*14/9, (vertex[1]+offset[1])*20+5]\n end", "def set_fixed_scale(vmin,vmax,divisions=5,vxmin=0,vxmax=0,xdivisions=5)\n @vmin = vmin\n @vmax = vmax\n @divisions = divisions\n #TODO check\n #if (!vxnin == 0 )\n if (vxnin != 0 )\n @vxmin = vxmin\n @vxmax = vxmax\n @xdivisions = xdivisions\n end\n end", "def scale(example)\n example.length.times do |i|\n # note that if the vector outside training set contains new feature value\n # (and training set contained only one other value) it'll be ignored\n @example_template[i].value = @max_vector[i] == @min_vector[i] ? @max_vector[i]\n : (example[i] - @min_vector[i]).to_f / (@max_vector[i] - @min_vector[i])\n end\n @example_template\n end", "def transform(row_index,col_index)\n\n if row_index-1 >= 0\n @image[row_index-1][col_index] = 1\n end\n if col_index - 1 >= 0\n @image[row_index][col_index-1] = 1\n end\n if row_index + 1 <= @image.length - 1\n @image[row_index+1][col_index] = 1\n end\n if col_index + 1 <= @image[row_index].length - 1\n @image[row_index][col_index+1] = 1\n end\n\n end", "def create_scale(*args)\n end", "def inqscale\n inquiry_int { |pt| super(pt) }\n end" ]
[ "0.608543", "0.5769861", "0.5751357", "0.5574123", "0.55465776", "0.55179185", "0.5439834", "0.5407834", "0.53989154", "0.53838366", "0.5382499", "0.5371986", "0.53586715", "0.5330766", "0.5267122", "0.52386886", "0.5177725", "0.51776254", "0.5172271", "0.5164977", "0.5160771", "0.5159466", "0.51575136", "0.50607115", "0.50125706", "0.4976371", "0.49504015", "0.49308544", "0.49298823", "0.49151462", "0.4899821", "0.48894745", "0.48510718", "0.48460495", "0.48236257", "0.47925794", "0.47907642", "0.4787411", "0.47845876", "0.4777702", "0.47747055", "0.47678617", "0.4764437", "0.47636858", "0.47636858", "0.47495544", "0.47365558", "0.47360605", "0.47342035", "0.471473", "0.47031376", "0.46985653", "0.4692412", "0.46902657", "0.4685767", "0.46855643", "0.46812615", "0.46811762", "0.46799138", "0.4677793", "0.46727362", "0.46725136", "0.46553522", "0.4652161", "0.46252802", "0.46247178", "0.46245086", "0.46209303", "0.461834", "0.4615047", "0.45945218", "0.45843", "0.45770967", "0.45737273", "0.45725685", "0.45708942", "0.45655227", "0.45573583", "0.45551208", "0.45436066", "0.45254597", "0.45115528", "0.4509925", "0.45022726", "0.44961944", "0.44937932", "0.4492784", "0.4476147", "0.4474549", "0.44716224", "0.44670117", "0.44647762", "0.44565094", "0.44501263", "0.44469392", "0.44380188", "0.44351363", "0.44342566", "0.4431334", "0.44276178" ]
0.68901503
0
Calling the validation chain should only happen once. If you make changes that may alter the result of valid?, consider instanciating another service instead of running the same service again. You should never be able to call valid? on a service that has been executed by skipping validations. That means that whenever the service has been executed: It has been validated when calling run You can't call valid? on it because you called run! and didn't get the instance back
def valid? return @_valid unless @_valid.nil? @_valid = super end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate\n\t\t\tif !(valid?)\n\t\t\t\treturn Core::ServiceError.new(\"Validation failed.\")\n\t\t\tend\n\n\t\t\treturn Core::ServiceSuccess.new\t\t\n\t\tend", "def validate\n\t\t\tif !(valid?)\n\t\t\t\treturn Core::ServiceError.new(\"Validation failed.\")\n\t\t\tend\n\n\t\t\treturn Core::ServiceSuccess.new\t\t\n\t\tend", "def run_validations\n run_callbacks :validation do\n failed_validators.clear\n validation_chain.run(self)\n @validated = true\n end\n end", "def validate(validator, *args); validation_chain.validate(validator, *args); end", "def validate\n errors.clear\n self.class.validator.invoke self\n end", "def run_validations\n true\n end", "def validate!\n # pass\n end", "def validate\n errors.clear\n instance_exec(&validate_block) if validate_block && get\n end", "def validate\n\t\t\tif !(valid?)\n\t\t\t\treturn Core::ServiceError.new(\"Mandatory fields not available\")\n\t\t\tend\n\t\t\treturn Core::ServiceSuccess.new\n\t\tend", "def validate\n\t\t\tif !(valid?)\n\t\t\t\treturn Core::ServiceError.new(\"Mandatory fields not available\")\n\t\t\tend\n\t\t\treturn Core::ServiceSuccess.new\n\t\tend", "def validate\r\n validate! rescue false\r\n end", "def _valid?(opts)\n return errors.empty? if frozen?\n errors.clear\n called = false\n # skip_validate = opts[:validate] == false # SEQUEL5\n around_validation do\n called = true\n if before_validation == false\n Sequel::Deprecation.deprecate(\"Having before_validation return false to mark the object as invalid\", \"Instead, call cancel_action inside before_validation\")\n raise_hook_failure(:before_validation)\n else\n validate # unless skip_validate # SEQUEL5\n after_validation\n end\n end\n # return true if skip_validate # SEQUEL5\n if called\n errors.empty?\n else\n raise_hook_failure(:around_validation)\n end\n end", "def validate!; end", "def validate!; end", "def validate!; end", "def validate!\n validate_redis\n validate_workers\n validate_options\n end", "def do_validation \n return true if self.ok\n set_ok\n self.ok\n end", "def validated; end", "def validated?; end", "def validate(instance)\n validator.invoke instance\n end", "def _valid?(opts)\n return errors.empty? if frozen?\n errors.clear\n called = false\n skip_validate = opts[:validate] == false\n around_validation do\n called = true\n before_validation\n validate unless skip_validate\n after_validation\n end\n\n return true if skip_validate\n\n if called\n errors.empty?\n else\n raise_hook_failure(:around_validation)\n end\n end", "def validate\n # add errors if not validate\n end", "def run_validation(vmode)\n validate(vmode)\n self\n end", "def should_validate\n validation_trigger\n end", "def run_validations!\n run_callbacks(:validation) do\n super\n end\n end", "def validate!\n self.class.validators.each do |validator|\n validator.validate!(self)\n end\n nil\n end", "def validate\n \n \n end", "def valid?\n return validate\n end", "def validate\n # perform presence related validations here\n # result object is returned\n service_params_list = ServicesBase.get_service_params(self.class.to_s)\n missing_mandatory_params = []\n service_params_list[:mandatory].each do |mandatory_param|\n missing_mandatory_params << \"missing_#{mandatory_param}\" if @params[mandatory_param].to_s.blank?\n end if service_params_list[:mandatory].present?\n\n return error_with_identifier('mandatory_params_missing',\n 'sb_1',\n missing_mandatory_params\n ) if missing_mandatory_params.any?\n\n success\n end", "def perform\n\n r = validate\n return r unless r.success?\n\n process_hook\n\n end", "def validate; end", "def validate; end", "def validate; end", "def validate; end", "def validate\n validations = self.class.meta_eval { @validations }\n\n validations.each do |v|\n raise \"#{self.class}.#{v[:name]} #{v[:options][:message]}\" unless\n v[:proc].call(send(v[:name]))\n end\n\n self\n end", "def validate!\n true\n end", "def valid?(context = nil)\n current_context, self.validation_context = validation_context, context\n errors.clear\n run_validations!\n ensure\n self.validation_context = current_context\n end", "def validation; end", "def validation; end", "def perform_validation?\n self.skip_validation == true ? false : true\n end", "def validator; end", "def validates?\n reset\n @passed = catch :validation_done do\n validate\n pass\n end\n end", "def be_valid\n BeValid.new\n end", "def run_validations(context)\n __run_validations__(context)\n end", "def valid; end", "def valid?\n validate\n end", "def valid!\n super\n valid_entities!\n valid_action_instances!\n entities.each(&:valid!)\n action_instances.each(&:valid!)\n end", "def validate\n original_status = self.validation_status\n self.transaction do\n self.validation_status = :validating\n self.validation.clear_errors\n bagit = BagIt::Bag.new(self.path)\n unless bagit.complete? and bagit.consistent?\n self.validation.be_invalid_with_errors(bagit.errors)\n return\n end\n self.validation_status = :valid\n end\n rescue Exception\n self.validation_status = original_status\n raise\n end", "def validate\r\n\r\n end", "def validate!\n\t\t\t\treturn true\n\t\t\tend", "def perform_validation\n raise NotImplementedError\n end", "def validate\n\n end", "def valid?\n run_validation\n @errors.empty?\n end", "def validate_build\n end", "def chain(params = {}, &block); validation_chain.chain(params, &block); end", "def validate\n valid?\n end", "def is_valid; end", "def validate\n end", "def validate\n end", "def validate\n end", "def validate\n self._errors = {}\n self.run_hook :validate\n not self.errors?\n end", "def valid?; end", "def valid?; end", "def valid?; end", "def valid?; end", "def valid?; end", "def valid?\n run_validations unless validated?\n failed_validators.list.empty?\n end", "def validate!\n MiddlewareValidator.new(middleware).validated_provides!\n end", "def validate\n validator_class.new(self).validate\n end", "def valid?(*)\n _run_validation_callbacks { super }\n _send_to_each_embedded_document(:_run_validation_callbacks)\n end", "def validate\n validate_amount\n validate_game\n validate_period\n end", "def valid?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n end", "def validate\n validate_root\n validate_associated\n valid?\n end", "def valid?\n run_validations!\n true\n rescue InvalidTaskError => e\n false\n end", "def valid?\n begin\n validate\n true\n rescue\n false\n end\n end", "def validate\n @validated = validated_statically? unless validated?\n @validated = validated_dynamically? unless validated?\n @validated\n end", "def validate\n end", "def validate\n end", "def validate\n end", "def validate\n end", "def valid?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n end", "def is_valid\n return true\n end", "def defer_validation(&block)\n #p [:defer_validation, self.validation_on, @this]\n old_validation = self.validation_on\n self.validation_on = false\n v = nil\n begin\n v = @this.instance_eval(&block)\n ensure\n self.validation_on = old_validation\n end\n @this.validate!(false)\n v\n end", "def validate\n @invalid=false\n end", "def valid?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n end", "def validate\r\n @invalid=false\r\n end", "def valid?\n self.errors = Mongomatic::Errors.new\n do_callback(:before_validate)\n check_required_fields\n validate\n do_callback(:after_validate)\n self.errors.empty?\n end", "def pre_validation\n\n\n end", "def be_valid\n ArBeValid.new\n end", "def valid?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n end", "def pre_validation\n\n end", "def validate_me(validator)\n validator.validate self, checks\n end", "def valid\n instance.stubs(:valid?).returns(true)\n instance.stubs(:save).returns(true)\n instance.stubs(:save!).returns(true)\n end", "def refute_valid\n @validator = validator\n refute @validator.validate(data_sample, fail_fast: true)\n refute @validator.validate(data_sample, fail_fast: false)\n end", "def valid\n @valid\n end", "def valid?\n validate!\n true\n rescue\n false\n end", "def patch_valid?\n validate(false).empty?\n end", "def valid?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n end", "def valid?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n end", "def valid?\n end", "def valid?\n end" ]
[ "0.71012247", "0.71012247", "0.6915862", "0.6857475", "0.6821005", "0.6714581", "0.66524214", "0.66137856", "0.65866315", "0.65866315", "0.6582796", "0.65666926", "0.6566087", "0.6566087", "0.6566087", "0.64854294", "0.64663076", "0.6425699", "0.6415018", "0.64129716", "0.633458", "0.6284904", "0.6281411", "0.626947", "0.62413573", "0.6239957", "0.6239548", "0.62243253", "0.62210864", "0.62077147", "0.61985", "0.61985", "0.61985", "0.61985", "0.6191678", "0.6183895", "0.6173537", "0.616812", "0.616812", "0.6159807", "0.61577916", "0.61443365", "0.61404705", "0.6135603", "0.61115766", "0.6105176", "0.6105119", "0.60917294", "0.60877967", "0.6083964", "0.60796046", "0.60715365", "0.6065176", "0.60612726", "0.60610604", "0.6057506", "0.6057397", "0.60406435", "0.60406435", "0.60406435", "0.6034216", "0.6033021", "0.6033021", "0.6033021", "0.6033021", "0.6033021", "0.6032909", "0.60140866", "0.60099155", "0.600136", "0.59920484", "0.59839606", "0.5979934", "0.59744716", "0.59740937", "0.596965", "0.59692144", "0.5955246", "0.5955246", "0.5955246", "0.59507823", "0.59481853", "0.5928361", "0.5924381", "0.5915194", "0.5914286", "0.59091145", "0.59064525", "0.5900057", "0.588967", "0.5873558", "0.58728254", "0.5862924", "0.58591676", "0.5858455", "0.5850069", "0.58471566", "0.5846849", "0.5846849", "0.58447045", "0.58447045" ]
0.0
-1
Transaction Interface Starts a database transaction.
def begin_db_transaction log('BEGIN', 'TRANSACTION') { @connection.begin } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def begin_db_transaction\n execute(\"BEGIN\")\n end", "def begin_db_transaction\n execute(\"BEGIN\")\n end", "def start_transaction!\n fail DbMod::Exceptions::AlreadyInTransaction if @in_transaction\n @in_transaction = true\n\n query 'BEGIN'\n end", "def begin_db_transaction\n log('begin transaction', nil) do\n begin_isolated_db_transaction(default_transaction_isolation)\n end\n end", "def begin_db_transaction\n # PG driver doesn't really do anything on setAutoCommit(false)\n # except for commit-ing a previous pending transaction if any\n log('/* BEGIN */') { @connection.begin }\n end", "def begin_db_transaction\n @transaction = @connection.transaction('READ COMMITTED')\n end", "def begin_db_transaction() end", "def begin_db_transaction() end", "def transaction(start_db_transaction=true)\n yield\n end", "def transaction\n start_transaction\n\n yield\n ensure\n end_transaction if transaction_started?\n end", "def begin_transaction\n return System.begin_transaction\n end", "def TransactionBegin()\n\[email protected](\"BEGIN\")\nend", "def transaction\n begin\n if block_given?\n begin_db_transaction\n result = yield\n commit_db_transaction\n result\n end\n rescue Exception => database_transaction_rollback\n rollback_db_transaction\n raise\n end\n end", "def transaction(mode = :deferred, &block)\n @db.transaction(mode, &block)\n end", "def transaction(start_db_transaction = true)\n transaction_open = false\n begin\n if block_given?\n if start_db_transaction\n begin_db_transaction\n transaction_open = true\n end\n yield\n end\n rescue Exception => database_transaction_rollback\n if transaction_open\n transaction_open = false\n rollback_db_transaction\n end\n raise unless database_transaction_rollback.is_a? ActiveRecord::Rollback\n end\n ensure\n if transaction_open\n begin\n commit_db_transaction\n rescue Exception => database_transaction_rollback\n rollback_db_transaction\n raise\n end\n end\n end", "def transaction(opts={}, &blk)\n Toshi.db.transaction(opts, &blk)\n end", "def begin_db_transaction\n @connection.autocommit = false\n end", "def transaction(options={}, &block)\n connection.transaction(options.update(:requires_new => true), &block)\n end", "def begin_transaction_sql\n SQL_BEGIN\n end", "def begin_transaction_sql\n SQL_BEGIN\n end", "def transaction\n start\n yield self\n rescue Object => ex\n rollback\n debug \"#{ex.class}: #{ex.message}\"\n ex.backtrace.each { |line| debug line }\n else\n commit\n end", "def transaction\n @database.transaction { yield self }\n end", "def begin_db_transaction() \n log('Opening boxcar', 'begin_db_transaction()')\n @command_boxcar = []\n end", "def transaction; end", "def transaction; end", "def transaction; end", "def begin_transaction(conn, opts=OPTS)\n if in_savepoint?(conn)\n _trans(conn)[:savepoints][-1][:obj] = log_connection_yield('Transaction.savepoint', conn){conn.set_savepoint}\n else\n log_connection_yield('Transaction.begin', conn){conn.setAutoCommit(false)}\n set_transaction_isolation(conn, opts)\n end\n end", "def transaction(&block)\n self['AutoCommit'] = false\n self.do_transaction(&block)\n self['AutoCommit'] = true\n end", "def start\n raise TransactionError, \"Transaction already opened.\" unless @id.nil?\n\n ensure_service!\n tx_res = service.begin_transaction \\\n previous_transaction: @previous_transaction\n @id = tx_res.transaction\n end", "def begin_transaction(conn)\n log_info(TRANSACTION_BEGIN)\n conn.setAutoCommit(false)\n conn\n end", "def begin_transaction(conn, opts={})\n set_transaction_isolation(conn, opts)\n super\n end", "def transaction(&block); end", "def start_transaction\n NewRelic::Agent.instance.events.notify(:start_transaction)\n end", "def transaction(&block)\n ActiveRecord::Base.transaction(&block)\n end", "def start(&block)\n res = database.execute_request(\n :post,\n '/transaction/begin',\n headers: { content_type: 'text/plain' }\n ).body\n self.id = res\n @state = :started\n instance_eval(&block) if block_given?\n self\n end", "def begin_transaction(conn, opts={})\n log_yield(TRANSACTION_BEGIN){conn.setAutoCommit(false)}\n conn\n end", "def start(&block)\n transaction.start do\n run_callbacks(:transaction, &block)\n end\n end", "def begin\n db.transaction do\n yield\n end\n end", "def transaction(&block)\n block.call\n end", "def begin_transaction(conn, opts=OPTS)\n log_connection_yield('Transaction.begin', conn){conn.autocommit = false}\n set_transaction_isolation(conn, opts)\n end", "def trans\n\t\tbegin\n\t app = Aas::Application\n\t doc = app.DocumentManager.MdiActiveDocument\n\t db = doc.Database\n\t tr = doc.TransactionManager.StartTransaction\n\t yield tr, db\n\t\n\t tr.Commit\n\t tr.Dispose\n\t rescue Exception => e\n\t puts_ex e\n\t ensure\n\t tr.Dispose \n\t end\t\n\tend", "def within_transaction; end", "def within_transaction; end", "def transaction\n start_transaction!\n\n result = yield\n\n query 'COMMIT'\n\n result\n rescue\n query 'ROLLBACK'\n raise\n\n ensure\n end_transaction!\n end", "def begin_isolated_db_transaction(isolation)\n log(\"BEGIN ISOLATED - #{isolation}\", 'TRANSACTION') { @connection.begin(isolation) }\n end", "def begin_isolated_db_transaction(isolation)\n @connection.transaction transaction_isolation_levels.fetch(isolation, isolation)\n end", "def transaction(&block)\n begin\n @store.transaction\n block.call(@store)\n @store.commit\n rescue SQLite3::Exception => exception\n raise \"SQLite exception: #{exception}\"\n end\n end", "def transaction(&block)\n yield\n commit\n end", "def commit_db_transaction\n execute(\"COMMIT\")\n end", "def commit_db_transaction\n execute(\"COMMIT\")\n end", "def commit_db_transaction() end", "def commit_db_transaction() end", "def transaction(&block)\n @in_transaction += 1\n begin\n yield self\n self.commit if @in_transaction > 0\n rescue => e\n self.rollback\n raise e\n ensure\n @in_transaction -= 1 unless @in_transaction == 0\n end\n end", "def begin_isolated_db_transaction(isolation)\n name = isolation.to_s.upcase; name.sub!('_', ' ')\n log(\"/* BEGIN */; SET TRANSACTION ISOLATION LEVEL #{name}\") do\n @connection.begin(isolation)\n end\n end", "def begin_transaction\n if @transaction_stack.empty?\n if @transaction_thread\n PEROBS.log.fatal 'transaction_thread must be nil'\n end\n @transaction_thread = Thread.current\n # The new transaction is the top-level transaction. Flush the write\n # buffer to save the current state of all objects.\n flush\n else\n # Nested transactions are currently only supported within the same\n # thread. If we are in another thread, raise TransactionInOtherThread\n # to pause the calling thread for a bit.\n if @transaction_thread != Thread.current\n raise TransactionInOtherThread\n end\n # Save a copy of all objects that were modified during the enclosing\n # transaction.\n @transaction_stack.last.each do |id|\n @transaction_objects[id]._stash(@transaction_stack.length - 1)\n end\n end\n # Push a transaction buffer onto the transaction stack. This buffer will\n # hold a reference to all objects modified during this transaction.\n @transaction_stack.push(::Array.new)\n end", "def start_transaction(**options)\n get_current_hub&.start_transaction(**options)\n end", "def transaction\n raise Mysql::Error, 'Not Connected' if @my.nil?\n\n if block_given?\n begin\n @my.query('START TRANSACTION WITH CONSISTENT SNAPSHOT')\n yield # Start executing the query black.\n @my.query('COMMIT')\n rescue Mysql::Error => e\n @my.query('ROLLBACK')\n raise e\n end\n end\n end", "def with_transaction(&block)\n base_model.transaction(&block)\n end", "def commit_transaction(tx)\n tx.execute\n end", "def transaction(object)\n object.db.transaction {raise ::Sequel::Error::Rollback unless yield}\n end", "def transaction\n sanity_check\n raise InterfaceError, \"No block given\" unless block_given?\n\n commit\n begin\n yield self\n commit\n rescue Exception\n rollback\n raise\n end\n end", "def use_transactions; end", "def use_transactions; end", "def transaction( &block )\n connect do | conn |\n conn.transaction do | conn |\n yield SqlRunner.new(SingleConnectionPool.new( conn ))\n end\n end\n end", "def transaction(options = {}, &block)\n @klass.connection.run_queries_on_shard(@shard) do\n @klass = @klass.connection.transaction(options, &block)\n end\n end", "def begin_transaction read_only: nil, previous_transaction: nil, read_time: nil\n if read_only\n transaction_options = Google::Cloud::Datastore::V1::TransactionOptions.new\n transaction_options.read_only = \\\n Google::Cloud::Datastore::V1::TransactionOptions::ReadOnly.new \\\n read_time: read_time_to_timestamp(read_time)\n\n end\n if previous_transaction\n transaction_options ||= \\\n Google::Cloud::Datastore::V1::TransactionOptions.new\n rw = Google::Cloud::Datastore::V1::TransactionOptions::ReadWrite.new(\n previous_transaction: previous_transaction.encode(\"ASCII-8BIT\")\n )\n transaction_options.read_write = rw\n end\n service.begin_transaction project_id: project, database_id: database, transaction_options: transaction_options\n end", "def commit_db_transaction\n @transaction = @connection.commit\n end", "def begin_transaction(mutable: false, graph_name: nil)\n raise NotImplementedError\n end", "def transaction(options = {}, &block)\n run_on_shard { @klass = klass.transaction(options, &block) }\n end", "def ddl_transaction(migration)\n if use_transaction?(migration)\n ActiveRecord::Base.transaction { yield }\n else\n yield\n end\n end", "def transaction(&block)\n db\n persister\n\n result = nil\n start_time = Time.now\n begin\n db.transaction(:rollback => :reraise, :isolation => :repeatable,\n :retry_on => @retry_on_error, :num_retries => 3) do\n result = yield block\n end\n total = Time.now.to_ms - start_time.to_ms\n debug \"Transaction committed (#{total} ms)\"\n result\n rescue StandardError => e\n total = Time.now.to_ms - start_time.to_ms\n warn \"Transaction failed (#{total} ms)\"\n raise e\n ensure\n GC.start\n end\n end", "def scaffold_transaction(&block)\n transaction(&block)\n end", "def transaction(opts = {})\n commit, rollback = start_transaction! opts\n tx_depth = nil\n begin\n if Pacer.verbose == :very\n tx_depth = threadlocal_graph_info[:dx_depth]\n puts \"--#{self.class.name} transaction #{ tx_depth } --> \"\n puts caller[0,3]\n end\n r = yield commit, rollback\n commit.call(false)\n r\n rescue Exception => e\n rollback.call e.message\n raise\n ensure\n puts \"--#{self.class.name} #{ tx_depth } <-- \" if Pacer.verbose == :very\n finish_transaction!\n end\n end", "def restart_transaction\n ActiveRecord::Base.connection.execute(\"COMMIT\")\n ActiveRecord::Base.connection.execute(\"BEGIN\")\n end", "def start\n raise \"Not implemented\"\n true if @transaction_nesting < 1\n @transaction_nesting += 1\n end", "def begin\n self.transaction_count += 1\n end", "def transaction\n raise Mysql2::Error, 2002 if @my.nil?\n\n if block_given?\n begin\n @my.query('START TRANSACTION WITH CONSISTENT SNAPSHOT')\n yield # Start executing the query black.\n @my.query('COMMIT')\n rescue Mysql2::Error => e\n @my.query('ROLLBACK')\n raise e\n end\n end\n end", "def commit_db_transaction\n log('COMMIT', 'TRANSACTION') { @connection.commit }\n end", "def in_transaction(opts = {})\n yield\n end", "def transaction(&block)\n yield\n end", "def transaction(&block)\n yield\n end", "def transaction(*sqls)\n begin\n db = SQLite3::Database.new(@@db_file)\n @@_set_db_handler.call(db)\n db.transaction do\n sqls.each do |sql|\n db.execute(sql)\n end\n end\n ensure\n db.close\n end\n end", "def transaction(opts={:auto_enable => false})\n @transaction_level||=0\n @transaction_level+=1\n session do\n raise_if_transaction_running\n @transaction ||= true\n raise Error.cannot_obtain_transaction_lock if not lock_transaction\n begin\n yield\n # get_transaction in case cfgsave or cfgenable was run in transaction block\n # if there is no transaction we do not need to run it\n # if there is transaction but opend by someone else then t\n cfg_save if @transaction_level==1 && get_transaction\n rescue => e\n abort_transaction\n raise e\n end \n end\n ensure\n @transaction_level-=1\n @transaction = nil if @transaction_level==0\n end", "def rollback_db_transaction() end", "def rollback_db_transaction() end", "def begin\n raise \"Illegal state for begin: #{@state}\" unless @state == :none\n each_adapter(:connect_adapter, [:log_fatal_transaction_breakage])\n each_adapter(:begin_adapter, [:rollback_and_close_adapter_if_begin, :close_adapter_if_none])\n @state = :begin\n end", "def commit_transaction(tx)\n tx.execute(self)\n end", "def with_transaction\n ActiveRecord::Base.transaction { yield }\n end", "def commit_db_transaction\n @connection.commit\n @connection.autocommit = true\n end", "def within_transaction(object); end", "def transaction\n raise ArgumentError, 'No block was given' unless block_given?\n\n with_client do |client|\n begin\n client.query('BEGIN')\n yield client\n client.query('COMMIT')\n rescue StandardError => e\n client.query('ROLLBACK')\n raise e\n end\n end\n end", "def add_to_transaction(*)\n @connection.add_transaction_record(self)\n end", "def begin\n new_transaction = Transaction.new(@data)\n\n # Record nested transactions in teh parent transactions buffer\n if current_transaction\n current_transaction.add_nested_transaction(new_transaction)\n end\n\n @all_transactions << new_transaction\n end", "def run_in_transaction isolation\n if isolation\n Base.transaction isolation: isolation do\n yield\n end\n else\n yield\n end\n end", "def run_in_transaction isolation\n if isolation\n Base.transaction isolation: isolation do\n yield\n end\n else\n yield\n end\n end", "def transaction\n use do |connection|\n connection.transaction do |conn|\n begin\n yield conn\n rescue Rollback\n return\n end\n end\n end\n end", "def commit()\n check_return_code(PureHailDB.ib_trx_commit(@trx_ptr))\n end", "def commit_db_transaction\n log('commit transaction', nil) { @connection.commit }\n end", "def commit_transaction_sql\n SQL_COMMIT\n end", "def commit_transaction_sql\n SQL_COMMIT\n end" ]
[ "0.82547086", "0.82547086", "0.82272166", "0.8130013", "0.7938806", "0.78634214", "0.76985353", "0.76985353", "0.7680118", "0.7668149", "0.7607679", "0.75491047", "0.73921615", "0.7342174", "0.72824055", "0.72412956", "0.723066", "0.7190104", "0.7186791", "0.7186791", "0.7126731", "0.71101624", "0.70925224", "0.70897806", "0.70897806", "0.70897806", "0.70536184", "0.70477456", "0.7040094", "0.70127386", "0.69984317", "0.694419", "0.6907283", "0.69052625", "0.6889404", "0.6880435", "0.6876929", "0.68564326", "0.6842931", "0.6831562", "0.6831556", "0.6798051", "0.6798051", "0.6762566", "0.6724226", "0.6720955", "0.67105335", "0.6706927", "0.6690796", "0.6690796", "0.6673466", "0.6673466", "0.6665293", "0.6655496", "0.66549915", "0.66437626", "0.6617397", "0.6616097", "0.66150653", "0.65885234", "0.65821695", "0.6569513", "0.6569513", "0.6566764", "0.6563022", "0.65515536", "0.654706", "0.654434", "0.6541154", "0.65266806", "0.65221316", "0.65220225", "0.6517305", "0.6510299", "0.64997494", "0.64753103", "0.64693123", "0.6466236", "0.64324224", "0.638982", "0.638982", "0.63761234", "0.63690984", "0.63637567", "0.63637567", "0.63632184", "0.6359405", "0.6345863", "0.63389754", "0.6331806", "0.6325638", "0.63089097", "0.6300229", "0.6271348", "0.6271348", "0.62651855", "0.62569827", "0.6244886", "0.6232903", "0.6232903" ]
0.8211707
3
Starts a database transaction.
def begin_isolated_db_transaction(isolation) log("BEGIN ISOLATED - #{isolation}", 'TRANSACTION') { @connection.begin(isolation) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_transaction!\n fail DbMod::Exceptions::AlreadyInTransaction if @in_transaction\n @in_transaction = true\n\n query 'BEGIN'\n end", "def begin_db_transaction\n execute(\"BEGIN\")\n end", "def begin_db_transaction\n execute(\"BEGIN\")\n end", "def begin_db_transaction\n log('begin transaction', nil) do\n begin_isolated_db_transaction(default_transaction_isolation)\n end\n end", "def begin_db_transaction\n log('BEGIN', 'TRANSACTION') { @connection.begin }\n end", "def begin_db_transaction\n # PG driver doesn't really do anything on setAutoCommit(false)\n # except for commit-ing a previous pending transaction if any\n log('/* BEGIN */') { @connection.begin }\n end", "def begin_db_transaction\n @transaction = @connection.transaction('READ COMMITTED')\n end", "def transaction(start_db_transaction=true)\n yield\n end", "def begin_db_transaction() end", "def begin_db_transaction() end", "def TransactionBegin()\n\[email protected](\"BEGIN\")\nend", "def begin_transaction\n return System.begin_transaction\n end", "def start(&block)\n res = database.execute_request(\n :post,\n '/transaction/begin',\n headers: { content_type: 'text/plain' }\n ).body\n self.id = res\n @state = :started\n instance_eval(&block) if block_given?\n self\n end", "def begin_db_transaction\n @connection.autocommit = false\n end", "def begin_db_transaction() \n log('Opening boxcar', 'begin_db_transaction()')\n @command_boxcar = []\n end", "def transaction\n start_transaction\n\n yield\n ensure\n end_transaction if transaction_started?\n end", "def startRun\n db_cached_connect\n\n @dbh.do(\"BEGIN TRANSACTION;\")\n @dbh.do(\"SELECT startRun();\")\n end", "def transaction(mode = :deferred, &block)\n @db.transaction(mode, &block)\n end", "def transaction(start_db_transaction = true)\n transaction_open = false\n begin\n if block_given?\n if start_db_transaction\n begin_db_transaction\n transaction_open = true\n end\n yield\n end\n rescue Exception => database_transaction_rollback\n if transaction_open\n transaction_open = false\n rollback_db_transaction\n end\n raise unless database_transaction_rollback.is_a? ActiveRecord::Rollback\n end\n ensure\n if transaction_open\n begin\n commit_db_transaction\n rescue Exception => database_transaction_rollback\n rollback_db_transaction\n raise\n end\n end\n end", "def begin_transaction_sql\n SQL_BEGIN\n end", "def begin_transaction_sql\n SQL_BEGIN\n end", "def begin\n db.transaction do\n yield\n end\n end", "def start(&block)\n transaction.start do\n run_callbacks(:transaction, &block)\n end\n end", "def start\n raise TransactionError, \"Transaction already opened.\" unless @id.nil?\n\n ensure_service!\n tx_res = service.begin_transaction \\\n previous_transaction: @previous_transaction\n @id = tx_res.transaction\n end", "def transaction\n begin\n if block_given?\n begin_db_transaction\n result = yield\n commit_db_transaction\n result\n end\n rescue Exception => database_transaction_rollback\n rollback_db_transaction\n raise\n end\n end", "def transaction(opts={}, &blk)\n Toshi.db.transaction(opts, &blk)\n end", "def transaction\n @database.transaction { yield self }\n end", "def transaction\n start\n yield self\n rescue Object => ex\n rollback\n debug \"#{ex.class}: #{ex.message}\"\n ex.backtrace.each { |line| debug line }\n else\n commit\n end", "def begin_transaction(conn)\n log_info(TRANSACTION_BEGIN)\n conn.setAutoCommit(false)\n conn\n end", "def begin_transaction(conn, opts=OPTS)\n if in_savepoint?(conn)\n _trans(conn)[:savepoints][-1][:obj] = log_connection_yield('Transaction.savepoint', conn){conn.set_savepoint}\n else\n log_connection_yield('Transaction.begin', conn){conn.setAutoCommit(false)}\n set_transaction_isolation(conn, opts)\n end\n end", "def start_transaction\n NewRelic::Agent.instance.events.notify(:start_transaction)\n end", "def begin_isolated_db_transaction(isolation)\n name = isolation.to_s.upcase; name.sub!('_', ' ')\n log(\"/* BEGIN */; SET TRANSACTION ISOLATION LEVEL #{name}\") do\n @connection.begin(isolation)\n end\n end", "def begin_isolated_db_transaction(isolation)\n @connection.transaction transaction_isolation_levels.fetch(isolation, isolation)\n end", "def transaction(options={}, &block)\n connection.transaction(options.update(:requires_new => true), &block)\n end", "def start_transaction(**options)\n get_current_hub&.start_transaction(**options)\n end", "def transaction(*sqls)\n begin\n db = SQLite3::Database.new(@@db_file)\n @@_set_db_handler.call(db)\n db.transaction do\n sqls.each do |sql|\n db.execute(sql)\n end\n end\n ensure\n db.close\n end\n end", "def transaction\n raise Mysql::Error, 'Not Connected' if @my.nil?\n\n if block_given?\n begin\n @my.query('START TRANSACTION WITH CONSISTENT SNAPSHOT')\n yield # Start executing the query black.\n @my.query('COMMIT')\n rescue Mysql::Error => e\n @my.query('ROLLBACK')\n raise e\n end\n end\n end", "def transaction; end", "def transaction; end", "def transaction; end", "def begin_transaction(conn, opts={})\n log_yield(TRANSACTION_BEGIN){conn.setAutoCommit(false)}\n conn\n end", "def transaction(&block); end", "def begin_transaction(conn, opts={})\n set_transaction_isolation(conn, opts)\n super\n end", "def trans\n\t\tbegin\n\t app = Aas::Application\n\t doc = app.DocumentManager.MdiActiveDocument\n\t db = doc.Database\n\t tr = doc.TransactionManager.StartTransaction\n\t yield tr, db\n\t\n\t tr.Commit\n\t tr.Dispose\n\t rescue Exception => e\n\t puts_ex e\n\t ensure\n\t tr.Dispose \n\t end\t\n\tend", "def begin_transaction(conn, opts=OPTS)\n log_connection_yield('Transaction.begin', conn){conn.autocommit = false}\n set_transaction_isolation(conn, opts)\n end", "def transaction(&block)\n self['AutoCommit'] = false\n self.do_transaction(&block)\n self['AutoCommit'] = true\n end", "def transaction\n raise Mysql2::Error, 2002 if @my.nil?\n\n if block_given?\n begin\n @my.query('START TRANSACTION WITH CONSISTENT SNAPSHOT')\n yield # Start executing the query black.\n @my.query('COMMIT')\n rescue Mysql2::Error => e\n @my.query('ROLLBACK')\n raise e\n end\n end\n end", "def transaction(&block)\n ActiveRecord::Base.transaction(&block)\n end", "def transaction( &block )\n connect do | conn |\n conn.transaction do | conn |\n yield SqlRunner.new(SingleConnectionPool.new( conn ))\n end\n end\n end", "def commit_db_transaction() end", "def commit_db_transaction() end", "def transaction(&block)\n block.call\n end", "def transaction(&block)\n begin\n @store.transaction\n block.call(@store)\n @store.commit\n rescue SQLite3::Exception => exception\n raise \"SQLite exception: #{exception}\"\n end\n end", "def commit_db_transaction\n execute(\"COMMIT\")\n end", "def commit_db_transaction\n execute(\"COMMIT\")\n end", "def restart_transaction\n ActiveRecord::Base.connection.execute(\"COMMIT\")\n ActiveRecord::Base.connection.execute(\"BEGIN\")\n end", "def within_transaction; end", "def within_transaction; end", "def transaction(options = {}, &block)\n @klass.connection.run_queries_on_shard(@shard) do\n @klass = @klass.connection.transaction(options, &block)\n end\n end", "def start\n raise \"Not implemented\"\n true if @transaction_nesting < 1\n @transaction_nesting += 1\n end", "def call\n db.transaction do\n _call_in_transaction\n end\n end", "def add_start_transaction!(command)\n command.tap do |c|\n if starting_transaction?\n c[:startTransaction] = true\n end\n end\n end", "def transaction(&block)\n yield\n commit\n end", "def transaction\n start_transaction!\n\n result = yield\n\n query 'COMMIT'\n\n result\n rescue\n query 'ROLLBACK'\n raise\n\n ensure\n end_transaction!\n end", "def scaffold_transaction(&block)\n transaction(&block)\n end", "def with_transaction\n ActiveRecord::Base.transaction { yield }\n end", "def ddl_transaction(migration)\n if use_transaction?(migration)\n ActiveRecord::Base.transaction { yield }\n else\n yield\n end\n end", "def begin_transaction read_only: nil, previous_transaction: nil, read_time: nil\n if read_only\n transaction_options = Google::Cloud::Datastore::V1::TransactionOptions.new\n transaction_options.read_only = \\\n Google::Cloud::Datastore::V1::TransactionOptions::ReadOnly.new \\\n read_time: read_time_to_timestamp(read_time)\n\n end\n if previous_transaction\n transaction_options ||= \\\n Google::Cloud::Datastore::V1::TransactionOptions.new\n rw = Google::Cloud::Datastore::V1::TransactionOptions::ReadWrite.new(\n previous_transaction: previous_transaction.encode(\"ASCII-8BIT\")\n )\n transaction_options.read_write = rw\n end\n service.begin_transaction project_id: project, database_id: database, transaction_options: transaction_options\n end", "def transaction(options = {}, &block)\n run_on_shard { @klass = klass.transaction(options, &block) }\n end", "def transaction_insert(num_times)\r\n client = self.connect\r\n r = Random.new\r\n \r\n # transaction start..\r\n client.run \"START TRANSACTION\"\r\n \r\n # insert test..\r\n 1.upto(num_times) do |i|\r\n db_str = \"INSERT INTO fleet (name, description) \" +\r\n \"VALUES (\" +\r\n \"'foo\" + r.rand(100).to_s + \"', \" +\r\n \"'bar' \" +\r\n \");\"\r\n #puts db_str \r\n client.run db_str \r\n end\r\n \r\n # transaction start..\r\n client.run \"COMMIT\"\r\n \r\n # cleanup\r\n puts \"transaction insert\"\r\n client.disconnect\r\n \r\n return true\r\n end", "def transaction(&block)\n db\n persister\n\n result = nil\n start_time = Time.now\n begin\n db.transaction(:rollback => :reraise, :isolation => :repeatable,\n :retry_on => @retry_on_error, :num_retries => 3) do\n result = yield block\n end\n total = Time.now.to_ms - start_time.to_ms\n debug \"Transaction committed (#{total} ms)\"\n result\n rescue StandardError => e\n total = Time.now.to_ms - start_time.to_ms\n warn \"Transaction failed (#{total} ms)\"\n raise e\n ensure\n GC.start\n end\n end", "def start_transaction(\n name = nil,\n type = nil,\n context: nil,\n trace_context: nil\n )\n agent&.start_transaction(\n name,\n type,\n context: context,\n trace_context: trace_context\n )\n end", "def transaction(object)\n object.db.transaction {raise ::Sequel::Error::Rollback unless yield}\n end", "def commit_db_transaction\n @transaction = @connection.commit\n end", "def begin_transaction\n if @transaction_stack.empty?\n if @transaction_thread\n PEROBS.log.fatal 'transaction_thread must be nil'\n end\n @transaction_thread = Thread.current\n # The new transaction is the top-level transaction. Flush the write\n # buffer to save the current state of all objects.\n flush\n else\n # Nested transactions are currently only supported within the same\n # thread. If we are in another thread, raise TransactionInOtherThread\n # to pause the calling thread for a bit.\n if @transaction_thread != Thread.current\n raise TransactionInOtherThread\n end\n # Save a copy of all objects that were modified during the enclosing\n # transaction.\n @transaction_stack.last.each do |id|\n @transaction_objects[id]._stash(@transaction_stack.length - 1)\n end\n end\n # Push a transaction buffer onto the transaction stack. This buffer will\n # hold a reference to all objects modified during this transaction.\n @transaction_stack.push(::Array.new)\n end", "def begin\n raise \"Nested transactions are not allowed\" if @state != :INITIALIZED\n begin\n case @isolation\n when Hash\n if @isolation[:timestamp]\n @grpc_transaction = @connection.session.create_snapshot timestamp: @isolation[:timestamp]\n elsif @isolation[:staleness]\n @grpc_transaction = @connection.session.create_snapshot staleness: @isolation[:staleness]\n elsif @isolation[:strong]\n @grpc_transaction = @connection.session.create_snapshot strong: true\n else\n raise \"Invalid snapshot argument: #{@isolation}\"\n end\n when :read_only\n @grpc_transaction = @connection.session.create_snapshot strong: true\n when :pdml\n @grpc_transaction = @connection.session.create_pdml\n else\n @begin_transaction_selector = Google::Cloud::Spanner::V1::TransactionSelector.new \\\n begin: Google::Cloud::Spanner::V1::TransactionOptions.new(\n read_write: Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite.new\n )\n\n end\n @state = :STARTED\n rescue Google::Cloud::NotFoundError => e\n if @connection.session_not_found? e\n @connection.reset!\n retry\n end\n @state = :FAILED\n raise\n rescue StandardError\n @state = :FAILED\n raise\n end\n end", "def with_transaction(&block)\n base_model.transaction(&block)\n end", "def checked_transaction(opts=OPTS)\n use_transaction?(opts) ? db.transaction({:server=>this_server}.merge!(opts)){yield} : yield\n end", "def checked_transaction(opts=OPTS)\n use_transaction?(opts) ? db.transaction({:server=>this_server}.merge!(opts)){yield} : yield\n end", "def test_transactions(table=\"test_monetdb_transactions\", columndefs=['col1 INT', 'col2 VARCHAR(255)'])\n test_create_table(table, columndefs)\n \n data = [1, 'aa'] \n values = \"\"\n \n data.each do |d| values += '\\'' + d.to_s + '\\'' + ',' end\n values = values.chop # remove last ',' character \n \n insert = \"INSERT INTO \" + table + \" VALUES \" + \" ( \" + values + \" )\"\n \n @db.query('START TRANSACTION')\n @db.auto_commit(flag=false) # if @db.auto_commit?\n @db.query(insert)\n\n @db.query(\"COMMIT\") \n \n res = @db.query('SELECT * FROM ' + table)\n rows_committed = res.fetch_all\n res.free\n \n # create a save point\n @db.save\n @db.query(\"SAVEPOINT #{@db.transactions} ;\")\n \n @db.query(insert)\n \n # rollback to savepoint\n @db.query(\"ROLLBACK TO SAVEPOINT #{@db.transactions};\")\n @db.release\n \n res = @db.query('SELECT * FROM ' + table)\n rows_rolled_back = res.fetch_all\n res.free\n \n assert_equal(rows_committed, rows_rolled_back)\n \n # restore autocommit for remaining tests\n @db.auto_commit(flag=true) \n end", "def use_transactions; end", "def use_transactions; end", "def begin\n self.transaction_count += 1\n end", "def commit_db_transaction\n @connection.commit\n @connection.autocommit = true\n end", "def in_transaction(opts = {})\n yield\n end", "def begin_transaction(mutable: false, graph_name: nil)\n raise NotImplementedError\n end", "def transaction(&block)\n yield\n end", "def transaction(&block)\n yield\n end", "def add_to_transaction(*)\n @connection.add_transaction_record(self)\n end", "def commit_db_transaction\n log('COMMIT', 'TRANSACTION') { @connection.commit }\n end", "def begin_new_transaction(conn, opts)\n super\n if opts.has_key?(:synchronous)\n case sync = opts[:synchronous]\n when true\n sync = :on\n when false\n sync = :off\n when nil\n return\n end\n\n log_connection_execute(conn, \"SET LOCAL synchronous_commit = #{sync}\")\n end\n end", "def commit\n # Nothing to do for an in memory database\n end", "def rollback_db_transaction() end", "def rollback_db_transaction() end", "def transaction(&block)\n @in_transaction += 1\n begin\n yield self\n self.commit if @in_transaction > 0\n rescue => e\n self.rollback\n raise e\n ensure\n @in_transaction -= 1 unless @in_transaction == 0\n end\n end", "def started_db\n start unless db.running?\n db\n end", "def started_db\n start unless db.running?\n db\n end", "def run_in_transaction isolation\n if isolation\n Base.transaction isolation: isolation do\n yield\n end\n else\n yield\n end\n end", "def run_in_transaction isolation\n if isolation\n Base.transaction isolation: isolation do\n yield\n end\n else\n yield\n end\n end", "def transaction\n use do |connection|\n connection.transaction do |conn|\n begin\n yield conn\n rescue Rollback\n return\n end\n end\n end\n end" ]
[ "0.8382846", "0.826889", "0.826889", "0.8138087", "0.807101", "0.80169153", "0.7758959", "0.7638615", "0.7618878", "0.7618878", "0.73823154", "0.72951317", "0.71919847", "0.7191075", "0.71797717", "0.7141438", "0.70849895", "0.7055831", "0.7027031", "0.7020137", "0.7020137", "0.70105946", "0.6999633", "0.6939845", "0.6914214", "0.69053346", "0.6881507", "0.6879718", "0.67370117", "0.6731373", "0.67285514", "0.6697098", "0.66809547", "0.6673167", "0.66436404", "0.6620462", "0.65977144", "0.6596906", "0.6596906", "0.6596906", "0.65886843", "0.65846926", "0.653607", "0.6508305", "0.6501179", "0.6498071", "0.6495879", "0.64922315", "0.64894384", "0.64382225", "0.64382225", "0.6415917", "0.64086246", "0.6367611", "0.6367611", "0.63600814", "0.6353073", "0.6353073", "0.63513076", "0.6327489", "0.6324727", "0.6316143", "0.63120484", "0.62745076", "0.62304866", "0.6214878", "0.6209349", "0.6180296", "0.61778754", "0.61734796", "0.61718446", "0.6150973", "0.61129487", "0.6108939", "0.6103667", "0.6066385", "0.6064429", "0.6060607", "0.6060607", "0.60597205", "0.6057576", "0.6057576", "0.60466987", "0.6041627", "0.6039845", "0.60351676", "0.6021459", "0.6021459", "0.60040754", "0.6002201", "0.5998852", "0.59951067", "0.5994108", "0.5994108", "0.5992327", "0.5991189", "0.5991189", "0.59830415", "0.59830415", "0.5976185" ]
0.67385566
28
Commits the current database transaction.
def commit_db_transaction log('COMMIT', 'TRANSACTION') { @connection.commit } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def commit_db_transaction\n execute(\"COMMIT\")\n end", "def commit_db_transaction\n execute(\"COMMIT\")\n end", "def commit\n @db.commit\n end", "def commit_db_transaction\n @transaction = @connection.commit\n end", "def commit\n db_interface.commit\n end", "def commit_db_transaction\n log('commit transaction', nil) { @connection.commit }\n end", "def commit_db_transaction\n @connection.commit\n @connection.autocommit = true\n end", "def commit()\n check_return_code(PureHailDB.ib_trx_commit(@trx_ptr))\n end", "def commit\n IBM_DB.commit(@conn)\n end", "def commit\n @MySQLConnection.query('commit')\n end", "def commit_transaction_sql\n SQL_COMMIT\n end", "def commit_transaction_sql\n SQL_COMMIT\n end", "def commit\n # no op\n end", "def commit_transaction(tx)\n tx.execute\n end", "def commit\n # Nothing to do for an in memory database\n end", "def commit!\n _commit( false )\n end", "def commit_transaction(tx)\n tx.execute(self)\n end", "def commit_db_transaction() end", "def commit_db_transaction() end", "def commit_transaction(conn)\n log_info(TRANSACTION_COMMIT)\n conn.commit\n end", "def commit\n query 'commit'\n self\n end", "def close\n commit\n end", "def commit\n sanity_check\n @handle.commit\n end", "def commit_transaction(conn, opts=OPTS)\n log_connection_yield('Transaction.commit', conn){conn.commit}\n end", "def commit_transaction(conn, opts={})\n log_yield(TRANSACTION_COMMIT){conn.commit}\n end", "def commit( transaction )\n fail NotImplementedError\n end", "def commit\n writer.commit\n end", "def commit()\n #This is a stub, used for indexing\n end", "def commit_transaction(conn)\n log_connection_execute(conn, commit_transaction_sql) unless Thread.current[:sequel_transaction_depth] > 1\n end", "def commit_transaction(conn, opts=OPTS)\n if in_savepoint?(conn)\n if supports_releasing_savepoints?\n log_connection_yield('Transaction.release_savepoint', conn){conn.release_savepoint(savepoint_obj(conn))}\n end\n else\n log_connection_yield('Transaction.commit', conn){conn.commit}\n end\n end", "def commit; end", "def commit; end", "def commit; end", "def commit()\n @conn.commit if @conn\n Log.i(\"#{@count} new bookings added\")\n end", "def commit\n {}\n end", "def commit\n {}\n end", "def commit( defer=false )\n save_logic( defer, false )\n end", "def commit(soft_commit = false)\n session.commit soft_commit\n end", "def commit(transaction)\n raise NotImplementedError\n end", "def commit\n if defined? _commit\n if dirty?\n _commit\n end\n end\n nil\n end", "def commit(txn)\n @current_transaction = txn.outer\n if @current_transaction\n @mode = @current_transaction.mode\n @current_transaction.read_cache = @read_cache\n @current_transaction.write_cache = @write_cache\n @current_transaction.delete_cache = @delete_cache\n else\n close\n end\n end", "def commit\n head.commit\n end", "def commit!() raise NotImplementedError end", "def commit!\n rsp = post(\"<commit/>\")\n success?(rsp.body) or log_error(rsp.body)\n end", "def exec_rollback_db_transaction\n @connection.rollback\n @connection.autocommit = true\n end", "def transaction(&block)\n yield\n commit\n end", "def commit mutations, transaction: nil\n mode = transaction.nil? ? :NON_TRANSACTIONAL : :TRANSACTIONAL\n service.commit project_id: project, database_id: database, mode: mode,\n mutations: mutations, transaction: transaction\n end", "def commiter() end", "def transaction\n start_transaction!\n\n result = yield\n\n query 'COMMIT'\n\n result\n rescue\n query 'ROLLBACK'\n raise\n\n ensure\n end_transaction!\n end", "def commit\n if !@rollback\n @indexes.each_value do |index| \n $LUCENE_LOGGER.debug{\"BEGIN: Commit index #{index} txt #{to_s}\"} \n index.commit\n $LUCENE_LOGGER.debug{\"END: Commited index #{index} txt #{to_s}\"}\n end \n end\n @commited = true\n $LUCENE_LOGGER.error(\"Index was not removed from commited transaction: #{@indexes.inspect}\") if [email protected]? && !@rollback \n @indexes.clear\n Thread.current[:lucene_transaction] = nil\n end", "def commit\n @handle.commit\n super\n end", "def tx_commit(&block)\n @connection.send_frame(Protocol::Tx::Commit.encode(@id))\n\n self.redefine_callback :tx_commit, &block\n self\n end", "def commit\n update\n end", "def commit\n cfm.commit_change_on(self) if do_commit?\n end", "def commit\r\n self.class.commit_orders [self]\r\n end", "def rollback_db_transaction() end", "def rollback_db_transaction() end", "def commit!\n save! unless persisted?\n end", "def commit\n freeze_time\n release_expired\n store_staged_data\n clean\n\n was_dirty?\n end", "def exec_rollback_db_transaction\n log('ROLLBACK', 'TRANSACTION') { @connection.rollback }\n end", "def tx_commit\n write_bytes FrameBytes.tx_commit(@id)\n expect :tx_commit_ok\n nil\n end", "def rollback_db_transaction\n execute(\"ROLLBACK\")\n end", "def rollback_db_transaction\n execute(\"ROLLBACK\")\n end", "def commit_db_transaction() \n log(\"Committing boxcar with #{@command_boxcar.length} commands\", 'commit_db_transaction()')\n \n previous_command = nil\n commands = []\n \n @command_boxcar.each do |command|\n if commands.length >= MAX_BOXCAR_SIZE or (previous_command and (command.verb != previous_command.verb))\n send_commands(commands)\n \n commands = []\n previous_command = nil\n else\n commands << command\n\t previous_command = command\n end\n end\n \n # Finish off the partial boxcar\n send_commands(commands) unless commands.empty?\n \n end", "def commit\n @repo.commit\n end", "def commit_transaction\n # TODO: wrap #rtErrPrimOutsideTrans in OutsideOfTransactionException\n unless System.commit_transaction\n raise CommitFailedException\n end\n return true\n end", "def begin_db_transaction\n @transaction = @connection.transaction('READ COMMITTED')\n end", "def begin_db_transaction\n @connection.autocommit = false\n end", "def begin_db_transaction\n execute(\"BEGIN\")\n end", "def begin_db_transaction\n execute(\"BEGIN\")\n end", "def commit\n @read_lock.synchronize do\n @write_lock.synchronize do\n unless @saved\n storage.store(self.class, @id, @data.dup)\n end\n @saved = true\n end\n end\n end", "def commit!(rollback: true, rollback_interval: 60)\n @@api.post(endpoint: self.endpoint + ['commit'], params: {'rollback' => rollback, 'rollback_interval' => rollback_interval})\n end", "def commit_transaction(session)\n session.commit_transaction\n Threaded.clear_modified_documents(session).each do |doc|\n doc.run_after_callbacks(:commit)\n end\n end", "def commit_transaction\n\t real_object = __getobj__\n\t partition_new_old_relations(:parent_objects) do |trsc_objects, rel, new, del, existing|\n\t\tfor other in new\n\t\t other.add_child_object(real_object, rel, trsc_objects[other][self, rel])\n\t\tend\n\t\tfor other in del\n\t\t other.remove_child_object(real_object, rel)\n\t\tend\n for other in existing\n other[real_object, rel] = trsc_objects[other][self, rel]\n end\n\t end\n\n\t partition_new_old_relations(:child_objects) do |trsc_objects, rel, new, del, existing|\n\t\tfor other in new\n\t\t real_object.add_child_object(other, rel, self[trsc_objects[other], rel])\n\t\tend\n\t\tfor other in del\n\t\t real_object.remove_child_object(other, rel)\n\t\tend\n for other in existing\n real_object[other, rel] = self[trsc_objects[other], rel]\n end\n\t end\n\n super\n\n if @executable != __getobj__.instance_variable_get(:@executable)\n __getobj__.executable = @executable\n end\n\n finalization_handlers.each do |handler|\n __getobj__.when_finalized(handler.as_options, &handler.block)\n end\n end", "def commit_if_dirty\n # no op\n end", "def commit\n solr_service_connection.commit\n end", "def close\n @master.puts \"COMMIT;\"\n @master.puts \"-- Generated in #{Time.now - @started} seconds\"\n @master.close\n end", "def commit \n results = submit_cmd('commit plant',:db, \"-env #{self.env}\")\n puts results\n end", "def after_commit(&blk)\n ActiveRecord::Base.connection.add_transaction_record(\n AfterCommitWrapper.new(&blk)\n )\n end", "def flush\n conn.transaction do\n buffer.flatten.each do |row|\n # check to see if this row's compound key constraint already exists\n # note that the compound key constraint may not utilize virtual fields\n next unless row_allowed?(row)\n\n # add any virtual fields\n add_virtuals!(row)\n \n names = []\n values = []\n order.each do |name|\n names << \"`#{name}`\"\n values << conn.quote(row[name]) # TODO: this is probably not database agnostic\n end\n q = \"INSERT INTO `#{table_name}` (#{names.join(',')}) VALUES (#{values.join(',')})\"\n ETL::Engine.logger.debug(\"Executing insert: #{q}\")\n conn.insert(q, \"Insert row #{current_row}\")\n @current_row += 1\n end\n buffer.clear\n end\n end", "def transaction(&block)\n begin\n @store.transaction\n block.call(@store)\n @store.commit\n rescue SQLite3::Exception => exception\n raise \"SQLite exception: #{exception}\"\n end\n end", "def transaction\n begin\n if block_given?\n begin_db_transaction\n result = yield\n commit_db_transaction\n result\n end\n rescue Exception => database_transaction_rollback\n rollback_db_transaction\n raise\n end\n end", "def commit(on_kill = false)\n\n unless @destination.sql.empty?\n\n $log.debug(self) {'Launch last commit'} if on_kill\n\n if @use_cache\n cache_time = Time.now\n\n # And add to the cache\n @cache.commit\n\n Thread.current[:threshold_log].add 'Cache time', (Time.now - cache_time).round(3)\n end\n\n pg_time = Time.now\n # Launch SQL commands\n @destination.commit\n Thread.current[:threshold_log].add 'Replicate time', (Time.now - pg_time).round(3)\n\n end\n\n end", "def save\n @connection.transactions.save\n end", "def begin_db_transaction\n # PG driver doesn't really do anything on setAutoCommit(false)\n # except for commit-ing a previous pending transaction if any\n log('/* BEGIN */') { @connection.begin }\n end", "def save\n\t\[email protected]\n\tend", "def begin_db_transaction() end", "def begin_db_transaction() end", "def commit()\n conn = connection(@commit_uri)\n resp = conn.post\n return DeziResponse.new(resp)\n end", "def commit_hook( &block ) # :yields:\n SQLite::API.commit_hook( @handler, block )\n end", "def endRun\n db_cached_connect\n\n @dbh.do(\"SELECT endRun();\")\n @dbh.do(\"COMMIT TRANSACTION;\")\n end", "def flushdb\n end", "def end_transaction!\n @in_transaction = false\n end", "def transaction\n @database.transaction { yield self }\n end", "def rollback_db_transaction\n @transaction = @connection.rollback\n end", "def release\n\t\[email protected]\n\tend", "def flushdb; end", "def transaction; end", "def transaction; end", "def transaction; end" ]
[ "0.84105986", "0.84105986", "0.8224817", "0.80955887", "0.7943903", "0.7921335", "0.79157156", "0.78948647", "0.7854213", "0.7649062", "0.7574977", "0.7574977", "0.75528127", "0.736996", "0.7368336", "0.73125714", "0.7255587", "0.7255008", "0.7255008", "0.7248397", "0.71258897", "0.70849216", "0.7076036", "0.6993138", "0.6987449", "0.6895295", "0.6877101", "0.6858379", "0.68535227", "0.68253845", "0.67551994", "0.67551994", "0.67551994", "0.675188", "0.65401345", "0.65401345", "0.65119994", "0.6479445", "0.644255", "0.64338195", "0.6427294", "0.63539195", "0.6297262", "0.62931526", "0.62815756", "0.6265075", "0.6253689", "0.62288904", "0.6223847", "0.6215026", "0.61964023", "0.6186658", "0.61695534", "0.6158132", "0.6148299", "0.61477757", "0.61477757", "0.61450344", "0.6139147", "0.61298496", "0.6125311", "0.6102213", "0.6102213", "0.6075213", "0.6042798", "0.6028545", "0.60168195", "0.60148203", "0.601163", "0.601163", "0.6001804", "0.5939164", "0.59294116", "0.590927", "0.5889604", "0.5886499", "0.58723855", "0.5868795", "0.5834757", "0.579409", "0.5786482", "0.5784128", "0.5767494", "0.57611495", "0.57524407", "0.5751333", "0.5746076", "0.5746076", "0.57281774", "0.5712487", "0.5711878", "0.5699352", "0.5694297", "0.56884736", "0.5663801", "0.56556666", "0.5644855", "0.5637975", "0.5637975", "0.5637975" ]
0.8247636
2
Rolls back the current database transaction. Called from 'rollback_db_transaction' in the AbstractAdapter
def exec_rollback_db_transaction log('ROLLBACK', 'TRANSACTION') { @connection.rollback } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rollback_db_transaction\n execute(\"ROLLBACK\")\n end", "def rollback_db_transaction\n execute(\"ROLLBACK\")\n end", "def rollback_db_transaction() end", "def rollback_db_transaction() end", "def rollback\n @db.rollback\n end", "def rollback_db_transaction\n @transaction = @connection.rollback\n end", "def rollback_transaction_sql\n SQL_ROLLBACK\n end", "def rollback_transaction_sql\n SQL_ROLLBACK\n end", "def rollback\n IBM_DB.rollback(@conn)\n end", "def rollback\n @MySQLConnection.query('rollback')\n end", "def rollback\n current_transaction.rollback\n last_transaction = @all_transactions.pop\n end", "def rollback\n # implement in subclasses\n end", "def rollback transaction\n service.rollback project_id: project, database_id: database, transaction: transaction\n end", "def rollback_db_transaction\n log('rollback transaction', nil) { @connection.rollback }\n end", "def rollback_transaction(tx)\n tx.rollback\n end", "def rollback()\n check_return_code(PureHailDB.ib_trx_rollback(@trx_ptr))\n end", "def rollback\n query 'rollback'\n self\n end", "def rollback_transaction(tx)\n # nothing to do\n end", "def rollback\n raise TransactionRollback.new\n end", "def rollback\n raise \"Illegal state for rollback: #{@state}\" unless @state == :begin\n each_adapter(:rollback_adapter_if_begin, [:rollback_and_close_adapter_if_begin, :close_adapter_if_none])\n each_adapter(:rollback_prepared_adapter_if_prepare, [:rollback_prepared_and_close_adapter_if_begin, :close_adapter_if_none])\n each_adapter(:close_adapter_if_open, [:log_fatal_transaction_breakage])\n @state = :rollback\n end", "def exec_rollback_db_transaction\n @connection.rollback\n @connection.autocommit = true\n end", "def rollback_db_transaction() \n log('Rolling back boxcar', 'rollback_db_transaction()')\n @command_boxcar = []\n end", "def rollback_transaction(conn)\n log_info(TRANSACTION_ROLLBACK)\n conn.rollback\n end", "def rollback; end", "def rollback; end", "def rollback; end", "def rollback; end", "def rollback; end", "def rollback\n end", "def rollback()\n #This is a stub, used for indexing\n end", "def rollback\n sanity_check\n @handle.rollback\n end", "def rollback_transaction(conn, opts={})\n log_yield(TRANSACTION_ROLLBACK){conn.rollback}\n end", "def rollback_transaction(conn, opts=OPTS)\n if in_savepoint?(conn)\n log_connection_yield('Transaction.rollback_savepoint', conn){conn.rollback(savepoint_obj(conn))}\n else\n log_connection_yield('Transaction.rollback', conn){conn.rollback}\n end\n end", "def rollback\n @repo.rollback\n end", "def rollback!\n restore_attributes\n end", "def rollback_transaction(conn, opts=OPTS)\n log_connection_yield('Transaction.rollback', conn){conn.rollback}\n end", "def rollback\n FileUtils.rm_r(path) if File.exist?(path)\n transaction.rollback\n end", "def rollback\n self.revert_to self.previous_version\n end", "def rollback\n objects.clear\n load\n finish_transaction\n end", "def rollback!\n self.revert_to! self.previous_version\n end", "def rollback\n Rails.logger.debug \"Rollback not implemented: #{self.class.to_s}\"\n end", "def rollback(&block)\n block_given? ? transaction {yield; rollback} : (raise Rollback)\n end", "def tx_rollback(&block)\n @connection.send_frame(Protocol::Tx::Rollback.encode(@id))\n\n self.redefine_callback :tx_rollback, &block\n self\n end", "def rollback\n each { |transition| transition.rollback }\n end", "def rollback\n each {|transition| transition.rollback}\n end", "def exec_rollback_to_savepoint(name = current_savepoint_name)\n log(\"ROLLBACK TO SAVEPOINT #{name}\", 'TRANSACTION') { @connection.rollback_savepoint(name) }\n end", "def commit_db_transaction() end", "def commit_db_transaction() end", "def end_transaction!\n @in_transaction = false\n end", "def rollback transaction_id\n service.rollback path, transaction_id\n @last_updated_at = Time.now\n true\n end", "def rolledback!\n @on_rollback.each do |callback|\n callback.call\n end\n clear\n end", "def abort_transaction\n return System.abort_transaction\n end", "def rollback opts = {}\n update opts.merge(:data => xml.rollback)\n end", "def disconnect_connection(conn)\n conn.RollbackTrans rescue nil\n super\n end", "def tx_rollback\n write_bytes FrameBytes.tx_rollback(@id)\n expect :tx_rollback_ok\n nil\n end", "def commit_db_transaction\n execute(\"COMMIT\")\n end", "def commit_db_transaction\n execute(\"COMMIT\")\n end", "def run(*args, &block)\n Sequel::Model.db.transaction(rollback: :always, auto_savepoint: true) { super }\n end", "def abort_transaction\n if @transaction_stack.empty?\n PEROBS.log.fatal 'No ongoing transaction to abort'\n end\n @transaction_stack.pop.each do |id|\n @transaction_objects[id]._restore(@transaction_stack.length)\n end\n @transaction_thread = nil\n end", "def rollback_savepoint_sql(depth)\n SQL_ROLLBACK_TO_SAVEPOINT % depth\n end", "def rollback\n if @id.nil?\n raise TransactionError, \"Cannot rollback when not in a transaction.\"\n end\n\n ensure_service!\n service.rollback @id\n true\n end", "def remove_transaction(conn, committed)\n if jdbc_level = _trans(conn)[:original_jdbc_isolation_level]\n log_connection_yield(\"Transaction.restore_isolation_level\", conn){conn.setTransactionIsolation(jdbc_level)}\n end\n unless in_savepoint?(conn)\n conn.setAutoCommit(true)\n end\n ensure\n super\n end", "def rollback\n _called.reverse_each do |command|\n begin\n command.rollback\n rescue => error\n raise Errors::InvokerRollbackError.new(error: error, command: command, invoker: self, backtrace: error.backtrace)\n end\n end\n end", "def rollback\n puts colorBlue('rolling back to commit blah')\n end", "def rollback\n true\n end", "def post_transaction_process\n fail(ActiveRecord::Rollback) unless @status\n end", "def rollback()\n oldpos = @checkpoints.pop\n unless oldpos\n oldpos = 0\n end\n self.pos = oldpos\n return self \n end", "def revert\n end", "def restart_transaction\n ActiveRecord::Base.connection.execute(\"COMMIT\")\n ActiveRecord::Base.connection.execute(\"BEGIN\")\n end", "def rollback(database, step = 1)\n ensure_schema_migrations_table_exists(database)\n Database.process(database) do\n ActiveRecord::Migrator.rollback(migration_paths(database), step)\n end\n dump_schema(database)\n end", "def remove_transaction(conn)\n conn.setAutoCommit(true) if conn\n super\n end", "def rollback(step = 1)\n files = File.migrated.reverse.first(step)\n Migrate::Down.new(files).perform\n end", "def rollback_transaction?\n false\n end", "def rollback\n if self.failed? && !self.rollbacked?\n response = RestClient.delete resource_uri, app_key: Contacts::API_KEY\n if response.code == 200\n self.update_attribute(:status, 'rollbacked')\n else\n return false\n end\n end\n end", "def remove_transaction(conn, committed)\n conn.autocommit = true\n ensure\n super\n end", "def void_last_transaction\n @total-=self.total\n end", "def rollback\n each {|transition| transition.machine.write(object, :event, transition.event)}\n super\n end", "def rollback()\n conn = connection(@rollback_uri)\n resp = conn.post \n return DeziResponse.new(resp)\n end", "def commit_db_transaction\n @transaction = @connection.commit\n end", "def rollback(database, step = 1)\n Tenant.switch(database) do\n if activerecord_below_5_2?\n ActiveRecord::Migrator.rollback(ActiveRecord::Migrator.migrations_paths, step)\n else\n ActiveRecord::Base.connection.migration_context.rollback(step)\n end\n end\n end", "def transaction\n start\n yield self\n rescue Object => ex\n rollback\n debug \"#{ex.class}: #{ex.message}\"\n ex.backtrace.each { |line| debug line }\n else\n commit\n end", "def rollback\n without_transactions do\n repository.transactions_log.delete_if do |(method, options)|\n\n begin\n case method\n when :ingest\n repository.purge_object :pid => options[:pid]\n\n when :modify_object\n repository.modify_object options\n\n when :add_datastream\n repository.purge_datastream :pid => options[:pid], :dsid => options[:dsid]\n\n when :add_relationship\n repository.purge_relationship options[:options].merge(:pid => options[:pid])\n\n when :purge_relationship\n repository.add_relationship options[:options].merge(:pid => options[:pid])\n\n when :purge_object\n repository.ingest :pid => options[:pid], :file => options[:foxml]\n\n when :set_datastream_options\n repository.set_datastream_options options\n\n when :modify_datastream\n repository.purge_object :pid => options[:pid] rescue nil\n repository.ingest :pid => options[:pid], :file => options[:foxml]\n\n when :purge_datastream\n repository.purge_object :pid => options[:pid] rescue nil\n repository.ingest :pid => options[:pid], :file => options[:foxml]\n end\n rescue\n # no-op\n end\n\n run_hook :after_rollback, :pid => options[:pid], :method => method, :options => options\n\n end\n end\n true\n end", "def abort_transaction!\n @ignore_trace = true\n end", "def rollback\n super\n each { |transition| transition.machine.write(object, :event, transition.event) unless transition.transient? }\n end", "def commit_transaction_sql\n SQL_COMMIT\n end", "def commit_transaction_sql\n SQL_COMMIT\n end", "def end(opts = nil)\n current.send :rollback, opts && opts[:rollback]\n Thread.current[:scheherazade_stories].pop\n current\n end", "def rollback_balance(transaction)\n if transaction.succeeded?\n sign = transaction.payment? ? -1 : 1\n self.balance.update_attributes!(amount: (self.balance.amount + (BigDecimal.new(transaction.amount_was) * sign)))\n end\n end", "def commit_db_transaction\n @connection.commit\n @connection.autocommit = true\n end", "def begin_db_transaction\n @connection.autocommit = false\n end", "def undo\n transaction do\n undoables = self.class.find(:not_undone, :all, :to => self.id, :include => :changes)\n raise Stale unless undoables.include? self\n undoables.each do |op|\n op.changes.each { |change| change.undo }\n op.undone = true\n op.save!\n end\n end\n end", "def stop_delete\r\n if self.id && self.id < 11\r\n raise ActiveRecord::Rollback\r\n end\r\n end", "def begin_db_transaction() end", "def begin_db_transaction() end", "def void_last_transaction\n self.total -= @last_transaction.pop\n end", "def abort_transaction(session)\n session.abort_transaction\n Threaded.clear_modified_documents(session).each do |doc|\n doc.run_after_callbacks(:rollback)\n end\n end", "def rollback\n release = args.shift.downcase.strip rescue nil\n rolled_back = heroku.rollback(app, release)\n display \"Rolled back to #{rolled_back}\"\n end", "def transaction(object)\n object.db.transaction {raise ::Sequel::Error::Rollback unless yield}\n end", "def rollback\n { rollback: {} }.to_json\n end", "def discard_transaction\n\t clear_relations\n\tend" ]
[ "0.84933585", "0.84933585", "0.8283671", "0.8283671", "0.8127145", "0.80999076", "0.78685427", "0.78685427", "0.7858752", "0.7838174", "0.77186024", "0.76602536", "0.7622137", "0.7608282", "0.7582207", "0.75779754", "0.75752103", "0.75327504", "0.7505258", "0.74692154", "0.7461357", "0.745026", "0.7400238", "0.73508376", "0.73508376", "0.73508376", "0.73508376", "0.73508376", "0.71942276", "0.71925074", "0.71484464", "0.70651644", "0.7055293", "0.70300126", "0.6909547", "0.6897807", "0.68352735", "0.68229693", "0.6822144", "0.68048775", "0.67286515", "0.66775423", "0.66412526", "0.66039914", "0.656347", "0.6550916", "0.64862597", "0.64862597", "0.6416433", "0.6400279", "0.6380114", "0.6365955", "0.6357419", "0.6355057", "0.63526005", "0.63316673", "0.63316673", "0.6295655", "0.629525", "0.6279848", "0.6269938", "0.6265528", "0.62619036", "0.62334085", "0.6221917", "0.6183672", "0.6082972", "0.6062951", "0.60575354", "0.60000336", "0.5990426", "0.5980897", "0.5971701", "0.5969376", "0.59550685", "0.59473854", "0.5944905", "0.59050727", "0.5892366", "0.5885178", "0.5864187", "0.5835462", "0.5827929", "0.5827452", "0.5821743", "0.5821743", "0.58058715", "0.57689106", "0.57669157", "0.57272214", "0.57104504", "0.5692942", "0.5690384", "0.5690384", "0.5683723", "0.5675407", "0.56687474", "0.5658701", "0.5649474", "0.5646944" ]
0.7780022
10
Savepoint Interface Creates a (transactional) savepoint one can rollback to. Unlike 'plain' `ActiveRecord` it is allowed to pass a savepoint name.
def create_savepoint(name = current_savepoint_name) log("SAVEPOINT #{name}", 'TRANSACTION') { @connection.create_savepoint(name) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exec_rollback_to_savepoint(name = current_savepoint_name)\n log(\"ROLLBACK TO SAVEPOINT #{name}\", 'TRANSACTION') { @connection.rollback_savepoint(name) }\n end", "def create_savepoint(name = current_savepoint_name(true))\n release_savepoint(name) if existing_savepoint_name?(name)\n super(name)\n end", "def create_savepoint\n execute(\"SAVEPOINT #{current_savepoint_name}\")\n end", "def release_savepoint(name = current_savepoint_name)\n log(\"RELEASE SAVEPOINT #{name}\", 'TRANSACTION') { @connection.release_savepoint(name) }\n end", "def rollback_savepoint_sql(depth)\n SQL_ROLLBACK_TO_SAVEPOINT % depth\n end", "def save_checkpoint(identifier, checkpoint)\n raise 'Not implemented'\n end", "def rollback_transaction(conn, opts=OPTS)\n if in_savepoint?(conn)\n log_connection_yield('Transaction.rollback_savepoint', conn){conn.rollback(savepoint_obj(conn))}\n else\n log_connection_yield('Transaction.rollback', conn){conn.rollback}\n end\n end", "def save_point\n @save_points\n end", "def savepoint_obj(conn)\n _trans(conn)[:savepoints][-1][:obj]\n end", "def rollback; end", "def rollback; end", "def rollback; end", "def rollback; end", "def rollback; end", "def commit_transaction(conn, opts=OPTS)\n if in_savepoint?(conn)\n if supports_releasing_savepoints?\n log_connection_yield('Transaction.release_savepoint', conn){conn.release_savepoint(savepoint_obj(conn))}\n end\n else\n log_connection_yield('Transaction.commit', conn){conn.commit}\n end\n end", "def transactions\n @connection.savepoint\n end", "def save(options = {})\n save_without_transaction(options)\n end", "def transactions\n\t\[email protected]\n\tend", "def rollback\n end", "def commit!\n save! unless persisted?\n end", "def rollback\n # implement in subclasses\n end", "def rollback_db_transaction() end", "def rollback_db_transaction() end", "def create\n @point = Point.new(params[:point])\n\n respond_to do |format|\n if @point.save_with_history!\n format.html { redirect_to(@point, :notice => 'Point was successfully created.') }\n format.xml { render :xml => @point, :status => :created, :location => @point }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @point.errors, :status => :unprocessable_entity }\n end\n end\n end", "def supports_savepoints?\n true\n end", "def supports_savepoints?\n true\n end", "def rollback()\n oldpos = @checkpoints.pop\n unless oldpos\n oldpos = 0\n end\n self.pos = oldpos\n return self \n end", "def rollback\n raise TransactionRollback.new\n end", "def save\r\n do_without_exception(:save!)\r\n end", "def pay_back\n return false unless valid?\n\n commit_or_rollback do\n res = save_expense\n res = create_ledger\n\n set_errors(expense, ledger) unless res\n\n res\n end\n end", "def rollback_db_transaction\n execute(\"ROLLBACK\")\n end", "def rollback_db_transaction\n execute(\"ROLLBACK\")\n end", "def save_person\n person.save(false)\n end", "def save_checkpoint\n @api.send(\"world.checkpoint.save()\")\n end", "def create\n @spent_point = SpentPoint.new(params[:spent_point])\n\n respond_to do |format|\n if @spent_point.save\n format.html { redirect_to(@spent_point, :notice => 'SpentPoint was successfully created.') }\n format.xml { render :xml => @spent_point, :status => :created, :location => @spent_point }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @spent_point.errors, :status => :unprocessable_entity }\n end\n end\n end", "def run(*args, &block)\n Sequel::Model.db.transaction(rollback: :always, auto_savepoint: true) { super }\n end", "def begin_transaction(conn, opts=OPTS)\n if in_savepoint?(conn)\n _trans(conn)[:savepoints][-1][:obj] = log_connection_yield('Transaction.savepoint', conn){conn.set_savepoint}\n else\n log_connection_yield('Transaction.begin', conn){conn.setAutoCommit(false)}\n set_transaction_isolation(conn, opts)\n end\n end", "def commit!() raise NotImplementedError end", "def saveAction(sender)\n error = Pointer.new(:id)\n\n unless self.managedObjectContext.commitEditing\n puts \"#{self.class} unable to commit editing before saving\"\n end\n\n unless self.managedObjectContext.save(error)\n NSApplication.sharedApplication.presentError(error[0])\n end\n end", "def supports_savepoints_in_prepared_transactions?\n supports_prepared_transactions? && supports_savepoints?\n end", "def supports_savepoints?\n false\n end", "def rollback\n Rails.logger.debug \"Rollback not implemented: #{self.class.to_s}\"\n end", "def test_transactions(table=\"test_monetdb_transactions\", columndefs=['col1 INT', 'col2 VARCHAR(255)'])\n test_create_table(table, columndefs)\n \n data = [1, 'aa'] \n values = \"\"\n \n data.each do |d| values += '\\'' + d.to_s + '\\'' + ',' end\n values = values.chop # remove last ',' character \n \n insert = \"INSERT INTO \" + table + \" VALUES \" + \" ( \" + values + \" )\"\n \n @db.query('START TRANSACTION')\n @db.auto_commit(flag=false) # if @db.auto_commit?\n @db.query(insert)\n\n @db.query(\"COMMIT\") \n \n res = @db.query('SELECT * FROM ' + table)\n rows_committed = res.fetch_all\n res.free\n \n # create a save point\n @db.save\n @db.query(\"SAVEPOINT #{@db.transactions} ;\")\n \n @db.query(insert)\n \n # rollback to savepoint\n @db.query(\"ROLLBACK TO SAVEPOINT #{@db.transactions};\")\n @db.release\n \n res = @db.query('SELECT * FROM ' + table)\n rows_rolled_back = res.fetch_all\n res.free\n \n assert_equal(rows_committed, rows_rolled_back)\n \n # restore autocommit for remaining tests\n @db.auto_commit(flag=true) \n end", "def save; end", "def save; end", "def save; end", "def save; end", "def save; end", "def save; end", "def save; end", "def save; end", "def save!\n if save\n true\n else\n fail 'InvalidWallet'\n end\n end", "def rollback()\n #This is a stub, used for indexing\n end", "def rollback\n query 'rollback'\n self\n end", "def saveAction(sender)\n error = Pointer.new_with_type('@')\n unless self.managedObjectContext.save(error)\n NSApplication.sharedApplication.presentError(error[0])\n end\n end", "def saveAction(sender)\n error = Pointer.new_with_type('@')\n unless self.managedObjectContext.save(error)\n NSApplication.sharedApplication.presentError(error[0])\n end\n end", "def save(options = {})\n trap_exception { save!(options) }\n end", "def save\n self.class.persistable\n DB[self.class.name] ||= {}\n DB[self.class.name][name] = self\n Maglev.commit_transaction\n end", "def save(options = {})\n trap_exception { save!(options) }\n end", "def saveAction(sender)\n error = Pointer.new_with_type('@')\n unless self.managedObjectContext.save(error)\n NSApp.presentError(error[0])\n end\n end", "def saveAction(sender)\n error = Pointer.new_with_type('@')\n\n unless self.managedObjectContext.commitEditing\n puts \"#{self.class} unable to commit editing before saving\"\n end\n\n unless self.managedObjectContext.save(error)\n NSApplication.sharedApplication.presentError(error[0])\n end\n end", "def save_employment\n self.current_stage = :references_stage\n self.save\n true\n end", "def sneaky_save!\n sneaky_create_or_update\n end", "def supports_savepoints?\n false\n end", "def begin_savepoint_sql(depth)\n SQL_SAVEPOINT % depth\n end", "def save!\n raise \"#{self.inspect} failed to save\" unless self.save\n end", "def save!(options = {})\n upload_to_s3 unless options[:skip_s3] == true\n \n # If this guy already exists, don't update it. You can't update a modification, only delete it.\n if self.id.nil?\n filename = \"#{photo.file_parts[:root]}-#{@attributes[:name]}.#{photo.file_parts[:extension]}\"\n results = StoredProcedures.create(photo.id, filename, s3_key, @attributes[:width], \n @attributes[:height], @attributes[:crop], @attributes[:name])\n self.id = results['id']\n end\n end", "def rollback\n puts colorBlue('rolling back to commit blah')\n end", "def save(wallet)\n db.transaction do\n db[wallet.address] = wallet\n end\n end", "def set_points_transaction\n @points_transaction = PointsTransaction.find(params[:id])\n end", "def set_points_transaction\n @points_transaction = PointsTransaction.find(params[:id])\n end", "def recoverable_save\n # do requires_new so that exception won't kill outer transaction\n ActiveRecord::Base.transaction(requires_new: true) {\n save\n }\n end", "def supports_savepoints?\n false\n end", "def supports_savepoints?\n false\n end", "def supports_savepoints?\n false\n end", "def supports_savepoints?\n false\n end", "def rollback_transaction_sql\n SQL_ROLLBACK\n end", "def rollback_transaction_sql\n SQL_ROLLBACK\n end", "def create\n @base_point = BasePoint.new(base_point_params)\n if @base_point.save\n flash[:success] = \"拠点登録完了しました\"\n else\n flash[:danger] = \"拠点登録に失敗しました\"\n end\n redirect_to base_points_path\n end", "def rollback_item\n ingreso_producto = self.ingreso_producto\n ingreso_producto.cantidad = ingreso_producto.cantidad + self.cantidad\n ingreso_producto.producto.stock = ingreso_producto.producto.stock + self.cantidad #suma al stock si se anula\n Lineakardex.create(:kardex => ingreso_producto.producto.kardex, :tipo => \"Entrada\", :fecha => Time.now, :cantidad => self.cantidad, :v_unitario => self.ingreso_producto.producto.precio_venta, :modulo => \"Hospitalizacion\", :observaciones => \"Pedido Anulado\" )\n ingreso_producto.save\n ingreso_producto.producto.save\n end", "def save!(options = {})\n tries = 0\n \n Collection.transaction do\n what_to do |state|\n case state\n when :create\n validate\n begin\n results = StoredProcedures.create(\n self.created_by_id,\n self.name,\n self.what.to_json,\n self.slug,\n @attributes[:description],\n @attributes[:icon]\n )\n self.id = results['id']\n \n # TODO: For 2.3.9\n # save_collection_places\n rescue\n # We do this in case the slug came back as a duplicate on save\n tries += 1\n self.slug = nil\n tries < 2 && retry || raise($!)\n end\n\n when :update\n validate\n StoredProcedures.update(\n self.id, \n self.name,\n self.what.to_json,\n self.slug,\n @attributes[:description],\n @attributes[:icon]\n )\n\n # TODO: For 2.3.9\n # save_collection_places\n when :delete\n StoredProcedures.delete(self.id)\n self.solr_server.delete(self.id)\n end\n end\n end\n \n self\n end", "def save!\n raise Cooler::InvalidObject unless save\n end", "def save\n Course::ExperiencePointsRecord.transaction { @experience_points_records.map(&:save!).all? }\n rescue ActiveRecord::RecordInvalid\n false\n end", "def save!(*)\n create_or_update || raise(RecordNotSaved)\n end", "def save(*)\n create_or_update\n end", "def commit( defer=false )\n save_logic( defer, false )\n end", "def create\n @point = Point.new(params[:point])\n\n respond_to do |format|\n if @point.save\n format.html { redirect_to([@layer, @point], :notice => 'Point was successfully created.') }\n format.xml { render :xml => @point, :status => :created, :location => @point }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @point.errors, :status => :unprocessable_entity }\n end\n end\n end", "def save( defer=false )\n save_logic( defer ) \n end", "def save\n raise NotFoundError\n end", "def supports_releasing_savepoints?\n true\n end", "def saving(point)\n (point.price * volume) - (price * volume)\n end", "def rollback\n true\n end", "def commit; end", "def commit; end", "def commit; end", "def save(options = {})\n # default autocommit is TRUE\n autocommit = (options.nil? or options[:autocommit].nil?)? true : options[:autocommit]\n \n # transform the String values to their values in the object (effectively calling the String on the object) \n insert_args_temp = []\n self.class.insert_args.each_with_index { |a, i| \n logger.debug \"self.#{a}\" << \"-\" << eval(\"self.#{a}\").to_s\n insert_args_temp[i] = eval(\"self.#{a}\") \n if (insert_args_temp[i].to_s.empty?) \n eval(\"self.#{a} = nil\") \n end\n }\n before_validation\n if valid? \n after_validation\n before_save \n out = Oracle.execute_procedure(self.class.package_name, self.class.insert_method, {:in => insert_args_temp, :autocommit => autocommit}) \n after_save\n @message = out[:message]\n @oracle_errors = out[:message]\n @out = out[:outvars]\n return ((out[:error])? false : [true, out])\n else\n after_validation\n @messages = errors.full_messages.join(\", \")\n \n return false\n end\n end", "def save\n\t\[email protected]\n\tend", "def save!\n raise NotImplemented\n end", "def save!(**options, &block)\n create_or_update(**options, &block) || raise(RecordNotSaved.new(\"Failed to save the record\", self))\n end", "def save\n end" ]
[ "0.7694426", "0.7623737", "0.75443494", "0.7108175", "0.5923058", "0.5874266", "0.5781033", "0.56733924", "0.56556267", "0.54954034", "0.54954034", "0.54954034", "0.54954034", "0.54954034", "0.5428379", "0.53508276", "0.53107053", "0.52920604", "0.5226993", "0.52247345", "0.51786935", "0.5154972", "0.5154972", "0.51441216", "0.51070774", "0.51070774", "0.51028746", "0.5100233", "0.5094349", "0.50490355", "0.50483024", "0.50483024", "0.5037137", "0.50294614", "0.50262326", "0.50169575", "0.5014817", "0.5010785", "0.5003305", "0.49976793", "0.49889126", "0.4988558", "0.49846482", "0.4980594", "0.4980594", "0.4980594", "0.4980594", "0.4980594", "0.4980594", "0.4980594", "0.4980594", "0.49797815", "0.4957516", "0.49501812", "0.4945379", "0.4945379", "0.4941989", "0.49408484", "0.49305174", "0.4925519", "0.4914771", "0.49049568", "0.49039248", "0.48985678", "0.48911202", "0.488479", "0.48821455", "0.48766583", "0.48666185", "0.4860289", "0.4860289", "0.48531547", "0.48525017", "0.48525017", "0.48525017", "0.48525017", "0.48508865", "0.48508865", "0.48315185", "0.48282906", "0.48016593", "0.48001748", "0.4795463", "0.47929764", "0.47860622", "0.47810018", "0.47787958", "0.47668555", "0.47630674", "0.47626883", "0.4751389", "0.47507015", "0.4743934", "0.4743934", "0.4743934", "0.4738277", "0.473663", "0.472709", "0.47041914", "0.4698598" ]
0.8096261
0
Transaction rollback to a given (previously created) savepoint. If no savepoint name given rollback to the last created one. Called from 'rollback_to_savepoint' in AbstractAdapter
def exec_rollback_to_savepoint(name = current_savepoint_name) log("ROLLBACK TO SAVEPOINT #{name}", 'TRANSACTION') { @connection.rollback_savepoint(name) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rollback_transaction(conn, opts=OPTS)\n if in_savepoint?(conn)\n log_connection_yield('Transaction.rollback_savepoint', conn){conn.rollback(savepoint_obj(conn))}\n else\n log_connection_yield('Transaction.rollback', conn){conn.rollback}\n end\n end", "def rollback_savepoint_sql(depth)\n SQL_ROLLBACK_TO_SAVEPOINT % depth\n end", "def release_savepoint(name = current_savepoint_name)\n log(\"RELEASE SAVEPOINT #{name}\", 'TRANSACTION') { @connection.release_savepoint(name) }\n end", "def rollback_db_transaction\n execute(\"ROLLBACK\")\n end", "def rollback_db_transaction\n execute(\"ROLLBACK\")\n end", "def rollback()\n oldpos = @checkpoints.pop\n unless oldpos\n oldpos = 0\n end\n self.pos = oldpos\n return self \n end", "def rollback; end", "def rollback; end", "def rollback; end", "def rollback; end", "def rollback; end", "def rollback\n current_transaction.rollback\n last_transaction = @all_transactions.pop\n end", "def rollback_db_transaction() end", "def rollback_db_transaction() end", "def rollback\n # implement in subclasses\n end", "def rollback transaction_id\n service.rollback path, transaction_id\n @last_updated_at = Time.now\n true\n end", "def rollback_transaction_sql\n SQL_ROLLBACK\n end", "def rollback_transaction_sql\n SQL_ROLLBACK\n end", "def rollback\n raise TransactionRollback.new\n end", "def rollback transaction\n service.rollback project_id: project, database_id: database, transaction: transaction\n end", "def rollback\n end", "def rollback_transaction(tx)\n # nothing to do\n end", "def rollback!\n self.revert_to! self.previous_version\n end", "def rollback_transaction(tx)\n tx.rollback\n end", "def rollback\n query 'rollback'\n self\n end", "def rollback opts = {}\n update opts.merge(:data => xml.rollback)\n end", "def rollback()\n #This is a stub, used for indexing\n end", "def rollback!\n restore_attributes\n end", "def rollback\n self.revert_to self.previous_version\n end", "def create_savepoint(name = current_savepoint_name)\n log(\"SAVEPOINT #{name}\", 'TRANSACTION') { @connection.create_savepoint(name) }\n end", "def rollback\n @db.rollback\n end", "def rollback_db_transaction\n @transaction = @connection.rollback\n end", "def rollback\n if @id.nil?\n raise TransactionError, \"Cannot rollback when not in a transaction.\"\n end\n\n ensure_service!\n service.rollback @id\n true\n end", "def rollback\n sanity_check\n @handle.rollback\n end", "def exec_rollback_db_transaction\n log('ROLLBACK', 'TRANSACTION') { @connection.rollback }\n end", "def rollback\n raise \"Illegal state for rollback: #{@state}\" unless @state == :begin\n each_adapter(:rollback_adapter_if_begin, [:rollback_and_close_adapter_if_begin, :close_adapter_if_none])\n each_adapter(:rollback_prepared_adapter_if_prepare, [:rollback_prepared_and_close_adapter_if_begin, :close_adapter_if_none])\n each_adapter(:close_adapter_if_open, [:log_fatal_transaction_breakage])\n @state = :rollback\n end", "def create_savepoint(name = current_savepoint_name(true))\n release_savepoint(name) if existing_savepoint_name?(name)\n super(name)\n end", "def rollback\n @repo.rollback\n end", "def rollback\n FileUtils.rm_r(path) if File.exist?(path)\n transaction.rollback\n end", "def rollback()\n check_return_code(PureHailDB.ib_trx_rollback(@trx_ptr))\n end", "def rollback_transaction(conn)\n log_info(TRANSACTION_ROLLBACK)\n conn.rollback\n end", "def remove_transaction(conn, committed)\n if jdbc_level = _trans(conn)[:original_jdbc_isolation_level]\n log_connection_yield(\"Transaction.restore_isolation_level\", conn){conn.setTransactionIsolation(jdbc_level)}\n end\n unless in_savepoint?(conn)\n conn.setAutoCommit(true)\n end\n ensure\n super\n end", "def rollback\n Rails.logger.debug \"Rollback not implemented: #{self.class.to_s}\"\n end", "def rollback_transaction(conn, opts={})\n log_yield(TRANSACTION_ROLLBACK){conn.rollback}\n end", "def rollback\n @MySQLConnection.query('rollback')\n end", "def rollback\n puts colorBlue('rolling back to commit blah')\n end", "def exec_rollback_db_transaction\n @connection.rollback\n @connection.autocommit = true\n end", "def rollback\n true\n end", "def rollback\n IBM_DB.rollback(@conn)\n end", "def rollback_db_transaction\n log('rollback transaction', nil) { @connection.rollback }\n end", "def tx_rollback\n write_bytes FrameBytes.tx_rollback(@id)\n expect :tx_rollback_ok\n nil\n end", "def rollback\n objects.clear\n load\n finish_transaction\n end", "def run(*args, &block)\n Sequel::Model.db.transaction(rollback: :always, auto_savepoint: true) { super }\n end", "def add_rollback(&block)\n existing_rollback = task_call_frames.last.rollback\n task_call_frames.last.rollback = lambda { block.call ; existing_rollback.call }\n end", "def rollback(&block)\n block_given? ? transaction {yield; rollback} : (raise Rollback)\n end", "def create_savepoint\n execute(\"SAVEPOINT #{current_savepoint_name}\")\n end", "def rollback_db_transaction() \n log('Rolling back boxcar', 'rollback_db_transaction()')\n @command_boxcar = []\n end", "def rollback_item\n ingreso_producto = self.ingreso_producto\n ingreso_producto.cantidad = ingreso_producto.cantidad + self.cantidad\n ingreso_producto.producto.stock = ingreso_producto.producto.stock + self.cantidad #suma al stock si se anula\n Lineakardex.create(:kardex => ingreso_producto.producto.kardex, :tipo => \"Entrada\", :fecha => Time.now, :cantidad => self.cantidad, :v_unitario => self.ingreso_producto.producto.precio_venta, :modulo => \"Hospitalizacion\", :observaciones => \"Pedido Anulado\" )\n ingreso_producto.save\n ingreso_producto.producto.save\n end", "def commit_transaction(conn, opts=OPTS)\n if in_savepoint?(conn)\n if supports_releasing_savepoints?\n log_connection_yield('Transaction.release_savepoint', conn){conn.release_savepoint(savepoint_obj(conn))}\n end\n else\n log_connection_yield('Transaction.commit', conn){conn.commit}\n end\n end", "def rollback(step = 1)\n files = File.migrated.reverse.first(step)\n Migrate::Down.new(files).perform\n end", "def rollback_transaction(conn, opts=OPTS)\n log_connection_yield('Transaction.rollback', conn){conn.rollback}\n end", "def tx_rollback(&block)\n @connection.send_frame(Protocol::Tx::Rollback.encode(@id))\n\n self.redefine_callback :tx_rollback, &block\n self\n end", "def pay_back\n return false unless valid?\n\n commit_or_rollback do\n res = save_expense\n res = create_ledger\n\n set_errors(expense, ledger) unless res\n\n res\n end\n end", "def rollback()\n rollback_to_release = releases[-2]\n\n if rollback_to_release.nil?\n server[:logger].warn('No release to rollback to')\n else\n current_release_dir = release_dir(releases.last)\n skip_current_release_dir = release_dir(\"skip-#{releases.last}\")\n cmd.ssh(\"mv #{current_release_dir} #{skip_current_release_dir}\")\n symlink_release_dir(rollback_to_release)\n end\n end", "def rollback\n without_transactions do\n repository.transactions_log.delete_if do |(method, options)|\n\n begin\n case method\n when :ingest\n repository.purge_object :pid => options[:pid]\n\n when :modify_object\n repository.modify_object options\n\n when :add_datastream\n repository.purge_datastream :pid => options[:pid], :dsid => options[:dsid]\n\n when :add_relationship\n repository.purge_relationship options[:options].merge(:pid => options[:pid])\n\n when :purge_relationship\n repository.add_relationship options[:options].merge(:pid => options[:pid])\n\n when :purge_object\n repository.ingest :pid => options[:pid], :file => options[:foxml]\n\n when :set_datastream_options\n repository.set_datastream_options options\n\n when :modify_datastream\n repository.purge_object :pid => options[:pid] rescue nil\n repository.ingest :pid => options[:pid], :file => options[:foxml]\n\n when :purge_datastream\n repository.purge_object :pid => options[:pid] rescue nil\n repository.ingest :pid => options[:pid], :file => options[:foxml]\n end\n rescue\n # no-op\n end\n\n run_hook :after_rollback, :pid => options[:pid], :method => method, :options => options\n\n end\n end\n true\n end", "def rollback_transaction?\n false\n end", "def rollback\n each {|transition| transition.rollback}\n end", "def rollback\n each { |transition| transition.rollback }\n end", "def rollback\n _called.reverse_each do |command|\n begin\n command.rollback\n rescue => error\n raise Errors::InvokerRollbackError.new(error: error, command: command, invoker: self, backtrace: error.backtrace)\n end\n end\n end", "def revert_sandbox_file_commit\n unless original_committed_file_location\n raise Chef::Exceptions::IllegalChecksumRevert, \"Checksum #{self.inspect} cannot be reverted because the original sandbox file location is not known\"\n end\n\n Chef::Log.warn(\"Reverting sandbox file commit: moving #{@storage} back to #{original_committed_file_location}\")\n @storage.revert(original_committed_file_location)\n cdb_destroy\n end", "def rollback\n super\n each { |transition| transition.machine.write(object, :event, transition.event) unless transition.transient? }\n end", "def rollback(database, step = 1)\n Tenant.switch(database) do\n if activerecord_below_5_2?\n ActiveRecord::Migrator.rollback(ActiveRecord::Migrator.migrations_paths, step)\n else\n ActiveRecord::Base.connection.migration_context.rollback(step)\n end\n end\n end", "def rollback\n { rollback: {} }.to_json\n end", "def rollback()\n conn = connection(@rollback_uri)\n resp = conn.post \n return DeziResponse.new(resp)\n end", "def rollback_configuration\n data[:rollback_configuration]\n end", "def undo\n\t\t\t\t\n\t\t\tend", "def rollback\n each {|transition| transition.machine.write(object, :event, transition.event)}\n super\n end", "def abort_transaction!\n @ignore_trace = true\n end", "def rollback(database, step = 1)\n ensure_schema_migrations_table_exists(database)\n Database.process(database) do\n ActiveRecord::Migrator.rollback(migration_paths(database), step)\n end\n dump_schema(database)\n end", "def test_transactions(table=\"test_monetdb_transactions\", columndefs=['col1 INT', 'col2 VARCHAR(255)'])\n test_create_table(table, columndefs)\n \n data = [1, 'aa'] \n values = \"\"\n \n data.each do |d| values += '\\'' + d.to_s + '\\'' + ',' end\n values = values.chop # remove last ',' character \n \n insert = \"INSERT INTO \" + table + \" VALUES \" + \" ( \" + values + \" )\"\n \n @db.query('START TRANSACTION')\n @db.auto_commit(flag=false) # if @db.auto_commit?\n @db.query(insert)\n\n @db.query(\"COMMIT\") \n \n res = @db.query('SELECT * FROM ' + table)\n rows_committed = res.fetch_all\n res.free\n \n # create a save point\n @db.save\n @db.query(\"SAVEPOINT #{@db.transactions} ;\")\n \n @db.query(insert)\n \n # rollback to savepoint\n @db.query(\"ROLLBACK TO SAVEPOINT #{@db.transactions};\")\n @db.release\n \n res = @db.query('SELECT * FROM ' + table)\n rows_rolled_back = res.fetch_all\n res.free\n \n assert_equal(rows_committed, rows_rolled_back)\n \n # restore autocommit for remaining tests\n @db.auto_commit(flag=true) \n end", "def undo\n if(@history != nil)\n @history.undo\n end\n end", "def rolledback!\n @on_rollback.each do |callback|\n callback.call\n end\n clear\n end", "def begin_transaction(conn, opts=OPTS)\n if in_savepoint?(conn)\n _trans(conn)[:savepoints][-1][:obj] = log_connection_yield('Transaction.savepoint', conn){conn.set_savepoint}\n else\n log_connection_yield('Transaction.begin', conn){conn.setAutoCommit(false)}\n set_transaction_isolation(conn, opts)\n end\n end", "def revert!\n @shell.call \"rm -rf #{self.checkout_path}\"\n\n last_deploy = previous_deploy_name(true)\n\n if last_deploy && !last_deploy.empty?\n @shell.symlink \"#{self.deploys_path}/#{last_deploy}\", self.current_path\n\n Sunshine.logger.info @shell.host, \"Reverted to #{last_deploy}\"\n\n else\n @crontab.delete!\n\n Sunshine.logger.info @shell.host, \"No previous deploy to revert to.\"\n end\n end", "def rollback!\n if (@status == 'DELETED')\n self.errors.add(:base, 'Campaign is already deleted.')\n return false\n end\n\n self.errors.clear\n\n self.update(\n :name => \"#{@name}_DELETED_#{(Time.now.to_f * 1000).to_i}\",\n :status => 'DELETED'\n )\n end", "def rollback(user = nil, summary = nil, markbot = nil)\n @site.login\n result = @site.query_prop_revisions(@normtitle, nil, nil, nil, nil, nil, nil, nil, user, nil, nil, nil, nil, 'rollback') \n #Page exists?\n if result['query']['pages']['page'].key?('missing')\n raise NoPage, \"Page [[#{@title}]] does not exist\"\n end\n #Has user edited this?\n if !result['query']['pages']['page'].key?('revisions')\n raise RbmediawikiError, \"#{@title}: No edits by user #{user}\"\n end\n\n #If the user made more than one contribs, this is an array\n #but the token is the same. We only want the token\n if result['query']['pages']['page']['revisions']['rev'].is_a? Array\n token = result['query']['pages']['page']['revisions']['rev'][0]['rollbacktoken']\n else\n token = result['query']['pages']['page']['revisions']['rev']['rollbacktoken']\n end\n result = @site.rollback(@normtitle, user, token, summary, markbot)\n if result.key?('error')\n raise RbmediawikiError, \"#{@title}: \"+result['error']['code']\n else\n return true \n end\n end", "def run_after_rollback_hooks(opts=OPTS)\n _run_transaction_hooks(:after_rollback, opts)\n end", "def rollback_balance(transaction)\n if transaction.succeeded?\n sign = transaction.payment? ? -1 : 1\n self.balance.update_attributes!(amount: (self.balance.amount + (BigDecimal.new(transaction.amount_was) * sign)))\n end\n end", "def rollback_changes(podspecFile, info)\n\n\t\t\t\tsave_podspec(podspecFile, info.original_spec)\n\t\t\t\toldspec = old_filename()\n\t\t\t\tFile.delete(oldspec) if File.exist?(oldspec)\n\n\t\t\t\tgit_commit_push(\"reverting back from #{info.versionString()}\")\n\t\t\t\tgit_tag_delete(\"#{info.versionString()}\")\n\t\t\tend", "def revert\n end", "def undo\n return unless applied = self.applied\n\n applied.undo\n\n self.applied = applied.parent\n self.pending = applied\n end", "def rollback\n release = args.shift.downcase.strip rescue nil\n rolled_back = heroku.rollback(app, release)\n display \"Rolled back to #{rolled_back}\"\n end", "def void_last_transaction\n#save add item to last transaction\n#take total and items list, and remove last transaction\n self.total -= self.last_transaction\n @title.pop\n end", "def undo\n\t\t\n\tend", "def undo\n\t\t\n\tend", "def undo!(modifier = nil, options_or_version = nil)\n undo(modifier, options_or_version)\n save!\n end", "def tll_commit\n oldself = self.class.unscoped.where(_id: id).first\n if oldself # We've got a previous saved document.\n self.class.unscoped.where(tll_top: oldself._id)\\\n .update_all(tll_top: id)\n oldself = oldself.clone\n oldself.tll_top = id\n self.tll_prev = oldself._id\n oldself.save\n end\n end", "def end(opts = nil)\n current.send :rollback, opts && opts[:rollback]\n Thread.current[:scheherazade_stories].pop\n current\n end", "def rollback\n if self.failed? && !self.rollbacked?\n response = RestClient.delete resource_uri, app_key: Contacts::API_KEY\n if response.code == 200\n self.update_attribute(:status, 'rollbacked')\n else\n return false\n end\n end\n end", "def commit!\n save! unless persisted?\n end" ]
[ "0.71942616", "0.6826054", "0.6451056", "0.63729036", "0.63729036", "0.63484573", "0.6269715", "0.6269715", "0.6269715", "0.6269715", "0.6269715", "0.6227035", "0.6194844", "0.6194844", "0.61876184", "0.61573255", "0.6147801", "0.6147801", "0.6131383", "0.61112034", "0.6075936", "0.60643286", "0.604532", "0.60413784", "0.60205466", "0.59662527", "0.59199023", "0.5912017", "0.5881119", "0.58710235", "0.58585", "0.58107674", "0.5800924", "0.5775767", "0.5712408", "0.5697842", "0.5697796", "0.56365275", "0.56332135", "0.5604146", "0.56012285", "0.55985266", "0.5587353", "0.55721253", "0.55504614", "0.552689", "0.5517167", "0.55111265", "0.5488029", "0.5473664", "0.5451696", "0.5423093", "0.54016346", "0.53952664", "0.53793246", "0.53537166", "0.5338244", "0.5270922", "0.5252748", "0.52432966", "0.5235027", "0.52217793", "0.5187949", "0.51739", "0.5146972", "0.51183695", "0.5104009", "0.5039744", "0.49686942", "0.4952382", "0.49209166", "0.4899309", "0.48886043", "0.48862982", "0.48755753", "0.4864178", "0.48396042", "0.4823679", "0.4819841", "0.48080313", "0.47844785", "0.47802693", "0.47699547", "0.47660416", "0.47553965", "0.47535178", "0.47534376", "0.47455388", "0.4730086", "0.4720645", "0.4711442", "0.47089553", "0.47086632", "0.47027585", "0.47027585", "0.46958026", "0.46780545", "0.46773648", "0.46751642", "0.4670788" ]
0.8339665
0
Release a previously created savepoint.
def release_savepoint(name = current_savepoint_name) log("RELEASE SAVEPOINT #{name}", 'TRANSACTION') { @connection.release_savepoint(name) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def release(point)\n\t\t\n\tend", "def release(point)\n\t\t\n\tend", "def release(point)\n\t\t\n\tend", "def release(point)\n\t\t\n\tend", "def release(point)\n\t\t\t\t\n\t\t\tend", "def release(point)\n\t\tsuper(point)\n\tend", "def create_savepoint(name = current_savepoint_name(true))\n release_savepoint(name) if existing_savepoint_name?(name)\n super(name)\n end", "def create_savepoint\n execute(\"SAVEPOINT #{current_savepoint_name}\")\n end", "def release\n end", "def release!\n @ec.release_temp self\n end", "def release\n end", "def release\n end", "def release(ptr = nil)\n V2.raptor_free_term(self) unless ptr.null?\n end", "def release(resource); end", "def release(options = {})\n current_claimant = claimant\n with_hooks(:release, current_claimant, options) do\n log(:release)\n set_claimant(nil)\n end\n end", "def release\n # @invObj.releaseObj(self)\n end", "def release\n @release_bike = storage.last\n raise \"Asking for a bike that doesn't exist\" if empty?\n storage.pop; return @release_bike if !empty?\n end", "def release\n\n a = self.to_a\n self.close\n a\n end", "def dispose_keep\n @savename = nil\n @saveindex = nil\n @saveghost = nil\n @saveswap = nil\n @saveflip = nil\n end", "def release\n action('release')\n end", "def release(plane)\n\n end", "def supports_releasing_savepoints?\n true\n end", "def release\n fail AlreadyRelease unless prerelease?\n @special = ''\n @metadata = ''\n end", "def release!\n ensure_service!\n service.delete_session path\n end", "def teardown\n teardown_construct(@target_path)\n @release.destroy\n @release = nil\n end", "def supports_releasing_savepoints?\n false\n end", "def release(number)\n \n end", "def release_data!\n @data = nil\n end", "def release\n variables[:release]\n end", "def release\n locked? && release!\n end", "def release(key, value)\n return\n end", "def release_marker\n signal_marker(marker)\n end", "def save!\n delete_file\n save\n end", "def release_ball\n @frozen_to.release_ball(self) unless @frozen_to.nil?\n @frozen_to = nil\n end", "def save filename = nil\n filename = find_free_name filename\n save! filename\n end", "def release_register reg\n if reg.end_point\n raise Errors::AlreadyReleasedError, \"register #{reg.name} already released at #{reg.end_point}\"\n end\n\n reg.end_point = (@instructions.length - 1)\n end", "def save_point\n @save_points\n end", "def release_lease(service=Azure::Blobs)\n service.lease(@blob, :release)\n end", "def release()\n res = super(self)\n return res\n end", "def release(step)\n # If this step is a preheat step, free up the preheat step slot it occupied\n if (index = @preheat_steps.index(step)) != nil\n @preheat_steps[index] = nil\n end\n\n unless step.equipment.nil?\n @free_equipment[step.equipment] += 1\n end\n\n @free_focus += FocusTypes.const_get(step.focus)\n end", "def release!\n PoolNode.delete(@id, node)\n end", "def close\n @disk.save(@filename) if @changed\n end", "def release_bike\n fail 'No bikes available' if empty?\n @bike = @dock.pop\n end", "def release(job = ALL_JOBS)\n DRMAA.control(job, DRMAA::ACTION_RELEASE)\n end", "def release\n @refresh_mutex.synchronize {\n @unlock = true\n\n delete\n\n @refresh_signal.signal\n }\n\n\n @refresh_thread.join if @refresh_thread\n @event_manager.create_event(\n {\n user: Config.current_job.username,\n action: 'release',\n object_type: 'lock',\n object_name: @name,\n task: @task_id,\n deployment: @deployment_name,\n }\n )\n end", "def release_bike\n fail 'No bikes available' if working_bikes.empty?\n bikes.delete working_bikes.pop\n end", "def release_bike\n raise 'no bike to be released' if empty?\n raise \"Can't release broken bike\" unless @bikes.last.working?\n @bikes.pop\n end", "def exec_rollback_to_savepoint(name = current_savepoint_name)\n log(\"ROLLBACK TO SAVEPOINT #{name}\", 'TRANSACTION') { @connection.rollback_savepoint(name) }\n end", "def release(entry)\n @lock.synchronize do\n unlocked_release(entry.id)\n end\n end", "def release(resource)\n\t\t\t\t\t# A resource that is not good should also not be reusable.\n\t\t\t\t\t# unless resource.closed?\n\t\t\t\t\t\treuse(resource)\n\t\t\t\t\t# else\n\t\t\t\t\t# \tretire(resource)\n\t\t\t\t\t# end\n\t\t\t\tend", "def released(&block)\n @up_callback = block\n end", "def release(job = ALL_JOBS)\n DRMAA.control(job, DRMAA::ACTION_RELEASE)\n end", "def release(resource)\n\t\t\t\t@available << resource\n\t\t\t\t\t\n\t\t\t\tif task = @waiting.pop\n\t\t\t\t\ttask.resume\n\t\t\t\tend\n\t\t\tend", "def savepoint_obj(conn)\n _trans(conn)[:savepoints][-1][:obj]\n end", "def release_item\n update_attribute( :pub_assmt, new_assmt )\n end", "def release_bike\n Bike.new\n end", "def release\n @@release[self] ||= if prerelease?\n segments = self.segments\n segments.pop while segments.any? {|s| String === s }\n self.class.new segments.join('.')\n else\n self\n end\n end", "def close\n save\n end", "def cleanup\n return unless @dst\n\n @dst.unlink\n @dst = nil\n end", "def release\n return unless @lock_file # Skip if we don't have a file\n\n @lock_file.flock(File::LOCK_UN)\n File.delete( @lock_file )\n close_file\n end", "def release!\n upload_io.close if @close_io_on_finish\n end", "def unlock\n self.is_locked = false\n self.locked_at = nil\n save!\n end", "def unpublish!\r\n unpublish\r\n save!\r\n end", "def release_attachment_position(attachment_position)\n\t\t@ring_positions.delete(attachment_position)\n\t\t# FIXME - NEED TO HAVE LIST OF POSITIONS TO CONSUME\n\tend", "def unlock!\n self.locked_by = nil\n self.locked_at = nil\n save!\n end", "def close(save=true)\n raise InvalidDbError if @stale\n\n if save && staging?\n self.staging.write\n end\n unstage\n @stale = true\n\n # TODO: remove all locks etc\n end", "def create_savepoint(name = current_savepoint_name)\n log(\"SAVEPOINT #{name}\", 'TRANSACTION') { @connection.create_savepoint(name) }\n end", "def remove_current_spouse\n raise_unless_current_spouse_enabled\n if gclass.perform_validation_enabled\n ex_current_spouse = current_spouse\n current_spouse.current_spouse = nil\n self.current_spouse = nil\n transaction do\n ex_current_spouse.save!\n save!\n end\n else\n transaction do\n current_spouse.update_attribute(:current_spouse,nil)\n self.update_attribute(:current_spouse,nil)\n end\n end\n end", "def destroy\n @assign_stage.destroy\n end", "def tear_down!\n return unless created?\n\n detach! if attached?\n destroy!\n end", "def release_blob_lease(container, blob, lease, options={})\n release_lease container, blob, lease, options\n end", "def free\n\n self.class.free(@pointer)\n @pointer = nil\n end", "def release\n @connection.transactions.release\n end", "def release_easy(easy)\n easy.reset\n easy_pool << easy\n end", "def expire_points\n self.available = 0\n self.save\n end", "def release_uri(uri)\n init_ivars\n\n p = Page.new(URI(uri))\n if @pages.include?(p)\n @pages.delete(p)\n @scheduler.remove_task(uri)\n 'ok'\n else\n 'error'\n end\n end", "def release_bike\n fail \"no bikes docked\" if empty?(@docked_bikes)\n @docked_bikes.pop\n end", "def release_bike\n raise(RuntimeError, \"No bikes available\") unless !empty?\n raise(\"Cannot release a broken bike\") if @bikes.last.broken?\n @bikes.pop\n end", "def release\n unless @fh.nil?\n @fh.flock(File::LOCK_UN)\n remove_pidfile\n end\n @pid = nil\n end", "def release\n unless @fh.nil?\n @fh.flock(File::LOCK_UN)\n remove_pidfile\n end\n @pid = nil\n end", "def release(machine)\n if (address = address_for(machine))\n @pool[address] = nil\n end\n end", "def release_eip!\n e = eip\n print \"Releasing EIP (#{e.allocation_id})...\"\n interface.association.delete\n e.release\n puts 'OK'\n @eip = nil\n end", "def release\n return self unless prerelease?\n\n segments = self.segments.dup\n segments.pop while segments.any? { |s| String === s }\n self.class.new segments.join('.')\n end", "def release(builder)\n raise TypeError unless builder.is_a? @klass\n builder.reset\n @pool.push builder\n nil\n end", "def release(n = 1)\n raise NotImplementedError\n end", "def teardown\n @p.destroy\n end", "def around_release\n yield\n end", "def release\n @start_script[:run] = start_run_script\n end", "def release\n\t\[email protected]\n\tend", "def release_lot(lot_name, release_signature)\n select_lot(lot_name)\n release.click\n release_agree.set(true)\n release_audit.set release_signature\n confirm_release.click\n end", "def saving(point)\n (point.price * volume) - (price * volume)\n end", "def release!(feature_key, resource_id)\n warn \"[DEPRECATION] `release!` is deprecated. Please use `release` instead.\"\n release(feature_key, resource_id)\n end", "def release_bike\n raise \"There is no bike\" if empty?\n raise \"This bike is broken and cannot be released\" if !@bikes[-1].working? # checks if the last bike entered is broken.\n # what if a broken bike is docked followed by a working one, does the working one still get released?\n \n @bikes.pop # here you refer to the instance variable @bikes.\n # Since you have the getter method/attr_reader method bikes, use that. Better to use instance methods than variables\n end", "def release(resource)\n\t\t\t\t# A resource that is not good should also not be reusable.\n\t\t\t\tif resource.reusable?\n\t\t\t\t\treuse(resource)\n\t\t\t\telse\n\t\t\t\t\tretire(resource)\n\t\t\t\tend\n\t\t\tend", "def release(resource)\n\t\t\t\t# A resource that is not good should also not be reusable.\n\t\t\t\tif resource.reusable?\n\t\t\t\t\treuse(resource)\n\t\t\t\telse\n\t\t\t\t\tretire(resource)\n\t\t\t\tend\n\t\t\tend", "def save!\n resource.save!\n end", "def destroy\n @book = @plot_point.book\n @plot_point.destroy\n\n @plot_points = PlotPoint.where(book_id: @book.id)\n\n respond_to do |format|\n format.html { redirect_to book_plot_points_url(@book), notice: \"Plot point was successfully destroyed.\" }\n format.json { head :no_content }\n flash.now[:now] = \"Plot Point was successfully destroyed.\"\n format.turbo_stream { render \"shared/destroy\", locals: { object: PlotPoint.new } }\n end\n end", "def release(threat)\n hero = Hero.find_to_batle(threat.rank)\n if hero\n # TODO add more one hero\n batle = Batle.create(threat: threat, heroes: [hero])\n @batles.append(batle)\n else\n # run release again in a thread mode\n Thread.new do\n Rails.application.executor.wrap do\n # waits 10 seconds\n sleep(30)\n release(threat)\n end\n end\n end\n end", "def release\n return self unless prerelease?\n rel_parts = parts.dup\n rel_parts.pop while rel_parts.any? { |part| part.alpha? }\n self.class.new(rel_parts.join('.'))\n end", "def close\n persist\n end" ]
[ "0.722674", "0.722674", "0.722674", "0.722674", "0.70163953", "0.6775867", "0.65793693", "0.6033079", "0.59665394", "0.59233636", "0.591036", "0.591036", "0.5820695", "0.5711869", "0.56387585", "0.55901396", "0.55707484", "0.55658317", "0.5532543", "0.5532046", "0.55225295", "0.55193275", "0.55099237", "0.54943866", "0.54814744", "0.5461146", "0.54606783", "0.54100496", "0.53662187", "0.535105", "0.53049415", "0.525279", "0.52199703", "0.52170694", "0.5199187", "0.5192724", "0.5179918", "0.51477456", "0.51079303", "0.5105137", "0.5086705", "0.5040314", "0.5028914", "0.501238", "0.5005081", "0.49908888", "0.4987992", "0.49802336", "0.49702847", "0.4953181", "0.49498373", "0.49326226", "0.49209407", "0.49154446", "0.49132496", "0.49065077", "0.48739576", "0.4872988", "0.48541442", "0.48292047", "0.48250872", "0.4818135", "0.48159787", "0.48073", "0.48019785", "0.47985423", "0.47961384", "0.47934127", "0.47871628", "0.47813565", "0.47795478", "0.4775118", "0.4770847", "0.47698772", "0.47524709", "0.4741622", "0.4735049", "0.47273293", "0.47253504", "0.47253504", "0.472057", "0.47188476", "0.47178772", "0.47166646", "0.47091055", "0.47043756", "0.47014025", "0.47009036", "0.47002402", "0.46962366", "0.4695784", "0.46952513", "0.46952352", "0.46938935", "0.46938935", "0.4692961", "0.46908137", "0.4682352", "0.46646586", "0.4662756" ]
0.7597761
0
Gets services dynamically from module for rails admin selection
def kind_enum # Only classes and base class can't be selected Services.constants.select do |c| Services.const_get(c).is_a?(Class) && c != :Base end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main_services\n main_co.services\n end", "def services\n @services_manager\n end", "def services\n end", "def services\n ServiceLocator.service_names.map{|name| \"#{name}_service\".to_sym}\n end", "def list_services\n @services\n end", "def services\n unless @services\n rows = database.view(VIEW_NAME, reduce: false, key: [1, name])['rows'] rescue []\n ids = rows.map {|row| row['value'] }\n @services = Service.all.keys(ids).to_a\n end\n @services\n end", "def services\n\n end", "def services\n return @services\n end", "def services\n\t\tService.find(:all)\n\tend", "def services\n\tend", "def services\n\t\tselect {|x| x.class == Service }\n\tend", "def service_list\n\t\tif session_has_services_depend?\n\t\t\tmeterpreter_service_list\n\t\telse\n\t\t\tshell_service_list\n\t\tend\n\tend", "def service_types\n get_info :service_types\n end", "def services()\n return @data[\"access\"][\"serviceCatalog\"]\n end", "def index\n @services = current_user.services.map{|s| s.becomes(s.name.constantize)}\n end", "def services\n @services ||= []\n end", "def service\n @service\n end", "def system_services\n find_by_group(SYSTEM_GROUP)\n end", "def services\n related_objects_by_type(\"Service\")\n end", "def provided_services\n\t\t\t\tdescription.provided_services\n\t\t\tend", "def set_admin_service\n @service = Service.find(params[:id])\n end", "def services\n @services ||= begin\n files = @api.generate_files.select { |f| f.package == @package }\n service_list = files.map(&:services).flatten\n mixin_service_names = gem.mixins_model.mixin_services\n service_list.delete_if { |s| mixin_service_names.include? s.full_name }\n # Omit common services in this package. Common service clients do not\n # go into their own package.\n normal_services = service_list.select { |s| @api.delegate_service_for(s).nil? }\n # But include common services that delegate to normal services in this package.\n common_services = normal_services.flat_map { |s| @api.common_services_for s }\n (normal_services + common_services).map { |s| ServicePresenter.new @gem_presenter, @api, s }\n end\n end", "def services\n\n @services.keys.sort.collect { |k| @services[k] }\n end", "def list_services\n services.map do |service|\n Hashie::Mash.new({\n service: service,\n display_name: service_display_name(service),\n id: service_id(service)\n })\n end\n end", "def set_admin_service\n @admin_service = Admin::Service.find(params[:id])\n end", "def service_names\n appliance_info['services'].keys\n end", "def service; services.first; end", "def services\n response = JSON.parse(@client.get(\"/api/v1/services\").body)\n return response[\"services\"] || response\n end", "def services\n output = riak_admin 'services'\n if $?.success?\n output.strip.match(/^\\[(.*)\\]$/)[1].split(/,/)\n else\n []\n end\n end", "def srv\n @service_finder\n end", "def service\n return @service\n end", "def sword_services\n Utility.find_elements_by_namespace_and_name(extensions, \"http://purl.org/net/sword/terms/\", \"service\")\n end", "def service_modules\n modules = []\n ObjectSpace.each_object(Module) do |clazz|\n if clazz < Thrift::Client\n modules << qualified_const(clazz.name.split('::')[0..-2].join('::')) # i miss activesupport...\n end\n end\n modules.delete(Thrift)\n modules\n end", "def services\n @services ||= begin\n files = @api.generate_files.select { |f| f.package == @package }\n services = files.map(&:services).flatten\n # Omit common services in this package. Common service clients do not\n # go into their own package.\n normal_services = services.select { |s| @api.delegate_service_for(s).nil? }\n # But include common services that delegate to normal services in this package.\n common_services = normal_services.flat_map { |s| @api.common_services_for s }\n (normal_services + common_services).map { |s| ServicePresenter.new @gem_presenter, @api, s }\n end\n end", "def services(version)\n service_config[version]\n end", "def method_missing(m, *args, &block)\n return @services[m.to_sym] if @services.include? m.to_sym\n raise NoMethodError.new(\"undefined method `#{m}' for #{self}\")\n end", "def service_names\n @services.keys\n end", "def get_list_service_types\n ServiceType.get_list_service_types\n end", "def service\n options[:service]\n end", "def get_services (type = nil, pool = nil)\n\n # NOTE: query_for_services asks for everything, rather than using the\n # more selective resource paths provided by the discovery services.\n # This allows the user to query for all services in a given pool,\n # which is not an available resource path\n\n if !pool.nil? && type.nil?\n service_data = query_for_services()\n result = []\n\n service_data['services'].each do |service|\n if type.nil? || service['type'].eql?(type)\n result << service if pool.nil? || service['pool'].eql?(pool)\n end\n end\n\n return result\n end\n\n service_data = query_for_services(type, pool)\n return service_data[\"services\"]\n end", "def service_name; end", "def list_of_services(name=nil)\n file = File.read('config/ms_ports.json')\n data_hash = JSON.parse(file)\n if name\n return data_hash[name]\n else\n return data_hash\n end\n\n end", "def services_for_home_page\n\t\tservices.for_home_page.display_order.order_by_name\n\tend", "def services\n @services ||= ApiFactory.new 'Repos::Services'\n end", "def services_for(node)\n # This info is taken from our JSON inventory file\n [JSON.parse(File.read(\"#{repository_path}/hosts.json\"))[\"#{node}.hpc_tutorial.org\"]]\n end", "def services\n params = { command: 'account_services' }\n get('/json.php', params)\n end", "def get id\n @services[id]\n end", "def get_auto_start_providers\n\t\ts = get_admin_section \"system.applicationHost/serviceAutoStartProviders\"\n\t\tIisObjectCollection.new s.Collection, :add, AutoStartProvider\n\tend", "def services\n env(default_environment).services\n end", "def service\n @service ||=\n if (c = self_class)\n name = c.safe_const_get(:SERVICE_NAME)\n name ||= c.module_parent_name.underscore.remove(/_service$/)\n name&.to_sym || super\n end\n end", "def find_services(params, serviceDir)\n service_files = []\n if ((services = params[:services]) != nil)\n services.each do |name|\n s = {}\n s[:name] = name\n s[:require] = \"omf-aggmgr/ogs_#{name}/#{name}\"\n s[:config] = \"#{name}.yaml\"\n service_files << s\n end\n else\n MObject.debug('gridservices', \"Loading all available services from #{serviceDir}\")\n Dir.foreach(serviceDir) do |filename|\n if (filename =~ /\\.yaml$/) then\n s = {}\n s[:name] = name = filename.split('.')[0]\n s[:require] = \"omf-aggmgr/ogs_#{name}/#{name}\"\n s[:config] = filename\n service_files << s\n end\n end\n end\n service_files\nend", "def load_services(svcs)\n unless @services\n @services = Gruf.services.concat(svcs)\n @services.uniq!\n end\n @services\n end", "def service\n softlayer_client[:Software_Component].object_with_id(self.id)\n end", "def registry\n Service.descendants\n end", "def service_list\n @service_list ||= {}\n end", "def method_missing( sym, *args, &block )\n if args.empty? && block.nil? && @registry[:services].has_key?( sym )\n return @registry[:services][ sym ]\n else\n super\n end\n end", "def read_service_types()\n types = []\n @client.services.each do |type|\n types << type.label\n end\n\n types\n end", "def service_key\n (is_a?(Module) ? name : self.class.name).demodulize.underscore.to_sym\n end", "def service_key\n (is_a?(Module) ? name : self.class.name).demodulize.underscore.to_sym\n end", "def get_service_names()\n return @mappings.get_names()\n end", "def services\n begin\n resp = _get build_agent_url('services')\n rescue\n logger.warn('Unable to request all the services on this through the HTTP API')\n return nil\n end\n # Consul returns id => ConsulServiceObjects.\n s_hash = JSON.parse(resp)\n s_hash.keys.map { |n| Consul::Model::Service.new.extend(Consul::Model::Service::Representer).from_hash(s_hash[n]) }\n end", "def services=(value)\n @services = value\n end", "def assignable_services\n\t\t(Service.predefined + services).sort_by(&:lower_case_name).uniq\n\tend", "def list_services\n response = @http_client.get(prefix_path('services'))\n Response.new(response)\n end", "def services\n return @service_manager if @service_manager\n\n @service_manager = Rosh::ServiceManager.new(@name)\n @service_manager.add_observer(self)\n\n @service_manager\n end", "def listAdmin\n super()\n updateModules()\n\n if @modulesUsed.include?(\"Autograde\") then\n autogradeListAdmin()\n end\n\n if @modulesUsed.include?(\"Scoreboard\") then\n scoreboardListAdmin()\n end\n\n if @modulesUsed.include?(\"Partners\") then\n partnersListAdmin()\n end\n \n if @modulesUsed.include?(\"Svn\") then\n svnListAdmin()\n end\n end", "def getHttpService()\r\n @currentlyDisplayedItem.getHttpService\r\n end", "def get_services()\n return get_request(address(\"/OS-KSADM/services\"), token())\n end", "def provided_services\n ancestors.find_all { |m| m.kind_of?(Models::TaskServiceModel) }\n end", "def services\n Win32::Service.services.select do |svc|\n # TODO in future, 1.8.7, can use start_with?\n svc.display_name[0,@name_key.size] == @name_key\n end\n end", "def get_services(sObjectType, oParams)\n case sObjectType\n when :services\n # oParams[sObjectType] will provide the controller object.\n # This one can be interpreted only by controller code,\n # except if controller declares how to map with this object.\n # Processes can deal only process mapped data.\n # Currently there is no services process function. No need to map.\n services = oParams[:services]\n if !oParams[:list_services].is_a?(Array)\n service_to_find = [oParams[:list_services]]\n else\n service_to_find = oParams[:list_services]\n end\n # Search for service. Ex: Can be :Networking or network. I currently do\n # not know why...\n search_services = services.rh_get(:service_catalog)\n service = nil\n service_to_find.each do |sServiceElem|\n if search_services.key?(sServiceElem)\n service = sServiceElem\n break\n end\n end\n\n controller_error 'Unable to find services %s',\n service_to_find if service.nil?\n result = services.rh_get(:service_catalog, service).keys\n result.delete('name')\n result.each_index do |iIndex|\n result[iIndex] = result[iIndex].to_s if result[iIndex].is_a?(Symbol)\n end\n return result\n else\n controller_error \"'%s' is not a valid object for 'get_services'\",\n sObjectType\n end\n end", "def index\n @services = Service.joins(:tool)\n end", "def service_functions(service_module)\n methods = service_module.const_get('Client').instance_methods.map {|method| method.to_s}\n methods.select do |method|\n send_exists = methods.include? \"send_#{method}\"\n upped = method.dup\n upped[0..0] = method[0..0].upcase\n begin\n send_exists && service_module.const_get(\"#{upped}_args\")\n rescue\n false\n end\n end\n end", "def services\n ServicePolicy::Scope.new(self, Service).resolve\n end", "def services(query = {})\n get('service', query)\n end", "def services\n services = RingyDingy::RingServer.list_services\n return [] if services.empty?\n\n services = RingyDingy::RingServer.list_services.values.first.uniq\n\n rrc_servers = services.select do |_, klass,|\n klass == RailsRemoteControl::Server::RINGY_DINGY_SERVICE\n end\n\n rrc_servers.map do |_, _, server, name|\n host, pid, = name.split '_', 3\n Server.new host, pid.to_i, server\n end\n end", "def service\n self.original_service or Service.find_by_name(\"FieldStatus\")\n end", "def services_for_see_all_page\n\t\tservices.display_order.order_by_name\n\tend", "def determine_services(specified_groups = []) \n services = {}\n\n activated_service_groups = self.config.select do |group_id, group_definition|\n ((group_id == \"default\" || group_definition[\"default\"] == true) ||\n specified_groups.include?(group_id)) &&\n ! specified_groups.include?(\"-#{group_id}\")\n end\n\n activated_service_groups.each_pair do |group_id, group_definition|\n services.merge! (group_definition[\"services\"] || {})\n end\n\n # Remove any disabled services\n services.reject! {|service_id, hash| hash && hash[\"disabled\"] == true}\n\n return services\n end", "def list_vs_services(options)\n options['method'] = \"vs\"\n dir_list = get_dir_item_list(options)\n message = \"vSphere Services:\"\n handle_output(options,message)\n dir_list.each do |service|\n handle_output(options,service)\n end\n handle_output(options,\"\")\n return\nend", "def service; end", "def services_for(node)\n [json_for(node)['policy_name']]\n end", "def services\n @services ||= Metaforce::Services::Client.new(@options)\n end", "def service\n @service ||= fetcher.get(Service, service_id)\n end", "def service_name\n return @service_name\n end", "def acquire_service_data\n if config[:tags] && config[:service]\n tags = config[:tags].split(',').to_set\n services = []\n Diplomat::Health.service(config[:service]).each do |s|\n if s['Service']['Tags'].to_set.superset? tags\n services.push(*s['Checks'])\n end\n end\n services\n elsif config[:nodename]\n data = []\n begin\n services = Diplomat::Node.get(config[:nodename]).Services\n rescue StandardError\n services = {}\n end\n services.each_value do |service|\n Diplomat::Health.checks(service['Service']).each do |check|\n data.push(check) if check.Node == config[:nodename]\n end\n end\n data\n elsif config[:all]\n Diplomat::Health.state('any')\n else\n Diplomat::Health.checks(config[:service])\n end\n end", "def find_service(service)\n @configs[service]\n end", "def list_services(client, args, options)\n response = client.get(RESOURCE_PATH)\n\n if CloudClient::is_error?(response)\n [response.code.to_i, response.to_s]\n else\n #[0,response.body]\n if options[:json]\n [0,response.body]\n else\n array_list = JSON.parse(response.body)\n SERVICE_TABLE.show(array_list['DOCUMENT_POOL']['DOCUMENT'])\n 0\n end\n end\nend", "def get_services\n reply = @client.call(:get_services)\n\n data = reply.body.dig(:get_services_response,\n :get_services_result,\n :array_of_string)\n data = check_if_data_exists(data)\n\n data.map do |attrs|\n {\n id: Integer(attrs[:string][0], 10),\n name: attrs[:string][1]\n }\n end\n end", "def service_types\n { \n \"renderer\" => {\"start\" => \"ls\", \"stop\" => \"ls\"},\n \"smscd\" => {\"start\" => \"sudo /etc/init.d/smscd start\", \"stop\" => \"sudo /etc/init.d/smscd stop\", \"options\" => \"tunnel\"},\n \"ussd\" => {\"start\" => \"ls\", \"stop\" => \"ls\"}\n }\n end", "def service\n return softlayer_client[\"Virtual_Guest\"].object_with_id(self.id)\n end", "def select(params = {})\n if params.has_key?(:path)\n path_regex = params[:path]\n path_regex = Regexp.new(path_regex.to_s) unless path_regex.is_a?(Regexp)\n selector = lambda {|agent| agent.config_path && path_regex.match(agent.config_path) }\n notify(:msg => \"[#{@name}] Selecting all services for path #{path_regex.inspect}\",\n :tags => [:galaxy, :trace])\n elsif params.has_key?(:type)\n type_regex = params[:type]\n type_regex = Regexp.new(type_regex.to_s) unless type_regex.is_a?(Regexp)\n selector = lambda {|agent| agent.config_path && type_regex.match(agent.type) }\n notify(:msg => \"[#{@name}] Selecting all services of type #{type_regex.inspect}\",\n :tags => [:galaxy, :trace])\n elsif params.has_key?(:core_type)\n core_type_regex = params[:core_type]\n core_type_regex = Regexp.new(core_type_regex.to_s) unless core_type_regex.is_a?(Regexp)\n selector = lambda {|agent| agent.config_path && core_type_regex.match(agent.core_type) }\n notify(:msg => \"[#{@name}] Selecting all services of core type #{core_type_regex.inspect}\",\n :tags => [:galaxy, :trace])\n elsif params.has_key?(:host) || params.has_key?(:hosts)\n host_names = arrayify(params[:host]) & arrayify(params[:hosts])\n selector = lambda {|agent| host_names.include?(agent.host) }\n notify(:msg => \"[#{@name}] Selecting all services for hosts #{host_names.inspect}\",\n :tags => [:galaxy, :trace])\n else\n notify(:msg => \"[#{@name}] Selecting all services\",\n :tags => [:galaxy, :trace])\n end\n command = ::Galaxy::Commands::ShowCommand.new([], @galaxy_options)\n command.report = GalaxyGatheringReport.new(@environment)\n agents = command.select_agents({})\n agents.each { |agent| agent.proxy = ::Galaxy::Transport.locate(agent.url) if agent.url }\n command.execute(agents)\n command.report.results.select {|result| selector.nil? || selector.call(result) }\n end", "def index\n @services = Services::Search.for(params[:term], params[:sort], params[:page], { is_admin: true})\n end", "def index\n @service_providers = ServiceProvider.all\n end", "def services()\n @services.map do |key, object|\n next unless object[:running]\n [key, object[:running].public_methods - Object.public_methods]\n end.compact\n end", "def services\n (YAML.load_file( @options[:path] )||[]) rescue []\n end", "def set_service_ids\n service_ids = FP::Vars.services_on_this_instance.join(',')\n Facter.add(:service_ids) { setcode { service_ids} }\nend", "def services\n ret = []\n offset = 0\n loop do\n cur = get(\"services?limit=#{PAGINATION_SIZE}&offset=#{offset}\")\n offset += PAGINATION_SIZE\n ret.push *cur.services\n break if offset >= cur.total\n end\n ret\n end", "def services\n return @services if @services\n files = Dir[File.join(File.dirname(__FILE__), 'config/[^#]*.yml')]\n @services = files.map do |file|\n File.basename(file, '.yml').to_sym\n end\n @all_services = @services.clone.freeze\n @services.freeze\n end", "def param_service_full_name(options = {})\n merge_options_with_defaults(options, {\n :mandatory => true,\n :lookup_method => lambda do |request| \n @op.with_machine(request.get_param_value(\"machine\")) do |machine| \n localhost.list_services().map do |x|\n x[\"full_name\"]\n end\n end\n end \n })\n RHCP::CommandParam.new(\"service\", \"the service to work with\", options)\nend", "def initialize\n @services = {}\n end" ]
[ "0.70924354", "0.70653266", "0.69642097", "0.69019437", "0.68727845", "0.68675977", "0.6852942", "0.6831881", "0.67676234", "0.6750557", "0.6740998", "0.67178506", "0.67056084", "0.6668765", "0.6636987", "0.65873873", "0.65507483", "0.6444492", "0.64258474", "0.63748944", "0.6293832", "0.62713325", "0.6244189", "0.623622", "0.62065214", "0.6206347", "0.6187614", "0.6185044", "0.61799824", "0.617837", "0.6146917", "0.6136376", "0.6121769", "0.6106674", "0.6095627", "0.60597426", "0.60466075", "0.6041919", "0.601438", "0.60134405", "0.59987915", "0.59977925", "0.59862715", "0.5981919", "0.5973571", "0.5965659", "0.59546113", "0.5943775", "0.5941547", "0.5921806", "0.5920557", "0.59169996", "0.59161705", "0.59085983", "0.58858794", "0.5881807", "0.5871584", "0.5859283", "0.5859283", "0.58566844", "0.58450097", "0.5836641", "0.58356285", "0.58340806", "0.581537", "0.5805874", "0.5803843", "0.5786771", "0.578296", "0.5778094", "0.5776201", "0.5775741", "0.5772926", "0.57698005", "0.57674783", "0.57636124", "0.5761511", "0.57590175", "0.57528985", "0.57477945", "0.57375383", "0.57208884", "0.57174474", "0.57076627", "0.57010007", "0.57007486", "0.56993806", "0.5697475", "0.5689679", "0.56885314", "0.5674047", "0.56729466", "0.56672084", "0.5665721", "0.56586134", "0.56462485", "0.5644681", "0.5634853", "0.5622541", "0.5617351", "0.56163937" ]
0.0
-1
START Browse Action Tests
def test_get_index get :index assert_response :success end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test1Action\n executeTest(\n 'DummyUser',\n {\n 'DummyTool' => {\n 'DummyAction' => [\n []\n ]\n }\n }\n )\n end", "def test_003\n\n # login\n login\n @@pu = 1\n @@pj = 1\n open\"/devgroup/pj_index/#{@@pu}/#{@@pj}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu}/#{@@pj}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # select uploading method in the master tab\n assert is_text_present(_(\"Select a master\"))\n assert is_text_present(_(\"Master\"))\n assert is_text_present(_(\"Select the upload method of individual analysis files\"))\n assert is_text_present(_(\"Upload of individual analysis files\"))\n\n #Select \"uploading a file individually\"\n click \"file_upload_upload_way_upload_each\"\n assert is_text_present(_(\"Uploaded individually.\"))\n #Click button Read tree\n click $xpath[\"task\"][\"read_tree\"]\n assert !60.times{ break if (is_text_present(_(\"Directory structure\")) rescue false); sleep 2 }\n #It will return, if a check is returned for uploading collectively (F2-003)\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # logout\n logout\n\n end", "def test_002\n\n # login\n login\n @@pu = 1\n @@pj = 1\n open\"/devgroup/pj_index/#{@@pu}/#{@@pj}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu}/#{@@pj}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n #Click Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n #Select \"uploading a file individually\"\n click \"file_upload_upload_way_upload_each\"\n assert is_text_present(_(\"Uploaded individually.\"))\n click $xpath[\"task\"][\"read_tree\"]\n\n assert !60.times{ break if (is_text_present(_(\"Directory structure\")) rescue false); sleep 2 }\n # logout\n logout\n\n end", "def test1ActionFileParameter\n # Create a local file name to transfer\n setupTempFile do |iTempFileName|\n executeTest(\n 'DummyUser',\n {\n 'DummyTool' => {\n 'DummyAction' => [\n [ WEACE::Master::TransferFile.new(iTempFileName) ]\n ]\n }\n }\n )\n end\n end", "def test05_L1DLT05_TC_24418\n\t\t$browser.goto($patch_login)\n\t\tloginDirectory\n\t\t$browser.goto($patch_directory_listing)\n\t\t$directory_listing_manager.when_present.click\n\t\t\n\t\t\n\t\tsleep 2\n\t\tbegin\n\t\tassert $browser.text.include? \"Recent Activity\"\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"L1DLT05: FAILED! Unable to click directory listing\"\n\t\tend\n\tend", "def test2Actions\n executeTest(\n 'DummyUser',\n {\n 'DummyTool' => {\n 'DummyActionWithParams' => [\n [ 'Param1', 'Param2' ]\n ],\n 'DummyAction' => [\n []\n ]\n }\n }\n )\n end", "def run_actions; end", "def start_tests(files)\n end", "def test_020\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n\n #A subwindow carries out fade-out and closes.\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def action\n driver.action\n end", "def test!\n in_test_dir do\n notify.start(\"Running tests on: #{proj_branch}\")\n test.run!\n notify.done(\"Test finished: #{test.status}\", test.passed?)\n end\n end", "def test_009\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n #Pu created\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n # click link setup QAC\n assert is_text_present(\"qac\")\n sleep 3\n click $xpath[\"task\"][\"analyze_allow_file_link\"]\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(\"analyze_allow_files(qac)\") rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n # click link setup QAC++\n assert is_text_present(\"qacpp\")\n sleep 3\n click $xpath[\"task\"][\"analyze_allow_file_link2\"]\n # check log in the navigation bar\n sleep 2\n assert !60.times{ break if (is_text_present(\"analyze_allow_files(qacpp)\") rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def click_run_file_dialog_popup(title)\n click_button_popup(title, \"&Run\")\nend", "def launch!\n\t\tintroduction\n\t\t\taction = nil\n\t\t\tuntil action == :quit\n\t\t\t# action loop\n\t\t\t# what do you want to do? (list, find, add, quit)\n\t\t\tprint \"> \"\n\t\t\tuser_response = gets.downcase.strip!.split(' ')\n\t\t\t# do that action\n\t\t\taction,args = do_action(user_response[0],user_response[1])\n\t\tend\n\t\tconclusion\n\tend", "def test_021\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n # logout\n logout\n\n end", "def testRunAction\n executeSlave(\n [\n '--user', 'DummyUser',\n '--tool', 'DummyTool',\n '--action', 'DummyAction'\n ],\n :AddRegressionActions => true,\n :Repository => 'Dummy/SlaveActionActive'\n ) do |iError|\n assert_equal('DummyUser', $Variables[:DummyAction_User])\n end\n end", "def sub_test\n shell(test_script, source_dir)\n end", "def testing_begin(files)\n end", "def test_017\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n #An option is checked\n assert is_checked($xpath[\"task\"][\"master_option_chk2\"])\n #Click a directory link\n click $xpath[\"task\"][\"master_option_dir1\"]\n sleep 2\n #All file of directory is checked.\n\n assert is_checked($xpath[\"task\"][\"master_option_chk3\"])\n assert is_checked($xpath[\"task\"][\"master_option_chk4\"])\n\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def test_010\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n #Pu created\n\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n # click link setup QAC\n assert is_text_present(\"qac\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link\"]\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def test_001\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n # #Find a PU\n #Pu created\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n pj_name = 'pj'\n register_pj(pj_name)\n @@pj = Pj.find(:last)\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n #Click Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n @@pu.destroy\n # logout\n logout\n\n end", "def run_test\n # Add your code here...\n end", "def run_test\n # Add your code here...\n end", "def test_019\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #Click link M of a directory\n click $xpath[\"task\"][\"m_link\"]\n sleep 2\n\n #The name of the directory which pushed [M] goes into the field of right-hand side make_root.\n assert_equal \"sample_c/\", get_value( $xpath[\"task\"][\"make_root_link\"])\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def test_007\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n @@pu = Pu.find_by_name('SamplePU1')\n\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n @@pj = Pj.find_by_name('SamplePJ1')\n\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # test for value of master into combobox in master tab\n assert_equal [\"sample_c_cpp\"], get_select_options(\"master_id\")\n assert is_text_present(_(\"Optional setting\"))\n # click link setup QAC\n assert is_text_present(\"qac\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link\"]\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n # click link setup QAC++\n assert is_text_present(\"qacpp\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link2\"]\n sleep 2\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n\n\n # logout\n logout\n\n end", "def action_run\n end", "def test01_LI2_view_contributor\n\t\t$browser.goto($patch_login)\n\t\tloginDirectory\n\t\t$browser.goto($patch_directory_listing)\n\t\t$directory_top.fire_event(\"onclick\")\n\t\t\n\t\tsleep 5\n\t\tbegin\n\t\tassert assert $browser.text.include? \"Recent Activity\"\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"LI2_view_contributor: FAILED! Unable to view top contributor profile.\"\n\t\tend\n\tend", "def start_all\n UiChanged::Screenshot.async_crawl_and_compare\n head :ok\n end", "def test1ActionWithFileTransfer\n initTestCase do\n setupTempFile(false) do |iTmpFileName|\n $Context[:SlaveActions] = [\n [ 'DummyTool', 'DummyAction', [WEACE::Master::TransferFile.new(iTmpFileName)] ]\n ]\n executeMaster( [ '--process', 'DummyProcess', '--user', 'DummyUser' ],\n :Repository => 'Dummy/MasterServerInstalledWithDummySender',\n :AddRegressionProcesses => true,\n :AddRegressionSenders => true\n ) do |iError|\n assert_equal( [\n [ 'prepareFileTransfer', [ iTmpFileName ] ],\n [ 'sendMessage', [ 'DummyUser', {\n 'DummyTool' => {\n 'DummyAction' => [\n [ \"#{iTmpFileName}_PREPARED\" ]\n ]\n }\n } ]\n ]\n ],\n $Variables[:DummySenderCalls]\n )\n assert(!File.exists?(iTmpFileName))\n assert_equal([], getSlaveClientQueue)\n assert_equal({}, getTransferFiles)\n end\n end\n end\n end", "def action\n trigger :click\n end", "def test_023\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n #The Make root directory set as the make_root field enters.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n #The directory/file names which were being changed into the check state\n #at the information dialog which clicks analyze_allow_files\n #and comes out are enumerated.\n click $xpath[\"task\"][\"analyze_allow_file_link\"]\n sleep 3\n\n assert !is_text_present(\"sample_c/Makefile\")\n\n # logout\n logout\n\n end", "def test_011\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n #Pu created\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n sleep 2\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # click link setup QAC++\n assert is_text_present(\"qacpp\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link2\"]\n # check log in the navigation bar\n sleep 2\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def test_005\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n # #Find a PU\n #Pu created\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n pj_name = 'pj'\n register_pj(pj_name)\n @@pj = Pj.find(:last)\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # Below \"selection of the upload method of an individual analysis file\" is displayed.\n assert is_text_present(_(\"Select a master\"))\n assert is_text_present(_(\"Master\"))\n assert is_text_present(_(\"Select the upload method of individual analysis files\"))\n assert is_text_present(_(\"Upload of individual analysis files\"))\n\n @@pu.destroy\n # logout\n logout\n\n end", "def begin_lights_test\n puts 'Invoker: start test'\n @on_start.execute if @on_start.is_a? Command\n\n puts 'Invoker: ...loading last tests...'\n\n puts 'Invoker: starting last tests'\n @on_finish.execute if @on_finish.is_a? Command\n end", "def test_022\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n #The Make root directory set as the make_root field enters.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n # logout\n logout\n\n end", "def go()\n\[email protected] @url\n end", "def test_024\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n #The Make root directory set as the make_root field enters.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n #The directory/file names which were being changed into the state\n #where it does not check at the information dialog\n #which clicks analyze_deny_files and comes out are enumerated.\n\n click $xpath[\"task\"][\"analyze_deny_files\"]\n sleep 3\n\n assert is_text_present(\"sample_c/Makefile\")\n\n\n # logout\n logout\n\n end", "def test_016\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n #An option setup was performed\n\n assert is_checked($xpath[\"task\"][\"master_option_chk2\"])\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Click a directory link\n click $xpath[\"task\"][\"master_option_dir1\"]\n sleep 2\n assert !is_checked($xpath[\"task\"][\"master_option_chk3\"])\n assert !is_checked($xpath[\"task\"][\"master_option_chk4\"])\n\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def run test_identifier=nil\n @dispatcher.run!\n # start\n message(\"start\")\n suite_setup,suite_teardown,setup,teardown,tests=*parse(test_identifier)\n if tests.empty? \n @dispatcher.exit\n raise RutemaError,\"No tests to run!\"\n else\n # running - at this point all checks are done and the tests are active\n message(\"running\")\n run_scenarios(tests,suite_setup,suite_teardown,setup,teardown)\n end\n message(\"end\")\n @dispatcher.exit\n @dispatcher.report(tests)\n end", "def screenActions\n actionobjects = @actionObjects[@action]\n return if actionobjects == nil\n actionobjects.each do |obj|\n if obj['Value'] == \"uploadfile:@step['Parameter1']\"\n p\n end\n waitTime = obj['Wait'].to_s.to_f\n sleep(waitTime)\n objectAction(obj)\n if @skipCurrentStep == true\n break\n end\n end\n end", "def run_kitchen(action, regexp, loader_config={})\n action = 'test' if action.nil?\n require 'kitchen'\n Kitchen.logger = Kitchen.default_file_logger\n config = {loader: Kitchen::Loader::YAML.new(loader_config)}\n kitchen_instances(regexp, config).each { |i| i.send(action) }\n end", "def test\n self.test_session.test\n end", "def test_004\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n # #Find a PU\n #Pu created\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n pj_name = 'pj'\n register_pj(pj_name)\n @@pj = Pj.find(:last)\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 全体解析 (Analysis of all)\n select \"analyze_type\", \"label=#{@overall}\"\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n #There is no display below \"selection of the upload method of an individual analysis file.\"\n assert !is_text_present(_(\"Select the upload method of individual analysis files\"))\n\n @@pu.destroy\n # logout\n logout\n\n end", "def test2ActionsDifferentTools\n executeTest(\n 'DummyUser',\n {\n 'DummyTool' => {\n 'DummyAction' => [\n []\n ]\n },\n 'DummyTool2' => {\n 'DummyAction2' => [\n []\n ]\n }\n }\n )\n end", "def test_0\n\n #log_level_to_debug\n\n li = OpenWFE::LaunchItem.new\n li.wfdurl = 'file:test/_testdef.rb'\n\n dotest(li, %w(a b c).join(\"\\n\"))\n end", "def launch!\n introduction\n # action loop\n result = nil\n until result == :quit do\n action, args = get_action\n result = do_action(action, args)\n end\n conclusion\n end", "def test1ActionParameters\n executeTest(\n 'DummyUser',\n {\n 'DummyTool' => {\n 'DummyActionWithParams' => [\n [ 'Param1', 'Param2' ]\n ]\n }\n }\n )\n end", "def test_uplink_class2\n start(\"tests/verify_uplink_class2.rb\")\n end", "def medium_test\n wait(20) # capture results from the easy test...\n \n 5.times do\n cmd(\"CFS CFS_WHE_OBS_START\")\n wait(20) \n end\nend", "def startcompany(action)\n @done = true\n action.setup\n end", "def test_home\n @current_test_name = \"Arch - Testing Home Page\"\n each_driver do\n each_view_redirects do\n common_elements?\n end\n end\n end", "def test_shall_list_briefcase_items\n login_as :administrator\n get :list\n assert :success\n end", "def test\n get(\"/help/test\")\n end", "def te_st_099_WIP\r\n\r\n sTestCase_Name = \"test_099_WIP\"\r\n puts2(\"Starting Testcase: #{sTestCase_Name}\")\r\n\r\n puts2(\"Close the window\")\r\n\r\n # Set the flag to close the $browser after the last test case runs\r\n @@bCloseBrowser = true\r\n\r\nend", "def run_kitchen(action, regexp, loader_config = {})\n action = 'test' if action.nil?\n require 'kitchen'\n Kitchen.logger = Kitchen.default_file_logger\n config = { loader: Kitchen::Loader::YAML.new(loader_config) }\n kitchen_instances(regexp, config).each { |i| i.send(action) }\n end", "def run_kitchen(action, regexp, loader_config = {})\n action = 'test' if action.nil?\n require 'kitchen'\n Kitchen.logger = Kitchen.default_file_logger\n config = { loader: Kitchen::Loader::YAML.new(loader_config) }\n kitchen_instances(regexp, config).each { |i| i.send(action) }\n end", "def test_006\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #A task type is changed into \"individual analysis\"\n # with a \"general control\" tab.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析 (Individual Analysis)\n select \"analyze_type\", \"label=#{@individual}\"\n #Click Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n #An option setup of \"master: A qac\" subwindow is displayed.\n click $xpath[\"task\"][\"option_setup_link\"]\n # click \"link=設定する\"\n sleep 3\n # #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n assert !60.times{ break if (@selenium.is_text_present(_(\"Optional setting\")+\":qac\") rescue false); sleep 2 }\n sleep 2\n\n # logout\n logout\n\n end", "def test_show_image\n\t\t#get :show, :path => 'photo1.jpg'\n\t\t#assert_response :success \n\tend", "def test_025\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n #The Make root directory set as the make_root field enters.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n #Move to general control tab\n click $xpath[\"task\"][\"general_control_tab\"]\n\n #The information set does not disappear and remains.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n # logout\n logout\n\n end", "def start_test(test_status)\n # Abstract\n end", "def run_app_tests\n end", "def action(type)\n ENV[\"runner_path\"] = $runner_path\n\n dirname = File.dirname(File.expand_path(__FILE__))\n script = File.join(dirname, \"action.py\")\n\n puts \"Calling python script: #{script} #{type}\"\n exec(\"python\", script, type, *$items)\nend", "def test_index\n login\n get(:index)\n\n assert_displayed_title(\"Names by Name\")\n end", "def open()\n \n #note we would want to check for the browser being open already\n #so we don't annoy people\n \n event(\"Pre\")\n require 'launchy'\n Launchy.open(\"http://store.mage.dev/admin\") #note this should be from setting file\n event(\"Post\")\n end", "def test_012\n\n #login\n login\n\n #Open PU management page\n open_pu_management_page_1\n\n # Find a PU\n # Pu created\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n #test for make root in the master tab & in the popup which is displayed by clicking 設定する\n # click link setup QAC\n assert is_text_present(\"qac\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link\"]\n #test for make root\n type \"makeroot_qac\", \"abc\"\n run_script \"destroy_subwindow()\"\n assert is_text_present(_(\"Make root\")+\":\")\n click $xpath[\"task\"][\"option_setup_link\"]\n sleep 2\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n sleep 3\n assert !60.times{ break if (@selenium.is_text_present(_(\"Optional setting\")+\":qac\") rescue false); sleep 2 }\n type \"makeroot_qac\", \"abc\"\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 2\n assert is_text_present(_(\"Make root\")+\":\")\n click $xpath[\"task\"][\"option_setup_link\"]\n assert !60.times{ break if (@selenium.is_text_present(_(\"Optional setting\")+\":qac\") rescue false); sleep 2 }\n\n\n\n #logout\n logout\n\n end", "def tests; end", "def tests; end", "def run_test(file_name)\n puts \"Running tests for #{file_name}\"\n Watir::Browser.default = 'firefox'\n browser = Watir::Browser.new\n browser.goto file_name\n results_paragraph = browser.p :id, 'qunit-testresult'\n if results_paragraph.exists?\n puts results_paragraph.text\n else\n puts 'Test failed to run'\n end\n # parse the output from the test and print error messages for failing tests\n browser.elements_by_xpath(\"//ol[@id='qunit-tests']/li\").each_with_index do |li, index|\n if li.class_name == 'fail'\n puts \" #{index} - #{li.text}\"\n end\n end\n #TODO: find the failing tests and list them\n browser.close\nend", "def start_work_on(guide)\n visit \"/admin\"\n click_on \"Lined up\"\n assert page.has_content?(guide.title)\n within :xpath, \"//form[contains(@action, '#{guide.id}/start_work')]\" do\n click_on \"Start work\"\n end\n assert page.has_content?(\"Work started\")\n end", "def test02_D3LRT03\n\t\t$browser.goto($patch_login)\n\t\tloginDirectory\n\t\t$browser.goto($patch_directory)\n\t\t$directory_title.fire_event(\"onclick\")\n\t\t\n\t\tsleep 2\n\t\tbegin\n\t\tassert $browser.text.include? \"Directory Group\"\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"D2FLT03: FAILED! Unable to click directory listing\"\n\t\tend\n\tend", "def start\n @actions << :start\n end", "def run_tests\n\n ::RSpec::Core::Runner.run([])\n\n print ::IRB.CurrentContext.io.prompt\n\n end", "def test_008\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n @@pj = Pj.find_by_name('SamplePJ1')#\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n # test for value of master into combobox in master tab\n assert_equal [\"sample_c_cpp\"], get_select_options(\"master_id\")\n assert is_text_present(_(\"Optional setting\"))\n\n click $xpath[\"task\"][\"registration_task_button\"]\n sleep 2\n #assert !60.times{ break if (is_text_present(\"解析ツール未選択 入力内容に問題があるためタスクを登録できません。\") rescue false); sleep 2 }\n\n\n # logout\n logout\n\n end", "def click\n @_node.click\n @_node.getPage.getWebClient.waitForBackgroundJavaScriptStartingBefore(3000)\n end", "def test02_D3LRT02\n\t\t$browser.goto($patch_login)\n\t\tloginDirectory\n\t\t$browser.goto($patch_directory)\n\t\t$directory_image.when_present.fire_event(\"onclick\")\n\t\t\n\t\tsleep 2\n\t\tbegin\n\t\tassert $browser.text.include? \"Directory Group\"\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"D2FLT02: FAILED! Unable to click directory listing\"\n\t\tend\n\tend", "def test_scm_st_003\n printf \"\\n Test 003\"\n open_periodical_analysis_setting_tab \n assert(is_element_present($display_scm_xpath[\"save_button\"])) \n assert(is_element_present($display_scm_xpath[\"clear_button\"]))\n assert(is_element_present($display_scm_xpath[\"delete_button\"]))\n assert(is_element_present($display_scm_xpath[\"save_all_button\"]))\n logout\n end", "def test_03()\n\t\tputs \"Inside test 3\"\n\t\t$browser.stop\n\t\t\n\tend", "def start\n test_btc\n test_email\n end", "def testRun2Actions\n executeSlave(\n [\n '--user', 'DummyUser',\n '--tool', 'DummyTool',\n '--action', 'DummyActionWithParams',\n 'Param1',\n 'Param2',\n '--action', 'DummyAction'\n ],\n :AddRegressionActions => true,\n :Repository => 'Dummy/AllDummyActionsAvailable'\n ) do |iError|\n assert_equal('DummyUser', $Variables[:DummyAction_User])\n assert_equal('DummyUser', $Variables[:DummyActionWithParams_User])\n assert_equal([ 'Param1', 'Param2' ], $Variables[:DummyActionWithParams_Params])\n end\n end", "def launch!\n\t\tintroduction\n\n\t\tresult = nil\n\t\tuntil result == :quit\n\t\t\tprint \"> Choose one of these options: List, Sort, Find or Add.\\n\\n\"\n\t\t\tuser_response = gets.chomp\n\t\t\tresult = do_action(user_response)\n\t\tend\n\t\tconclusion\n\tend", "def testRunActionWithParameters\n executeSlave(\n [\n '--user', 'DummyUser',\n '--tool', 'DummyTool',\n '--action', 'DummyActionWithParams',\n 'Param1',\n 'Param2'\n ],\n :AddRegressionActions => true,\n :Repository => 'Dummy/AllDummyActionsAvailable'\n ) do |iError|\n assert_equal([ 'Param1', 'Param2' ], $Variables[:DummyActionWithParams_Params])\n end\n end", "def actions; end", "def testchoose\n # list filters as you type\n $log.debug \"called CHOOSE \" if $log.debug?\n filter = \"*\"\n filter = ENV['PWD']+\"/*\"\n str = choose filter, :title => \"Files\", :prompt => \"Choose a file: \"\n message \"We got #{str} \"\nend", "def test_018\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n #An option is checked\n assert is_checked($xpath[\"task\"][\"master_option_chk2\"])\n #Click a directory link\n click $xpath[\"task\"][\"master_option_dir1\"]\n sleep 2\n #Click a sub directory link\n click $xpath[\"task\"][\"master_option_file1\"]\n sleep 2\n #uncheck a file\n\n click $xpath[\"task\"][\"master_option_chk5\"]\n sleep 2\n\n #The state of other check boxes is not influenced.\n assert is_checked($xpath[\"task\"][\"master_option_chk6\"])\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def test_document_server(url)\n test_name = \"Test Document Server Connection\"\n puts test_name\n get_website(url)\n login_as_guest_test\n if @browser.find_element(:css=>'.focus') #Dismisses the splashscreen if present\n @wait.until{@browser.find_element(:css=>'.focus')}.click\n end\n login_toolshelf_button_test\n login_test\nend", "def test_downlink_class1\n # Test Class 2 downlink capabilities\n start(\"tests/verify_downlink_class1.rb\")\n end", "def test_scm_st_002\n printf \"\\n Test 002\"\n login(PJ_ADMIN_USER,PJ_ADMIN_PASSWORD)\n open \"/devgroup/pj_index/1/1\"\n sleep SLEEP_TIME\n click ($display_scm_xpath[\"menu_link\"])\n sleep SLEEP_TIME\n assert is_text_present($display_scm[\"scm_tab_name\"])\n logout\n end", "def start\n @driver.navigate.to \"http://play.threesgame.com\"\n sleep(0.5)\n end", "def test_013\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n\n #Get window id\n window_id = get_attribute(\"//body/div[2]\", \"id\")\n window_id =~ /.*?id=(\\d+).*?/\n\n #Maximize window\n click window_id + \"_maximize\"\n\n sleep 3\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def test02_LI2_view_event\n\t\t$browser.goto($patch_login)\n\t\tloginDirectory\n\t\t$browser.goto($patch_directory_listing)\n\t\t$directory_upcoming_events.click\n\t\t\n\t\tsleep 5\n\t\tbegin\n\t\tassert assert $browser.text.include? \"All Events\"\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"LI2_view_event: FAILED! Unable to view upcoming events.\"\n\t\tend\n\tend", "def run_one_test(session)\n \n end", "def test_015\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n #An option setup was performed\n\n assert is_checked($xpath[\"task\"][\"master_option_chk1\"])\n\n #uncheck an option setup\n click $xpath[\"task\"][\"master_option_chk1\"]\n\n\n #Get window id\n window_id = get_attribute(\"//body/div[2]\", \"id\")\n window_id =~ /.*?id=(\\d+).*?/\n\n #Close window\n click window_id + \"_close\"\n\n sleep 3\n #Open popup set again\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n #the information set remains\n assert is_checked($xpath[\"task\"][\"master_option_chk1\"])\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def start_run()\n \"Click the <b>Start Run</b> button\"\n end", "def test_014\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n\n #Get window id\n window_id = get_attribute(\"//body/div[2]\", \"id\")\n window_id =~ /.*?id=(\\d+).*?/\n\n #Maximize window\n click window_id + \"_close\"\n\n sleep 3\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def test_downlink_class2\n start(\"tests/verify_downlink_class2.rb\")\n end", "def test_AddJobOrderFromUploading\n \n #PRECONDITIONS\n #Login\n Common.login(Users::USER_EMAIL, Users::PASSWORD)\n \n #Go to HomePage\n Common.goToTab(HomePage::HOME_TAB_LINK_XPATH)\n \n # 1 - Click on \"Job Order Tools\" on sidebar sections\n test = [\n {\"displayed\" => HomePage::ADD_JOB_ORDERS_XPATH},\n # 2 - Click on \"Add Job Order\" \n {\"click\" => HomePage::ADD_JOB_ORDERS_XPATH}\n ]\n Common.main(test)\n \n newWindow= $browser.window_handles.last\n $browser.switch_to.window(newWindow)\n \n file = File.join(Dir.pwd, @@JobBoard01)\n \n test = [\n {\"displayed\" => HomePage::UPLOAD_BTN_BROWSE_XPATH},\n {\"upload\" => HomePage::UPLOAD_BTN_BROWSE_XPATH, \"file\" => file},\n {\"click\" => HomePage::UPLOAD_BTN_ADD_JOB_XPATH}\n ]\n Common.main(test)\n \n newWindow= $browser.window_handles.first\n $browser.switch_to.window(newWindow)\n \n assert $wait.until{\n $browser.find_element(:xpath => RequisitionsDetail::REQUISITIONS_DETAIL_NAME_XPATH).displayed?\n }\n \n end", "def testing\n # ...\n end", "def test_login\n # Your test\n end", "def test_my_brain_start\n current_user.test_my_brain_started!\n redirect_to \"#{ENV[\"test_my_brain_url\"]}?id=#{current_user.subject_code}#{current_user.current_event_brain_code}\", allow_other_host: true\n end", "def test_NeedHelpLink\n\n loginpage = Hudl_Login_Page.new @@driver\n\n loginpage.ClickNeedHelp()\n\n end", "def test_public_page_titles\n @selenium.open \"/\"\n assert_equal \"Google\", @selenium.title\n end" ]
[ "0.66013664", "0.64105886", "0.638466", "0.62344986", "0.6178465", "0.61123097", "0.6051982", "0.60236186", "0.59732795", "0.59589386", "0.5955443", "0.5937518", "0.5927585", "0.5920483", "0.5917375", "0.59161735", "0.59154874", "0.5907668", "0.5901746", "0.58961457", "0.5885998", "0.5872731", "0.5872731", "0.5869498", "0.58692795", "0.5849889", "0.58421946", "0.58354664", "0.5812667", "0.57984966", "0.5798397", "0.5787745", "0.578223", "0.57726365", "0.57626307", "0.5760084", "0.57594573", "0.5758956", "0.5758462", "0.57566893", "0.5755903", "0.57549536", "0.5752396", "0.5747359", "0.5741662", "0.5741418", "0.57241493", "0.5722764", "0.5721398", "0.5720344", "0.5713754", "0.5711271", "0.5699002", "0.5690645", "0.56888425", "0.56888425", "0.56844497", "0.567912", "0.56731653", "0.56721926", "0.5663514", "0.5650187", "0.5650049", "0.5633542", "0.5632011", "0.56311494", "0.56311494", "0.56202894", "0.56172675", "0.56152666", "0.56073546", "0.5607247", "0.5606305", "0.5602683", "0.5602112", "0.5597368", "0.5583409", "0.5582417", "0.55797136", "0.5579364", "0.5573473", "0.55704397", "0.5564123", "0.55596095", "0.5559098", "0.5552345", "0.5551709", "0.55369014", "0.5535964", "0.55336666", "0.55322766", "0.5527167", "0.55270904", "0.5524497", "0.55213314", "0.54850125", "0.5479797", "0.54762924", "0.5475674", "0.547436", "0.5469717" ]
0.0
-1
END Browse Action Tests START Browse Defect Tests
def test_get_nonexistent_continent assert_raise(ActiveRecord::RecordNotFound) { get :continent, :continent_code => 'GL', :continent_name => 'Gondwanaland' } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_002\n\n # login\n login\n @@pu = 1\n @@pj = 1\n open\"/devgroup/pj_index/#{@@pu}/#{@@pj}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu}/#{@@pj}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n #Click Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n #Select \"uploading a file individually\"\n click \"file_upload_upload_way_upload_each\"\n assert is_text_present(_(\"Uploaded individually.\"))\n click $xpath[\"task\"][\"read_tree\"]\n\n assert !60.times{ break if (is_text_present(_(\"Directory structure\")) rescue false); sleep 2 }\n # logout\n logout\n\n end", "def test_003\n\n # login\n login\n @@pu = 1\n @@pj = 1\n open\"/devgroup/pj_index/#{@@pu}/#{@@pj}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu}/#{@@pj}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # select uploading method in the master tab\n assert is_text_present(_(\"Select a master\"))\n assert is_text_present(_(\"Master\"))\n assert is_text_present(_(\"Select the upload method of individual analysis files\"))\n assert is_text_present(_(\"Upload of individual analysis files\"))\n\n #Select \"uploading a file individually\"\n click \"file_upload_upload_way_upload_each\"\n assert is_text_present(_(\"Uploaded individually.\"))\n #Click button Read tree\n click $xpath[\"task\"][\"read_tree\"]\n assert !60.times{ break if (is_text_present(_(\"Directory structure\")) rescue false); sleep 2 }\n #It will return, if a check is returned for uploading collectively (F2-003)\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # logout\n logout\n\n end", "def test1Action\n executeTest(\n 'DummyUser',\n {\n 'DummyTool' => {\n 'DummyAction' => [\n []\n ]\n }\n }\n )\n end", "def tests; end", "def tests; end", "def test_case; end", "def test_021\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n # logout\n logout\n\n end", "def test_023\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n #The Make root directory set as the make_root field enters.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n #The directory/file names which were being changed into the check state\n #at the information dialog which clicks analyze_allow_files\n #and comes out are enumerated.\n click $xpath[\"task\"][\"analyze_allow_file_link\"]\n sleep 3\n\n assert !is_text_present(\"sample_c/Makefile\")\n\n # logout\n logout\n\n end", "def test_024\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n #The Make root directory set as the make_root field enters.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n #The directory/file names which were being changed into the state\n #where it does not check at the information dialog\n #which clicks analyze_deny_files and comes out are enumerated.\n\n click $xpath[\"task\"][\"analyze_deny_files\"]\n sleep 3\n\n assert is_text_present(\"sample_c/Makefile\")\n\n\n # logout\n logout\n\n end", "def test_007\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n @@pu = Pu.find_by_name('SamplePU1')\n\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n @@pj = Pj.find_by_name('SamplePJ1')\n\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # test for value of master into combobox in master tab\n assert_equal [\"sample_c_cpp\"], get_select_options(\"master_id\")\n assert is_text_present(_(\"Optional setting\"))\n # click link setup QAC\n assert is_text_present(\"qac\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link\"]\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n # click link setup QAC++\n assert is_text_present(\"qacpp\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link2\"]\n sleep 2\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n\n\n # logout\n logout\n\n end", "def test_005\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n # #Find a PU\n #Pu created\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n pj_name = 'pj'\n register_pj(pj_name)\n @@pj = Pj.find(:last)\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # Below \"selection of the upload method of an individual analysis file\" is displayed.\n assert is_text_present(_(\"Select a master\"))\n assert is_text_present(_(\"Master\"))\n assert is_text_present(_(\"Select the upload method of individual analysis files\"))\n assert is_text_present(_(\"Upload of individual analysis files\"))\n\n @@pu.destroy\n # logout\n logout\n\n end", "def test05_L1DLT05_TC_24418\n\t\t$browser.goto($patch_login)\n\t\tloginDirectory\n\t\t$browser.goto($patch_directory_listing)\n\t\t$directory_listing_manager.when_present.click\n\t\t\n\t\t\n\t\tsleep 2\n\t\tbegin\n\t\tassert $browser.text.include? \"Recent Activity\"\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"L1DLT05: FAILED! Unable to click directory listing\"\n\t\tend\n\tend", "def test_009\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n #Pu created\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n # click link setup QAC\n assert is_text_present(\"qac\")\n sleep 3\n click $xpath[\"task\"][\"analyze_allow_file_link\"]\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(\"analyze_allow_files(qac)\") rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n # click link setup QAC++\n assert is_text_present(\"qacpp\")\n sleep 3\n click $xpath[\"task\"][\"analyze_allow_file_link2\"]\n # check log in the navigation bar\n sleep 2\n assert !60.times{ break if (is_text_present(\"analyze_allow_files(qacpp)\") rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def test_004\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n # #Find a PU\n #Pu created\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n pj_name = 'pj'\n register_pj(pj_name)\n @@pj = Pj.find(:last)\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 全体解析 (Analysis of all)\n select \"analyze_type\", \"label=#{@overall}\"\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n #There is no display below \"selection of the upload method of an individual analysis file.\"\n assert !is_text_present(_(\"Select the upload method of individual analysis files\"))\n\n @@pu.destroy\n # logout\n logout\n\n end", "def test_008\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n @@pj = Pj.find_by_name('SamplePJ1')#\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n # test for value of master into combobox in master tab\n assert_equal [\"sample_c_cpp\"], get_select_options(\"master_id\")\n assert is_text_present(_(\"Optional setting\"))\n\n click $xpath[\"task\"][\"registration_task_button\"]\n sleep 2\n #assert !60.times{ break if (is_text_present(\"解析ツール未選択 入力内容に問題があるためタスクを登録できません。\") rescue false); sleep 2 }\n\n\n # logout\n logout\n\n end", "def testing\n # ...\n end", "def test2Actions\n executeTest(\n 'DummyUser',\n {\n 'DummyTool' => {\n 'DummyActionWithParams' => [\n [ 'Param1', 'Param2' ]\n ],\n 'DummyAction' => [\n []\n ]\n }\n }\n )\n end", "def test_022\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n #The Make root directory set as the make_root field enters.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n # logout\n logout\n\n end", "def testing_begin(files)\n end", "def test_020\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n\n #A subwindow carries out fade-out and closes.\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def test_006\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #A task type is changed into \"individual analysis\"\n # with a \"general control\" tab.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析 (Individual Analysis)\n select \"analyze_type\", \"label=#{@individual}\"\n #Click Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n #An option setup of \"master: A qac\" subwindow is displayed.\n click $xpath[\"task\"][\"option_setup_link\"]\n # click \"link=設定する\"\n sleep 3\n # #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n assert !60.times{ break if (@selenium.is_text_present(_(\"Optional setting\")+\":qac\") rescue false); sleep 2 }\n sleep 2\n\n # logout\n logout\n\n end", "def test_scm_st_002\n printf \"\\n Test 002\"\n login(PJ_ADMIN_USER,PJ_ADMIN_PASSWORD)\n open \"/devgroup/pj_index/1/1\"\n sleep SLEEP_TIME\n click ($display_scm_xpath[\"menu_link\"])\n sleep SLEEP_TIME\n assert is_text_present($display_scm[\"scm_tab_name\"])\n logout\n end", "def test_001\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n # #Find a PU\n #Pu created\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n pj_name = 'pj'\n register_pj(pj_name)\n @@pj = Pj.find(:last)\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n #Click Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n @@pu.destroy\n # logout\n logout\n\n end", "def test2ActionsDifferentTools\n executeTest(\n 'DummyUser',\n {\n 'DummyTool' => {\n 'DummyAction' => [\n []\n ]\n },\n 'DummyTool2' => {\n 'DummyAction2' => [\n []\n ]\n }\n }\n )\n end", "def running_test_case; end", "def test01_LI2_view_contributor\n\t\t$browser.goto($patch_login)\n\t\tloginDirectory\n\t\t$browser.goto($patch_directory_listing)\n\t\t$directory_top.fire_event(\"onclick\")\n\t\t\n\t\tsleep 5\n\t\tbegin\n\t\tassert assert $browser.text.include? \"Recent Activity\"\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"LI2_view_contributor: FAILED! Unable to view top contributor profile.\"\n\t\tend\n\tend", "def test_025\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n #The Make root directory set as the make_root field enters.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n #Move to general control tab\n click $xpath[\"task\"][\"general_control_tab\"]\n\n #The information set does not disappear and remains.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n # logout\n logout\n\n end", "def test_010\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n #Pu created\n\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n # click link setup QAC\n assert is_text_present(\"qac\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link\"]\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def open_fertility_tests\n touch \"* marked:'Fertility testing and workup'\"\n end", "def test_017\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n #An option is checked\n assert is_checked($xpath[\"task\"][\"master_option_chk2\"])\n #Click a directory link\n click $xpath[\"task\"][\"master_option_dir1\"]\n sleep 2\n #All file of directory is checked.\n\n assert is_checked($xpath[\"task\"][\"master_option_chk3\"])\n assert is_checked($xpath[\"task\"][\"master_option_chk4\"])\n\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def test_scm_st_003\n printf \"\\n Test 003\"\n open_periodical_analysis_setting_tab \n assert(is_element_present($display_scm_xpath[\"save_button\"])) \n assert(is_element_present($display_scm_xpath[\"clear_button\"]))\n assert(is_element_present($display_scm_xpath[\"delete_button\"]))\n assert(is_element_present($display_scm_xpath[\"save_all_button\"]))\n logout\n end", "def test_011\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n #Pu created\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n sleep 2\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # click link setup QAC++\n assert is_text_present(\"qacpp\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link2\"]\n # check log in the navigation bar\n sleep 2\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def done\n puts 'Done running tests'\n end", "def testing_end\n end", "def test_016\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n #An option setup was performed\n\n assert is_checked($xpath[\"task\"][\"master_option_chk2\"])\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Click a directory link\n click $xpath[\"task\"][\"master_option_dir1\"]\n sleep 2\n assert !is_checked($xpath[\"task\"][\"master_option_chk3\"])\n assert !is_checked($xpath[\"task\"][\"master_option_chk4\"])\n\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def test1ActionFileParameter\n # Create a local file name to transfer\n setupTempFile do |iTempFileName|\n executeTest(\n 'DummyUser',\n {\n 'DummyTool' => {\n 'DummyAction' => [\n [ WEACE::Master::TransferFile.new(iTempFileName) ]\n ]\n }\n }\n )\n end\n end", "def test_TestPaper\n # login(\"cn.fra\", \"12345\")\n begin\n\n @@title=$question\n $action.open($link+\"/Course/ExamTemplateTrain.aspx\")\n assert_equal(@@loginpage.getTitle,\"EF Online Academy\")\n @@testpaperpage.addNew\n @@testpaperpage.title(@@title)\n\n @@testpaperpage.uniqueId(Time.now.to_s)\n @@testpaperpage.description(@@title)\n @@testpaperpage.totalScore(\"100\")\n @@testpaperpage.passScore(\"0\")\n @@testpaperpage.testTime(\"10\")\n @@testpaperpage.layout \"123\"\n @@testpaperpage.tag\n # @@testpaperpage.addGroup \"1\",@@title\n @@testpaperpage.addGroup @@title\n sleep 3\n @@testpaperpage.ok\n sleep 6\n @@testpaperpage.titleFilter(@@title)\n @@testpaperpage.search\n sleep 3\n assert($action.findelementByName(\"ctl00$cphMain$rptList$ctl00$imgBtnEdit\"))\n $log.puts(__method__.to_s+\" -------------------pass \\n\")\n\n rescue\n $log.puts(__method__.to_s+\" -------------------fail \\n\")\n $action.screenshot($path)\n puts \":error:#{$!}-----at:#{$@} \\n\"\n end\n end", "def test_012\n\n #login\n login\n\n #Open PU management page\n open_pu_management_page_1\n\n # Find a PU\n # Pu created\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n #test for make root in the master tab & in the popup which is displayed by clicking 設定する\n # click link setup QAC\n assert is_text_present(\"qac\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link\"]\n #test for make root\n type \"makeroot_qac\", \"abc\"\n run_script \"destroy_subwindow()\"\n assert is_text_present(_(\"Make root\")+\":\")\n click $xpath[\"task\"][\"option_setup_link\"]\n sleep 2\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n sleep 3\n assert !60.times{ break if (@selenium.is_text_present(_(\"Optional setting\")+\":qac\") rescue false); sleep 2 }\n type \"makeroot_qac\", \"abc\"\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 2\n assert is_text_present(_(\"Make root\")+\":\")\n click $xpath[\"task\"][\"option_setup_link\"]\n assert !60.times{ break if (@selenium.is_text_present(_(\"Optional setting\")+\":qac\") rescue false); sleep 2 }\n\n\n\n #logout\n logout\n\n end", "def test_step; end", "def my_tests\n end", "def test_setup\r\n \r\n end", "def test_019\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #Click link M of a directory\n click $xpath[\"task\"][\"m_link\"]\n sleep 2\n\n #The name of the directory which pushed [M] goes into the field of right-hand side make_root.\n assert_equal \"sample_c/\", get_value( $xpath[\"task\"][\"make_root_link\"])\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def test_steps; end", "def test_steps; end", "def test05_LI2_repost_review\n\t\t$browser.goto($patch_login)\n\t\tloginDirectory\n\t\t$browser.goto($patch_directory_listing)\n\t\t\n\t\t\n\t\t\n\tend", "def test02_LI2_view_event\n\t\t$browser.goto($patch_login)\n\t\tloginDirectory\n\t\t$browser.goto($patch_directory_listing)\n\t\t$directory_upcoming_events.click\n\t\t\n\t\tsleep 5\n\t\tbegin\n\t\tassert assert $browser.text.include? \"All Events\"\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"LI2_view_event: FAILED! Unable to view upcoming events.\"\n\t\tend\n\tend", "def test_03_storyadmin_clickall_links()\n\t\t\n\t\tputs \"---------------------- START OF SCENARIO 02 ----------------------\"\n\t\tlogin(\"[email protected]\", \"123456\")\n\t\tverifyHeaderLinks()\n\t\tverifyFooterLinks()\n\t\tverifyMyAccountLinks()\n\t\tverifyNPOAdminLinks(\"Minnesota Community Foundation\")\n\t\t#~ searchProject(\"RazooTrunkFirefoxPRO20 of Minnesota Community Foundation\")\n\t\t#~ verifyStoryAdminLinks()\n\t\tlogout()\n\t\tputs \"---------------------- END OF SCENARIO 02 --------------------------\"\n\tend", "def test01_D3LRT01\n\t\t$browser.goto($patch_login)\n\t\tloginDirectory\n\t\t$browser.goto($patch_directory)\n\t\t$directory_review.click\n\t\t$directory_review_bottom_comment.set(\"New Review Comment Test#{random}.\")\n\t\t$directory_comment_post.click\n\t\t\n\t\tsleep 2\n\t\tbegin\n\t\tassert $browser.text.include? \"Follow this Group\"\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"D2FLT01: FAILED! Unable to click directory listing\"\n\t\tend\n\tend", "def test02_ArticleOneComment_TC_24319\n\t\tcommentArticlePop\n\t\tcommentPopSubmit\n\tend", "def test\n end", "def test\n end", "def test\n end", "def test \n end", "def test_cases; end", "def test_scm_st_046\n printf \"\\n Test 046\"\n open_periodical_analysis_setting_tab\n click $display_scm_xpath[\"save_all_button\"]\n sleep SLEEP_TIME\n assert is_text_present($display_scm[\"save_all_success\"])\n logout\n end", "def test\n\n end", "def test_018\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n #An option is checked\n assert is_checked($xpath[\"task\"][\"master_option_chk2\"])\n #Click a directory link\n click $xpath[\"task\"][\"master_option_dir1\"]\n sleep 2\n #Click a sub directory link\n click $xpath[\"task\"][\"master_option_file1\"]\n sleep 2\n #uncheck a file\n\n click $xpath[\"task\"][\"master_option_chk5\"]\n sleep 2\n\n #The state of other check boxes is not influenced.\n assert is_checked($xpath[\"task\"][\"master_option_chk6\"])\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def test02_post_open_board_cancel_article_draft\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_post_open_article_new)\n\t\t\n \t\tcreate_article_draft \"Article for Draft #{random}\"\n\t\tcancel_delete\n\tend", "def test_method\n end", "def te_st_099_WIP\r\n\r\n sTestCase_Name = \"test_099_WIP\"\r\n puts2(\"Starting Testcase: #{sTestCase_Name}\")\r\n\r\n puts2(\"Close the window\")\r\n\r\n # Set the flag to close the $browser after the last test case runs\r\n @@bCloseBrowser = true\r\n\r\nend", "def test_scm_st_013\n printf \"\\n Test 013\"\n open_periodical_analysis_setting_tab\n assert is_text_present($display_scm[\"file_field\"])\n assert is_element_present($display_scm_xpath[\"file_field\"])\n logout\n end", "def test_ID_25843_edit_profile_what_i_love_about_your_town\n login_as_user1\n go_to_edit_profile_page\n verify_little_more_about_my_community\n verify_text_can_be_entered_saved_on_about_my_community\n end", "def test_ID_25843_edit_profile_what_i_love_about_your_town\n login_as_user1\n go_to_edit_profile_page\n verify_little_more_about_my_community\n verify_text_can_be_entered_saved_on_about_my_community\n end", "def test_015\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n #An option setup was performed\n\n assert is_checked($xpath[\"task\"][\"master_option_chk1\"])\n\n #uncheck an option setup\n click $xpath[\"task\"][\"master_option_chk1\"]\n\n\n #Get window id\n window_id = get_attribute(\"//body/div[2]\", \"id\")\n window_id =~ /.*?id=(\\d+).*?/\n\n #Close window\n click window_id + \"_close\"\n\n sleep 3\n #Open popup set again\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n #the information set remains\n assert is_checked($xpath[\"task\"][\"master_option_chk1\"])\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def test02_post_open_board_publish_article_draft_TC_24309\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_post_open_article_new)\n\t\t\n \t\tcreate_article_draft \"Article for Draft #{random}\"\n\t\tdelete_draft\n\tend", "def test04_EventOneComment_TC_24319\n\t\tcommentEventPop\n\t\tcommentPopSubmit\n\tend", "def test_scm_st_047\n printf \"\\n Test 047\"\n open_periodical_analysis_setting_tab\n fill_scm_form(\"SVN\",\n nil,\n nil,\n URL_SVN_RIGHT_KEYWORD,\n LOGIN_RIGHT_KEYWORD,\n PASSWORD_RIGHT_KEYWORD,\n nil,\n MASTER_BASE_NAME_RIGHT_KEYWORD,\n 1,\n 1\n )\n click $display_scm_xpath[\"save_button\"]\n sleep SLEEP_TIME\n choose_ok_on_next_confirmation\n click $display_scm_xpath[\"delete_button\"]\n sleep SLEEP_TIME\n assert @selenium.get_confirmation()\n assert is_text_present($display_scm[\"success_delete\"])\n logout\n end", "def test02_L1DLT02_TC_24418\n\t\t$browser.goto($patch_login)\n\t\tloginDirectory\n\t\t$browser.goto($patch_directory_listing)\n\t\t$directory_review_follow.click\n\t\t\n\t\tsleep 2\n\t\tbegin\n\t\tassert $browser.text.include? \"Follow\"\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"L1DLT02: FAILED! Unable to click directory listing\"\n\t\tend\n\tend", "def test03_pre_closed_board_edit_article_draft\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_pre_closed_article_new)\n\t\t\n \t\tcreate_article_draft \"Article for Draft #{random}\"\n\t\tsleep 2\n\t\tedit_draft\n\t\t\n\t\tsleep 2\n\t\tassert $browser.text.include? \"submitted this for approval\"\n\tend", "def test_shall_list_briefcase_items\n login_as :administrator\n get :list\n assert :success\n end", "def test05_post_open_board_close_article_draft\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_post_open_article_new)\n\t\t\n \t\tcreate_article_draft \"Article for Draft #{random}\"\n\t\tclose_delete\n\tend", "def test_scm_st_019\n printf \"\\n Test 019\"\n open_periodical_analysis_setting_tab\n fill_scm_form(\"SVN\",\n nil,\n nil,\n URL_SVN_RIGHT_KEYWORD,\n LOGIN_RIGHT_KEYWORD,\n PASSWORD_RIGHT_KEYWORD,\n nil,\n MASTER_BASE_NAME_RIGHT_KEYWORD,\n 1,\n 0\n )\n click $display_scm_xpath[\"save_button\"]\n sleep SLEEP_TIME\n begin\n assert(is_text_present($display_scm[\"success_message\"]))\n open \"/devgroup/pj_index/1/1\"\n wait_for_page_to_load LOAD_TIME\n @selenium.click $display_scm_xpath[\"menu_link\"]\n sleep SLEEP_TIME\n @selenium.click $display_scm_xpath[\"scm_tab\"]\n sleep SLEEP_TIME\n assert_equal URL_SVN_RIGHT_KEYWORD,get_value($display_scm_xpath[\"url_field\"])\n# rescue Test::Unit::AssertionFailedError\n# @verification_errors << $!\n end\n logout\n ScmConfig.destroy_all\n end", "def test_scm_st_020\n printf \"\\n Test 020\"\n open_periodical_analysis_setting_tab\n fill_scm_form(\"SVN\",\n nil,\n nil,\n URL_SVN_RIGHT_KEYWORD,\n LOGIN_WRONG_KEYWORD,\n PASSWORD_WRONG_KEYWORD,\n nil,\n MASTER_BASE_NAME_RIGHT_KEYWORD,\n 1,\n 0\n )\n click $display_scm_xpath[\"save_button\"]\n sleep SLEEP_TIME\n # assert(is_text_present($display_scm[\"url_error\"]))\n logout\n end", "def test_authorization_of_protocols_and_datafiles_links\n #sanity check the fixtures are correct\n check_fixtures_for_authorization_of_protocols_and_datafiles_links\n login_as(:model_owner)\n experiment=experiments(:experiment_with_public_and_private_protocols_and_datafiles)\n assert_difference('ActivityLog.count') do\n get :show, :id=>experiment.id\n end\n\n assert_response :success\n\n assert_select \"div.tabbertab\" do\n assert_select \"h3\", :text=>\"Protocols (1+1)\", :count=>1\n assert_select \"h3\", :text=>\"Data Files (1+1)\", :count=>1\n end\n\n assert_select \"div.list_item\" do\n assert_select \"div.list_item_title a[href=?]\", protocol_path(protocols(:protocol_with_fully_public_policy)), :text=>\"Protocol with fully public policy\", :count=>1\n assert_select \"div.list_item_actions a[href=?]\", protocol_path(protocols(:protocol_with_fully_public_policy)), :count=>1\n assert_select \"div.list_item_title a[href=?]\", protocol_path(protocols(:protocol_with_private_policy_and_custom_sharing)), :count=>0\n assert_select \"div.list_item_actions a[href=?]\", protocol_path(protocols(:protocol_with_private_policy_and_custom_sharing)), :count=>0\n\n assert_select \"div.list_item_title a[href=?]\", data_file_path(data_files(:downloadable_data_file)), :text=>\"Download Only\", :count=>1\n assert_select \"div.list_item_actions a[href=?]\", data_file_path(data_files(:downloadable_data_file)), :count=>1\n assert_select \"div.list_item_title a[href=?]\", data_file_path(data_files(:private_data_file)), :count=>0\n assert_select \"div.list_item_actions a[href=?]\", data_file_path(data_files(:private_data_file)), :count=>0\n end\n\n end", "def test05_news_OpenLiving_TC_24397\n\t\tlogin $editor_1_email, $master_password\n\t\twait_for_ajax\n\t\t\n\t\t$header_tools_icon.click\n\t\tsleep 2\n\t\t$header_tools_start_news.click\n\n\t\t$group_name.set(\"Living Group #{random}\")\n\t\t$boards_group_nickname.set(\"Nickname #{random}\")\n\t\t$group_description.set(\"Description #{random}\")\n\t\t$group_category_living.click\n\t\t$boards_arts_ent_image.when_present.fire_event(\"onclick\")\n\t\t$group_create.click\n\t\t\n\t\tcheckIfIncorrectErrorDisplays\t\n\t\t\n\t\t#edit group type settings\n\t\twait_for_ajax\n \t\tsleep 2\n \t\t$group_basic_information_link.click\n \t\t$group_group_type.click \n \t\twait_for_ajax\n \t\t$group_setting_pre_moderated.click #make blog pre-moderated\n \t\tsleep 2\n \t\t$group_settings_save.click\n \t\tsleep 3\n \t\t\n \t\tassert $browser.text.include? \"group updated successfully\"\n \t\t\n \t\t$group_back_group.click\n \t\twait_for_ajax\n \t\t$browser.text.include? \"Posts awaiting your approval\"\n\tend", "def test_scm_st_017\n printf \"\\n Test 017\"\n open_periodical_analysis_setting_tab\n fill_scm_form(\"SVN\",\n nil,\n nil,\n WRONG_URL,\n LOGIN_RIGHT_KEYWORD,\n PASSWORD_RIGHT_KEYWORD,\n nil,\n MASTER_BASE_NAME_RIGHT_KEYWORD,\n 1,\n 0\n )\n click $display_scm_xpath[\"save_button\"]\n sleep SLEEP_TIME\n # assert(is_text_present($display_scm[\"url_error\"]))\n sleep SLEEP_TIME\n logout\n end", "def test02_pre_closed_board_publish_article_draft_TC_24309\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_pre_closed_article_new)\n\t\t\n \t\tcreate_article_draft \"Article for Draft #{random}\"\n\t\tdelete_draft\n\tend", "def run_actions; end", "def testNominal\n setupTest do |iTasksFileName, iTicketsFileName|\n $Context[:OS_ExecAnswers] = [\n # svn co => success\n [ 0, '' ],\n # deliver => success, generating files\n [ 0, '', @@Generator_SingleDummyGem ]\n ]\n executeProcess(\n [\n '--user', 'ReleaseUser',\n '--branch', 'BranchName',\n '--comment', 'ReleaseComment',\n '--version', '0.0.1.20100317',\n '--tasksfile', iTasksFileName,\n '--ticketsfile', iTicketsFileName,\n '--svnco', 'MySVNRep',\n '--deliver', 'deliver %{DeliverablesDir}'\n ]\n ) do |iError, iSlaveActions|\n checkCallsMatch(\n [\n [ 'query', 'svn co MySVNRep' ],\n [ 'query', /^deliver .*$/ ]\n ],\n $Variables[:OS_Exec]\n )\n assert_equal( @@CommonSlaveActions.merge(\n {\n Tools::FilesManager => {\n Actions::File_Upload => [\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/Releases/All/Gem/DummyGem.gem\"), 'All', 'Gem', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ]\n ]\n }\n } ),\n iSlaveActions\n )\n end\n end\n end", "def test04_pre_closed_news_ArticleVideo_TC_24303\n\t\tlogin $editor_1_email, $master_password\n\t\t$browser.goto($patch_news_pre_open_article_new)\n\t\t\t\n\t\tsleep 2\n\t\tassert $post_pick_group.exists?\n \t\trepostGroupPop\n \t\t$post_article_title.when_present.set(\"Article #{random}\")\n\t\t$browser.execute_script(\"jQuery('iframe.wysihtml5-sandbox').contents().find('body').prepend('Port angeles is next to the klallam reservation')\")\n \t\t$post_add_media.when_present.click\n\t\tfile_upload \"DungenessSpit102.26.2012.mov\"\n\t\t$post_now_alt_1.when_present.fire_event(\"onclick\")\n\t\n\t\tsleep 2\n\t\tassert $post_new_post.exists?\n\tend", "def test_scm_st_014\n printf \"\\n Test 014\"\n open_periodical_analysis_setting_tab\n select $display_scm_xpath[\"scm_select_field\"],\"CVS\"\n assert is_element_present($display_scm_xpath[\"cvs_access\"])\n assert is_element_present($display_scm_xpath[\"cvs_module\"])\n logout\n end", "def default_test\r\n end", "def test_014\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n\n #Get window id\n window_id = get_attribute(\"//body/div[2]\", \"id\")\n window_id =~ /.*?id=(\\d+).*?/\n\n #Maximize window\n click window_id + \"_close\"\n\n sleep 3\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def test_013\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n\n #Get window id\n window_id = get_attribute(\"//body/div[2]\", \"id\")\n window_id =~ /.*?id=(\\d+).*?/\n\n #Maximize window\n click window_id + \"_maximize\"\n\n sleep 3\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def test_sources_tc958 #20 \n # Refering candidate with tracking source, new candidate, Clear Source Tracking for Internal Referrals\n Common.login(Users::USER_EMAIL, Users::PASSWORD)\n # Preconditions\n Common.goToTab(HomePage::BOARD_SETUP_TAB_LINK_XPATH)\n Common.displayed(BoardSetupHomePage::CAREERS_LINK_LIST_XPATH)\n Common.click_and_load(BoardSetupHomePage::INTERNAL_LINK_LIST_XPATH)\n Common.displayed(BoardSetupDetailPage::BOARD_DETAIL_EDIT_BUTTON_XPATH)\n test = [\n {\"displayed\" => BoardSetupDetailPage::BOARD_DETAIL_EDIT_BUTTON_XPATH},\n {\"click\" => BoardSetupDetailPage::BOARD_DETAIL_EDIT_BUTTON_XPATH},\n \n {\"displayed\" => BoardSetupEditPage::BOARD_EDIT_APPLY_REFERRAL_IMMEDIATELY_XPATH},\n {\"checked\" => BoardSetupEditPage::BOARD_EDIT_APPLY_REFERRAL_IMMEDIATELY_XPATH},\n {\"set_text\" => BoardSetupEditPage::BOARD_EDIT_SOURCE_TRACKING_FOR_INTERNAL_REFERRAL_XPATH, \"text\" => \" \"},\n \n {\"click\" => BoardSetupEditPage::BOARD_EDIT_SAVE_BUTTON_XPATH},\n ]\n Common.main(test)\n \n $browser.get HomePage::JOB_BOARD_INTERNAL_URL\n test = [\n {\"check_apply\" => \"\"},\n {\"displayed\" => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_REFER_CANDIDATE_XPATH},\n {\"click\" => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_REFER_CANDIDATE_XPATH},\n \n {\"displayed\" => JobBoardJobDetail::JOB_BOARD_APPLY_REFERRER_EMAIL_XPATH},\n {\"set_text\" => JobBoardJobDetail::JOB_BOARD_APPLY_REFERRER_EMAIL_XPATH, \"text\" => Users::JOB_BOARD_USER_TEXT},\n {\"click\" => JobBoardJobDetail::JOB_BOARD_CONTINUE_BUTTON_XPATH},\n \n {\"displayed\" => JobBoardJobDetail::PROSPECT_FIRST_NAME_XPATH},\n {\"set_text\" => JobBoardJobDetail::PROSPECT_FIRST_NAME_XPATH, \"text\" => \"a\"},\n {\"set_text\" => JobBoardJobDetail::PROSPECT_LAST_NAME_XPATH, \"text\" => \"b\"},\n {\"set_text\" => JobBoardJobDetail::PROSPECT_EMAIL, \"text\" => \"[email protected]\"},\n {\"click\" => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_SUBMIT_XPATH},\n {\"displayed\" => JobBoardJobDetail::THANK_YOU_REFERRAL_MESSAGE_XPATH}\n ]\n Common.main(test)\n \n assert $browser.find_element(:xpath, JobBoardJobDetail::THANK_YOU_REFERRAL_MESSAGE_XPATH).displayed?\n \n end", "def test1ActionParameters\n executeTest(\n 'DummyUser',\n {\n 'DummyTool' => {\n 'DummyActionWithParams' => [\n [ 'Param1', 'Param2' ]\n ]\n }\n }\n )\n end", "def testNominalShort\n setupTest do |iTasksFileName, iTicketsFileName|\n $Context[:OS_ExecAnswers] = [\n # svn co => success\n [ 0, '' ],\n # deliver => success, generating files\n [ 0, '', @@Generator_SingleDummyGem ]\n ]\n executeProcess(\n [\n '-u', 'ReleaseUser',\n '-b', 'BranchName',\n '-c', 'ReleaseComment',\n '-v', '0.0.1.20100317',\n '-t', iTasksFileName,\n '-k', iTicketsFileName,\n '-s', 'MySVNRep',\n '-d', 'deliver %{DeliverablesDir}'\n ]\n ) do |iError, iSlaveActions|\n checkCallsMatch(\n [\n [ 'query', 'svn co MySVNRep' ],\n [ 'query', /^deliver .*$/ ]\n ],\n $Variables[:OS_Exec]\n )\n assert_equal( @@CommonSlaveActions.merge(\n {\n Tools::FilesManager => {\n Actions::File_Upload => [\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/Releases/All/Gem/DummyGem.gem\"), 'All', 'Gem', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ]\n ]\n }\n } ),\n iSlaveActions\n )\n end\n end\n end", "def test_ID_25839_edit_profile_home_patch\n login_as_user1\n go_to_edit_profile_page\n verify_users_default_town_name_displayed_as_home_patch \"test_ID_25835_edit_profile_desc\" , \"Bellmore Patch\"\n verify_hometown_change_is_saved \"Bellmore Patch\",\"Garden City Patch\"\n end", "def test_ID_25839_edit_profile_home_patch\n login_as_user1\n go_to_edit_profile_page\n verify_users_default_town_name_displayed_as_home_patch \"test_ID_25835_edit_profile_desc\" , \"Bellmore Patch\"\n verify_hometown_change_is_saved \"Bellmore Patch\",\"Garden City Patch\"\n end", "def test_project\n project\n @browser.find_element(:id, 'tab-versions').click\n sleep (2)\n @browser.find_element(:xpath, \"//*[@id='tab-content-versions']/p[2]/a\").click\n version = rand(999).to_s + 'version'\n @browser.find_element(:id, 'version_name').send_keys version\n @browser.find_element(:name, 'commit').click\n #expected = 'Successful creation.'\n expected = 'Создание успешно.'\n assert_equal(expected, @browser.find_element(:id, 'flash_notice').text)\n end", "def test_home\n @current_test_name = \"Arch - Testing Home Page\"\n each_driver do\n each_view_redirects do\n common_elements?\n end\n end\n end", "def verifyStoryAdminLinks()\n\t\n\tputs \"************** START: Verify PRO page Links ****************\"\n\t\n\tputs \"Step 1 : Click on EditPage link on the Story page.\"\n\t$browser.click \"link=Edit Page\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"The Basics\")\n\t\tputs \"Step 1 is Passed. User has reached the EditPage screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 1 is Failed. User had failed to reach EditPage screen.\"\n\t\t$verification_errors << $!\n\tend\n\n\tputs \"Step 2 : Click on Thumbnail link on the Story page.\"\n\t$browser.click \"link=Thumbnail\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Current Thumbnail\")\n\t\tputs \"Step 2 is Passed. User has reached the Thumbnail screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 2 is Failed. User had failed to reach Thumbnail screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 3 : Click on Matching Grants link on the Story page.\"\n\t$browser.click \"link=Matching Grants\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Grantor\")\n\t\tputs \"Step 3 is Passed. User has reached the Matching Grants screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 3 is Failed. User had failed to reach Matching Grants screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 4 : Click on Promote link on the Story page.\"\n\t$browser.click \"link=Promote\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Or get a donation button to put on your website\")\n\t\tputs \"Step 4 is Passed. User has reached the Promote screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 4 is Failed. User had failed to reach Promote screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 5 : Click on DonateAnywhere link on the Story page.\"\n\t$browser.click \"link=DonateAnywhere\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"DonateAnywhere\")\n\t\tputs \"Step 5 is Passed. User has reached the DonateAnywhere screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 5 is Failed. User had failed to reach DonateAnywhere screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 6 : Click on Donations link on the Story page.\"\n\t$browser.click \"link=Donations\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Donations Listing\")\n\t\tputs \"Step 6 is Passed. User has reached the Donations screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 6 is Failed. User had failed to reach Donations screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"************** END: Verify PRO page Links ****************\"\n\t\nend", "def verifyStoryAdminLinks()\n\t\n\tputs \"************** START: Verify PRO page Links ****************\"\n\t\n\tputs \"Step 1 : Click on EditPage link on the Story page.\"\n\t$browser.click \"link=Edit Page\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"The Basics\")\n\t\tputs \"Step 1 is Passed. User has reached the EditPage screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 1 is Failed. User had failed to reach EditPage screen.\"\n\t\t$verification_errors << $!\n\tend\n\n\tputs \"Step 2 : Click on Thumbnail link on the Story page.\"\n\t$browser.click \"link=Thumbnail\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Current Thumbnail\")\n\t\tputs \"Step 2 is Passed. User has reached the Thumbnail screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 2 is Failed. User had failed to reach Thumbnail screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 3 : Click on Matching Grants link on the Story page.\"\n\t$browser.click \"link=Matching Grants\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Grantor\")\n\t\tputs \"Step 3 is Passed. User has reached the Matching Grants screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 3 is Failed. User had failed to reach Matching Grants screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 4 : Click on Promote link on the Story page.\"\n\t$browser.click \"link=Promote\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Or get a donation button to put on your website\")\n\t\tputs \"Step 4 is Passed. User has reached the Promote screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 4 is Failed. User had failed to reach Promote screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 5 : Click on DonateAnywhere link on the Story page.\"\n\t$browser.click \"link=DonateAnywhere\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"DonateAnywhere\")\n\t\tputs \"Step 5 is Passed. User has reached the DonateAnywhere screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 5 is Failed. User had failed to reach DonateAnywhere screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 6 : Click on Donations link on the Story page.\"\n\t$browser.click \"link=Donations\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Donations Listing\")\n\t\tputs \"Step 6 is Passed. User has reached the Donations screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 6 is Failed. User had failed to reach Donations screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"************** END: Verify PRO page Links ****************\"\n\t\nend", "def test_acknowledgement \n end", "def test03_OpenEducation_TC_24397\n\t\tloginGroup\n\t\t\n\t\tsleep 5\n\n\t\t$open_group.fire_event(\"onclick\")\n\t\t$group_name.set(\"Education Group #{random}\")\n\t\t$group_nickname.set(\"Nickname #{random}\")\n\t\t$group_description.set(\"Description #{random}\")\n\t\t$category_education.click\n\t\tchooseExistingIcon\n\t\t$create_group.click\n\t\t\n\t\tcheckIfIncorrectErrorDisplays\n\t\t\n\t\tsleep 5\n\t\t\n\t\tbegin\n\t\tassert $invite_facebook.exists?\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"GO01T03: FAILED! Invite via Facebook button not found\"\n\t\tend\t\n\t\t\n\t\tbegin\n\t\tassert $invite_aol_mail.exists?\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"GO01T03: FAILED! Invite via AOL Mail button not found.\"\n\t\tend\n\t\t\n\t\tbegin\n\t\tassert $invite_email.exists?\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"GO01T03: FAILED! Invite via Email button not found.\"\n\t\tend\n\t\t\n\t\tbegin\n\t\tassert $invite_gmail.exists?\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"GO01T03: FAILED! Invite via Gmail button not found.\"\n\t\tend\n\t\t\n\t\tbegin\n\t\tassert $invite_yahoo.exists?\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"GO01T03: FAILED! Invite via Yahoo button not found.\"\n\t\tend\n\tend", "def test02_blog_OpenEducationFamily\n\t\tlogin $user_1_email, $master_password\n\t\t\n\t\tsleep 5\n\n\t\t$open_group.fire_event(\"onclick\")\n\t\t$group_name.set(\"Education/Family Group #{random}\")\n\t\t$group_nickname.set(\"Nickname #{random}\")\n\t\t$group_description.set(\"Description #{random}\")\n\t\t$category_education.click\n\t\t$category_family.click\n\t\t$boards_arts_ent_image.when_present.fire_event(\"onclick\")\n\t\t$create_group.click\n\t\t\n\t\tcheckIfIncorrectErrorDisplays\n\t\t\n\tend", "def test_scm_st_016\n printf \"\\n Test 016\"\n open_periodical_analysis_setting_tab\n fill_scm_form(\"CVS\",\n CVS_ACCESS_TYPE,\n CVS_MODULE_RIGHT,\n URL_CVS_RIGHT_KEYWORD,\n LOGIN_RIGHT_KEYWORD,\n PASSWORD_RIGHT_KEYWORD,\n nil,\n MASTER_BASE_NAME_RIGHT_KEYWORD,\n 1,\n 0\n )\n click $display_scm_xpath[\"save_button\"]\n sleep SLEEP_TIME\n begin\n assert(is_text_present($display_scm[\"success_message\"]))\n open \"/devgroup/pj_index/1/1\"\n wait_for_page_to_load LOAD_TIME\n @selenium.click $display_scm_xpath[\"menu_link\"]\n sleep SLEEP_TIME\n @selenium.click $display_scm_xpath[\"scm_tab\"]\n sleep SLEEP_TIME\n assert_equal \"CVS\",get_selected_value($display_scm_xpath[\"scm_select_field\"])\n# rescue Test::Unit::AssertionFailedError\n# @verification_errors << $!\n end\n logout\n ScmConfig.destroy_all\n end", "def test_scm_st_015\n printf \"\\n Test 015\"\n open_periodical_analysis_setting_tab\n fill_scm_form(\"SVN\",\n nil,\n nil,\n URL_SVN_RIGHT_KEYWORD,\n LOGIN_RIGHT_KEYWORD,\n PASSWORD_RIGHT_KEYWORD,\n nil,\n MASTER_BASE_NAME_RIGHT_KEYWORD,\n 1,\n 0\n )\n click $display_scm_xpath[\"save_button\"]\n sleep SLEEP_TIME\n begin\n assert(is_text_present($display_scm[\"success_message\"]))\n open \"/devgroup/pj_index/1/1\"\n wait_for_page_to_load LOAD_TIME\n @selenium.click $display_scm_xpath[\"menu_link\"]\n sleep SLEEP_TIME\n @selenium.click $display_scm_xpath[\"scm_tab\"]\n sleep SLEEP_TIME\n assert_equal \"SVN\",get_selected_value($display_scm_xpath[\"scm_select_field\"])\n# rescue Test::Unit::AssertionFailedError\n# @verification_errors << $!\n end\n logout\n ScmConfig.destroy_all\n end", "def actions; end", "def test02_D3LRT03\n\t\t$browser.goto($patch_login)\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_directory)\n\t\t$directory_title.fire_event(\"onclick\")\n\t\t\n\t\tsleep 2\n\t\tassert $browser.text.include? \"Directory Group\"\n\tend", "def test_scm_st_021\n printf \"\\n Test 021\"\n open_periodical_analysis_setting_tab\n fill_scm_form(\"SVN\",\n nil,\n nil,\n URL_SVN_RIGHT_KEYWORD,\n LOGIN_RIGHT_KEYWORD,\n PASSWORD_RIGHT_KEYWORD,\n nil,\n MASTER_BASE_NAME_RIGHT_KEYWORD,\n 1,\n 0\n )\n click $display_scm_xpath[\"save_button\"]\n sleep SLEEP_TIME\n begin\n assert(is_text_present($display_scm[\"success_message\"]))\n open \"/devgroup/pj_index/1/1\"\n wait_for_page_to_load LOAD_TIME\n @selenium.click $display_scm_xpath[\"menu_link\"]\n sleep SLEEP_TIME\n @selenium.click $display_scm_xpath[\"scm_tab\"]\n sleep SLEEP_TIME\n assert_equal LOGIN_RIGHT_KEYWORD,get_value($display_scm_xpath[\"user_field\"])\n rescue Test::Unit::AssertionFailedError\n @verification_errors << $!\n end\n logout\n ScmConfig.destroy_all\n end" ]
[ "0.68578845", "0.67133355", "0.66575646", "0.66213465", "0.66213465", "0.6412068", "0.6401228", "0.6366158", "0.63639957", "0.63636154", "0.6344919", "0.63262576", "0.6308626", "0.6292936", "0.6285739", "0.62802273", "0.6272148", "0.6265529", "0.62622845", "0.62597656", "0.6251934", "0.6244543", "0.6241536", "0.6232082", "0.6214227", "0.6213857", "0.6209492", "0.6186005", "0.61500055", "0.61253303", "0.6114136", "0.60954124", "0.6069615", "0.60675246", "0.60652906", "0.60620254", "0.60499215", "0.60424584", "0.60324556", "0.6023658", "0.6010989", "0.60057306", "0.59997874", "0.59997874", "0.5998839", "0.5986472", "0.5973509", "0.59461695", "0.59432477", "0.59398973", "0.59398973", "0.59398973", "0.5934254", "0.59280235", "0.59171677", "0.5897181", "0.58844507", "0.58692956", "0.5858363", "0.5855118", "0.58520883", "0.58499765", "0.58499765", "0.5845158", "0.58265907", "0.58253735", "0.5812835", "0.58001417", "0.5792784", "0.57836473", "0.5783635", "0.578166", "0.57784176", "0.5778107", "0.57762814", "0.5772302", "0.5756818", "0.574884", "0.5746283", "0.5745483", "0.5743164", "0.574043", "0.5738282", "0.573786", "0.5737615", "0.5736808", "0.57363576", "0.57341695", "0.57341695", "0.5733618", "0.5730914", "0.5729703", "0.5729703", "0.57240313", "0.5722507", "0.572014", "0.5715509", "0.5715211", "0.57136714", "0.57100844", "0.57094246" ]
0.0
-1
opts can have keys" :hash_form
def components(opts = {}) opts[:hash_form] ? hash_form_array(:component) : object_form(:component) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sanitize_options(opts)\n opts = opts.to_hsh rescue opts.to_h\n \n HashWithIndifferentAccess.new(opts)\n end", "def relevant_options_digest(options); end", "def load(hash)\n @opts = hash\n end", "def params=(hash); end", "def params=(hash); end", "def key; @opts['key'] end", "def set_hash_method(opts)\n opts = check_params(opts,[:methods])\n super(opts)\n end", "def build_opts(hash, *args)\n opts = args\n hash.each do |key, value|\n case key\n when :secure, :soft\n value == :yes && opts << '--%s' % key\n when :appname, :appversion\n when :name\n else\n opts << '--%s' % key << value\n end\n end\n opts << hash[:appname]\n opts << hash[:appversion]\n opts.compact\n end", "def valid_opts\n true\n end", "def build_opts(opts)\n {}.tap do |o|\n o[:serialize] = if opts[:serialize] && opts[:serialize].is_a?(Array)\n opts[:serialize].map(&:to_s)\n else\n []\n end\n\n o[:only] = opts[:only] || [\"add\", \"remove\"]\n o[:notify] = opts[:notify] || false\n end\n end", "def takes_hash(opts = {})\n c = opts[:c]\nend", "def opts=(o=nil)\n raise \"opts must be a hash\" unless (o ||= {}).is_a? Hash\n @opts = o\n end", "def set_hash_length(opts)\n opts = check_params(opts,[:lengths])\n super(opts)\n end", "def domain_option_params(option_hash)\n option_hash ||= {}\n option_hash[:missing] = false if option_hash.key?(:missing) && option_hash[:missing].blank?\n option_hash.permit(:display_name, :value, :description, :missing)\n end", "def same_options?(opts)\n opts.hash == options.hash\n end", "def same_options?(opts)\n opts.hash == options.hash\n end", "def same_options?(opts)\n opts.hash == options.hash\n end", "def same_options?(opts)\n opts.hash == options.hash\n end", "def same_options?(opts)\n opts.hash == options.hash\n end", "def same_options?(opts)\n opts.hash == options.hash\n end", "def same_options?(opts)\n opts.hash == options.hash\n end", "def same_options?(opts)\n opts.hash == options.hash\n end", "def same_options?(opts)\n opts.hash == options.hash\n end", "def same_options?(opts)\n opts.hash == options.hash\n end", "def hash\n hash_args.hash\n end", "def opts_reset!(hash)\n opts.reset!\n opts.configure_from_hash(hash)\n end", "def options=(opts)\n myopts = {}\n opts.each do |key, val|\n debug \"looping on key #{key}, val #{val}\"\n debug \"class of key is #{key.class}\"\n tftpassert(\"options keys must be symbols\") { key.class == Symbol }\n myopts[key.to_s] = val.to_s\n end\n @options = myopts\n end", "def rehash_options(opts)\n\n opts['Accept'] ||= (opts.delete(:accept) || 'application/json')\n opts['Accept'] = 'application/json' if opts['Accept'] == :json\n\n if ct = opts.delete(:content_type)\n opts['Content-Type'] = ct\n end\n if opts['Content-Type'] == :json\n opts['Content-Type'] = 'application/json'\n end\n\n if et = opts.delete(:etag)\n opts['If-None-Match'] = et\n end\n\n opts\n end", "def yardopts_options(opts); end", "def same_options?(opts)\n opts.length == 0 || opts.hash == options.hash\n end", "def add_pem_values_to_options_store(opts); end", "def convert_options(opts); end", "def params=(opts={})\n #add the parameters only if in options\n opts.each_pair do |parameter, value|\n @params[parameter.to_s] = value if options.has_key?(parameter.to_s)\n end \n end", "def initialize(optHash)\n @optHash=optHash\n setParameters()\nend", "def complete_defaults(hash)\n ok, values = @validator.convert_and_validate(*collect_on_hash(hash))\n @args.each_with_index {|arg, i| hash[arg] = values[i]}\n end", "def options(hash)\n @options.merge! hash\n end", "def parse_opts(opts)\n object_update(opts[:object])\n\n res = {}\n TABLE[@vobject][:cli].each do |arg|\n raise \"#{arg} it's mandadory for this op\" if opts[arg].nil?\n\n res[arg] = method(arg).call(opts[arg])\n end\n\n res[:config] = parse_file(opts[:configuration]) if opts[:configuration]\n\n res\n end", "def valid_attributes(h={})\n { :topic_id => \"topic_type\", name: \"3\", query: { query_string: { query: 'foo' } } }.merge!(h)\n end", "def parse_hash(options)\n options.each { |key, val| remove_required(options, key, val) }\n hash = update_required_from_global\n check_requirement!(*hash.keys)\n end", "def params\n @opts[:params] || {}\n end", "def rehash_options (opts)\n\n opts['Accept'] ||= (opts.delete(:accept) || 'application/json')\n\n if ct = opts.delete(:content_type)\n opts['Content-Type'] = ct\n end\n if opts['Content-Type'] == :json\n opts['Content-Type'] = 'application/json'\n end\n\n if et = opts.delete(:etag)\n opts['If-None-Match'] = et\n end\n\n opts\n end", "def fill_out_form(hash)\n self.main_title=hash[:main_title]\n self.main_author=hash[:main_author]\n self.co_authors=hash[:co_authors]\n self.publisher=hash[:publisher]\n self.place_of_publication=hash[:place]\n self.volume_title=hash[:volume_title]\n self.volume_information=hash[:volume_info]\n self.year=hash[:year]\n self.number=hash[:number]\n self.series_title=hash[:series]\n self.url=hash[:url]\n end", "def validate_opts(opts)\n e = Exceptions::InvalidOptions\n raise(e, 'Is not Hash-like') unless opts.respond_to?(:[]) && opts.respond_to?(:key?)\n\n validate_server(opts[:server])\n if opts.key?(:base_uri)\n begin\n URI.parse(opts[:base_uri])\n rescue URI::InvalidURIError => e\n raise(e, \"Invalid base_uri: #{e}\")\n end\n end\n\n validate_creds(opts, e)\n true\n end", "def validate_opts(opts)\n e = Exceptions::InvalidOptions\n raise(e, 'Is not Hash-like') unless opts.respond_to?(:[]) && opts.respond_to?(:key?)\n validate_server(opts[:server])\n if opts.key?(:base_uri)\n begin\n URI.parse(opts[:base_uri])\n rescue URI::InvalidURIError => e\n raise(e, \"Invalid base_uri: #{e}\")\n end\n end\n\n validate_creds(opts, e)\n true\n end", "def hash_in_argument_hash\n argument_hash = {} if argument_hash.nil?\n return true\n end", "def initialize(opts = {})\n super()\n opts.each do |k,v|\n self[k.to_sym] = v\n end\n end", "def handle_key_option\n if key = @opts[:key]\n unless @attr[:name] || @attr['name']\n @attr[:name] = namespaced_name(key, @opts[:array] || @opts[:multiple])\n if [email protected]_key?(:value) && [email protected]_key?('value') && (values = @form.opts[:values])\n set_value_from_namespaced_values(namespaces, values, key)\n end\n end\n unless @attr[:id] || @attr['id']\n id = namespaced_id(key)\n if suffix = @opts[:key_id]\n id += \"_#{suffix}\"\n end\n @attr[:id] = id\n end\n end\n end", "def with_opts(opts)\n orig_opts = @opts\n @opts = orig_opts.merge(opts)\n copy_inputs_wrapper_from_wrapper(opts, @opts)\n yield\n ensure\n @opts = orig_opts if orig_opts\n end", "def options(opt); end", "def serializable_hash(opts = {})\n options = {\n :only => [:id, :email, :account_id, :firstname, :lastname, :biography]\n }.update(opts)\n super(options)\n end", "def options(opt); end", "def add_options(opts)\n opts\n end", "def options(opts)\n opts.each { |k,v| merge_options(k, v) }\n end", "def set_ending_hash_pattern(opts)\n opts = check_params(opts,[:patterns])\n super(opts)\n end", "def form_passwords(form) # Implement this in Form class\r\n { \r\n :passwords => [ \r\n form['password'],\r\n form['confirm_password']\r\n ]\r\n }\r\n end", "def accept_no_params(opts={})\n accept_params(opts) {}\n end", "def input_opts(name, opts = {})\n opts[:input_html] ||= {}\n opts[:input_html][:name] = @config[:field_names][name]\n opts\n end", "def options(opt)\n end", "def set_secret_hash(opts = {})\n unless ['md5', 'sha512', nil].include?(opts[:value])\n raise ArgumentError, 'secret hash must be md5 or sha512'\n end\n cmd = command_builder(\"secret hash #{opts[:value]}\")\n cmds = ['management defaults', cmd]\n configure(cmds)\n end", "def accept_no_params(opts={})\n accept_params(opts) {}\n end", "def parse_additional_options(opts)\n end", "def parse_additional_options(opts)\n end", "def user_options; end", "def set_hash_more_data_state(opts)\n opts = check_params(opts,[:states])\n super(opts)\n end", "def init_hash(hash)\n if hash[:parser]\n self.parser=hash[:parser]\n elsif hash[:many]\n init_many hash\n elsif hash[:match]\n init hash[:match]\n elsif hash[:any]\n init_any hash[:any]\n else\n raise \"extended-options patterns (specified by a hash) must have either :parser=> or a :match=> set\"\n end\n\n self.name = hash[:as] || self.name\n self.optional ||= hash[:optional] || hash[:optionally]\n self.could_match ||= hash[:could]\n self.negative ||= hash[:dont]\n end", "def options(opts)\n @options = @options.merge(opts)\n end", "def update_fields!(opts)\n opts.each_pair { |k, v| field_set! k, v }\n self\n end", "def form_from_options(opts)\n\t\tform_html = ''\n\t\topts.select {|e| e.has_key?(:method) && e[:method].match(/POST|PUT/)}.each do |opt|\n\t\t\tform_html += %Q{<h3>#{opt[:description]}</h3>}\n\t\t\tform_html += %Q{<form method=\"POST\" action=\"#{opt[:href]}\">\\n}\n\t\t\tif opt[:method] != \"POST\"\n\t\t\t\tform_html += %Q{<input type=\"hidden\" name=\"_method\" value=\"#{opt[:method]}\">}\n\t\t\tend\n\n\t\t\tif opt.has_key?(:parameters)\n\t\t\t\topt[:parameters].each do |k, v|\n\t\t\t\t\tform_html += %Q{#{v[:description]} <input type=\"text\" name=\"#{k}\"><br>\\n}\n\t\t\t\tend\n\t\t\tend\n\t\t\tform_html += '<input type=\"submit\" value=\"Do\"></form><br>'\n\t\tend\n\t\treturn form_html\n\tend", "def check_for_verify_plugin_signatures_option(hash); end", "def hash(name = nil, options = nil)\n return super() unless name # Allow Object.hash\n set_default_options(name, options)\n super(name, options)\n end", "def params\n @opts\n end", "def opts(**kws)\n res = {}\n kws.each_pair do |kw, v|\n res[kw] = v[0] unless v[0] == v[1]\n end\n res\n end", "def common_options(opts); end", "def initialize(hash)\r\n @question = hash['Question']\r\n\r\n @options = []\r\n hash['Options'].each {|option| @options << option}\r\n\r\n @answer = hash['Answer']\r\n end", "def fill_out_form(hash)\n self.institution=hash[:institution]\n self.department=hash[:department]\n self.title_role=hash[:title]\n self.email=hash[:email]\n self.instant_messaging=hash[:im]\n self.phone=hash[:phone]\n self.mobile=hash[:mobile]\n self.fax=hash[:fax]\n self.address=hash[:address]\n self.city=hash[:city]\n self.state=hash[:state]\n self.postal_code=hash[:zip]\n self.country=hash[:country]\n end", "def help_option_params\n params.require(:help_option).permit(:descriptionvol, :descriptioncall)\n end", "def prep_opts( params )\n need_to_split = %w(exclude_cookies exclude_vectors exclude include)\n\n cparams = {}\n params.each_pair {\n |name, value|\n\n next if %w(_csrf modules plugins).include?( name ) || ( value.is_a?( String ) && value.empty?)\n\n value = true if value == 'on'\n\n if name == 'cookiejar' && value[:tempfile]\n cparams['cookies'] = {}\n cparams['cookie_string'] = ''\n Arachni::Element::Cookie.from_file( '', value[:tempfile] ).each do |c|\n cparams['cookies'][c.name] = c.value\n cparams['cookie_string'] += c.to_s + ';'\n end\n elsif name == 'extend_paths' && !value.is_a?( Array ) && value[:tempfile]\n cparams['extend_paths'] = Arachni::Options.instance.paths_from_file( value[:tempfile] )\n elsif name == 'restrict_paths' && !value.is_a?( Array ) && value[:tempfile]\n cparams['restrict_paths'] = Arachni::Options.instance.paths_from_file( value[:tempfile] )\n elsif need_to_split.include?( name ) && value.is_a?( String )\n cparams[name] = value.split( \"\\r\\n\" )\n\n elsif name == 'redundant' && value.is_a?( String )\n cparams[name] = {}\n value.split( \"\\r\\n\" ).each {\n |rule|\n regexp, counter = rule.split( ':', 2 )\n cparams[name][regexp] = counter\n }\n elsif name == 'custom_headers' && value.is_a?( String )\n cparams[name] = {}\n value.split( \"\\r\\n\" ).each {\n |line|\n header, val = line.to_s.split( /=/, 2 )\n cparams[name][header] = val\n }\n else\n cparams[name] = to_i( value )\n end\n }\n\n if !cparams['audit_links'] && !cparams['audit_forms'] &&\n !cparams['audit_cookies'] && !cparams['audit_headers']\n\n cparams['audit_links'] = true\n cparams['audit_forms'] = true\n cparams['audit_cookies'] = true\n end\n\n return cparams\n end", "def serializable_hash (options={})\n options = {\n except: [:password_digest],\n methods: [:url]\n \n }.update(options)\n\n super(options)\n end", "def opts\n @opts\n end", "def validate_options(opts, valid_options = VALID_FIELDS)\n super(opts,valid_options)\n end", "def validate_options(opts, valid_options = VALID_FIELDS)\n super(opts,valid_options)\n end", "def options\n Hash[*VALID_PARAMS_KEYS.map {|key| [key, send(key)] }.flatten]\n end", "def _normalize_options! opts, new_opts = { }\n opts.each do | k, v |\n new_opts[k.to_sym] = v\n end\n \n new_opts\n end", "def add_params(opts = {})\n unless opts[:params].nil?\n opts[:params].each do |opt, value|\n @params[opt.to_sym] = value\n end\n opts.delete(:params)\n end\n end", "def options; @opts end", "def set_options(opts)\n if not opts.nil?\n @options[\"min_tokens\"] = opts[\"min_tokens\"] if not opts[\"min_tokens\"].nil?\n @options[\"max_tokens\"] = opts[\"max_tokens\"] if not opts[\"max_tokens\"].nil?\n @options[\"matching_method\"] = opts[\"matching_method\"] if not opts[\"matching_method\"].nil?\n @options[\"threshold\"] = opts[\"threshold\"] if not opts[\"threshold\"].nil?\n @options[\"top_n\"] = opts[\"top_n\"] if not opts[\"top_n\"].nil?\n end\n end", "def initialize(opts, defaults = {})\n opts.transform_keys!(&:to_sym)\n @options = defaults.update(opts)\n end", "def use(opts)\n keys = opts.keys & @takes\n\n fail 'too many keys' if keys.size > 1\n new(keys.first, opts.delete(keys.first))\n end", "def process_params(opts)\n opts = opts.dup\n check_exclusivity(opts.keys, ['template_body', 'template_url'])\n check_exclusivity(opts.keys, ['disable_rollback', 'on_failure'])\n check_exclusivity(opts.keys, ['stack_policy_body', 'stack_policy_url'])\n check_exclusivity(opts.keys, ['parameters', 'parameters_file'])\n\n sync_stdout = consume_option(opts, 'sync_stdout')\n $stdout.sync = sync_stdout\n\n opts['template_body'] = file_or_content(opts['template_body']) if opts['template_body']\n opts['tags'] = process_stack_tags(opts['tags']) if opts['tags']\n opts['stack_policy_body'] = file_or_content(opts['stack_policy_body']) if opts['stack_policy_body']\n opts['parameters'] = process_stack_parameters(opts['parameters']) if opts['parameters']\n opts['parameters'] = process_stack_parameters_file(consume_option(opts, 'parameters_file')) if opts['parameters_file']\n\n opts\n end", "def build_dict(option_specs) #:nodoc:\n @dict = {}\n keys = []\n option_specs.each do |option_spec|\n # Parse the specification\n m, label, oper, cont, arg = *option_spec.match(/([^=:]+)(?:([=:])([@])?(\\w+))?/)\n raise ParseError.new(\"invalid option format for '#{option_spec}'\") unless m\n\n # Figure out the specification type\n is_bang_arg = label.gsub!(/!$/, '')\n is_increment = label.gsub!(/\\+$/, '')\n forms = label.split('|')\n key = forms.first\n\n # Create an instance of OptionDefinition to hold metat data\n od = OptionDefinition.new(key)\n od.option_type = :boolean if is_bang_arg\n od.option_type = :increment if is_increment\n if (arg)\n od.option_type = (oper == '=') ? :required_argument : :optional_argument\n od.container_type = case cont\n when '@'; :array\n else :scalar\n end\n od.argument_type = case arg\n when 'f', 'float' ; :float\n when 'i', 'integer'; :integer\n when 's', 'string' ; :string\n else raise ParseError.new(\"unknown argument type '#{arg}'\")\n end\n end\n\n # Process alternate key names\n forms.each do |k|\n @dict[k] = od.dup\n keys << k\n end\n\n # Only support negation on long option names\n if (is_bang_arg)\n @dict[\"no-#{key}\"] = od.dup\n end\n end\n\n # Allow abbreviated long options\n keys.abbrev.each do |ab,key|\n @dict[ab] = @dict[key].dup\n @dict[ab].abbreviated = true unless (ab == key)\n end\n end", "def secure_hash\r\n params['secureHash']\r\n end", "def update_or_create_options(hash, opts)\n results = {}\n attrs = self.import_attrs || []\n attrs -= opts[:only] unless opts[:only].nil?\n attrs.each do |attr|\n key = nil\n if hash.key?(attr)\n key = attr\n elsif hash.key?(attr.to_s)\n key = attr.to_s\n end\n results[attr] = hash[key] unless key.nil?\n end\n results\n end", "def edit_hash(hash)\n raw = edit_data(hash, false)\n Chef::JSONCompat.parse(raw)\n end", "def pass(hash, allowed_keys)\n ret = {}\n hash.each do |k,v|\n ret[k] = v if allowed_keys.include? k\n end\n ret\n end", "def make_option_list\n @data = @option.values\n if @data.is_a?(Hash)\n @keys = @data.keys\n @data = @data.values\n end\n end", "def make_option_list\n @data = @option.values\n if @data.is_a?(Hash)\n @keys = @data.keys\n @data = @data.values\n end\n end", "def redirect_hash_facet_params\n if params[:f].respond_to?(:transform_values) && params[:f].values.any? { |x| x.is_a?(Hash) }\n original_f_params = params[:f].to_unsafe_h\n corrected_params = {}\n\n corrected_params[:f] = original_f_params.transform_values do |value|\n value.is_a?(Hash) ? value.values : value\n end\n\n redirect_to helpers.safe_params_merge_url(corrected_params), :status => :moved_permanently\n end\n end", "def map_to_prepared_args(hash)\n prepared_args.map{|k| hash[k.to_sym]}\n end", "def with_opts(opts = {})\n modified_instance = self.dup\n opts.each_pair do |key, value|\n modified_instance.options.send(\"#{key}=\", value) if modified_instance.options.methods.map(&:to_sym).include? \"#{key}=\".to_sym\n end\n modified_instance\n end", "def validate(hash, errors)\n end", "def initialize(options)\n @hash = options\n validate\n end" ]
[ "0.64559245", "0.6423782", "0.64234257", "0.64152306", "0.64152306", "0.6312778", "0.62213886", "0.61425644", "0.609628", "0.60873413", "0.607029", "0.606209", "0.59922534", "0.5964718", "0.5943323", "0.5943323", "0.5943323", "0.5943323", "0.5943323", "0.5943323", "0.5943323", "0.5943323", "0.5943323", "0.5943323", "0.59359473", "0.59204596", "0.58520436", "0.58396006", "0.5816057", "0.5812478", "0.57887167", "0.5776622", "0.5752239", "0.575137", "0.5737605", "0.5716052", "0.5713072", "0.56993836", "0.56974995", "0.56890434", "0.5684345", "0.56574136", "0.5655118", "0.5653865", "0.56170344", "0.5615435", "0.5609064", "0.5607096", "0.5592531", "0.5592386", "0.55920154", "0.55898994", "0.55808944", "0.55759156", "0.5564154", "0.5555248", "0.5542651", "0.55409926", "0.55358815", "0.55237067", "0.55190253", "0.55190253", "0.55111223", "0.5503562", "0.55020726", "0.5496395", "0.5478706", "0.54693717", "0.5465625", "0.5462339", "0.54538023", "0.5452433", "0.5441604", "0.5440146", "0.5434519", "0.5429166", "0.5425012", "0.54223686", "0.5421558", "0.54155093", "0.54155093", "0.5410811", "0.5410748", "0.5404867", "0.5404296", "0.5404286", "0.5402098", "0.5392007", "0.53917146", "0.5388092", "0.5384685", "0.5374137", "0.5372839", "0.53723264", "0.5368019", "0.5368019", "0.53615713", "0.536078", "0.53595567", "0.5355609", "0.5355119" ]
0.0
-1
opts can have keys: :cols
def children_objects(type, opts = {}) self.clone_copy_output.children_objects(level(type), type, opts) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def colnum; @options.fetch(:colnum, 0); end", "def columns(cols, options = {})\n if cols.is_a? Array\n cols.each.map{|c| columns(c.first, c.count >= 2 ? c.second : {}) if c.is_a? Array }\n return\n end\n cols.split(/,\\s/).each do |col|\n n = col.split(':')\n id = n.first\n name = n.count > 1 ? n.second : nil\n search = col_by_id id\n tmp = search.nil? ? Flexigrid::Column.new(self, id, name) : search\n options.map{|key,value| tmp.send(key.to_s + \"=\",value)}\n tmp.update!\n @columns << tmp\n @columns_hash[tmp.id] = tmp\n end\n end", "def columns()\n cols = {}\n prefix = \"#{@opts[:pname]}_\"\n fspec = @opts[:fspec]\n\n fspec.params.each do |name, opts|\n cols[prefix + name] = opts\n end\n cols \n end", "def cols=(cols)\n @cols = cols\n build\n end", "def columns *args\n if args.size > 0 && configurable?\n raise 'please call %s only inside #model block' % __method__ if model_defined?\n return @columns_opted = false if args.first == false\n @columns_opted = args\n end\n end", "def columns=(integer); end", "def expected_columns; end", "def columns(*args)\n @columns = @columns | args.map(&:to_sym)\n end", "def columns; end", "def update!(**args)\n @cols = args[:cols] if args.key?(:cols)\n @rows = args[:rows] if args.key?(:rows)\n end", "def cols\n @cols\n end", "def insert_col!(*args)\r\n after, before = nil, nil\r\n opts = (Hash === args.last || Numeric === args.last) ? args.pop : {}\r\n case opts\r\n when Numeric\r\n before = opts\r\n when Hash\r\n name = opts[:name]\r\n after = opts[:after]\r\n before = opts[:before]\r\n else\r\n after = col_count\r\n end\r\n #TODO lookup after, before if not Numeric\r\n input = args.flatten\r\n \r\n if @data.empty? && !input.empty?\r\n col_init!(input, name)\r\n else\r\n \r\n # pad or truncate column based on row count\r\n input = normalized_rows(input) \r\n \r\n if after\r\n col_insert_after!(after, input, name)\r\n end \r\n if before\r\n col_insert_before!(before, input, name)\r\n end\r\n \r\n end\r\n \r\n self\r\n end", "def initialize(opts = {})\n self.header = opts['Header']\n self.headeri = opts['HeaderIndent'] || 0\n self.columns = opts['Columns'] || []\n # updated below if we got a \"Rows\" option\n self.rows = []\n\n self.width = opts['Width'] || 80\n self.indent = opts['Indent'] || 0\n self.cellpad = opts['CellPad'] || 2\n self.prefix = opts['Prefix'] || ''\n self.postfix = opts['Postfix'] || ''\n self.colprops = []\n self.scterm = /#{opts['SearchTerm']}/mi if opts['SearchTerm']\n\n self.sort_index = opts['SortIndex'] || 0\n self.sort_order = opts['SortOrder'] || :forward\n\n # Default column properties\n self.columns.length.times { |idx|\n self.colprops[idx] = {}\n self.colprops[idx]['MaxWidth'] = self.columns[idx].length\n self.colprops[idx]['Stylers'] = []\n self.colprops[idx]['Formatters'] = []\n }\n\n # ensure all our internal state gets updated with the given rows by\n # using add_row instead of just adding them to self.rows. See #3825.\n opts['Rows'].each { |row| add_row(row) } if opts['Rows']\n\n # Merge in options\n if (opts['ColProps'])\n opts['ColProps'].each_key { |col|\n idx = self.columns.index(col)\n\n if (idx)\n self.colprops[idx].merge!(opts['ColProps'][col])\n end\n }\n end\n\n end", "def performArgs(args)\n proj = [] # new column index -> list of original column indices\n projNames = [] # new column index -> name to show\n # In the following, columns refer to the new column index\n sort = nil # Which column to sort by (only support one)\n aggregate = [] # Which columns to aggregate (rest of columns are used as the key)\n sortReverse = false\n selectTransforms = [] # Select / transform subset of the columns\n hist = [] # Array of columns to compute the histogram key over\n histMaxExemplars = 1 # For each key, how many to print\n\n # No arguments means we want to select everything\n addAllCols = lambda {\n proj += (0...numCols).map { |col| [col] }\n projNames += (0...numCols).map { |col| @header[col] }\n }\n\n # Default: if no arguments, then add all columns\n addAllCols.call if args.size == 0\n\n ensureProjExists = lambda { throw \"No column specified before #{arg}\" if proj.size == 0 }\n\n args.each { |arg|\n if arg == '.sort'\n sort = proj.size-1\n elsif arg == '.sort-'\n sort = proj.size-1\n sortReverse = true\n elsif arg == '.all'\n addAllCols.call\n elsif arg =~ /^\\.hist(\\d*)$/\n histMaxExemplars = Integer($1) if $1 != ''\n ensureProjExists.call\n hist << proj.size-1\n elsif arg == '.agg'\n ensureProjExists.call\n aggregate << proj.size-1\n elsif arg =~ /^\\?(.+)$/ # Select: general (e.g., '?_>5')\n ensureProjExists.call\n query = $1\n selectTransforms << ['select', proj.size-1, eval(\"lambda { |_,_i| #{query} }\")]\n elsif arg =~ /^[\\/=](.*)$/ # Select: search (e.g., /5)\n ensureProjExists.call\n query = $1\n if query == ''\n selectTransforms << ['select', proj.size-1, lambda { |x,i| x == nil }]\n else\n if arg =~ /^=/\n selectTransforms << ['select', proj.size-1, lambda { |x,i| x.to_s == query }]\n else\n selectTransforms << ['select', proj.size-1, lambda { |x,i| x.to_s =~ /#{query}/ }]\n end\n end\n elsif arg =~ /^%(.+)$/ # Transform: general (e.g., %_*2)\n ensureProjExists.call\n body = $1\n selectTransforms << ['transform', proj.size-1, eval(\"lambda { |_,_i| #{body} }\")]\n elsif arg =~ /^s\\/(.+)\\/(.*)\\/g?$/ # Transform: search and replace (e.g., s/a/b/)\n ensureProjExists.call\n search, replace, global = $1, $2, $3\n if global\n func = lambda{|x,i| x.sub(/#{search}/, replace)}\n else\n func = lambda{|x,i| x.gsub(/#{search}/, replace)}\n end\n selectTransforms << ['transform', proj.size-1, func]\n elsif arg =~ /^.split=(.+)$/ # Transform: split using a particular delimiter (generates two columns, one before delimiter and one after)\n ensureProjExists.call\n delim = $1\n selectTransforms << ['transform', proj.size-1, lambda { |x,i| x.split(/#{delim}/, 2)[0] }] # Pick out stuff before a delimiter\n proj << proj.last\n selectTransforms << ['transform', proj.size-1, lambda { |x,i| x.split(/#{delim}/, 2)[1] }] # Pick out after after a delimiter\n else\n # Specify a new column\n proj << parseColumns(arg)\n projNames << arg\n end\n }\n\n # Canonicalize only when we need to use the row\n canonicalized = {}\n canonicalizeColumn = lambda { |cols|\n cols.each { |col|\n next if canonicalized[col] # Already canonicalized\n $stderr.puts \"Canonicalize #{col}\" if $verbose\n @data.each { |row|\n row[col] = canonicalizeValue(row[col])\n }\n }\n }\n\n # proj is a sequence of cols (e.g., [[0,1], [2]]\n # Project onto the specified columns.\n # Perform aggregation within each group of columns.\n @header = proj.map_with_index { |cols,j|\n cols.size == 1 ? @header[cols[0]] : projNames[j]\n }\n @data = @data.map { |row|\n proj.map_with_index { |cols,j|\n if cols.size == 1\n value = row[cols[0]] # No need to aggregate\n else\n if cols.all?{|col| row[col] == nil} # Aggregate nils into nil\n value = nil\n else # Concatenate non-numerical values\n value = cols.map{|col| row[col]}.join(' ')\n end\n end\n value\n }\n }\n\n # Select and transform\n selectTransforms.each { |mode,col,func|\n canonicalizeColumn.call([col])\n canonicalized[col] = true\n if mode == 'select'\n i = -1\n @data = @data.select { |row| i += 1; func.call(row[col], i) }\n elsif mode == 'transform'\n @data.each_with_index { |row,i| row[col] = func.call(row[col], i) }\n else\n raise \"Internal error: bad mode #{mode}\"\n end\n }\n\n # Sort rows by some column\n if sort\n canonicalizeColumn.call([sort])\n canonicalized[sort] = true\n # Ensure stable sort\n indices = ([email protected]).sort { |i,j|\n a = @data[i][sort] || 0\n b = @data[j][sort] || 0\n a != b ? a <=> b : i <=> j\n }\n @data = indices.map {|i| @data[i]}\n @data.reverse! if sortReverse\n end\n\n # Create histogram (hist specifies columns that determine the key)\n if hist.size > 0\n counts = {}\n exemplars = {} # key => list of rows\n keys = []\n @data.each { |row|\n key = hist.map { |col| row[col] }\n if not counts[key]\n keys << key\n counts[key] = 1\n exemplars[key] = [row]\n else\n counts[key] += 1\n list = exemplars[key]\n list << row if list.size < histMaxExemplars\n end\n }\n @data = []\n # Preserve order if we want to actually get multiple views\n keys = keys.sort{|a,b| counts[a] <=> counts[b]} if histMaxExemplars == 1\n keys.each { |key|\n exemplars[key].each { |row|\n @data << row + [counts[key]]\n }\n }\n @header << 'count'\n end\n\n if aggregate.size > 0\n # |aggregate| specifies the columns that we will do aggregation over.\n # The rest of the columns serve to form the key.\n # For each key, stats[key][j] will be a list of numbers for the j-th\n # column that we're aggregating over.\n aggregate.each { |col|\n canonicalizeColumn.call([col])\n canonicalized[col] = true\n }\n keyCols = (0...numCols).select { |col| not aggregate.index(col) }\n stats = {}\n keys = []\n @data.each { |row|\n key = keyCols.map { |col| row[col] }\n keyStats = stats[key]\n if not keyStats\n keyStats = stats[key] = aggregate.map { [] }\n keys << key\n end\n aggregate.each_with_index { |col,j|\n keyStats[j] << row[col]\n }\n }\n\n # Change header: remove aggregated fields with statistics\n newHeader = @header.map_with_index {|name,col|\n aggregate.index(col) ? nil : name\n }.compact\n aggregate.each_with_index { |col,j|\n newHeader << @header[col] + \".min\"\n newHeader << @header[col] + \".mean\"\n newHeader << @header[col] + \".stddev\"\n newHeader << @header[col] + \".max\"\n newHeader << @header[col] + \".sum\"\n }\n @header = newHeader\n\n @data = keys.map { |key|\n row = key\n keyStats = stats[key]\n aggregate.each_with_index { |col,j|\n numbers = keyStats[j].compact\n row << numbers.min\n row << numbers.mean\n row << numbers.stddev\n row << numbers.max\n row << numbers.sum\n }\n row\n }\n end\n\n # Use custom header\n if $Fields\n @header = $Fields\n end\n end", "def cols\r\n if !@cols\r\n require \"#{File.dirname(__FILE__)}/drivers/#{@opts[:type]}/knjdb_#{@opts[:type]}_columns\" if ([email protected]?(:require) or @opts[:require])\r\n @cols = Kernel.const_get(\"KnjDB_#{@opts[:type]}\".to_sym).const_get(:Columns).new(\r\n :db => self\r\n )\r\n end\r\n \r\n return @cols\r\n end", "def set_column(*args)\n data = args\n cell = data[0]\n\n # Check for a cell reference in A1 notation and substitute row and column\n if cell =~ /^\\D/\n data = substitute_cellref(*args)\n\n # Returned values $row1 and $row2 aren't required here. Remove them.\n data.shift # $row1\n data.delete_at(1) # $row2\n end\n\n return if data.size < 3 # Ensure at least $firstcol, $lastcol and $width\n return if data[0].nil? # Columns must be defined.\n return if data[1].nil?\n\n # Assume second column is the same as first if 0. Avoids KB918419 bug.\n data[1] = data[0] if data[1] == 0\n\n # Ensure 2nd col is larger than first. Also for KB918419 bug.\n data[0], data[1] = data[1], data[0] if data[0] > data[1]\n\n # Limit columns to Excel max of 255.\n data[0] = ColMax - 1 if data[0] > ColMax - 1\n data[1] = ColMax - 1 if data[1] > ColMax - 1\n\n @colinfo.push(data)\n\n # Store the col sizes for use when calculating image vertices taking\n # hidden columns into account. Also store the column formats.\n #\n firstcol, lastcol, width, format, hidden = data\n\n width ||= 0 # Ensure width isn't undef.\n hidden ||= 0\n width = 0 if hidden > 1 # Set width to zero if col is hidden\n\n (firstcol .. lastcol).each do |col|\n @col_sizes[col] = width\n @col_formats[col] = format unless format.nil?\n end\n end", "def col; end", "def initialize cols=nil, *args, &block\n @chash = [] # hash of column info, not used\n @_skip_columns = {} # internal, which columns not to calc width of since user has specified\n @separ = @columns = @numbering = nil\n @y = '|'\n @x = '+'\n @use_separator = false\n @_hidden_columns_flag = false\n self.columns = cols if cols\n if !args.empty?\n self.data = args\n end\n yield_or_eval(&block) if block_given?\n end", "def too_many_cols?; cols.count >= MAX_COL_COUNT; end", "def update!(**args)\n @cols = args[:cols] if args.key?(:cols)\n @data = args[:data] if args.key?(:data)\n @rows = args[:rows] if args.key?(:rows)\n @type = args[:type] if args.key?(:type)\n end", "def prepared_columns(cols)\n RUBY_VERSION >= '1.9' ? cols.sort : cols.sort_by(&:to_s)\n end", "def lnbsetColumnsPos _args\n \"lnbsetColumnsPos _args;\" \n end", "def columns=(cols)\n if cols && cols.uniq.size != cols.size\n handle_duplicate_columns(cols)\n end\n super\n end", "def allow_more_cols?\n !cols_enum_empty? && cols_enum_ready? && !(cols.values.include?('') || cols.values.include?(nil)) && cols.values.count < MAX_COL_COUNT\n end", "def initialize(cols, *args)\n @using = cols \n super(*args)\n end", "def columns!\n @columns = nil\n columns\n end", "def rowify(opts)\n unless opts[:rows].respond_to? :to_i\n raise \"Columns must be an integer\" unless opts[:columns].respond_to? :to_i\n opts[:rows] = (@cards.size / opts[:columns].to_i).ceil\n end\n opts\n end", "def columns!\n ds = clone(opts.merge(:sql => \"SELECT TOP 1 [T1].* FROM (#{opts[:sql]}) \\\"T1\\\"\"))\n ds.each{break}\n\n if cols = ds.cache[:_columns]\n self.columns = cols\n else\n []\n end\n end", "def columns(*array)\n unless array.empty?\n if (array.class == Array)\n options[:columns] = array\n else\n raise \"Report columns must be specified.\"\n end\n else\n options[:columns]\n end\n end", "def columns\n end", "def columns(names, options=nil)\n names.each do |name|\n column name, options\n end\n end", "def columns(*args,&block)\n if (args && args.any?) || block_given? || !@columns\n self.columns = Lolita::Configuration::Columns.new(dbi,*args,&block)\n end\n @columns\n end", "def short cols\n decode_values :short, cols\n end", "def column_params\n params.fetch(:column, {}).permit(\n :span_xs, :span_sm, :alignment, :viewport, :pivot, :background_color,\n :gradient_color, :gradient_type, :gradient_direction, :gradient_balance\n )\n end", "def columns; @columns; end", "def columns=(arr)\n @columns = arr\n update_height\n end", "def column_options\n { limit: column.limit, default: column.default, null: column.null }\n end", "def schema_ds_select(table_name, opts)\n cols = [:column_name___column, :data_type___db_type, :character_maximum_length___max_chars, \\\n :numeric_precision, :column_default___default, :is_nullable___allow_null]\n cols << :c__table_name unless table_name\n cols\n end", "def add_select_options(opt)\n opt.on('--select x,y,z', Array,\n \"Select x, y, z columns only\") do |value|\n self.select = value.collect{|c| c.to_sym}\n end\n opt.on('--allbut x,y,z', Array,\n \"Select all but x, y, z columns\") do |value|\n self.allbut = value.collect{|c| c.to_sym}\n end\n end", "def repeat_columns(*args)\n # Check for a cell reference in A1 notation and substitute row and column\n if args =~ /^\\D/\n args = substitute_cellref(*args)\n\n # Returned values $row1 and $row2 aren't required here. Remove them.\n args.shift # $row1\n args.delete_at(1) # $row2\n end\n\n @title_colmin = args[0]\n @title_colmax = args[1] || args[0] # Second col is optional\n end", "def fetch_rows_set_cols(res)\n cols = []\n procs = db.conversion_procs\n res.nfields.times do |fieldnum|\n cols << [fieldnum, procs[res.ftype(fieldnum)], output_identifier(res.fname(fieldnum))]\n end\n self.columns = cols.map{|c| c[2]}\n cols\n end", "def draw_columns\n @sections[:body][:fields].each do |field, settings|\n settings = [settings[0], @posY, (@defaults.merge (settings[1] || { }).symbolize_keys!)]\n settings[2][:style] = settings[2][:style].to_sym\n set_options settings[2]\n draw_line(@posY + @sections[:body][:settings][:height]/2)\n field = settings[2][:column] || field.to_s.split('_').inject('') do |str, part|\n str << part.camelize << \" \"\n end\n draw_text field, settings\n end\n draw_line(@posY - @sections[:body][:settings][:height]/2)\n set_pos_y @sections[:body][:settings][:height]\n end", "def columns\n @columns || 150\n end", "def update!(**args)\n @columns = args[:columns] if args.key?(:columns)\n @rows = args[:rows] if args.key?(:rows)\n end", "def table_opts\n {\n converters: [YEAR_NORMALIZER, :float],\n headers: true,\n header_converters: [->(header) { normalize_key(header) }],\n # Needed to retrieve the headers in case of an otherwise empty csv file\n return_headers: true\n }\n end", "def initialize( columns, table_name, opts = {} )\n @columns = [ *columns ]\n @table_name = table_name\n @opts = opts\n if key = opts[ :key ]\n opts[ :key ] = [ *key ]\n end\n end", "def update!(**args)\n @columns = args[:columns] if args.key?(:columns)\n end", "def update!(**args)\n @columns = args[:columns] if args.key?(:columns)\n end", "def columns(table_name, name = nil) end", "def each_col\n cols.each\n end", "def update!(**args)\n @column_headers = args[:column_headers] if args.key?(:column_headers)\n @kind = args[:kind] if args.key?(:kind)\n @rows = args[:rows] if args.key?(:rows)\n end", "def columns=(value)\n @columns = value\n end", "def each_column\n end", "def columns=(val)\n if (cr=colrow)\n @records.set(GRT_COLROW, [val, cr[1]])\n else\n @records.set(GRT_COLROW, [val, nil])\n end\n end", "def columns(*cs)\n if cs.empty?\n super\n else\n self.columns = cs\n self\n end\n end", "def columns_incdec howmany\n @gviscols += howmany.to_i\n @gviscols = 1 if @gviscols < 1\n @gviscols = 6 if @gviscols > 6\n @pagesize = @grows * @gviscols\nend", "def initialize(args={})\n super\n @rows = args[:rows]\n @cols = args[:cols]\n @title = args[:title]\n\n @rowtitles = args[:rowtitles] || args[:row_titles] || Array.new(@rows) { \"\" }\n @coltitles = args[:coltitles] || args[:col_titles] || Array.new(@cols+1) { \"\" }\n @colwidths = args[:colwidths] || args[:col_widths] || Array.new(@cols+1) { 5 }\n @coltypes = args[:coltypes] || args[:col_types] || Array.new(@cols+1) { :UMIXED }\n end", "def shorts cols\n decode_values :short, cols, true\n end", "def initialize\n @col_specs = []\n end", "def check_columns!\n if columns.nil? || columns.empty?\n raise Error, 'cannot literalize HashRow without columns'\n end\n end", "def update!(**args)\n @column = args[:column] if args.key?(:column)\n @column_span = args[:column_span] if args.key?(:column_span)\n @row = args[:row] if args.key?(:row)\n @row_span = args[:row_span] if args.key?(:row_span)\n end", "def profile_property_columns_tag(options={})\n defaults = {:editable => false, :width => 480, :edit_control_width => 11}\n options = defaults.merge(options).symbolize_keys\n html = ''\n if options[:editable]\n html << content_tag(:col, '', :width => \"#{options[:width] - options[:edit_control_width]}\")\n html << content_tag(:col, '', :width => \"#{options[:edit_control_width]}\")\n else\n html << content_tag(:col, '', :width => \"#{options[:width]}\")\n end\n html\n end", "def columns; @columns_hash.values; end", "def columns(model, options)\n if cols = options[:columns]\n cols\n else\n cols = model.keys.collect do |k|\n { :key => k.to_sym, :label => \"#{k.capitalize}\" }\n end\n end\n end", "def cols\n # remove the nils\n cols = (Array.new(@size) { Array.new(@size) }).map { |col| col.select { |el| el != nil} }\n \n @rows.each do |row|\n row.each_with_index do |mark, col_idx|\n cols[col_idx] << mark\n end\n end\n \n cols\n end", "def column id = nil, options = {}\n unless id\n id = options[:id]\n raise \"Need a column ID\" if id.nil?\n end\n if options.empty?\n @cols << {}\n else\n @cols << options\n end\n @col_count = @cols.size\n @col_ids << id\n end", "def column_deltas=(_arg0); end", "def set_cols(visible, list)\n @rows = 1 if visible\n @cols = (depends_on & list).find_all { |u| u.visible }.inject(0) { |s, v| s + (v.cols || 0) }\n @cols = 1 if @cols == 0 and visible\n end", "def update!(**args)\n @column_headers = args[:column_headers] if args.key?(:column_headers)\n @errors = args[:errors] if args.key?(:errors)\n @kind = args[:kind] if args.key?(:kind)\n @rows = args[:rows] if args.key?(:rows)\n end", "def clone(opts = {})\n c = super()\n c.opts = @opts.merge(opts)\n c.instance_variable_set(:@columns, nil) unless (opts.keys & COLUMN_CHANGE_OPTS).empty?\n c\n end", "def geometry_columns!; end", "def sh_set_lines_and_columns(lines, cols)\r\n ENV[\"LINES\"] = lines.to_s\r\n ENV[\"COLUMNS\"] = cols.to_s\r\n end", "def update!(**args)\n @columns = args[:columns] if args.key?(:columns)\n @columns_int16 = args[:columns_int16] if args.key?(:columns_int16)\n @columns_int32 = args[:columns_int32] if args.key?(:columns_int32)\n @columns_int64 = args[:columns_int64] if args.key?(:columns_int64)\n @columns_int8 = args[:columns_int8] if args.key?(:columns_int8)\n @values = args[:values] if args.key?(:values)\n end", "def add_csv_options(opt)\n opt.on(\"--headers\", \"-h\", \"Read/Write column names on first line\") do\n io_options[:csv][:headers] = true\n end\n opt.on(\"--separator=C\", \"Use C as column separator character\") do |value|\n io_options[:csv][:col_sep] = value\n end\n opt.on(\"--quote=C\", \"Use C as quoting character\") do |value|\n io_options[:csv][:quote_char] = value\n end\n opt.on(\"--force-quotes\", \"Force quoting?\") do \n io_options[:csv][:force_quotes] = true\n end \n opt.on(\"--skip-blanks\", \"Skip blank lines?\") do \n io_options[:csv][:skip_blanks] = true\n end \n end", "def keep_geom_columns_option\n \"-oo KEEP_GEOM_COLUMNS=#{keep_geom_columns? ? 'YES' : 'NO'}\"\n end", "def appropriate_column_listing(columns = columns_joined)\n has_config_defined_cols? == true ? \", #{columns}\" : \"\"\n end", "def set_raw_columns(cols)\n @columns = cols.collect { |args| Column.new(*args) }\n end", "def includeColumn? (col)\n return @cols.nil? ? true : @cols.member?(col)\nend", "def initialize(options={})\n @cols = []\n @rows = []\n @listeners = []\n @options = options\n return if options.empty?\n\n new_columns(options[:cols]) unless options[:cols].nil?\n\n return if options[:rows].nil?\n\n rows = options[:rows]\n rows.each do |row|\n add_row(row[:c])\n end\n end", "def options_to_columns(options)\n columns = []\n options[:columns].each do |column|\n if column.kind_of? Symbol # a column from the database, we don't need to do anything\n columns << {:name => column, :attribute => column}\n elsif column.kind_of? Hash\n columns << {:name => column[:name], :special => column}\n end\n end\n columns\n end", "def build_array_of_cols_and_vals( num )\n cols = [:my_name, :description]\n value_sets = []\n num.times { |i| value_sets << [\"My Name #{i}\", \"My Description #{i}\"] }\n [cols, value_sets]\n end", "def build_columns\n return unless configurable?\n return if @columns_opted == false\n selector(ORMUtils.properties(model), @columns_opted, @columns_ignored).each do |setup|\n setup << {summary: false} if setup.last == 'text'\n column *setup\n end\n end", "def columns_param(column_names)\n column_names.map! { |name| escape(name) }\n \"columns:!(#{column_names.join(',')})\"\n end", "def column_size; end", "def cols\n @dimension\n end", "def include_columns(mod, args = {})\n mod.columns.each do |column|\n column = args[:record] ? DerefColumn.new(column, args[:record]) : column\n columns_hash[column.name] = column\n end\n end", "def report_column_options\n @@report_column_options ||= [\n column_config(name: :user_name,\n custom_select: \"\n (SELECT u.name\n FROM users u\n WHERE u.id = orders.user_id)\n as user_name\"),\n column_config(name: :id, order_sql: 'orders.id', link: :order_path),\n column_config(name: :amount, order_sql: 'orders.amount', summarizable: true),\n column_config(name: :description, order_sql: 'orders.description')\n ]\n end", "def columns\n raise NotImplementedError\n end", "def col_options(question)\n question.question_cells.select { |cell| cell.type =~ /Rating|TextBox|Comment/ }.collect do |cell|\n [cell.col, cell.col]\n end\n end", "def to_s(cols = T.unsafe(nil)); end", "def max_columns(fit = T.unsafe(nil)); end", "def column(key, opts=nil)\n defaults = { :name => key.to_s }\n opts = defaults.merge(opts || {})\n\n @heads[key] = opts[:name]\n @columns[key] = opts\n @stack << key\n end", "def cols(value)\n @page_cols_num = value.to_i\n end", "def columns\n 1\n end", "def add_column(name, type, options = {})\n\t printf \"Column name is: %s\\n\", name\n\t printf \"Type is: %s\\n\", type\n\t options.each {|key, value| puts \"The #{key} is #{value}\" }\n\tend", "def update!(**args)\n @column = args[:column] if args.key?(:column)\n @columns = args[:columns] if args.key?(:columns)\n end", "def columns=(value)\n return if @columns == value\n @columns = value\n refresh\n end", "def _select_map_multiple(ret_cols)\n rows = []\n clone(:_sequel_pg_type=>:array).fetch_rows(sql){|s| rows << s}\n rows\n end", "def columns=(n)\n @columns = n\n end", "def in_step_args arg\n if arg[:type] == :DataTable\n res = []\n arg[:rows].each_with_index do |row, i|\n sep = i == 0 ? '||' : '|'\n res << surround(row[:cells].map {|hsh| jira_monospace(jira_blank_pad hsh[:value])}, sep)\n end\n return res\n elsif arg[:type] == :DocString\n # todo: handle if needed\n @log.warn \"Docstrings found in '#{arg}' found in file @ #{@file_path}\"\n else\n @log.warn \"Unknown type '#{arg[:type]}' found in file @ #{@file_path}\"\n end\n []\n end", "def parseColumns(arg)\n if arg =~ /^(\\d+)-(\\d+)$/ # Range of column indices (e.g., 3-5)\n return (Integer($1)..Integer($2)).to_a\n elsif arg =~ /^([\\d,]+)$/ # Just a set of columns\n return arg.split(/,/).map{|x| Integer(x)}\n elsif arg =~ /^:(.*)$/ # Search to find the column\n query, rest = $1, $2\n result = nil\n @data.each { |row|\n (0...row.size).each { |col|\n if row[col].to_s =~ /#{query}/\n result = col\n break\n end\n }\n }\n return [result] if result\n raise \"Can't identify column from #{arg}\"\n else\n # Comma-separated list of names\n matches = []\n arg.split(/,/).each { |a|\n @header.each_with_index { |name,i|\n matches << i if name =~ /^#{a}$/\n }\n }\n raise \"Not valid header: #{arg}, possible headers: #{@header.inspect}\" if matches.size == 0\n return matches\n end\n end" ]
[ "0.6659095", "0.6503524", "0.64285696", "0.62890756", "0.6174786", "0.6151229", "0.60430926", "0.60385543", "0.6008436", "0.5889924", "0.58576703", "0.57490665", "0.57094514", "0.5705763", "0.57038283", "0.5686613", "0.56641334", "0.56387085", "0.56217223", "0.5578129", "0.55701596", "0.55646837", "0.5561139", "0.55441695", "0.55440414", "0.5522158", "0.54895854", "0.54816264", "0.54665136", "0.54594487", "0.5457203", "0.5454487", "0.5452367", "0.5443074", "0.5425726", "0.54252326", "0.5375849", "0.5366917", "0.536531", "0.5324141", "0.5311178", "0.530781", "0.5307747", "0.52981645", "0.5289604", "0.52840215", "0.52741796", "0.52741796", "0.52718985", "0.5251504", "0.52507055", "0.5247687", "0.524457", "0.5236939", "0.52349734", "0.52238107", "0.5221627", "0.52191406", "0.5214002", "0.5193567", "0.5192882", "0.5191121", "0.51777625", "0.51775426", "0.5176553", "0.51596016", "0.5154092", "0.5149438", "0.51419955", "0.5130528", "0.51302046", "0.51297927", "0.5116697", "0.5099586", "0.50953156", "0.50932974", "0.50913405", "0.5081752", "0.50803417", "0.5048012", "0.5044185", "0.5040573", "0.50375664", "0.5034905", "0.5024852", "0.50197655", "0.5017405", "0.5013861", "0.50080734", "0.5006171", "0.5006125", "0.5005845", "0.49999273", "0.49932888", "0.4992989", "0.4986097", "0.49766606", "0.49742568", "0.49651292", "0.49544802", "0.4946287" ]
0.0
-1
request is leaf node
def approver_group_notified return unless request.group_name send_event(EVENT_APPROVER_GROUP_NOTIFIED, :request_id => request.root.id, :group_name => request.group_name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_leaf\n true\n end", "def is_leaf\n true\n end", "def leaf?\n !node?\n end", "def leaf?\n true\n end", "def leaf?; false end", "def leaf(node, tag)\r\n end", "def leaf?; @leaf; end", "def leaf_node?(node_id)\n @leaf_count < node_id\n end", "def leaf?(r)\n r.children.empty?\n end", "def leaf?\n self.children.size == 0\n end", "def leaf?\n new_record? || (rgt - lft == 1)\n end", "def is_node?(obj)\n obj.respond_to?(:children) && obj.location.expression\n end", "def is_leaf?\n\t\tself.part_map.empty?\n\tend", "def leaf?\n level.zero?\n end", "def leaf?(node)\n terminal?(node) && out_degree(node) == 0\n end", "def node(node)\n true\n end", "def leaf?\n @children.length.zero?\n end", "def leaf?\n @children.empty?\n end", "def request?\n self.operation == OP_REQUEST\n end", "def leaf?\n children.empty?\n end", "def node?\n node.present?\n end", "def is_node?(); @type == GRT_NODE; end", "def is_leaf\n return @left == nil\n end", "def root_node; end", "def request?\n @type == :request\n end", "def allowed_type?(parent_node); end", "def scanned_node?(node); end", "def is_leaf?\n self.children_count.zero?\n end", "def leaf?\n leaves.count == 0\n end", "def leaf?\n @succ.length == 0\n end", "def node?\n @subject.node?\n end", "def _is_root_node?\n @nodes.size == 1\n end", "def leaf?\n record.persisted? && if children.loaded? || tree.columns.counter_cache?\n # no SQL-queries here\n children.empty?\n else\n !children.exists?\n end\n end", "def node_type; end", "def node_type; end", "def root?\n @type == ROOT\n end", "def node?\n any?(&:node?)\n end", "def request?\n !!request\n end", "def is_nodetype?(); @type == GRT_NODETYPE; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def is_root?\n \troot == id\n end", "def has_children?\n !leaf?\n end", "def valid_tree?\n false\n end", "def leaf?(term_or_go)\n go_id = as_term(term_or_go).id\n not_a_leaf = @terms.any? do |term| \n term.is_as.any? do |is_a_id| \n go_id == is_a_id\n end\n end\n !not_a_leaf\n end", "def leaf?\n children.where(parent_id: self.id).empty?\n end", "def leaf_node?(tree_node)\n tree_node.left.nil? && tree_node.right.nil?\nend", "def is_subtree(root)\n\nend", "def is_node(line)\n\t\treturn line.split(\" \")[1].downcase == \"node\" ? true : false\n\tend", "def valid_tree?\n true\n end", "def valid_tree?\n true\n end", "def leaf_version?\n\t\treturn self.child_versions.empty?\n\tend", "def is_leaf?\n self.left_child == nil and\n self.right_child == nil\n end", "def leaf?\n persisted? && if children_counter_cache_column\n self[children_counter_cache_column] == 0\n else\n children.count == 0\n end\n end", "def valid_tree?\n true\n end", "def leaf?\n right - left == 1\n end", "def hasRequest?\n !requests.empty?\n end", "def cltn_request?( path )\n path.size == 3\n end", "def goalNode?(node)\n node.name == 'Goal'\nend", "def parent_singleton?\n !parent_type_from_request.nil? && parent_type_from_params.nil?\n end", "def root?\n !parent\n end", "def check(node); end", "def children_are_leaves?\n unless leaf?\n @children[0].leaf?\n end\n end", "def root?\r\n\t\treturn parent == nil\r\n\tend", "def for_node; end", "def child_node; end", "def nested?\n @nodes.any?\n end", "def leaf?\n self.variations.size == 0\n end", "def is_root?()\n return (name.nil? and parent.nil?) \n end", "def leaf?(sexp)\n list?(sexp) && depth(sexp) == 1\nend", "def unknown?\n !root? && !child?\n end", "def unknown?\n !root? && !child?\n end", "def unknown?\n !root? && !child?\n end", "def parent_singleton?\n !parent_type_from_request.nil? && parent_type_from_params.nil?\n end", "def object_attribute_is_node?(name)\n %i[\n alias_of\n delegate\n demand_source\n output_capacity_from_demand_of\n source\n ].include?(name)\n end", "def nodes?\r\n\t\treturn !h? || (h? && root?)\r\n\tend" ]
[ "0.66414416", "0.66414416", "0.6619851", "0.6516141", "0.6511789", "0.64122164", "0.6410618", "0.63338476", "0.62276137", "0.62275434", "0.6212207", "0.6189261", "0.61245453", "0.61234343", "0.6119546", "0.60960525", "0.60889244", "0.606563", "0.6029906", "0.60223407", "0.5975271", "0.59564424", "0.59490895", "0.594456", "0.59385216", "0.59366506", "0.5934155", "0.59319985", "0.5863992", "0.5862181", "0.5799002", "0.57863003", "0.57675266", "0.57637376", "0.57637376", "0.57378405", "0.5727049", "0.5721719", "0.56913996", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.5664384", "0.56326956", "0.5627841", "0.5624345", "0.5623926", "0.5615183", "0.56140924", "0.5596699", "0.5590787", "0.5590787", "0.5571507", "0.55713934", "0.5539961", "0.552086", "0.55164135", "0.54999024", "0.5491139", "0.5486779", "0.5484302", "0.5461141", "0.5447789", "0.5447699", "0.54348904", "0.54241985", "0.54198056", "0.5419799", "0.54093874", "0.5405916", "0.5384261", "0.5383612", "0.5383612", "0.5383612", "0.5380065", "0.5376246", "0.5376165" ]
0.0
-1
request is leaf node
def approver_group_finished return unless request.group_name send_event(EVENT_APPROVER_GROUP_FINISHED, :request_id => request.root.id, :group_name => request.group_name, :decision => request.decision, :reason => request.reason || '') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_leaf\n true\n end", "def is_leaf\n true\n end", "def leaf?\n !node?\n end", "def leaf?\n true\n end", "def leaf?; false end", "def leaf(node, tag)\r\n end", "def leaf?; @leaf; end", "def leaf_node?(node_id)\n @leaf_count < node_id\n end", "def leaf?(r)\n r.children.empty?\n end", "def leaf?\n self.children.size == 0\n end", "def leaf?\n new_record? || (rgt - lft == 1)\n end", "def is_node?(obj)\n obj.respond_to?(:children) && obj.location.expression\n end", "def is_leaf?\n\t\tself.part_map.empty?\n\tend", "def leaf?\n level.zero?\n end", "def leaf?(node)\n terminal?(node) && out_degree(node) == 0\n end", "def node(node)\n true\n end", "def leaf?\n @children.length.zero?\n end", "def leaf?\n @children.empty?\n end", "def request?\n self.operation == OP_REQUEST\n end", "def leaf?\n children.empty?\n end", "def node?\n node.present?\n end", "def is_node?(); @type == GRT_NODE; end", "def is_leaf\n return @left == nil\n end", "def root_node; end", "def request?\n @type == :request\n end", "def allowed_type?(parent_node); end", "def scanned_node?(node); end", "def is_leaf?\n self.children_count.zero?\n end", "def leaf?\n leaves.count == 0\n end", "def leaf?\n @succ.length == 0\n end", "def node?\n @subject.node?\n end", "def _is_root_node?\n @nodes.size == 1\n end", "def leaf?\n record.persisted? && if children.loaded? || tree.columns.counter_cache?\n # no SQL-queries here\n children.empty?\n else\n !children.exists?\n end\n end", "def node_type; end", "def node_type; end", "def root?\n @type == ROOT\n end", "def node?\n any?(&:node?)\n end", "def request?\n !!request\n end", "def is_nodetype?(); @type == GRT_NODETYPE; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def is_root?\n \troot == id\n end", "def has_children?\n !leaf?\n end", "def valid_tree?\n false\n end", "def leaf?(term_or_go)\n go_id = as_term(term_or_go).id\n not_a_leaf = @terms.any? do |term| \n term.is_as.any? do |is_a_id| \n go_id == is_a_id\n end\n end\n !not_a_leaf\n end", "def leaf?\n children.where(parent_id: self.id).empty?\n end", "def leaf_node?(tree_node)\n tree_node.left.nil? && tree_node.right.nil?\nend", "def is_subtree(root)\n\nend", "def is_node(line)\n\t\treturn line.split(\" \")[1].downcase == \"node\" ? true : false\n\tend", "def valid_tree?\n true\n end", "def valid_tree?\n true\n end", "def leaf_version?\n\t\treturn self.child_versions.empty?\n\tend", "def is_leaf?\n self.left_child == nil and\n self.right_child == nil\n end", "def leaf?\n persisted? && if children_counter_cache_column\n self[children_counter_cache_column] == 0\n else\n children.count == 0\n end\n end", "def valid_tree?\n true\n end", "def leaf?\n right - left == 1\n end", "def hasRequest?\n !requests.empty?\n end", "def cltn_request?( path )\n path.size == 3\n end", "def goalNode?(node)\n node.name == 'Goal'\nend", "def parent_singleton?\n !parent_type_from_request.nil? && parent_type_from_params.nil?\n end", "def root?\n !parent\n end", "def check(node); end", "def children_are_leaves?\n unless leaf?\n @children[0].leaf?\n end\n end", "def root?\r\n\t\treturn parent == nil\r\n\tend", "def for_node; end", "def child_node; end", "def nested?\n @nodes.any?\n end", "def leaf?\n self.variations.size == 0\n end", "def is_root?()\n return (name.nil? and parent.nil?) \n end", "def leaf?(sexp)\n list?(sexp) && depth(sexp) == 1\nend", "def unknown?\n !root? && !child?\n end", "def unknown?\n !root? && !child?\n end", "def unknown?\n !root? && !child?\n end", "def parent_singleton?\n !parent_type_from_request.nil? && parent_type_from_params.nil?\n end", "def object_attribute_is_node?(name)\n %i[\n alias_of\n delegate\n demand_source\n output_capacity_from_demand_of\n source\n ].include?(name)\n end", "def nodes?\r\n\t\treturn !h? || (h? && root?)\r\n\tend" ]
[ "0.66414416", "0.66414416", "0.6619851", "0.6516141", "0.6511789", "0.64122164", "0.6410618", "0.63338476", "0.62276137", "0.62275434", "0.6212207", "0.6189261", "0.61245453", "0.61234343", "0.6119546", "0.60960525", "0.60889244", "0.606563", "0.6029906", "0.60223407", "0.5975271", "0.59564424", "0.59490895", "0.594456", "0.59385216", "0.59366506", "0.5934155", "0.59319985", "0.5863992", "0.5862181", "0.5799002", "0.57863003", "0.57675266", "0.57637376", "0.57637376", "0.57378405", "0.5727049", "0.5721719", "0.56913996", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.567731", "0.5664384", "0.56326956", "0.5627841", "0.5624345", "0.5623926", "0.5615183", "0.56140924", "0.5596699", "0.5590787", "0.5590787", "0.5571507", "0.55713934", "0.5539961", "0.552086", "0.55164135", "0.54999024", "0.5491139", "0.5486779", "0.5484302", "0.5461141", "0.5447789", "0.5447699", "0.54348904", "0.54241985", "0.54198056", "0.5419799", "0.54093874", "0.5405916", "0.5384261", "0.5383612", "0.5383612", "0.5383612", "0.5380065", "0.5376246", "0.5376165" ]
0.0
-1
MongoMapper.database.collections.each do |c| puts c c.drop end MongoMapper.database $DATABASE_DEV note: programming by intention, this is the smallest goal I want to achieve
def find_people_around_football_pitch_around_jindigeling find_shops end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def teardown\n Mongoid::Clients.default.database.collection_names.each do |c|\n Mongoid::Clients.default[c].drop\n end\n end", "def clean_db\n Mongoid::Sessions.default.collections.select {|c| c.name !~ /system/}.each {|c| c.find.remove_all}\n end", "def teardown\n # Mongoid::Sessions.default.use('mongoid_sequence_test').drop\n ::Mongoid.default_client.database.drop\n end", "def delete_collection(db, coll_name)\n if db.collection('__METADATA__').find_one('_id' => coll_name) == nil\n raise \"collection does not exist\"\n end\n\n db.collection(coll_name).drop\n db.collection_names.keep_if {|c| c.start_with? coll_name+'__'}.each {|related_collection| db.collection(related_collection).drop}\n\n db.collection('__METADATA__').remove('_id' => coll_name)\n end", "def clear_collections(fs)\n fs.files_collection.delete_many\n fs.files_collection.indexes.drop_all rescue nil\n fs.chunks_collection.delete_many\n fs.chunks_collection.indexes.drop_all rescue nil\n #@operation.clear_collections(fs)\n end", "def shrink(collection_or_table_names=nil)\n return unless is_mongodb\n creds=credentials()\n base_dir=VMC::KNIFE.get_mongodb_base_dir()\n instance_name=creds['name']\n dbpath=File.join(base_dir, instance_name, 'data') \n mongod_lock=File.join(dbpath,'mongod.lock')\n raise \"Can't shrink #{name}; the mongodb is currently running\" if File.exists?(mongod_lock) && File.size(mongod_lock)>0\n mongodump_exec=VMC::KNIFE.get_mongo_exec('mongodump')\n raise \"Can't find mongodump\" unless File.exist? mongodump_exec\n mongorestore_exec=VMC::KNIFE.get_mongo_exec('mongorestore')\n raise \"Can't find mongorestore\" unless File.exist? mongorestore_exec\n cmd = \"#{mongodump_exec} --dbpath #{dbpath}\"\n puts \"#{cmd}\"\n puts `#{cmd}`\n \n `rm -rf #{dbpath}`\n `mkdir #{dbpath}`\n cmd = \"#{mongorestore_exec} --dbpath #{dbpath} dump/\"\n puts \"#{cmd}\"\n puts `#{cmd}`\n `rm -rf dump`\n end", "def drop\n @db.drop_collection(@name)\n end", "def remove_from_all_dil_collections\r\n self.collections.each do |collection|\r\n collection.members.remove_member_by_pid( self.pid )\r\n collection.save\r\n self.collections.delete(collection)\r\n end\r\n end", "def delete_all_child_collections()\r\n all_names = get_all_child_collections_names()\r\n all_names.each do |name|\r\n delete_child_collection(name)\r\n end\r\n end", "def clean_up_keyspace!(conn)\n conn.collection_names.each do |cf|\n coll = conn.collection(cf)\n coll.drop() unless cf == 'system.indexes'\n end\n end", "def drop\n @db.drop_collection(@name)\n end", "def drop_db\n Mongoid.purge!\n end", "def db_clear\n [Project, Milestone, Category, Version, LoaderRelease].each {|x| x.delete_all}\n end", "def destroy\n\n DataField.destroy_all :data_collection_id => @data_collection.id\n\n if not @data_collection.collection_name.nil?\n mongo_collection = MongoConnection.instance.get_collection @data_collection.collection_name\n mongo_collection.drop\n end\n\n @data_collection.destroy\n\n respond_to do |format|\n format.html { redirect_to data_collections_url }\n format.json { head :no_content }\n end\n end", "def reset_collection\n LogMessage.collection.drop\n create_collection\n end", "def removeCollection(collection)\n collection.drop\n end", "def db_clear\n [Project, Milestone, Category, Version, LoaderRelease].each(&:delete_all)\n end", "def wRestoreCollections()\n puts \"Back up commencing...\"\n Dir.chdir('/Users/jeydurai')\n system('start_mongorestore_coll.bat')\n end", "def list_collections(db)\n return db.collection('__METADATA__').find({'_id' => {'$ne'=> '__METADATA__'}}, {:fields => '_id'}).map {|c| c['_id']}\n end", "def restore_collections\n\t original_collections.each do |col, backup|\n\t\tcol.clear\n\t\tif col.kind_of?(Hash)\n\t\t col.merge! backup\n\t\telse\n backup.each do |obj|\n col << obj\n end\n\t\tend\n\t end\n original_collections.clear\n\tend", "def remove_indexes\n indexed_database_names.each do |database|\n with(database: database) do |klass|\n begin\n klass.collection.indexes(session: _session).each do |spec|\n unless spec[\"name\"] == \"_id_\"\n klass.collection.indexes(session: _session).drop_one(spec[\"key\"])\n logger.info(\n \"MONGOID: Removed index '#{spec[\"name\"]}' on collection \" +\n \"'#{klass.collection.name}' in database '#{database}'.\"\n )\n end\n end\n rescue Mongo::Error::OperationFailure; end\n end\n end and true\n end", "def cleanup_old_docs(old_object_doc_array, collection_name)\n logger.debug \"Clean up old documents\"\n # iterate over each old doc\n old_object_doc_array.each do\n |old_object_doc|\n # Remove it from MongoDB by referencing '_id' key\n collection_by_name(collection_name).remove({\"_id\" => old_object_doc[\"_id\"]})\n end\n end", "def clean_up_spanner_objects\n puts \"Cleaning up instances and databases after spanner tests.\"\n $spanner.instances.all.select { |i| i.instance_id.start_with? $spanner_prefix }.each do |instance|\n instance.databases.all.each &:drop\n instance.delete\n end\nrescue => e\n puts \"Error while cleaning up instances and databases after spanner tests.\\n\\n#{e}\"\nend", "def clear_db\n users = User.all\n users.delete_all\n companies = Company.all\n companies.delete_all\n feedbacks = Feedback.all\n feedbacks.delete_all\n co_emp = CompanyEmployee.all\n co_emp.delete_all\n projects = Project.all\n projects.delete_all\n proj_fb = ProjectFeedback.all\n proj_fb.delete_all\nend", "def xRestoreCollections()\n puts \"Back up commencing...\"\n Dir.chdir('/Users/jeydurai')\n system('start_mongorestore_coll.bat')\n end", "def clear_db\n DB.from(\"mentees\").delete\n DB.from(\"mentors\").delete\n DB.from(\"admins\").delete\n DB.from(\"users\").delete\n DB.from(\"codes\").delete\n DB.from(\"requests\").delete\n DB.from(\"questions_answers\").delete\nend", "def drop_collection(name)\n response = RequestResponse.new\n names_resp = collection_names\n names_resp.callback do |names|\n if names.include?(name.to_s)\n cmd_resp = command(:drop=>name)\n cmd_resp.callback do |doc|\n response.succeed EM::Mongo::Support.ok?(doc)\n end\n cmd_resp.errback { |err| response.fail err }\n else\n response.succeed false\n end\n end\n names_resp.errback { |err| response.fail err }\n response\n end", "def clear\n @dao.collection.remove\n end", "def flush_db\n [ 'active_sources', 'data_records', 'semantic_properties', 'semantic_relations', 'workflows'].reverse.each { |f| ActiveRecord::Base.connection.execute \"DELETE FROM #{f}\" }\n # Also remove the \"unsaved cache\" for the wrappers (may be important during testing)\n TaliaCore::SemanticCollectionWrapper.instance_variable_set(:'@unsaved_source_cache', {})\n end", "def restore_collections\n original_collections.each do |col, backup|\n col.clear\n if col.kind_of?(Hash)\n col.merge! backup\n else\n backup.each do |obj|\n col << obj\n end\n end\n end\n original_collections.clear\n end", "def drop_collection(collection_name)\n get_db.drop_collection(collection_name)\n end", "def drop_collection(collection_name)\n get_db.drop_collection(collection_name)\n end", "def db_cleaner\n JSON.parse(params[:mongified_data][:data]).each do |data|\n data[\"lob\"] = params[:mongified_data][:lob]\n @client.destroy(data)\n end\n end", "def clear_db\n clear_urls + clear_docs\n end", "def delete_maps\n own_maps.each do | map |\n logger.debug \"deleting map #{map.inspect}\"\n map.destroy\n end\n end", "def delete_maps\n own_maps.each do | map |\n logger.debug \"deleting map #{map.inspect}\"\n map.destroy\n end\n end", "def clean_cache_collection collection # :nodoc:\n collection.each do |name, item|\n if item.empty? then\n collection.delete name\n else\n # HACK mongrel-1.1.5 documents its files twice\n item.uniq!\n item.sort!\n end\n end\n end", "def clear!(db_as_well=true)\n Document.destroy_all if db_as_well\n close\n Dir.glob(File.join(Picolena::IndexSavePath,'**/*')).each{|f| FileUtils.rm(f) if File.file?(f)}\n end", "def delete_child_collection(name)\r\n #Delete collection = delete all documents in it and than delete field in envId:collections key\r\n coll_id = nil\r\n begin\r\n coll_id = get_child_collection_id(name)\r\n rescue Transformer::MappingException => ex\r\n ex.message\r\n return\r\n end\r\n collection = RedXmlApi::Collection.new(@env_id, coll_id)\r\n collection.delete_all_documents\r\n collection.delete_all_child_collections\r\n @db_interface.delete_from_hash @certain_coll_key, [name]\r\n #We have to delete all keys of collection, e.g. <info, <documents, <collections\r\n del_keys = [Transformer::KeyBuilder.collection_info(@env_id, coll_id), Transformer::KeyBuilder.documents_key(@env_id, coll_id), Transformer::KeyBuilder.child_collections_key(@env_id, coll_id)]\r\n @db_interface.delete_keys del_keys\r\n end", "def destroy\n @collection = Collection.find(params[:id])\n \n #destroy all child documents\n @collection.documents.each do |d|\n upload_remove(d) #Removes upload record if file is deleted\n d.destroy\n end\n \n #destroy all child collections\n @collection.collections.each do |c|\n collection_recursive_destroy(c)\n end\n \n @collection.destroy\n\n respond_to do |format|\n format.html { redirect_to collections_url }\n format.json { head :ok }\n end\n end", "def remove_all_documents\n\n all_clusters = @cluster_warehouse.all_clusters\n\n all_clusters.each do |cluster|\n cluster.remove_all_documents\n end\n\n @cluster_warehouse.clear_dangling_documnents \n end", "def clear_all_databases\n excluded_tables = [\"schema_migrations\", \"common_states\", \"common_activities\"]\n connection = ActiveRecord::Base.connection\n table_names = connection.tables.dup\n table_names.delete_if { |table_name| excluded_tables.include?(table_name) }\n \n table_names.each do |table_name|\n sql_command = \"DELETE FROM #{table_name};\"\n connection.execute sql_command\n end\nend", "def cleanup\n @models.reverse_each(&:destroy_all)\n end", "def dbvalidationmul(table_name)\nmongo_client = Mongo::Client.new($mongo_connect_string)\n@list=mongo_client[:\"#{table_name}\"].find.to_a\n# mongo collections have fields called \"_id\" which is not returned by api response\n# deleting the \"_id\" field from mongo response to map api response\[email protected] do |l|\nl.delete(\"_id\")\nend\nputs \"===========================================\"\nputs @list\nputs \"===========================================\"\nreturn @list\nend", "def clean_database\n [Entry, Room, User].each do |model|\n model.delete_all\n end\nend", "def clear\n run_hook(:before_clear)\n db.clear\n run_hook(:after_clear)\n end", "def delete_test_dbs\n server = MDB::Server.server\n server.db_names.each do |name|\n if name.to_s =~ MDB::Test::TEST_DB_REGEXP\n begin\n server.delete name\n rescue MDB::Server::DatabaseNotFound\n $stderr.puts \"--- unexpected #{e} in before()\"\n end\n end\n end\n end", "def delete_collection\n FileUtils.rm_r @src_path\n FileUtils.rm_r @store_path if store_exist?\n end", "def removeIndexes(collection)\n collection.indexes.drop_all()\n end", "def destroy_orphaned_collection_numbers\n collection_numbers.each do |col_num|\n col_num.destroy_without_callbacks if col_num.observations == [self]\n end\n end", "def clear(collection)\n blk = Proc.new {}\n query(collection, blk).each { |entity| delete(collection, entity) }\n end", "def refresh_collections(valid_collections)\n collections.delete_all\n valid_collections.each do |collection|\n collection_to_add = Collection.find_or_create_by(druid: collection)\n collections << collection_to_add unless collections.include?(collection_to_add)\n end\n end", "def database_reset\n @database = nil\n end", "def import_rebalancing\n dbname = 'baybike'\n collection_name = 'rebalancing'\n `mongo #{dbname} --eval \"db.dropDatabase()\"`\n command = \"mongoimport -d #{dbname} -c #{collection_name} --type csv --file #{rebalancing} --headerline\"\n `#{command}`\nend", "def ensure_cleanup_mongoid_session(&block)\n block.call\n ensure\n Mongoid::IdentityMap.clear\n Mongoid.disconnect_sessions\n end", "def collection_recursive_destroy(c)\n c.children.each do |child_c|\n collection_recursive_destroy(child_c)\n end\n \n #destroy all child documents\n c.documents.each do |d|\n d.destroy\n end\n \n c.destroy\n end", "def destroy\n @collection.destroy\n end", "def teardown\n teardown_db\n end", "def clean_database\n models = [Comment, Article, Admin, User]\n if ENV['AN_USE_EXISTING_DYNAMODB_TABLE']\n ActivityNotification::Notification.where('id.not_null': true).delete_all\n ActivityNotification::Subscription.where('id.not_null': true).delete_all\n else\n models.concat([ActivityNotification::Notification, ActivityNotification::Subscription])\n end\n models.each do |model|\n model.delete_all\n end\nend", "def destroy\n response = connection.delete(\"/collections/#{id}\")\n (200..299).include?(response.status)\n end", "def drop_database\n options = { database: Orientdb::ORM.connection_uri.database, user: Orientdb::ORM.connection_uri.user, password: Orientdb::ORM.connection_uri.password }\n Orientdb::ORM.with { |conn| conn.client.delete_database( options ) }\nend", "def clear_database\n User.destroy_all\n Animal.destroy_all\n Report.destroy_all\nend", "def remove_pre_mongified_ids\n self.copy_tables.each do |t|\n Mongify::Status.publish('remove_pre_mongified', :size => 1, :name => \"Removing pre_mongified_id #{t.name}\", :action => 'add')\n no_sql_connection.remove_pre_mongified_ids(t.name)\n Mongify::Status.publish('remove_pre_mongified', :action => 'finish')\n end\n end", "def clear_teams\n\t@table_array.each do |each_table_name|\n\t\[email protected](\"DROP TABLE IF EXISTS \" + each_table_name)\n\tend\nend", "def drop\n do_callback(:before_drop)\n collection.drop\n do_callback(:after_drop)\n end", "def collections(what)\n list = []\n collections = what == 'all' ? all_collections() : local_collections()\n collections.each do |collection|\n model = collection.classify.constantize rescue nil\n next if model.nil?\n next unless model.respond_to?(:mongo_client)\n record = {'id' => collection, 'description' => I18n.t(\"helpers.label.#{collection}.tabletitle\") } \n list << [record, model_fields(collection)]\n end\n list\nend", "def collections_coll\n settings.db['collections']\n end", "def clear_docs\n result = @client[DOCUMENTS_COLLECTION].delete_many({})\n result.n\n ensure\n @last_result = result\n end", "def remove_indexes(models = ::Mongoid.models)\n models.each do |model|\n next if model.embedded?\n indexes = model.collection.indexes.map{ |doc| doc[\"name\"] }\n indexes.delete_one(\"_id_\")\n model.remove_indexes\n logger.info(\"MONGOID: Removing indexes on: #{model} for: #{indexes.join(', ')}.\")\n model\n end.compact\n end", "def clear_properties\n Config::Collection.clear\n end", "def destroy_database\n unless defined?(ORD) == 'constant' \n Object.send :const_set, :ORD, ActiveOrient::OrientDB.new( preallocate: false)\n end \n ORD.delete_database database: ActiveOrient.database\n ActiveOrient::Model.allocated_classes = {}\n Object.send :remove_const, :ORD \n Object.send( :remove_const, :DB ) if defined?(DB) == 'constant'\n\nend", "def destroy_database\n unless defined?(ORD) == 'constant' \n Object.send :const_set, :ORD, ActiveOrient::OrientDB.new( preallocate: false)\n end \n ORD.delete_database database: ActiveOrient.database\n ActiveOrient::Model.allocated_classes = {}\n Object.send :remove_const, :ORD \n Object.send( :remove_const, :DB ) if defined?(DB) == 'constant'\n\nend", "def clean_document!\n self.questions.destroy_all\n self.comments.destroy_all\n self.timeline_events().each{|event| event.destroy}\n self.document_items.each{|item| item.timeline_events.destroy_all}\n end", "def truncate_all\n Content::Version.all.map(&:destroy)\n ContentKey::Version.all.map(&:destroy)\n Content.all.map(&:destroy)\n ContentKey.all.map(&:destroy)\n end", "def clean\n\t\t\n\t\[email protected] 'twitter'\n\t\[email protected] 'rpg'\n\t\n\tend", "def flush_database\n\t\t\tp \"Flushing Database\"\n\t\t\tAdmin.destroy_all\n\t\t\tCountry.destroy_all\n\t\t\tDoorkeeper::Application.destroy_all\n\t\tend", "def teardown\n delete_goo_models(LinkedData::Models::Project.all)\n delete_goo_models(LinkedData::Models::Ontology.all)\n delete_goo_models(LinkedData::Models::User.all)\n @projectParams = nil\n @user = nil\n @ont = nil\n @p = nil\n end", "def teardown\n puts \"Teardown running...\"\n %x[rake db:reset]\n end", "def teardown\n puts \"Teardown running...\"\n %x[rake db:reset]\n end", "def teardown\n puts \"Teardown running...\"\n %x[rake db:reset]\n end", "def teardown\n puts \"Teardown running...\"\n %x[rake db:reset]\n end", "def drop_collection(name)\n return false if strict? && !collection_names.include?(name.to_s)\n begin\n ok?(command(:drop => name))\n rescue OperationFailure => e\n false\n end\n end", "def drop_database(name)\n single_db_command(name, :dropDatabase => 1)\n end", "def clear_towers\n Node.destroy_all\n OutConnector.destroy_all\n InConnector.destroy_all\n end", "def delete\n# if stat.directory?\n# FileUtils.rm_rf(file_path)\n# else\n# File.unlink(file_path)\n# end\n if collection?\n @collection.find({:filename => /^#{Regexp.escape(@bson['filename'])}/}).each do |bson|\n @collection.remove(bson)\n end\n else\n @collection.remove(@bson)\n end\n NoContent\n end", "def shutdown\n drop_database\n end", "def modification_2_deletion\n projects = Perpetuity[Project].all.sort(:created_at).reverse.to_a[0..4]\n document_mapper = Perpetuity[Document]\n documents = document_mapper.all.to_a\n document_mapper.load_association! documents, :projects\n contract_mapper = Perpetuity[LegalContract]\n contracts = contract_mapper.all.to_a\n contract_mapper.load_association! contracts, :projects\n\n projects.each do |project|\n ds = document_mapper.select{|document| document.project.id == project.id}\n ds.each do |doc|\n document_mapper.delete doc\n end\n\n lc = contract_mapper.select{|contract| contract.project.id == project.id}\n lc.each do |lcon|\n contract_mapper.delete lcon\n end\n\n Perpetuity[Project].delete project\n end\n\n return \"deleted\"\nend", "def clean_up_my_app(orchestrate)\n\n\t# -----------------------------------------------------------------------------------\n\t# Delete the 'league/teams' relationship for each league\n\t#\n\tif @population_control['member-teams'] == :delete\n\t\tif false\n\t\t\t@all_league_ids.each do |league_id_str|\n\t\t\t\t# # Try deleting each relation individually (directly via the API)\n\t\t\t\t# filename = \"#{@root_name}-leagues-#{league_id_str}-teams-t2-relation.json\"\n\t\t\t\t# keys_B = JSON.parse(open(\"#{@src_dir}/#{filename}\").read)['member-team-ids']\n\t\t\t\t# keys_B.each do |key_B|\n\t\t\t\t# \torchestrate.delete_relation({\n\t\t\t\t# \t\tcollection_A: :leagues,\n\t\t\t\t# \t\tkey_A: league_id_str,\n\t\t\t\t# \t\trelation: :teams,\n\t\t\t\t# \t\tcollection_B: :teams,\n\t\t\t\t# \t\tkey_B: key_B,\n\t\t\t\t# \t})\n\t\t\t\t# end\n\n\t\t\t\t# Try deleting each relation individually (via the helper)\n\t\t\t\tdelete_relation_list({\n\t\t\t\t\tclient: orchestrate,\n\t\t\t\t\tcollection_A: 'leagues',\n\t\t\t\t\tkey_A: league_id_str, \n\t\t\t\t\trelation: 'teams'\n\t\t\t\t})\n\n\t\t\t\t# Try deleting the entire relationship\n\t\t\t\torchestrate.delete_relations(collection_A: 'leagues', key_A: league_id_str, relation: 'teams')\n\t\t\tend\n\t\tend\n\tend\n\n\t# -----------------------------------------------------------------------------------\n\t# Delete the 'league/standings' events for each league\n\t#\n\tif @population_control[:standings] == :delete\n\t\tif false\n\t\t\t@all_league_ids.each do |league_id_str|\n\t\t\t\torchestrate.delete_events(collection_A: 'leagues', key: league_id_str, event_type: 'standings')\n\t\t\tend\n\t\tend\n\tend\n\n\t# -----------------------------------------------------------------------------------\n\t# Delete the 'leagues' collection keys\n\t#\n\tif @population_control[:leagues] == :delete\n\t\t@all_league_ids.each do |league_id_str|\n\t\t\torchestrate.delete_key(collection: 'leagues', key: league_id_str)\n\t\tend\n\tend\nend", "def teardown\n\t\tActiveRecord::Base.clear_all_connections!\n\t\t#File.delete \"test.sqlite\"\n\tend", "def destroy_db(options)\n info \"Dropped database '#{options[:name]}'\"\n end", "def remove(coll)\n @db[coll].remove\n end", "def cleanup\n self.objectives.destroy_all\n end", "def clean_db\n\n puts \"Caching wikipedia links\"\n @wikipedia_cache = {}\n Artist.all\n .where('wikilink IS NOT NULL')\n .pluck( 'name' , 'wikilink' )\n .each { |result| @wikipedia_cache[ key_name(result[0]) ] = result[1] }\n\n puts \"Cleaning db\"\n PlayerState.delete_all\n PlayListSong.delete_all\n Song.delete_all\n Album.delete_all\n Artist.delete_all\n end", "def clear_db\n @@db.clear_db\n end", "def purge_db\n\tUser.delete_all\n\tSubscription.delete_all\n\tDorkus.delete_all\nend", "def destroy\n @root_collection.destroy\n respond_to do |format|\n format.html { redirect_to root_collections_url, notice: 'Root collection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def cleanup_db_yml(*args)\n end", "def tables\n Mongo::DocumentDefinition.defined_document_names\n #db.collection_names\n end", "def setup_config_db\n\t\tMongrel2::Config.db ||= Mongrel2::Config.in_memory_db\n\t\tMongrel2::Config.init_database\n\t\tMongrel2::Config.db.tables.collect {|t| Mongrel2::Config.db[t] }.each( &:truncate )\n\tend", "def clean\r\n if @conns\r\n @conns.objects.each do |data|\r\n data[:object].clean if data[:object].respond_to?(\"clean\")\r\n end\r\n elsif @conn\r\n @conn.clean if @conn.respond_to?(\"clean\")\r\n end\r\n end", "def delete\n self.users.each do |id|\n user = User.find_by_id(id)\n next if user.nil?\n user.databases.delete(self._id)\n user.working_db_id = nil if user.working_db == self\n user.save\n end\n super\n end" ]
[ "0.80612063", "0.72668755", "0.7017725", "0.697472", "0.6843106", "0.6713452", "0.6703108", "0.668582", "0.6681324", "0.6669801", "0.6657881", "0.657797", "0.6571152", "0.64720213", "0.64647424", "0.6410979", "0.64088976", "0.62796193", "0.61837983", "0.6173104", "0.6158883", "0.6153457", "0.6141408", "0.6129203", "0.6129177", "0.61133444", "0.6110864", "0.6097805", "0.6091564", "0.60910976", "0.60664326", "0.60664326", "0.6051554", "0.604352", "0.603631", "0.603631", "0.5958273", "0.59295285", "0.5927516", "0.592575", "0.5925409", "0.59077674", "0.5879327", "0.58773136", "0.5876298", "0.5874926", "0.5870382", "0.58519804", "0.5843553", "0.5820354", "0.58039474", "0.5778478", "0.5778042", "0.5772077", "0.5762872", "0.575546", "0.5748125", "0.5741062", "0.5740629", "0.573671", "0.57050425", "0.5704557", "0.5695768", "0.56665826", "0.56654185", "0.5664348", "0.566137", "0.56607604", "0.56461287", "0.5640478", "0.56378144", "0.56378144", "0.563375", "0.5626896", "0.5626572", "0.561286", "0.5586177", "0.5583842", "0.5583842", "0.5583842", "0.5583842", "0.5579029", "0.5573368", "0.55574644", "0.5551024", "0.5546862", "0.5533993", "0.5533736", "0.55332667", "0.55206984", "0.55033195", "0.5499928", "0.5499366", "0.54826975", "0.5479148", "0.54756683", "0.5472019", "0.547103", "0.5462095", "0.5457465", "0.54567826" ]
0.0
-1
Returns an array of shops via a Dianping.com's search TODO: handling no record scenario, TODO: make sure the geo context is correct. play: more search via geo location play: watch out for updated information, redo the search or history bookkeeping.
def dianping_search_shops(keywords,limit_query_pages) shops = [] query_link = "#{$DIANPING_SHOP_SEARCH_PATH_START_PAGE}#{URI.escape(keywords)}" pages = DianpingPageParser.number_of_pages(query_link) puts pages max_page_to_crawl = (limit_query_pages.to_int < pages) ? limit_query_pages.to_int : pages (1..max_page_to_crawl).each { | page | shops << DianpingPageParser.shops_in_page(File.join(query_link, "p#{page}")) } return shops end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_by_location\n \tlat = params[:lat]\n \tlng = params[:lng]\n \tnext_start = params[:next_start]\n \tshops = Hotpepper.search_location(lat, lng, next_start);\n \tset_to_results(shops);\n end", "def index\n\n # search query\n if params[:q].nil?\n @shops = Shop.all\n else\n @shops = Shop.search_with_elasticsearch(params[:q]).records\n end\n\n if params[:filter].present?\n if params[:filter] == 'name'\n @shops = @shops.order('title ASC')\n elsif params[:filter] == 'date'\n @shops = @shops.order('updated_at DESC')\n elsif params[:filter] == 'location'\n define_location\n @shops = @shops.near([@latitude, @longitude], 8_000_000, order: 'distance')\n end\n else\n @shops = @shops.order('updated_at DESC')\n end\n\n @shops = @shops.page(params[:page]).per(20)\n\n end", "def searches\n {\n fine_dining: GooglePlaces::RadarSearch.new(types: %w{food restraunt},\n keyword: 'fine dining',\n minprice: 3,\n key: key),\n\n cajun_food: GooglePlaces::RadarSearch.new(types: %w{food restraunt},\n keyword: 'cajun food',\n key: key),\n\n creole_food: GooglePlaces::RadarSearch.new(types: %w{food restraunt},\n keyword: 'creole food',\n key: key),\n\n cheap_food: GooglePlaces::RadarSearch.new(types: %w{food restraunt},\n maxprice: 1,\n key: key),\n\n food: GooglePlaces::RadarSearch.new(types: %w{food restraunt},\n key: key),\n\n cocktail_bar: GooglePlaces::RadarSearch.new(types: %w{bar},\n keyword: 'cocktails',\n minprice: 2,\n key: key),\n\n bar: GooglePlaces::RadarSearch.new(types: %w{bar},\n key: key),\n\n dive_bar: GooglePlaces::RadarSearch.new(types: %w{bar},\n keyword: 'dive bar',\n maxprice: 1,\n key: key),\n\n live_music: GooglePlaces::RadarSearch.new(types: %w{bar night_club},\n keyword: 'live music',\n key: key),\n\n night_club: GooglePlaces::RadarSearch.new(types: %w{night_club},\n key: key),\n\n shopping: GooglePlaces::RadarSearch.new(types: %w{department_store clothing_store shopping_mall jewelry_store shoe_store},\n keyword: 'shopping',\n key: key),\n\n cafe: GooglePlaces::RadarSearch.new(types: %w{cafe},\n key: key),\n\n zoo: GooglePlaces::RadarSearch.new(types: %w{zoo},\n key: key),\n\n aquarium: GooglePlaces::RadarSearch.new(types: %w{aquarium},\n key: key),\n\n museum: GooglePlaces::RadarSearch.new(types: %w{museum},\n key: key),\n\n }\n end", "def index\n if search_params[:address] == nil\n @engines = Engine.all\n else\n shop_ids = Shop.near(search_params[:address], 10).to_a.pluck(:id)\n # Engine.where('shop_id IN (?)', shop_ids)\n @engines = Engine.where(shop_id: shop_ids)\n end\n end", "def searches\n search_objects.map{ |s| s.query }\n end", "def temp_crawling(keyword)\n \n shops_modelled_selfmade = dianping_search_shops(keyword, 3)\n \n shops_modelled_selfmade.flatten! # TODO: should be somewhere else\n \n # convert to hashes\n shops_in_hashes = []\n shops_modelled_selfmade.each do |shop| \n shops_in_hashes << shop.to_hash\n end\n # save to local files\n File.open(\"data/search_#{keyword}.yml\", \"w\") {|f| f.write(shops_in_hashes.to_yaml) }\n \n return shops_in_hashes\nend", "def search\n if params[:key] == AUTHORIZATION_TOKEN && params[:q] == \"discover\"\n @google_places = discover\n @places = PLACES.select do |place|\n (place[:coordinates][:latitude].between?(average_location - 0.01, average_location + 0.01))\n end\n elsif params[:key] == AUTHORIZATION_TOKEN && params[:q]\n params_hash = {\n q: params[:q],\n type: params[:type] || \"bar\"\n }\n @google_places = call(params_hash)\n @places = PLACES.select do |place|\n (place[:name].downcase.include? (params[:q].downcase)) || (place[:coordinates][:latitude].between?(average_location - 0.01, average_location + 0.01))\n end\n\n render_error(\"empty\") if @google_places.empty? && @places.empty?\n elsif params[:q]\n render_error\n else\n render_error(\"missing_params\")\n end\n end", "def search\n url = @@url\n url.query = Addressable::URI.form_encode(\n 'v' => '1.0',\n 'q' => (@args[:site]) ? @query + \" site:#{ @args[:site] }\" : @query ,\n 'key' => @google_api_key,\n 'userip' => @ip_number\n )\n results = JSON.parse(open(url, 'Referer' => @referrer_site).read) rescue {}\n \n @response_details = results['responseDetails'] # => nil,\n @response_status = results['responseStatus' ] # => 200\n \n @cursor = Cursor.new(results['responseData']['cursor'])\n \n results['responseData']['results']\n end", "def searches\n Boundary.get(@url)\n end", "def search\n if params[:term]\n @shops = Shop.where(\"title like '%\"+params[:term]+\"%'\")\n else\n @shops = Shop.all\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shops }\n end\n\n end", "def get_data\n @all_snops.map do |snop|\n title = link_to snop.title, search_path(q: params[:q], type: params[:type], snop: snop, browse_view: true, iSortCol_0: params[:iSortCol_0], sSortDir_0: params[:sSortDir_0], sSearch: params[:sSearch]), remote: true\n\n user_link = link_to snop.user.username, snop.user\n\n domain_link = link_to snop.domain.uri, snop.domain unless snop.domain.nil?\n\n created = time_ago_in_words(snop.created_at) + \" ago\"\n [\n title,\n user_link,\n domain_link,\n created,\n \"\"\n ]\n end\n end", "def index\n @q = params[:q]\n @q ||= \"\"\n @shops = Shop.search(@q).records\n\n\n respond_to do |format|\n format.html { render action: 'index' }\n format.json { render json: @shops, each_serializer: ShopListSerializer }\n end\n end", "def search\n\n\t\t@search_loc = params[:search_loc] # address user searched for\n\t\t@search_lat = params[:search_lat] # the user's current location latitude. If the address searched for fails to give a new latitude, this is used instead\n\t\t@search_long = params[:search_long] # the user's current longitude - same use case as above\n\t\tif @search_loc != nil\n\t\t\taddress = @search_loc.gsub(/\\s/, \"+\")\n\t\t\turi = URI.parse(\"http://maps.googleapis.com/maps/api/geocode/json?address=\" + address + \"&sensor=false\")\n\t\t\thttp = Net::HTTP.get_response(uri)\n\t\t\tresults = JSON.parse(http.body)\n\t\t\t# if address yielded results, override the user's current location coordinates with the searched-for-latitude/longitude\n\t\t\tif results[\"status\"] != \"ZERO_RESULTS\"\n\t\t\t\t@search_lat = results[\"results\"][0][\"geometry\"][\"location\"][\"lat\"]\n\t\t\t\t@search_long = results[\"results\"][0][\"geometry\"][\"location\"][\"lng\"]\n\t\t\tend\n\t\tend\n\n\t\t@search_item = \"\"\n\t\tif params[:search_item] then\n\t\t\t@search_item = params[:search_item]\n\t\tend\n\t\t@search_item.downcase\n\n\t\t# the default search distance (max circular radius of a restaurant from the searched for location) is 5 unless the user specified a search radius\n\t\t@search_distance = DEFAULT_SEARCH_DISTANCE\n\t\tif params[:search_distance] then\n\t\t\t@search_distance = params[:search_distance]\n\t\tend\n\n\t\t@max_results = DEFAULT_MAX_RESULTS\n\t\tif params[:results] then\n\t\t\t@max_results = params[:results].to_i\n\t\tend\n\n\t\t# Based on the Haversine Formula found on google maps API. The below is a Sql query to find all restaurants that has dishes with a dish name containing the search query or a dish description containing the search query,\n\t\t# (independent of case), or the restaurant name or description contains the search query, and the restaurant must be within the circular search\n\t\t# radius of the searched for location.\n\t\t@restaurants = Restaurant.find_by_sql([\"SELECT DISTINCT restaurants.* from foods, restaurants WHERE\n\t\t\t(3959*acos(cos(radians(?))*cos(radians(restaurants.latitude))*cos(radians(restaurants.longitude)-radians(?)) + \n\t\t\tsin(radians(?))*sin(radians(restaurants.latitude)))) < ? AND ((lower(restaurants.name) like ? OR \n\t\t\tlower(restaurants.description) like ?) OR (lower(foods.dish_name) like ? OR lower(foods.description) like ?)) AND \n\t\t\tfoods.restaurant_id = restaurants.id LIMIT ?\", @search_lat, @search_long, @search_lat, @search_distance, \"%#{@search_item}%\", \n\t\t\t\"%#{@search_item}%\", \"%#{@search_item}%\", \"%#{@search_item}%\", @max_results])\n\n\t\t# All of the dishes returned below are ordered by average rating from highest to lowest.\n\t\t# Similar to the above query, but returns the dishes that are within restaurants within the given distance radius that has a dish name or description\n\t\t# with the search query, or its restaurant name / description has the search query.\n\t\t@dishes = Food.find_by_sql([\"SELECT DISTINCT foods.* from foods, restaurants WHERE \n\t\t\t(3959*acos(cos(radians(?))*cos(radians(restaurants.latitude))*cos(radians(restaurants.longitude)-radians(?)) + \n\t\t\tsin(radians(?))*sin(radians(restaurants.latitude)))) < ? AND ((lower(restaurants.name) like ? OR \n\t\t\tlower(restaurants.description) like ?) OR (lower(foods.dish_name) like ? OR lower(foods.description) like ?)) AND \n\t\t\tfoods.restaurant_id = restaurants.id ORDER BY foods.rating DESC NULLS LAST OFFSET 2 LIMIT ?\", @search_lat, @search_long, @search_lat, \n\t\t\t@search_distance, \"%#{@search_item}%\", \"%#{@search_item}%\", \"%#{@search_item}%\", \"%#{@search_item}%\", @max_results])\n\n\t\t@num_items_per_row = DEFAULT_NUM_ITEMS_PER_ROW\n\t\t@num_rows_per_page = DEFAULT_NUM_ROWS_PER_PAGE\n\t\tif params[:itemspr] then\n\t\t\t@num_items_per_row = params[:itemspr].to_i\n\t\tend\n\t\tif params[:rowspp] then\n\t\t\t@num_rows_per_page = params[:rowspp].to_i\n\t\tend\n\n\t\t@render = 'default'\n\t\tif params[:render] then\n\t\t\t@render = params[:render]\n\t\tend\n\n\t\tif @render == 'json_only' then\n\t\t\trender :json => {:restaurants => @restaurants, :dishes => @dishes}\n\t\telsif @render == 'partials_only' then\n\t\t\trender :partial => 'shared/results', :locals => {:rend => 'all', :dishes => @dishes, :restaurants => @restaurants,\n\t\t\t\t:with_json => false, :num_items_per_row => @num_items_per_row, :num_rows_per_page => @num_rows_per_page}\n\t\telsif @render == 'partials_and_json_only' then\n\t\t\trender :partial => 'shared/results', :locals => {:rend => 'all', :dishes => @dishes, :restaurants => @restaurants,\n\t\t\t\t:with_json => true, :num_items_per_row => @num_items_per_row, :num_rows_per_page => @num_rows_per_page}\n\t\telsif @render == 'dish_partials_only' then\n\t\t\trender :partial => 'shared/results', :locals => {:rend => 'dishes_only', :render_restaurants => false, :results => 'dishes',\n\t\t\t\t:dishes => @dishes, :with_json => false, :num_items_per_row => @num_items_per_row, :num_rows_per_page => @num_rows_per_page}\n\t\telsif @render == 'restaurant_partials_only' then\n\t\t\trender :partial => 'shared/results', :locals => {:rend => 'restaurants_only', :results => 'restaurants',\n\t\t\t\t:restaurants => @restaurants, :with_json => false, :num_items_per_row => @num_items_per_row, :num_rows_per_page => @num_rows_per_page}\n\t\tend\n\t\t# else search.html.erb (the default) will be rendered\n\n\tend", "def gather_search\n local_search = Search.search @query\n unless local_search.nil?\n local_search = FoodItem.fetch_local_items local_search['food_items']\n return local_search unless local_search.nil?\n end\n\n remote_search = search_apis @query # adds searches remote end for elements\n unless remote_search.nil?\n Search.add @query, remote_search # adds elements to search\n remote_search = add_multiple_food_items remote_search unless remote_search.nil?\n return remote_search unless remote_search.nil?\n end\n\n nil # fallback\n end", "def index\n @search = Slisting.search(params[:q])\n @slistings = @search.result\n end", "def get_shops_by_keywords_from_dianping(kw)\n \n # read local data file for data already crawled. (similar code from hackingLBS/ddmap_resources.rb\n Dir.mkdir(\"data\") unless File.exists?(\"data\")\n \n saved = Dir.glob(\"./data/search_#{kw}.yml\")\n shops = []\n if saved.size <=0\n shops = temp_crawling(\"#{kw}\") \n else\n saved.each do |filename|\n shops |= YAML::load( File.open(filename) )\n end\n end\n p shops \nend", "def find_shelters(options = {})\n defaults = {'location' => '90210'}\n options = defaults.merge(options)\n \n @petfinder.find_shelters(options['location'], options)\n end", "def search_site\n db = Site::Database::SiteOrm.all\n db_lat = db.reduce([]) { |box, record| box << record[:lat] }\n db_lng = db.reduce([]) { |box, record| box << record[:lng] }\n tmp = db_lat.zip(db_lng)\n result = @site.lat.zip(@site.lng)\n result << tmp\n result.uniq!\n end", "def search\n if params[:geocode].present?\n lat = params[:geocode][:latitude]\n lng = params[:geocode][:longitude]\n radius = params[:radius]? params[:radius] : @_default_search_distanse\n skill_category = params[:skill_category]\n if skill_category.present?\n scope1 = Service.where(skill_category_id: skill_category).pluck(:supplier_id)\n scope2 = Supplier.near([lat, lng], radius, {order: \"\", units: :km}).pluck(:id)\n @suppliers = Supplier.where(isSupplier: true).find(scope1 & scope2)\n else\n @suppliers = Supplier.near([lat, lng], radius, units: :km).where(isSupplier: true)\n end\n elsif params[:skill_category].present?\n @suppliers = Supplier.find(Service.where(skill_category_id: params[:skill_category], isSupplier: true).pluck(:supplier_id));\n else\n @suppliers = Supplier.where(isSupplier: true)\n end\n render :action => 'search_result.json'\n end", "def search\n \n # Populate the @traveler variable\n get_traveler\n \n query = params[:query]\n query_str = query + \"%\"\n Rails.logger.debug query_str\n\n # This array will hold the list of matching places\n matches = [] \n # We create a unique index for mapping etc for each place we find\n counter = 0 \n \n # First search for matching names in my places\n rel = Place.arel_table[:name].matches(query_str)\n places = @traveler.places.active.where(rel)\n places.each do |place|\n matches << {\n \"index\" => counter,\n \"type\" => PLACES_TYPE,\n \"name\" => place.name,\n \"id\" => place.id,\n \"lat\" => place.location.first,\n \"lon\" => place.location.last,\n \"address\" => place.address,\n \"description\" => render_to_string(:partial => \"/shared/map_popup\", :locals => { :place => {:icon => 'icon-building', :name => place.name, :address => place.address} })\n }\n counter += 1\n end\n \n # Second search for matching address in trip_places. We manually filter these to find unique addresses\n rel = TripPlace.arel_table[:raw_address].matches(query_str)\n tps = @traveler.trip_places.where(rel).order(\"raw_address\")\n old_addr = \"\"\n tps.each do |tp|\n if old_addr != tp.raw_address\n matches << {\n \"index\" => counter,\n \"type\" => CACHED_ADDRESS_TYPE,\n \"name\" => tp.raw_address,\n \"id\" => tp.id,\n \"lat\" => tp.lat,\n \"lon\" => tp.lon,\n \"address\" => tp.raw_address,\n \"description\" => render_to_string(:partial => \"/shared/map_popup\", :locals => { :place => {:icon => 'icon-building', :name => tp.name, :address => tp.raw_address} })\n }\n counter += 1\n old_addr = tp.raw_address\n end \n end\n \n # Lastly search for matching names in the POI table\n rel = Poi.arel_table[:name].matches(query_str)\n pois = Poi.where(rel).limit(MAX_POIS_FOR_SEARCH)\n pois.each do |poi|\n matches << {\n \"index\" => counter,\n \"type\" => POI_TYPE,\n \"name\" => poi.name,\n \"id\" => poi.id,\n \"lat\" => poi.lat,\n \"lon\" => poi.lon,\n \"address\" => poi.address,\n \"description\" => render_to_string(:partial => \"/shared/map_popup\", :locals => { :place => {:icon => 'icon-building', :name => poi.name, :address => poi.address} })\n }\n counter += 1\n end\n \n respond_to do |format|\n format.js { render :json => matches.to_json }\n format.json { render :json => matches.to_json }\n end\n end", "def basic_search(data)\n fill_in_if_supplied('product_id', data['Product Id'])\n select_if_supplied('designer_id', data['Designer'])\n select_if_supplied('season_id', data['Season'])\n select_if_supplied('season_act_id', data['Act'])\n select_if_supplied('product_department_id', data['Department'])\n fill_in_if_supplied('keywords', data['Keywords'])\n fill_in_if_supplied('style_ref', data['Style Ref'])\n fill_in_if_supplied('sku', data['Legacy Sku'])\n select_if_supplied('channel_id', data['Channel'])\n find_and_set_if_supplied(stock_locator(data), data['Stock / Sample'])\n end", "def results\n raw_input = params[:search].to_s\n formatted_input = raw_input.gsub(\" \", \"+\")\n\n @client = HTTParty.get(\"http://api.shopstyle.com/api/v2/products?pid=uid5001-30368749-95&fts='#{formatted_input}'&offset=0&limit=20\")\n\n render json: @client\n end", "def search\n spotyfy_client = SpotyfyClient.new(params[:search])\n spotyfy_client.perform\n items = SpotyfyService.parse_hash(spotyfy_client.body)\n render :json => items.to_json\n end", "def search\n if params[:search].blank?\n @shoes = Shoe.all\n else\n @shoes = Shoe.search(params)\n end\nend", "def getResultsFromSearch(query, type, guts, ppOverride)\n request('getResultsFromSearch', {'query' => query, 'type' => type, 'guts' => guts, 'ppOverride' => ppOverride})\nend", "def index\n if params[:search].present?\n @buildings = Building.near(params[:search], 50, :order => :distance)\n else\n @buildings = Building.all\n end\n\n end", "def index\n\t\tif params[:search].present?\n\t\t\t@locations = Location.near(params[:search], 10, :order => distance)\n\t\telse\n\t\t\t@locations = Location.all\n\t\tend\n\tend", "def filterHotDogStandsByDistanceFromReferenceLocation(httpRequestParameters)\n # Use this array to store the stands that will have their data be returned to the frontend for processing.\n hotDogStandsWithFavourablePositions = []\n\n @searchQuery.each do |currentHotDogStand|\n if httpRequestParameters[\"distanceUnit\"] == \"KM\" and httpRequestParameters[\"distanceRange\"] != \"0\"\n # If the user has specified a range in kilometers, check to see that the distance between the user's current position\n # and the hot dog stand is less than the range the user specified in kilometers.\n if distanceBetweenTwoPointsLatAndLongInKM(httpRequestParameters[\"latitude\"].to_f, httpRequestParameters[\"longitude\"].to_f, \\\n currentHotDogStand.latitude, currentHotDogStand.longitude) < httpRequestParameters[\"distanceRange\"].to_f\n hotDogStandsWithFavourablePositions.push(currentHotDogStand)\n end\n elsif httpRequestParameters[\"distanceUnit\"] == \"MI\" and httpRequestParameters[\"distanceRange\"] != \"0\"\n # If the user has specified a range in miles, check to see that the distance between the user's current position\n # and the hot dog stand is less than the range the user specified in miles.\n if distanceBetweenTwoPointsLatAndLongInKM(httpRequestParameters[\"latitude\"].to_f, httpRequestParameters[\"longitude\"].to_f, \\\n currentHotDogStand.latitude, currentHotDogStand.longitude) < httpRequestParameters[\"distanceRange\"].to_f\n hotDogStandsWithFavourablePositions.push(currentHotDogStand)\n end\n else\n # Otherwise, put all of the existing stands into the array.\n hotDogStandsWithFavourablePositions.push(currentHotDogStand)\n end\n end\n return hotDogStandsWithFavourablePositions\n end", "def index\n @shops = Shop.all\n @search = Shop.search(params[:q])\n @shops = @search.result.page(params[:page]).per(30)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shops }\n end\n\n end", "def index\n\t\tbegin\n\t\t\tif params[:lat].present? && params[:lng].present?\n\t\t\t\t@address = Geokit::Geocoders::GoogleGeocoder.reverse_geocode \"#{params[:lat]},#{params[:lng]}\"\n\t\t\t\tparams[:postal_code] = @address.try(:zip) if @address.success\n\t\t\tend\n\t\t\t@search = Store.search do\n\t\t\t\tfulltext(params[:postal_code]) do\n\t\t\t\t\tfields(:postal_code)\n\t\t\t\tend\n\t\t\tend\n\t\t\tif @address.present?\n\t\t\t\t@stores = @search.results.sort_by{|s| s.distance_to([@address.lat,@address.lng])}\n\t\t\telse\n\t\t\t\t@stores = @search.results\n\t\t\tend\n\t\t\t\t@postal_code = params[:postal_code]\n\t\t\t\t@stores =\[email protected](5) if params[:type] == \"collection\"\n\t\t\trender :index, status: :ok\n\t\trescue Exception => e\n\t\t\terror_handling_bad_request(e)\n\t\tend\n\tend", "def get_places(opts = {})\n @search_fields = [\n :id, :title, :city_id, :size_sqf, :size_sqm, :reviews_overall, :photos, \n :currency, :num_bedrooms, :num_bathrooms, :favorited, \n :price_per_month_usd, :price_per_month\n ]\n @user_fields = [:id, :first_name, :last_name, :avatar_file_name, :role]\n @place_type_fields = [:id,:name]\n\n if opts[:search_type] == \"recently_added\"\n search_params = self.query.merge({\"date_from\" => self.delivered_at})\n elsif opts[:search_type] == \"new_results\"\n search_params = self.query.merge({\"exclude_ids\" => self.results})\n else\n search_params = self.query\n end\n\n place_search = PlaceSearch.new(self.user, search_params)\n if !place_search.all_results.blank?\n filtered_places = filter_fields(place_search.all_results, @search_fields, { :additional_fields => {\n :user => @user_fields,\n :place_type => @place_type_fields },\n :currency => self.query['currency']\n })\n return filtered_places\n else\n return nil\n end\n end", "def index\n @shops = Shop.order('isnull(alexa) asc,alexa asc')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { \n q = \"%#{params[:q]}%\"\n @shops = @shops.\n where(\"name like ? or domain like ? or cert like ?\",q,q,q) if params[:q].present?\n render json: @shops \n }\n end\n end", "def index\n if params[:search].present?\n @locations = Location.near(params[:search], 50)#, :order => :distance)\n else\n @locations = Location.all\n end\n end", "def index\n if params[:search].present? and !params[:search].empty?\n @search_location = params[:search]\n @boats = Boat.complete.near(search_params, 20, unit: :km, order: 'distance').select(&:can_be_published?)\n @search_results_count = @boats.size # count doesn't work with near\n if @boats.empty?\n @boats = Boat.complete.near(search_params, 99999, unit: :km, order: 'distance').select(&:can_be_published?)\n @boats = Boat.all if @boats.empty?\n end\n else\n @boats = Boat.complete.all.select(&:can_be_published?)\n end\n end", "def index\n if params[\"query\"]\n #Represent SoQL query as HTTP params\n args = {\"$q\" => params[\"query\"], \n \"$select\" => \"applicant, address, latitude, longitude, schedule\", \n \"$limit\" => SODA_SEARCH_LIMIT.to_s}\n response = FOOD_TRUCK_FINDER_SODA_CLIENT.get(SF_FOOD_TRUCK_SODA_DATASET_ID,\n args)\n \n # Formating the SODA response into a dictionary of attributes which\n # the Google Maps plugin can consume\n @trucks = response.flat_map { |truck|\n if (truck.applicant && \n truck.schedule && \n truck.latitude && \n truck.longitude &&\n truck.address)\n [{ \"applicant\" => truck.applicant, \n \"schedule\" => truck.schedule, \n \"lat\" => truck.latitude, \n \"lng\" => truck.longitude, \n \"title\" => truck.applicant,\n \"address\" => truck.address,\n #Generating and dynamically formatting the HTML for the \n #'info-window' that pops up when a map marker is clicked on\n \"infowindow\" => generate_infowindow(truck)\n }]\n else\n #Remove food trucks with missing attributes \n []\n end\n }\n else\n @trucks = []\n end\n\n respond_to do |format|\n format.html\n end\n end", "def hops_store_list\n $tracer.trace(__method__)\n #return GameStopHopsStoreList.new(jquery(\"table[id~='searchResults']> tbody > tr\"))\n return GameStopHopsStoreList.new(table.id(\"/searchResults/\").tbody.tr, __method__)\n end", "def search\n\n @search = Location.near(params[:search], 15, :order => :distance)\n \n @query = params[:search]\n @locations = @search\n \n @filtros = ajustaFiltros\n @precios = precios(@locations)\n @campos = self.campos\n @places = places(@locations,@filtros)\n @facets = facetas(@locations, @filtros)\n @json = @locations.to_gmaps4rails\n end", "def scsearch(squery)\n\thttp = Net::HTTP.new(\"shell-storm.org\", 80)\n\treq = Net::HTTP::Get.new(\"/api/?s=#{squery.downcase}\", {'User-Agent' => 'Shell-Storm Ruby API - Search'})\n\tres = http.request(req)\n\tcase res\n\twhen Net::HTTPSuccess then\n\t\tt=[ [ \"Author\", 'Platform', 'Description', 'ID' ] ]\n\t\tres.body.split(\"\\n\").each do |entry|\n\t\t\tshow = entry.split(\"::::\")\n\t\t\tt << [ \"#{show[0]}\", \"#{show[1]}\", \"#{show[2]}\", \"#{show[3]}\" ]\n\t\tend\n\t\ttable = t.to_table(:first_row_is_head => true)\n\t\tputs \"#{HC}#{FGRN}\" + table.to_s + \"#{RS}\"\n\telse\n\t\tputs \"#{HC}#{FRED}Seems we made a bad request somehow#{FWHT}....#{RS}\"\n\t\tputs res.value\n\tend\nend", "def index\n @stores = @stores.full_text_search(params[:search]).with_pg_search_rank if params[:search].present?\n @stores = @stores.by_state(params[:state]) if params[:state].present?\n @stores = @stores.by_type(params[:type]) if params[:type].present?\n @stores = @stores.where(latitude: nil).or(Store.where(longitude: nil)) if params[:no_info]\n\n @stores = @stores.order(:name)\n\n respond_to do |format|\n format.html do\n @stores = @stores.page(params[:page])\n end\n format.json do\n @stores = @stores.limit(50)\n end\n format.csv do\n send_data @stores.to_csv, type: 'csv', filename: 'pins-export.csv'\n end\n end\n end", "def find_all_by_shop_name(shop_name, opts = {})\n shop_id = Shop.find_by_name(shop_name).shop_id\n find_all_by_shop_id(shop_id, opts) if shop_id\n end", "def get_tracks search\n sa = search.split(' ')\n\n if sa.size > 1\n case sa.first\n when 'u' \n sa.shift\n @sc_client.User.find(sa.join('-')).tracks\n when 't'\n sa.shift\n @sc_client.Track.find(:all,:params => { :q => sa.join('-') } )\n else\n @sc_client.Track.find(:all,:params => { :q => sa.join('-')} )\n end\n else\n @sc_client.Track.find(:all,:params => { :q => search } )\n end\n end", "def index\n @gosoks = params[:q] ? Gosok.search_for(params[:q]) : Gosok.all\n end", "def search(query)\n # Check if we need a new Grooveshark session\n if session_expired?\n init_grooveshark\n end\n query.strip!\n\n songs = []\n begin\n songs = @grooveshark_client.search_songs(query)\n rescue Exception\n end\n\n unless songs.length == 0\n return songs.to_json\n else\n return nil\n end\n end", "def gatherAllItemsFromAvailableStands()\n\n # Set up three arrays.\n array_of_available_food_prices = []\n array_of_available_drink_prices = []\n array_of_available_condiments = []\n\n # Get the food prices, drink prices, and available condiments that each stand has.\n @searchQuery.each do |resultingStand|\n array_of_available_food_prices.push(FoodPrice.where( \"hot_dog_stands_id = ?\", resultingStand.id).to_a)\n array_of_available_drink_prices.push(DrinkPrice.where( \"hot_dog_stands_id = ?\", resultingStand.id).to_a)\n array_of_available_condiments.push(AvailableCondiment.where( \"hot_dog_stands_id = ?\", resultingStand.id).to_a)\n end\n\n # Place the resulting arrays into a hash, a Ruby-based dictionary.\n allAvailableItemsForTheStands = {\\\n \"availableFoodAndPrices\" => array_of_available_food_prices, \\\n \"availableDrinksAndPrices\" => array_of_available_drink_prices, \\\n \"availableCondiments\" => array_of_available_condiments \\\n }\n\n return allAvailableItemsForTheStands\n end", "def search\n @search ||= exhibit.searches.first\n # @searches ||= exhibit.searches.published.where(slug: item_ids).sort do |a, b|\n # order.index(a.slug) <=> order.index(b.slug)\n # end\n end", "def search\n @results = Cookbook.search(\n params.fetch(:q, nil)\n ).offset(@start).limit(@items)\n end", "def search\n\n # Starting query for the search to be performed.\n @searchQuery = HotDogStand.all\n\n # Add all of the optional filters the user has specified.\n filterHotDogStandsByFoodPreferences(params)\n filterHotDogStandsByDrinkPreferences(params)\n filterHotDogStandsByCondimentPreferences(params)\n\n # With the resulting stands based on the preferences, filter them down further by distance range.\n hotDogStandsWithFavourablePositions = filterHotDogStandsByDistanceFromReferenceLocation(params)\n\n # Get all of the data that holds the available items for the resulting stands.\n allAvailableItemsForTheStands = gatherAllItemsFromAvailableStands()\n\n\n # Add a distance range return value where the front-end will create a transparent green circle\n # to overlap around the desired area with the user's current location at its center in the\n # Google Maps widget.\n distanceRangeInMeters = 0.00;\n\n if params[\"distanceUnit\"] == \"MI\" and params[\"distanceRange\"] != \"0\"\n distanceRangeInMeters = 1609.34 * params[\"distanceRange\"].to_f\n elsif params[\"distanceUnit\"] == \"KM\" and params[\"distanceRange\"] != \"0\"\n distanceRangeInMeters = 1000 * params[\"distanceRange\"].to_f\n end\n\n # Finally, respond to the AJAX request with a JSON string by putting together the JSON dictionary,\n # then use the gems Ruby on Rails has loaded up to format it into a JSON string.\n respond_to do |format|\n format.json { render json: { referenceLatitude: params[\"latitude\"].to_f, referenceLongitude: params[\"longitude\"].to_f, \\\n distanceRange: distanceRangeInMeters, numberOfResults: hotDogStandsWithFavourablePositions.size, \\\n resultingHotDogStands: hotDogStandsWithFavourablePositions, availableFoodPrices: allAvailableItemsForTheStands[\"availableFoodAndPrices\"], \\\n allFood: Food.all, availableDrinkPrices: allAvailableItemsForTheStands[\"availableDrinksAndPrices\"], allDrinks: Drink.all, \\\n availableCondiments: allAvailableItemsForTheStands[\"availableCondiments\"], allCondiments: Condiment.all } }\n end\n end", "def search\n @results = Tool.ordered_by(params[:order])\n\n if params[:q].present?\n @results = @results.search(params[:q])\n end\n\n if Tool::ALLOWED_TYPES.include?(params[:type])\n @results = @results.where(type: params[:type])\n end\n\n @results = @results.offset(@start).limit(@items)\n\n @total = @results.count(:all)\n end", "def search(query)\n @client.get('/BikePoint/Search', { query: query })\n end", "def index\n @buildings = Building.find_near_me(search_params)\n end", "def index\n @services = Services::Search.for(params[:term], params[:sort], params[:page], { is_admin: true})\n end", "def show\n @shops = Shop.near([@shop.latitude, @shop.longitude], 20, units: :km)\n end", "def search_for_stores(data)\n Log.instance.debug \"Searching for stores that match '#{data}'\"\n populate_page_with(data)\n search_button_element.click\n wait_for_loading_mask\n end", "def search; end", "def search\n @array = from_json\n @array = from_ga unless @array.any?\n sort_hits!\n end", "def search_locally(search_term:)\n return [] unless search_term.present? && search_term.length > 2\n\n orgs = local_search(search_term: search_term)\n prepare(search_term: search_term, records: orgs)\n end", "def discover\n discover_places = [\n \"Experimental Cocktail Club Paris\",\n \"Le Connetable\",\n \"Le Baron Rouge\",\n \"Le Bistrot des Dames\",\n \"Aux Folies\",\n \"UDO Bar\"\n ]\n params_hash = {\n q: discover_places.sample\n }\n call(params_hash)\n end", "def all_search\n @results ||= []\n feat_keyword ||= {:name_contains => params[:q]}\n reward_keyword ||= {:partner_business_name_contains => params[:q]}\n\n Feat.search(feat_keyword).all.each do |r|\n @results << r\n end if !Feat.search(feat_keyword).all.nil? && feat_keyword.length > 0\n\n Reward.search(reward_keyword).all.each do |r|\n @results << r\n end if !Reward.search(reward_keyword).all.nil? && reward_keyword.length > 0\n end", "def search_shopify_order(search)\n count = ShopifyAPI::Order.count\n pages = (count / 250) + 1\n order = nil\n\n begin\n orders = ShopifyAPI::Order.find(:all, params: {limit: 250, page: pages})\n orders.each do |o|\n if o.order_number.to_s == search.to_s\n order = o\n elsif o.name.to_s == search.to_s\n order = o \n end\n end\n pages -= 1\n break if order\n end while pages > 0\n\n return order\nend", "def index\n @q = params['q']\n\n if params['underground']\n tube = \" AND underground = 1\"\n else\n tube = \"\"\n end\n if params['lat'] and params['lng']\n lat = params['lat'].to_f\n lng = params['lng'].to_f\n @stations = Station.unscoped.select(\"stations.*, #{distance_sql(lat,lng)} AS distance\").where(\"lat IS NOT NULL AND lng IS NOT NULL\" + tube).order(\"distance ASC\").limit(1)\n elsif @q && [email protected]?\n @stations = Station.where(\"(upper(crs) LIKE ? OR upper(name) LIKE ?)\" + tube, @q.upcase, \"%#{@q.upcase}%\").page(params[:page])\n else\n @stations = Station.page(params[:page])\n end\n\n respond_to do |format|\n format.html\n format.xml { render xml: @stations }\n format.json { render json: @stations, callback: params['callback'] }\n end\n end", "def get_shops_list\n\n\t\tbegin\n\t\t\tres = []\n\t\t\tcost = 0\n\t\t\toffer_cost = 0\n\n\t\t\tService.where(:shop_service_type_id => params[:shop_service_type_id]).each do |s|\n\t\t\t\tputs s.inspect\n\t\t\t\tputs params.inspect\n\t\t\t\tif s.shop.location_id == params[:location_id].to_i\n\t\t\t\t\t\n\n\t\t\t\t\tif s.offers.blank?\n\t\t\t\t\t\tputs \"no offers\"\n\t\t\t\t\t\tputs s.inspect\n\t\t\t\t\t\tcase params[:membership_type].to_s\n\t\t\t\t\t\twhen 'y'\n\t\t\t\t\t\t\tcost = s.cost_yearly\n\t\t\t\t\t\twhen 'h'\n\t\t\t\t\t\t\tcost = s.cost_halfyearly\n\n\t\t\t\t\t\twhen 'q'\n\t\t\t\t\t\t\tcost = s.cost_quartly\n\n\t\t\t\t\t\twhen 'm'\n\t\t\t\t\t\t\tcost = s.cost_monthly\n\n\t\t\t\t\t\twhen 'd'\n\t\t\t\t\t\t\tcost = s.cost_daily\n\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\tcost = 0\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\tputs \"has offer\"\n\t\t\t\t\t\tputs s.offers.inspect\n\t\t\t\t\t\tcase params[:membership_type].to_s\n\t\t\t\t\t\twhen 'y'\n\t\t\t\t\t\t\tcost = s.cost_yearly\n\t\t\t\t\t\t\toffer_cost = s.offers.last.cost_yearly\n\t\t\t\t\t\twhen 'h'\n\t\t\t\t\t\t\tcost = s.cost_halfyearly\n\t\t\t\t\t\t\toffer_cost = s.offers.last.cost_halfyearly\n\t\t\t\t\t\twhen 'q'\n\t\t\t\t\t\t\tcost = s.cost_quartly\n\t\t\t\t\t\t\toffer_cost = s.offers.last.cost_quartly\n\t\t\t\t\t\twhen 'm'\n\t\t\t\t\t\t\tcost = s.cost_monthly\n\t\t\t\t\t\t\toffer_cost = s.offers.last.cost_monthly\n\t\t\t\t\t\twhen 'd'\n\t\t\t\t\t\t\tcost = s.cost_daily\n\t\t\t\t\t\t\toffer_cost = s.offers.last.cost_daily\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\tcost = 0\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tend\n\n\t\t\t\t\tend\n\n\t\t\t\t\tjson_obj = { \"shop_id\" => s.shop_id,\n\t\t\t\t\t\t\"shop_name\" => s.shop.name,\n\t\t\t\t\t\t\"icon\" => s.shop.icon,\n\t\t\t\t\t\t\"time_slot_ids\" => s.shop.time_slot_ids,\n\t\t\t\t\t\t\"day_slot_ids\" => s.shop.day_slot_ids,\n\t\t\t\t\t\t\"service_name\" => s.shop_service_type.name,\n\t\t\t\t\t\t\"cost\" => cost,\n\t\t\t\t\t\t\"offer_cost\" => offer_cost\n\t\t\t\t\t}\n\t\t\t\t\tputs \"json obj \"+json_obj.to_s\n\t\t\t\t\tres << json_obj\n\t\t\t\t\tputs res\n\n\t\t\t\tend\n\n\t\t\t\t\n\t\t\tend\n\n\n\n\n\n\t\t\trender :json => {:data => res.as_json,:success => true, :message => \"App Data found\"}\n\n\t\trescue Exception => e\n\t\t\tputs e.inspect\n\t\t\trender :json => {:data => \"\", :success => false, :message => \"Unable to retrive data\"}\n\t\tend\t\n\tend", "def index\n results = @search.result(distinct: true)\n if params[:customer_id]\n results = results.where(customer_id: params[:customer_id])\n end\n results = results.tagged_with(params[:tags].split(/\\s*,\\s*/)) if params[:tags].present?\n results = results.includes :series\n results.paginate(page: params[:page], per_page: 20)\n\n set_listing results.paginate(page: params[:page], per_page: 20)\n\n end", "def getZapposSvpplyWants\n\n zapposSvpplyWants = Array.new()\n \n begin\n svpplyUserId = self.svpplyUserId\n productsResponse = JSON.parse(HTTParty.get(\"https://api.svpply.com/v1/users/#{svpplyUserId}/wants/products.json\").response.body)[\"response\"][\"products\"]\n \n #filter out products for sale at Zappos\n productsResponse.each do |p|\n if p[\"store\"].to_s.include?(\"Zappos\")\n zapposSvpplyWants.push(p)\n end\n end\n rescue\n #do nothing - will send error email to user \n end\n \n zapposSvpplyWants\n end", "def search\n @hits = []\n\n if params[:query]\n search = DesignMethod.solr_search do\n fulltext params[:query] do\n highlight\n minimum_match 0\n end\n end\n store_location\n @hits = search.hits\n @results = search.results\n end\n\n respond_to do |format|\n format.html\n format.json { render json: @results }\n end\n end", "def search(sfilter = nil)\n sfilter ||= filter\n\n result = []\n connect do |conn|\n conn.search2(base, 1, sfilter) do |entry|\n result << entry2provider(entry)\n end\n end\n return(result.empty? ? nil : result)\n end", "def searches\n wrapping!(\n search(\n root_uri,\n data_raw.to_s.gsub('=>', ':')\n )\n )\n end", "def\tsearch\n\t\tresult = query_google_places\n\t\trender :json => result\n\tend", "def search\n query = {\n 'res_id' => params[:id]\n }\n @search = HTTParty.get('https://developers.zomato.com/api/v2.1/restaurant?', query: query, headers: headers)\n end", "def search(user_query)\n\n characters = @client.characters(name: user_query)\n # comics = @client.comics(name: user_query)\n # creators = @client.creators(name: user_query)\n # events = @client.events(name: user_query)\n # series = @client.series(name: user_query)\n # stories = @client.stories(name: user_query)\n\n puts characters\n # I'm finally getting return goobledigook! But Derek also used this API and is getting different return than me. His was formulated like a nice little hash. \n\n end", "def index\n @customers = Customer.like_customer(params[:latitude],params[:longitude])\n @vendors = Vendor.like_vendor(params[:latitude],params[:longitude])\n @gps = GpsLocation.find(params[:gps_id].to_i)\n end", "def index\n @searches = Search.order(:created_at)\n\n get_location\n end", "def index\n @search = Search.new(:site_sku, params[:search], :per_page =>100 )\n @search.order = 'updated_at DESC'\n @site_skus = @search.run\n @skus = Sku.all\n end", "def search_buddies_by_location\n buddy_data = []\n if latitude.blank? || longitude.blank?\n location = [requested_user.current_latitude, requested_user.current_longitude] \n else\n location = [latitude.to_f, longitude.to_f]\n end\n if location_lock == \"true\"\n if search.blank?\n users = User.page(page).per(10).joins(:feeds).includes(:feeds).within(proximity, :origin => location)\n else\n users = User.page(page).per(10).joins(:feeds).includes(:feeds).where(\"name like '%#{search}%'\").within(proximity, :origin => location)\n end\n else\n if search.blank?\n render :status=>401,\n :json=>{:Message=>\"The search cannot be blank for universal search.\",\n :Response => \"Fail\",\n :Data => nil} \n end\n users = User.page(page).per(10).joins(:feeds).includes(:feeds).where(\"name like '%#{search}%'\") unless search.blank?\n end\n users.collect {|user| buddy_data.push(Hashie::Mash.new(:User => user, :Feeds => user.feeds))}\n render :status=>200,\n :json=>{:Message=>\"Here are the buddies near you!\",\n :Response => \"Success\",\n :Data => buddy_data} \n end", "def srch(opts={})\n\t\t\t\tsrch_client.search(opts)\n\t\t\tend", "def shops\n @shops ||= (@doc/\"SpcShop\").collect { |it| Element.new(it) }\n end", "def index\n modify_search_query\n\n @services = Service.approved\n @garages = nil\n\n if !params[:max_radius].present? && !params[:min_radius].present?\n @q = Garage.near(get_lat_long, 999999999999).ransack(params[:q])\n else\n @q = donut_search\n end\n\n if params[:search_service_ids].present?\n @garages = @q.result.where(\"services_ids @> ?\", \"{#{params[:search_service_ids].join(',')}}\")\n else\n @garages = @q.result\n end\n\n if params[:garage_sort_by] == 'rating'\n @garages = @garages.decorate.sort_by(&:avg_rating)\n elsif params[:garage_sort_by] == 'date'\n @garages = @garages.decorate.sort_by(&:created_at)\n else\n params[:garage_sort_by] = 'distance'\n @garages = @garages.decorate\n end\n\n restore_search_query\n end", "def search\n @places = FoursquarePlace.places_near_coordinates(@coordinates, query: params[:search_terms])\n render json: { data: @places }\n end", "def scrape\n request = BoundingBox.new(\n :term => keyword,\n :sw_latitude => sw_lat,\n :sw_longitude => sw_long,\n :ne_latitude => ne_lat,\n :ne_longitude => ne_long,\n :sort => 2)\n\n request2 = BoundingBox.new(\n :term => keyword,\n :sw_latitude => sw_lat,\n :sw_longitude => sw_long,\n :ne_latitude => ne_lat,\n :ne_longitude => ne_long,\n :sort => 2,\n :limit => 20,\n :offset => 20)\n\n\n [ client.search(request), client.search(request2) ]\n end", "def search(query); end", "def searches_from_history\n []\n end", "def search(search_options)\n Array(global_catalog_connection.search(search_options.merge(options)))\n end", "def index\n if params[:search]\n @pet_shops = PetShop.search(params[:search]).order(\"created_at DESC\")\n else\n @pet_shops = PetShop.all.order('created_at DESC')\n end \n end", "def search_place\n @radius = @params[:radius] if @params[:radius].present?\n @type = @params[:type] if @params[:type].present?\n if @params[:filters].present?\n places=HTTParty.get(\"https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=#{@params[:lat]},#{@params[:lng]}&key=#{ENV['GOOGLE_PLACES_KEY']}&name=\"+@params[:filters]+\"&radius=#{@radius}&type=#{@type}\")\n else\n places=HTTParty.get(\"https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=#{@params[:lat]},#{@params[:lng]}&key=#{ENV['GOOGLE_PLACES_KEY']}&radius=#{@radius}&type=#{@type}\")\n end\n places[\"results\"] \n end", "def search(term, location)\n url = \"#{API_HOST}#{SEARCH_PATH}\"\n params = {\n term: term,\n location: location,\n limit: SEARCH_LIMIT\n }\n#this takes info from params hash\n response = HTTP.auth(bearer_token).get(url, params: params)\n response.parse[\"businesses\"]\nend", "def index\n @foods = Listing.all\n # Orders posts (Default is newst -> oldest) and sets paginate paramaters\n @foods = Listing.order(\"created_at DESC\")\n\n if params[:search]\n @foods = Listing.where('tool LIKE ?', \"%#{params[:search]}%\")\n end\n end", "def search\t\t\n\t\t @query = params[:query]\n\t\t @storecunsumptions = Storecunsumption.search @query, :page => params[:page], :per_page => 10\t\t\n\tend", "def search(params)\n invalid_keys = params.keys - SEARCH_KEYS\n raise InvalidRequest.new \"Invalid keys: #{invalid_keys.join(\", \")}\" unless invalid_keys.empty?\n\n # Convert arrays into CSVs\n [:keywords, :keywords_exclude].each do |key|\n params[key] = params[key].join(\",\") unless params[key].nil?\n end\n\n # Convert any Time/DateTime objects to UNIX time integers\n params[:updated_min] = params[:updated_min].to_i unless params[:updated_min].nil?\n\n process_location! params\n\n request :search_listings, params\n end", "def get_shoppers(proximity=nil)\n Euclid::Shopper.get_shoppers(@credential, proximity)\n end", "def index\n @sales = Sale.all\n @sale = Sale.new\n if params[:search]\n company_id = params[:search][:company_id]\n greenhouse_id = params[:search][:greenhouse_id]\n @show_sales = true\n @greenhouse = Greenhouse.find(greenhouse_id)\n @cycle = Cycle.where(greenhouse_id: greenhouse_id).active.first\n from_date = @cycle.start_date\n to_date = @cycle.end_date\n @sales = Sale.where(greenhouse_id: greenhouse_id).where(event_date: from_date..to_date).order(:event_date)\n @sale = Sale.new\n else\n @show_sales == false\n @companies = current_user.companies\n @greenhouses = Greenhouse.where(company_id: @[email protected])\n end\n end", "def search\n\n end", "def searches\n full = options[:full]\n item_list.map { |item|\n next unless item.is_a?(Search)\n entry = {\n query_params: item.sorted_query,\n updated_at: item.updated_at,\n created_at: item.created_at,\n }\n full && entry.merge!(\n id: item.id,\n user_id: item.user_id,\n user_type: item.user_type,\n )\n entry\n }.compact.as_json\n end", "def search_by_gadget(search)\n conds = []\n limit = 10\n search.each do |k, v|\n case k\n when :any\n v.each do |ary|\n conds << \"((%s) AND ret_distance > %d)\" % [cond_any(ary).join(' OR '), ary.size]\n end\n when :address\n conds += cond_by_addr(v) unless v.size == 0\n when :dst\n conds << cond_by_dst(v) unless v.size == 0\n when :src\n conds << cond_by_src(v) unless v.size == 0\n when :limit\n limit = v\n end\n end\n return if conds.size == 0\n found = []\n search(conds).each do |row|\n addr = row['address']\n ret_addr = row['ret_addr']\n g = gadget_build(addr, ret_addr)\n\n next unless g\n next if found.include?(g)\n\n if yield(g)\n found << g\n limit -= 1\n end\n\n break if limit == 0\n end\n end", "def search_tracks(q, page=1)\n \t response_body = get_body(http_get(\"http://ws.spotify.com/search/1/track.json?q=#{CGI.escape(q)}&page=#{page}\"))\n \t json = ActiveSupport::JSON.decode(response_body)\n to_tracks(json[\"tracks\"])\n \tend", "def index\n @restaurantes_proximos = Array.new\n @found_foods = Array.new\n\n if params[:search]\n\n restaurants = Array.new\n\n params[:search].split().each do |tag|\n Tag.where(nome: tag).pluck(:prato_id).each() do |food_id|\n Prato.where(id: food_id).pluck(:id, :restaurante_id).each do |food|\n @found_foods << Prato.find(food[0])\n\n unless restaurants.include?(food[1])\n restaurants << food[1]\n end\n end\n end\n end\n\n @restaurantes_proximos = RestaurantesProximo.where(\"restaurante_id IN (?)\", restaurants)\n end\n end", "def songs_from_query\n logger.info \"Grooveshark :: Query request initiated.\"\n if params[:query]\n query = URI.escape(params[:query])\n url = URI.parse(\"#{TINY_SONG_API}/s/#{query}?format=json&limit=#{NUM_SEARCH_RESULTS}&key=#{TINY_SONG_API_KEY}\")\n response = Net::HTTP.get_response(url).body\n response_json = ActiveSupport::JSON.decode(response)\n @song_results = response_json.map do |song_json|\n Song.find_or_create(song_json[\"SongID\"], song_json[\"SongName\"],\n song_json[\"AlbumID\"], song_json[\"AlbumName\"],\n song_json[\"ArtistID\"], song_json[\"ArtistName\"])\n end\n logger.info \"Grooveshark :: query results #{@song_results}.\"\n if @song_results.empty?\n render :text => \"No results were found.\"\n else\n render :partial => 'songs/song_list', :locals => {:songs => @song_results},\n :layout => false\n end\n else\n render :text => \"No query.\"\n end\n end", "def get_search_product_list\n\t\tresponse_search = Partay.get('http://shoponline.tescolotus.com/api/v1/search/products?query=Sugar&page=1&sortBy=Relevance', :headers => {'Content-Type' => 'application/json', 'language' => 'en-gb', 'region' => 'TH', 'userId' => access_token})\n\t\t@@product_list=Array.new\n\t\t3.times do |i|\n\t\t\t@@count ||=0\n\t\t\tsearch_result=JSON(response_search['productItems'][i])\n\t\t\tproduct_list_name =JSON(search_result)[\"product\"][\"shortDescription\"]\n\t\t\t@@product_list.push product_list_name\n\t\t\t@@count+= 1\n\t\tend\n\t\tself.product_name_list(@@product_list)\n\tend", "def search_for(keywords, options = {})\n solr_server.find(keywords, options.merge(:results => PublicEarth::Search::PlaceResults))\n end", "def shoes\n results = DATABASE.execute(\"SELECT * FROM shoes WHERE category_id = #{@id};\")\n\n store_results = []\n\n results.each do |hash|\n store_results << Shoe.new(hash)\n end\n\n return store_results\n end", "def shops\n shop_ids = stocks.pluck(:shop_id).uniq\n Shop.where(id: shop_ids).sales\n end", "def from_search\n name = params[:id]\n lat = params[:lat]\n lon = params[:lon]\n @locations = Location.locations_from_candy_ids(Candy.ids_by_name(name))\n if(lat and lon)\n @locations = Location.nearest_five(lat.to_f, lon.to_f, @locations)\n end\n\n respond_to do |format|\n format.html\n format.json { render :json => @locations }\n end\n end" ]
[ "0.6720328", "0.6622495", "0.636436", "0.632069", "0.6091188", "0.6009157", "0.60049474", "0.5987633", "0.59522676", "0.59036195", "0.5845148", "0.5815751", "0.5814982", "0.57974005", "0.5791948", "0.5790009", "0.57899183", "0.5783678", "0.5783495", "0.5770429", "0.57684416", "0.57490236", "0.57321614", "0.5710091", "0.5705032", "0.56905", "0.56823397", "0.5672884", "0.56491244", "0.5630751", "0.5628171", "0.56245166", "0.56244177", "0.5622963", "0.5617082", "0.56061834", "0.55842024", "0.5581766", "0.55788535", "0.55730563", "0.55619454", "0.5552665", "0.55501515", "0.55466014", "0.5546536", "0.55389386", "0.55326897", "0.5528728", "0.551799", "0.55170935", "0.5511001", "0.55056536", "0.5494035", "0.5490743", "0.5490215", "0.54900277", "0.548787", "0.54873025", "0.54869896", "0.5481883", "0.5481185", "0.5478532", "0.547839", "0.5477734", "0.5477018", "0.5476926", "0.5474416", "0.5468856", "0.5464043", "0.5447204", "0.54464555", "0.54449123", "0.54444826", "0.54392165", "0.5437793", "0.54373187", "0.5428762", "0.5425731", "0.54243755", "0.5424368", "0.54236436", "0.5423249", "0.54218894", "0.54160297", "0.53984016", "0.53981155", "0.5393725", "0.5392692", "0.5382908", "0.5370903", "0.5370872", "0.53603905", "0.5357485", "0.5352691", "0.5350439", "0.53495735", "0.5348648", "0.53398335", "0.5338236", "0.5334479" ]
0.638052
2
Returns an array of users whose checkins were recorded in a specific shop.
def dianping_shop_checkins(shop) if shop is_a? Shop users = Shop.find_people_via_checkins end return users || [] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def users\n #book_a.users\n #returns all the users that checked out this book\n\n checkout_array = Checkout.all.select {|checkout| checkout.book == self}\n checkout_array.map {|checkout| checkout.user}\n end", "def checkout\n @checkouts = Array.new\n User.all.each do |user|\n url = untappd_url('/user/checkins/' + user.untappd_id)\n if user.last_checkin.blank?\n user.last_checkin = \"0\"\n else\n url += \"max_id=#{user.last_checkin}\"\n end\n json_txt = RestClient.get(url)\n json_obj = JSON.parse(json_txt)\n user_checkouts = Array.new\n failed_checkouts = Array.new\n checkout_keyword = \"#cellar\"\n checkin_max = 0\n json_obj[\"response\"][\"checkins\"][\"items\"].each do |checkin|\n checkin_id = checkin['checkin_id']\n checkin_max = checkin_id if checkin_id > checkin_max\n if checkin['checkin_comment'].include? checkout_keyword and checkin_id > user.last_checkin.to_i\n beer = Beer.find_by untappd: checkin['beer']['bid']\n if ( beer.nil? )\n failed_checkouts << checkin['beer']['beer_name']\n else\n beer.quantity = beer.quantity - 1\n beer.save\n user_checkouts << checkin['beer']['beer_name']\n end\n end\n end\n if checkin_max > user.last_checkin.to_i\n user.last_checkin = checkin_max\n user.save\n end\n @checkouts << { email: user.untappd_id,\n user_checkouts: user_checkouts,\n failed_checkouts: failed_checkouts }\n end\n end", "def user_checkins user_id=\"self\", options={}\n response = get(\"/users/#{user_id}/checkins\",options)[\"response\"][\"checkins\"]\n response[\"items\"].map!{|checkin| Foursquared::Response::Checkin.new(self, checkin)} if response[\"items\"]\n response\n end", "def users\n user_arr = []\n subscriptions.each do |s|\n user_arr << User.find(s.user.id)\n end\n user_arr\n end", "def users\n signups.map do |signup|\n user_id = signup.user_id\n User.all.find {|user| user.id == user_id}\n end\n end", "def checkins(id = 'self', options = {})\n get(\"users/#{id}/checkins\").checkins\n end", "def index\n @shop_owners = ShopOwner.all\n end", "def users\n user_arr = []\n accounts.each do |s|\n user_arr << User.find(s.user.id)\n end\n user_arr\n end", "def all_checkouts\n all_checkouts_arr = []\n results = DB.exec(\"SELECT * FROM checkouts WHERE patron_id = #{@id};\")\n results.each do |tuple|\n all_checkouts_arr.push(tuple)\n end\n all_checkouts_arr\n end", "def household_users\n User.where(id: household_user_ids)\n end", "def all_active_shops\n Shop.all\n end", "def index\n @shops = if params[:user_id] || user_signed_in?\n Shop.where(user_id: params[:user_id] || current_user.id).page(params[:page])\n else\n Shop.all.page(params[:page])\n end\n end", "def index\n @check_ins = CheckIn.all\n end", "def signups\n sign_up = []\n lists = self.listings.map {|listing| listing.id}\n PlayerSignup.all.select do |signup|\n if lists.any?(signup.listing_id)\n sign_up << signup\n end\n end\n sign_up\n end", "def checkins( params={} )\n checkins = get_connections(\"checkins\", params)\n return map_connections checkins, :to => Facebook::Graph::Checkin\n end", "def users\n watches_unique_by_user.map(&:user)\n end", "def index\n\t\t@shops = current_user.shop_profiles\n\tend", "def index\n @customers = Customer.where(\"shop=?\",@shop_session.url)\n end", "def other_household_members\n return [] if period.nil?\n ids = chooser.household.users.pluck(:id) - [chooser.id]\n period.shares.nonzero.where(user_id: ids).includes(:user).map(&:user)\n end", "def shops\n shop_ids = stocks.pluck(:shop_id).uniq\n Shop.where(id: shop_ids).sales\n end", "def get_target_users\n\n users = []\n\n self.get_orders.each do |user_hash|\n\n user_ids = user_hash.keys\n\n users = users + user_ids unless user_ids.nil?\n end\n\n users.compact!\n\n return users\n end", "def buildings\n Building.where(\n user_id: users.map(&:id)\n )\n end", "def users\n User.in_teams(self.teams.pluck(:id))\n end", "def index\n @checkins = Checkin.active\n end", "def get_checks(subscription)\n c = []\n\n # Load the checks\n file = File.read(CHECKS)\n checks = JSON.parse(file)\n\n for check in checks\n if check[\"subscribers\"].include? subscription\n c.push(check)\n end\n end\n\n return c\nend", "def signups\n Signup.all.select {|signup| signup.opportunity_id == self.id}\n end", "def players\n players_in_signup = []\n player_ids = self.signups.map {|sign| sign.player_id}\n User.all.select do |user|\n if player_ids.any?(user.id)\n players_in_signup << user\n end\n end\n players_in_signup.uniq\n end", "def find_all_by_shop_name(shop_name, opts = {})\n shop_id = Shop.find_by_name(shop_name).shop_id\n find_all_by_shop_id(shop_id, opts) if shop_id\n end", "def users\n gateway_check\n @users\n end", "def all_users\n result = []\n api.search(accounts_dn, ::LDAP::LDAP_SCOPE_SUBTREE, accounts_filter) do |user|\n result << user.to_hash\n end\n result\n end", "def index\n @checkins = Checkin.all\n end", "def index\n @checkins = Checkin.all\n end", "def index\n @checkins = Checkin.all\n end", "def find_all_gym_users\n self.gym_user_instances.map{|user| user.name } \n end", "def index\n @shopper_accounts = ShopperAccount.all\n end", "def login_users\n self.journal_entries.collect { |entry| entry.login_user }.compact\n end", "def show\n @is_current_user = is_current_user?\n if @user.is_authorized\n checkin_count = @is_current_user ? 10 : 1\n client = Foursquare2::Client.new(:oauth_token => @user.token)\n @checkins = client.user_checkins(:limit => checkin_count, :sort => 'newestfirst', :v => '20140806')\n end\n # byebug\n end", "def stakeholders\n self.stakeholder_ids.collect{|user_id| User.find(user_id)}\n end", "def associated_users(permission: nil)\n owner = self.user\n shares = permission.present? ? self.study_shares.where(permission: permission) : self.study_shares\n share_users = shares.map { |share| User.find_by(email: /#{share.email}/i) }.compact\n [owner] + share_users\n end", "def index\n if params[:user_sid]\n @checkins = Checkin.where(user_sid: params[:user_sid]).order('week asc')\n begin\n @user = User.find(params[:user_sid])\n rescue ActiveRecord::RecordNotFound => e\n puts \"im here.....\"\n flash[:error] = \"Invalid SID\"\n redirect_to '/my_checkins'\n # User.first.errors.add(e)\n end\n else\n @checkins = Checkin.all.order('week asc')\n end\n end", "def index\n @shopping_lists = ShoppingList.where(user_id: current_user.id)\n end", "def get_all_users\n @users = []\n\n User.all.each do|user|\n @users << user.to_hash\n end\n end", "def shouts\n Shout.where(user_id: shout_user_ids)\n end", "def get_saved_games_list(username)\n result = Array.new()\n res = @db.query(\"SELECT DISTINCT GameID, User1, User2, GameType FROM SavedGames WHERE User1 = '#{username}' OR User2 = '#{username}';\")\n while row = res.fetch_row do\n result.push(GameListElement.new(row[0], row[1], row[2], row[3]))\n end\n result\n end", "def perform\n request \"/users/self\" do |json|\n user = json[\"user\"]\n checkin_count = user[\"checkins\"][\"count\"].to_i\n load_checkins(checkin_count)\n end\n end", "def get_all_users\n @users = []\n results = User.all\n results.each do |user|\n @users << user.to_hash\n end\n end", "def get_all_users\n @users = []\n User.all.each do |user|\n @users << user.to_hash\n end\n end", "def users\n users = []\n if current_user.lead?\n users = object.users.select { |u| u.id != current_user.id }\n users = users.unshift(current_user)\n elsif current_user.dev?\n vms_v = object.vms.select { |vm| vm.is_jenkins }\n users = vms_v.flat_map(&:user).uniq.select { |u| u.id != current_user.id }\n users = users.unshift(current_user)\n else\n users <<= current_user\n end\n users.map { |u| u.id }\n end", "def index\n pagesize = params[:pagesize].nil? ? 20 : params[:pagesize]\n since = DateTime.new(0)\n if params[:since]\n begin\n since = params[:since].to_datetime\n rescue\n end\n end\n \n if params[:page] && params[:page] == \"all\"\n @checkins = current_user.checkins.where([\"created_at > ?\", since]).order(\"created_at DESC\").all\n else\n @checkins = current_user.checkins.where([\"created_at > ?\", since]).order(\"created_at DESC\").paginate(:per_page => pagesize, :page => params[:page])\n end\n \n respond_with @checkins\n end", "def users\n gateway_check\n unavailable_servers_check\n @users\n end", "def index\n @user_logins = UserLogin.all\n end", "def get_all_for_sale\n Listing.find_all_by_market_status( 1 , :include => :user )\n end", "def index\n @member_check_ins = MemberCheckIn.search(params[:search])\n end", "def ordered_users_list(trade, viewer = nil)\n viewer ||= auth_user\n users = []\n if viewer.id == trade.buyer_id\n users << trade.seller\n users << trade.buyer\n else\n users << trade.buyer\n users << trade.seller\n end\n users\n end", "def getAllOnlineUsers\n return false if !@usrData\n @usrData[login]\n end", "def users\n Section.find_roles.pluck(:name).inject(Array.new) do |result, role|\n result += User.with_role(role, self)\n end.uniq\n end", "def filtered_checkins(args)\n args[:device] ? args[:device].filtered_checkins(args) : safe_checkin_info_for(args)\n end", "def users\n # TODO use SQL\n results = self.approvers + self.observers + [self.requester]\n results.compact\n end", "def users\n User.in(id: user_promotions.pluck(:user_id))\n end", "def find_passengers\n journeys = Journey.includes(\"stages\").where(stages: {route_id: self.id, accepted: true})\n passengers = []\n journeys.each do |journey|\n passengers << journey.user\n end\n passengers\n end", "def index\n @stocks_users = StocksUser.all\n end", "def users\n result_hash['usr']\n end", "def get_students\n StudentInCourse.where(:course_id => id).collect(&:user_id)\n end", "def pickups\n @users.map { |u| u.pickup }.uniq\n end", "def fetch_watchers\n watcher_users.to_a\n end", "def users_who_completed_all_studies\n @downloaded_studies = Study.find(self.study_ids)\n\n user_arr = []\n @downloaded_studies.each do |study|\n user_arr.push(study.study_completions.pluck(:user_id).uniq)\n end\n\n ## SELECT THE COMMON VALUES OF ALL INTERIOR ARRAYS\n user_ids_and_nil = user_arr.reduce { |a, b| a & b }\n\n\n ## THIS COMMAND GETS RID OF ALL LOGGED OUT USER SURVEY DATA -- could be interesting to see if its use can dry up code\n user_ids_who_completed_all_studies = user_ids_and_nil.grep(Integer)\n\n user_ids_who_completed_all_studies\n end", "def get_subscriptions\n subscriptions = []\n\n # Load the checks\n file = File.read(CHECKS)\n checks = JSON.parse(file)\n\n for check in checks\n subscriptions |= check[\"subscribers\"]\n end\n\n return subscriptions\nend", "def users\n users_array = []\n if serialization_options[:include_users] == true\n # NOTE: object here refers to the ActiveRecord model object. self refers to the serializer object itself.\n object.users.each do |user|\n # NOTE: You can pass serialization_options to serializable_hash.\n users_array << UserSerializer.new(user, {}).serializable_hash({})\n end\n end\n return users_array\n end", "def checks_having_payers\r\n checks = []\r\n jobs.each do |job|\r\n check = job.check_informations.first\r\n checks << check if !check.payer.blank?\r\n end\r\n checks = checks.flatten.compact\r\n end", "def users\n User.where(network_id: context[:current_network]&.id)\n end", "def show\n @user_list= []\n \n @customtable = CustomeTable.where(:identifier_id => @hackathon.id)\n @reguser = Registration.where(:hackathon_id => @hackathon.id)\n \n @reguser.each do |user| \n u = User.find(user.userId)\n @user_list.push(u.user_name)\n end\n end", "def get_favorites\n @user = User.find(self.id)\n return Shop.where(id: \n { :$in => @user.favorite_places })\n .each { |shop| pp \"#{shop.picture}, #{shop.name}, #{shop.email}, #{shop.city}, #{shop.location}\"}\n end", "def users\n RecipeCard.all.map{|recipe_card| recipe_card.user if recipe_card.recipe_O == self}.compact\n end", "def returning_users\n []\n end", "def purchases\n # Our .select method on the line below does all the work of the 6 lines with the .each method\n # But remember that either way works just fine\n Purchase.all.select { |purchase| purchase.user == self }\n\n # purchases = []\n # Purchase.all.each do |purchase|\n # if purchase.user == self\n # purchases << purchase\n # end\n # end\n end", "def purchased usr\n Listing.where(\"listings.status not in (?)\", closed_arr(false)).joins(:invoices)\n .where(\"invoices.buyer_id = ? AND invoices.status = ?\", usr.id, 'paid').uniq\n end", "def users\n RecipeCard.all.select do |recipe_card|\n recipe_card.recipe == self\n end\n end", "def users\n recipe_rc = RecipeCard.all.select {|rc| rc.recipe == self}\n # recipe_rc.map {|rc| rc.user}\n end", "def index\n @check_in = @account.check_ins.find(params[:id])\n @members = @account.members.includes(:user, :subscribers).order('users.first_name asc').order('users.last_name asc')\n @subscribers = @check_in.subscribers.includes(member: :user).order('users.first_name asc').order('users.last_name asc')\n end", "def index\n @checkingins = Checkingin.all\n end", "def user_ids\n self.class.where(id: id).user_ids\n end", "def household_user_ids\n @household_user_ids || household.users.where.not(id: id).pluck(:id)\n end", "def household_user_ids\n @household_user_ids || household.users.where.not(id: id).pluck(:id)\n end", "def fetch_users!(track)\n log(\"Fetching users for track #{track.id}\")\n\n user_ids = track.user_ids.members\n\n user_ids.each do |user_id|\n next if user_id == @user.id.to_s\n\n user = Smoothie::User.new(user_id)\n\n next unless user.synced? && user.favorites_synced?\n\n add_user!(user, track)\n end\n end", "def users\n users = Backlogjp.base._command \"getUsers\", self.id\n users.map {|hash| User.new(hash)}\n end", "def users\n RecipeCard.all.select { |c| c.recipe == self }.map { |c| c.user }\n end", "def here_now_checkins(options={:limit => \"50\"})\n @foursquare.get(\"venues/#{id}/herenow\", options)[\"hereNow\"][\"items\"].map do |item|\n Foursquare::Checkin.new(@foursquare, item)\n end\n end", "def index\n @checkins = @startup.checkins\n authorize! :read, Checkin.new(:startup => @startup)\n @checkins = @checkins.ordered\n end", "def index\n @shopping_cart_entries = ShoppingCartEntry.where(user: current_user)\n end", "def get_games\n @games = Game.where(:user_id=>:id)\n end", "def get_lawyer_user_ids\n @assigned_lawfirm_users.map(&:id)\n end", "def get_repo_users\n repo_users = Array.new\n github = Github.new :oauth_token => github_token\n\n github.repos.list.body.each do |repo|\n repo_users << repo[\"owner\"][\"login\"]\n end\n\n repo_users\n end", "def get_accounts_by_user\n return User.find(params[:user_id]).accounts\n end", "def users\n RecipeCard.all.select do |card|\n card.recipe == self\n end.map do |card|\n card.user\n end\n end", "def users\n Webmail::User.in(group_ids: id)\n end", "def active_copoolers\n sql = \"SELECT DISTINCT ON (u.id) u.* FROM users u JOIN pools p ON p.user_id = u.id\n WHERE p.is_active = true\n AND p.user_id != :uid\n AND p.trip_id in (:tids)\"\n vars = {uid: id, tids: trips.ids}\n @active_copoolers = User.find_by_sql [sql,vars]\n end", "def index\n @shop_profiles = ShopProfile.all\n end", "def get_users\n users = call(CMD_GET_USERS)[:users]\n users.map {|account| User.new(account) }\n end", "def sign_in(shop)\n session[:shop_id] = shop.id\n end", "def channel_shops\n @_channel_shops ||= own_shop.descendant_entities.where.\n not(channel_id: nil).where.\n not(channel_id: id)\n end" ]
[ "0.60277617", "0.5741701", "0.5729292", "0.572716", "0.5719351", "0.571868", "0.57101995", "0.56574583", "0.556235", "0.5557169", "0.54946303", "0.5398625", "0.53967273", "0.53673154", "0.5335916", "0.53343534", "0.53147274", "0.5304935", "0.5276906", "0.5271251", "0.52616566", "0.5253509", "0.52368724", "0.52080834", "0.52019393", "0.5175557", "0.51753914", "0.51625717", "0.5160738", "0.5156351", "0.5151937", "0.5151937", "0.5151937", "0.5134956", "0.512785", "0.51233965", "0.5117146", "0.51091427", "0.5105244", "0.5103355", "0.50770724", "0.50588447", "0.50583935", "0.50406545", "0.5035305", "0.50338006", "0.5027294", "0.50093997", "0.50071216", "0.5004332", "0.4996041", "0.49893966", "0.4987011", "0.4969105", "0.4966857", "0.49435976", "0.49288222", "0.49214512", "0.49133697", "0.49109635", "0.49041903", "0.48883143", "0.4881944", "0.48758274", "0.4868077", "0.48661876", "0.48641613", "0.48456582", "0.4835137", "0.48311988", "0.48286316", "0.48230612", "0.48178756", "0.48150793", "0.48136893", "0.48105177", "0.4808456", "0.48083705", "0.4807967", "0.48050684", "0.48004586", "0.47978526", "0.47978526", "0.4794094", "0.47862157", "0.47802505", "0.47773588", "0.47743142", "0.47683448", "0.47517446", "0.47510308", "0.4750758", "0.47496188", "0.47481167", "0.47480124", "0.47466907", "0.47454178", "0.47367346", "0.47365937", "0.47326434" ]
0.7747347
0
GET /profiles/1 GET /profiles/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_default_profile \n get(\"/profiles.json/default\")\nend", "def my_profiles\n @user = User.find(params[:user_id])\n @profiles = @user.profiles\n end", "def show\n profile = Profile.find(params[:id])\n render status: 200, json: profile\n end", "def index\n authorize Profile\n @profiles = ProfilePolicy::Scope.new(current_user, @user.profiles).resolve\n render json: @profiles\n end", "def profiles \n personid = params[:id]\n @response = JSON.parse(current_user.access_token.token.get('/api/v0/aspects/profiles?ids=['+params[:id]+']'))\n respond_to do |format|\n format.html\n format.json {render :json=> @response, :callback=>params[:callback]}#{render json: @response}\n end\n end", "def index\n @profiles = Profile.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @profiles }\n end\n end", "def profile\n check_auth :profile\n \n response = connection.post do |req|\n req.url '/user/profile'\n req.body = { :format => @format }\n end\n response.body[0]\n end", "def show\n @profile = @user.profile\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end", "def show\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end", "def show\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end", "def show\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end", "def index\n @profiles = current_user.profiles\n end", "def index\n @profiles = current_user.profiles\n end", "def index\n @profiles = Profile.all\n @profile = Profile.find_by_id(params[:profile_id])\n end", "def profile(user_id: '-')\n return get(\"#{API_URI}/#{PROFILE_API_VERSION}/user/#{user_id}/profile.json\")\n end", "def index\n @profiles = Profile.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @profiles }\n end\n end", "def get_profile_configuration(args = {}) \n get(\"/profiles.json/#{args[:profileId]}/configuration\", args)\nend", "def retrieve_profile(id, content_type)\n call(:get, path(\"#{id}/profiles/#{content_type}/\"))\n end", "def show\n @profile = current_user.profile\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end", "def profile(profile_name:)\n claim_url = \"#{@@profile_service_url}/profile/#{profile_name}/next\"\n response = Faraday.get claim_url\n profile = JSON.parse(response.body)\n raise \"No profile available for #{profile_name}\" unless profile\n profile\n end", "def show\n @profile = Profile.find(params[:id])\n render json: @profile.to_json(include_hash)\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end", "def index\n @profiles = Profile.all.paginate :page => params[:page], :per_page => 3\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @profiles }\n end\n end", "def show\n @user_profile = UserProfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_profile }\n end\n end", "def profile\n p @user.as_json\n render json: @user.as_json\n end", "def index\n @profiles = Profile.all\n @original_niche = get_subscriber_details(@profiles, \"niche\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @profiles }\n end\n end", "def show\n\t\t# begin\n\t\t\tprofile = Profile.find(params[:id])\n\t @conversation = current_profile.find_conversation(profile)\n\t respond_to do |format|\n\t format.html {render \"profiles/#{profile._type.underscore}_show\"}\n\t format.json { render :json => @profile }\n\t end\n\t\t# rescue => error\n\t\t# \trender \"profiles/not_found\"\n\t\t# \tputs error.message\n\t\t# end\n end", "def get_profile\n path = self.api_root + '/register/profile'\n process_firecloud_request(:get, path)\n end", "def profile; Profile.get(self.profile_id); end", "def get_profile\n \n profil =\n Excon.get(\n 'https://eastus.api.cognitive.microsoft.com/speaker/identification/v2.0/text-independent/profiles',\n headers: {\n 'Content-Type' => 'application/json',\n 'Ocp-Apim-Subscription-Key' => \"3c43bca9ad884fe39518a5cf3925e707\"\n },\n body: JSON.generate(\"locale\": 'en-us')\n )\n return profil.body\n parsed = JSON.parse(profil.body)\n return parsed['profiles']\n rescue Excon::Error => e\n puts \"Error: #{e}\"\n\n end", "def profiles\n collection(\"profiles\", paged: true)\n end", "def profile\n raw = client.get @json['user']['links']['self']\n client.factory.create(GoodData::Profile, raw)\n end", "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @user_profiles }\n end\n end", "def show\n @profile = Profile.find(params[:id])\n end", "def show\n @profile = Profile.find(params[:id])\n end", "def show\n @profile = Profile.find(params[:id])\n end", "def show\n @profile = Profile.find(params[:id])\n end", "def show\n @profile = Profile.find(params[:id])\n end", "def show\n @profile = Profile.find(params[:id])\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def show\n @profile = Profile.find(params[:id])\n @checkin = CheckIn.find_last_by_user_id(@profile.user_id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end", "def show\n @profile = Profile.find(params[:id])\n @checkin = CheckIn.find_last_by_user_id(@profile.user_id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end", "def show\n @profile = current_user.profile\n\n # ToDo: error message if no profile is found for user\n\n puts 'Got profile='\n pp @profile\n \n\n puts 'got other_names='\n pp @profile.other_names\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @profile }\n format.json { render :json => @profile }\n end\n \n end", "def details\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n format.html # details.html.erb\n format.json { render json: @profile }\n end\n end", "def index\n @profiles = Profile.all\n\n end", "def index\n @profiles = current_user\n end", "def index \n @profiles = Profile.all\n end", "def profile\n @oneuser = User.find_by(username: params[:username]) \n profile = user_profile(@oneuser.id, @oneuser.username, @oneuser.email, @oneuser.first_name, @oneuser.last_name, @oneuser.avatar_img, @oneuser.created_at) \n render json: profile\n end", "def show\n @private_profile = PrivateProfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @private_profile }\n end\n end", "def user_profile(id)\n users(request(\"users/profile/#{id}.xml\", :auth => true))\n end", "def index\r\n @profiles = Profile.all\r\n end", "def index\r\n @profiles = Profile.all\r\n end", "def index\n @profiles = Profile.all\n end", "def users_profile\n @usersProfile = User.find(params[:id]).to_json(:include => :user_connections)\n render json: { data: @usersProfile }\n end", "def find_profile\n\t\t# Find particular Profile \n\t\t@profile = Profile.where(id:params[:id])[0]\n\t\trender json: {success: false, message: 'Invalid Profile ID !'}, status: 400 if @profile.nil?\n\tend", "def profile\n @profile ||= GATEWAY.get_profile_details(self.profile_id) unless profile_id.nil?\n end", "def get_profile\n begin\n client.profile(fields: PROFILE_FIELDS)\n rescue Exception => e\n logger.error \"Linkedin #get_profile error #{e}\"\n end\n end", "def profile\n render_json 0,\"ok\",current_member.as_profile\n end", "def show\n @profiles = @grab.profiles\n end", "def show_current\n user = current_user\n profile = Profile.find_by user_id: user.id\n\n render json: profile\n end", "def profile\n if object = send(:\"current_#{resource_name}\")\n self.resource = resource_class.to_adapter.get!(object.to_key)\n respond_with self.resource\n else\n render json: '', status: 404\n end\n end", "def get_profile_information\n # body = {\n # cmd: \"get_profile_information\"\n # }\n\n end", "def getUserProfile(uid)\r\n uri = sprintf(\"/api/v1/users/%d/profile\",uid)\r\n dbg(uri)\r\n profile = $canvas.get(uri)\r\n return profile\r\nend", "def getUserProfile(uid)\r\n uri = sprintf(\"/api/v1/users/%d/profile\",uid)\r\n dbg(uri)\r\n profile = $canvas.get(uri)\r\n return profile\r\nend", "def show\n \t@profile = Profile.where(profile_name: params[:id]).first\n end", "def profile\n service_response = UserManagement::ProfileDetail.new(params).perform\n render_api_response(service_response)\n end", "def profile(profile_id, fields: nil)\n check_not_empty profile_id, 'profile_id'\n params = build_fields_params fields\n res = @connection.get profile_path(profile_id), params\n Profile.new res.body, self\n end", "def profile\n @user = UserService.getUserById(params[:id])\n end", "def profile\n # (1) the request go into the headers and grab the key authorization and give us the value back (this's the token our server gave us originally)\n # the server only knows about the system\n # byebug/\n token = request.headers[\"Authorization\"]\n # what makes it secure? only the server knows about the secret 'pegasuscode'; the data is encoded using this secret, only server knows it so when server gets the information back, it must be the same information server encoded using the secret. Otherwise, it will break.\n # server uses the secret to encode and decode information\n decoded_token = JWT.decode(token, 'pegasuscode', true, { algorithm: 'HS256' })\n\n user_id = decoded_token[0][\"user_id\"] # user id\n\n user = User.find(user_id)\n\n # get the user back\n render json: user\n end", "def profiles(fields: nil)\n params = build_fields_params fields\n res = @connection.get profile_path, params\n map_as_collection res, Profile\n end", "def index\n @skill_user_profiles = SkillUserProfile.all\n\n render json: @skill_user_profiles\n end", "def get_user_detail\n user_id = params[:id]\n user = User.find(user_id)\n\n render json: UserSerializer.new(user).profile_detail_hash\n end", "def index\n @github_profiles = GithubProfile.all\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @user_profile }\n end\n end", "def show\n @providers = @profile.providers_data\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @profile }\n end\n end", "def show\n @profile = @user.profile\n end", "def get_profile\n\n # Auth\n token = auth\n\n # Get Client info based on fields provided\n client = LinkedIn::Client.new(API_KEY, API_SECRET, token)\n client.profile(:fields => @profile_fields)\n end", "def get_profile\n self.class.get '/members/private', @options\n end", "def profile\n @user = User.find(params[:id])\n end", "def show\n @profile_attribute = current_user.profile_attributes.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @profile_attribute }\n format.json { render :json => @profile_attribute }\n end\n end", "def profile_url\n @json['profile']['url'] rescue nil\n end", "def user\n\n \n @profile = Profile.find_by_user_id(params[:id])\n\n\nend", "def profile\n\n end", "def show\n @profile = Profile.find(params[:id]) || current_user.profile\n end", "def profile\n \t@user = UsersService.findUserById(params[:id])\n end", "def index\n @profiles = Profile.all\n respond_to do |format|\n format.html\n format.json do\n @profiles = Profile.near(\n [\n current_user.profile.latitude,\n current_user.profile.longitude\n ], params[:radius]\n ).distinct\n @profiles = @profiles.where.not(id: current_user.profile.id)\n @profiles = @profiles.min_age(params[:min_age]) if params[:min_age].present?\n @profiles = @profiles.max_age(params[:max_age]) if params[:max_age].present?\n @profiles = @profiles.by_gender(params[:gender]) if params[:gender].present?\n @profiles = @profiles.by_activity(params[:activity])\n\n render json: @profiles.map{|profile| profile.attributes.merge(image: profile.image.url(:medium))}\n end\n end\n end" ]
[ "0.7775192", "0.749174", "0.7487005", "0.7365681", "0.73053837", "0.730274", "0.7301948", "0.72442514", "0.72312385", "0.72312385", "0.72312385", "0.7217105", "0.7217105", "0.71651936", "0.71406406", "0.71140933", "0.707894", "0.7045284", "0.701664", "0.69901544", "0.6978521", "0.6962739", "0.69494796", "0.694837", "0.69436747", "0.6939894", "0.6938486", "0.6930165", "0.68933207", "0.68899614", "0.6877104", "0.6876668", "0.68707955", "0.68064415", "0.68064415", "0.68064415", "0.68064415", "0.68064415", "0.68064415", "0.6799769", "0.6799769", "0.6799769", "0.6799769", "0.6799769", "0.6799769", "0.6799769", "0.6799769", "0.6799769", "0.6799769", "0.6799769", "0.6799769", "0.6799769", "0.6799769", "0.6799769", "0.6799769", "0.6792336", "0.6792336", "0.6784594", "0.67775995", "0.67466736", "0.67327726", "0.6731769", "0.6725357", "0.67211384", "0.6711643", "0.670597", "0.670597", "0.6693201", "0.66872925", "0.6683526", "0.6673759", "0.6670222", "0.6668304", "0.66665876", "0.66657776", "0.6663294", "0.66614413", "0.6659211", "0.6659211", "0.66287506", "0.6614315", "0.66118926", "0.65992856", "0.6598246", "0.65974706", "0.6585762", "0.6561011", "0.65553385", "0.6548105", "0.65348506", "0.6530548", "0.6510188", "0.6507686", "0.64951384", "0.6482705", "0.6478008", "0.6470358", "0.6458661", "0.6458303", "0.6448591", "0.64452636" ]
0.0
-1
PATCH/PUT /profiles/1 PATCH/PUT /profiles/1.json
def update respond_to do |format| if @profile.update(profile_params) format.html { redirect_to [@stakeholder, @profile], notice: 'Profile was successfully updated.' } format.json { render :show, status: :ok, location: [@stakeholder, @profile] } else format.html { render :edit } format.json { render json: @profile.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @profiles = current_user.profiles.find(params[:id])\n\n respond_to do |format|\n if @profiles.update(profile_params)\n format.html { redirect_to profiles_path, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profiles }\n else\n format.html { render :edit }\n format.json { render json: @profiles.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @profile = Profile.find(params[:id])\n logger.debug(\"UPDATE PROFILE @profile = #{@profile.inspect}\")\n logger.debug(\"UPDATE PROFILE params = #{params[:profile].inspect}\")\n logger.debug(\"UPDATE PROFILE update_attributes #{@profile.update_attributes(params[:profile]).inspect}\")\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @profile.update(profile_params)\n respond_with(@profile)\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to edit_profile_path(current_user.profile), notice: t('controller.profiles.update.success') }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to vanity_profile_path(:id => @profile.user.name), notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @profile = current_user.profile\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to @profile, :notice => 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to user_path, notice: 'Profile was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_profile(body={})\n perform_post(\"/account/update_profile.json\", :body => body)\nend", "def update\n if user_signed_in?\n if @profile.update(profile_params)\n render json: @profile, status: :ok\n else\n render json: @profile.errors, status: :unprocessable_entity\n end\n end\n end", "def update\n @profile = Profile.find(current_user.id)\n @profile.update_attributes(params[:profile])\n respond_with @profile\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n Rails.logger.info(\"PARAMS: #{profile_params}\")\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @profile = current_user.profile\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to (user_profile_path(current_user)), notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n #format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n #format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to root_url, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n #@profile = UsersDisciplines.find(params[:id])\n @profile = Profile.find_by_user_id(current_user.id)\n \n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to users_profile_index_path, notice: t(:profile_successfully_updated) }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to root_path, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n new_properties = params[:d]\n profile = Profile[params[:id]]\n profile.update_with(new_properties)\n\n respond_with(profile) do |format|\n format.json { render json: profile.stripped }\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to '/', notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to edit_profile_path(), notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html do\n redirect_to @profile,\n notice: \"Profile was successfully updated.\"\n end\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json do\n render json: @profile.errors,\n status: :unprocessable_entity\n end\n end\n end\n end", "def update\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n if @profile.update_attributes(profile_attributes)\n format.html { redirect_to root_path, notice: 'Анкета успешно обновлена.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\r\n params = profile_params\r\n params.delete(\"id\")\r\n params.delete(\"user\")\r\n respond_to do |format|\r\n if @profile.update(params)\r\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\r\n format.json { render :show, status: :ok, location: @profile }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @profile.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n current_user.admin? ? true : params[:profile][:id] = current_user.id\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n current_user.admin? ? true : params[:profile][:id] = current_user.id\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\r\n respond_to do |format|\r\n if @profile.update(profile_params)\r\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\r\n format.json { render :show, status: :ok, location: @profile }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @profile.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n good_change(format, :ok)\n else\n bad_change(format, :edit)\n end\n end\n end", "def update\n @profile = @user.profile \n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = t('profiles.new.success')\n format.html { redirect_to(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def assign_default_profile(args = {}) \n put(\"/profiles.json/#{args[:profileId]}/default\", args)\nend", "def update_profile! (data = {})\n check_auth :update\n \n response = connection.put do |req|\n req.url '/user/update'\n req.body = { :format => @format }.merge(data)\n end\n response\n end", "def update\n @profile = @user.profile\n @profile.update_attributes(params[:profile])\n if params[\"starting\"] == \"pending\"\n @profile.started_on = nil\n @profile.target_completion_date = nil\n end\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to user_profile_path, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update_attributes profile_params\n format.html { redirect_to(@profile, notice: 'Profile was successfully updated.') }\n format.xml { head :ok }\n else\n @original_profile = Profile.find(@profile.id)\n format.html { render action: \"edit\" }\n format.xml { render xml: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\t\t@user = current_user\n\t\t@profile = @user.profile\n\t\[email protected]_columns(profile_params)\n\t\trespond_with @profile \n\tend", "def update\n respond_to do |format|\n if @profile.update(pro_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n # This must be update_attributes, to do validations\n if @profile.update(profile_params)\n format.html { redirect_to profile_home_path(@profile.site_identifier), notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @profile = Profile.find_by_user_id(current_user.id)\n authorize! :update, @profile\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update_attributes(profile_params)\n format.html {\n flash[:notice] = t('Profile was successfully update.')\n redirect_to home_path\n }\n format.json { render json: {ok: true}, status: :ok }\n else\n format.html { redirect_to profile_edit_url, notice: t('Profile not saved !') }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n @profile.photo.data.blank? ? @profile.photo.update_attributes(photo_type: 2) : @profile.photo.update_attributes(photo_type: 1)\n\n current_user.user_tries.last.state_machine.transition_to(:pending)\n format.html { redirect_to root_path, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = 'Profile was successfully updated.'\n format.html { redirect_to profile_path(@profile.user_id) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n \n # Get photos directly from the params and save them to the database one by one\n if params[:profile][:photos]\n params[:profile][:photos].each { |photo|\n ProfilePhoto.create(profile: @profile, photo: photo)\n }\n end\n \n format.html { redirect_to @profile, notice: 'profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def clear_default_profile \n put(\"/profiles.json/default/clear\")\nend", "def update\n # FIXME There's probably a better way to manage STI.\n profile_params = (@profile.type == DeveloperProfile.to_s ? params[:developer_profile] : params[:contractor_profile])\n profile_params[:project_type_ids] ||= []\n\n respond_to do |format|\n if @profile.update_attributes(profile_params)\n format.html { redirect_to(profile_path(@profile), :notice => 'Profile was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update_profile(params)\n post 'account/update_profile', :post => params\n end", "def update_profile(params)\n post('/account/update_profile.json', params)\n end", "def update\n respond_to do |format|\n if @profile.update_attributes params[:profile]\n @profile.user.index!\n format.html { redirect_to get_stored_location, :notice => t('profile.profile_updated') }\n else\n format.html { render :action => :edit }\n end\n end\n end", "def update\n @profile = current_user.profile\n respond_to do |format|\n if @profile\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to(@profile, :notice => 'Profile was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n else\n format.html { render :text => \"You currently do not have a profile.\" }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to profile_path, notice: \"Book was successfully updated.\" }\n format.json { render profile_path, status: :ok, location: @profile }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @personal_profile.update(personal_profile_params)\n format.html { redirect_to resume_path, notice: 'Your Personal profile was successfully updated.' }\n format.json { render :show, status: :ok, location: resume_path }\n else\n format.html { render :edit }\n format.json { render json: @personal_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @user_profile = UserProfile.find(params[:id])\n\n respond_to do |format|\n if @user_profile.update_attributes(params[:user_profile])\n format.html { redirect_to @user_profile, notice: 'User profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @user_profile = UserProfile.find(params[:id])\n\n respond_to do |format|\n if @user_profile.update_attributes(params[:user_profile])\n format.html { redirect_to @user_profile, notice: 'User profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Din profil uppdaterades!' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = 'Profile was successfully updated.'\n format.html { redirect_to(@profile) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n # render :text => \"<pre>#{params.to_yaml}</pre>\" and return\n @profile = Profile.find(params[:id])\n # @profile = Profile.find_or_create_by_user_id(@user.id)\n unless params.empty?\n @profile.update_attributes(params[:profile])\n @profile.user.update_attributes(params[:user])\n end\n respond_to do |format|\n if @profile.errors.empty? && @profile.user.errors.empty?\n flash[:notice] = 'Profile was successfully updated.'\n format.html { redirect_to(@profile) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors + @profile.user.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n authorize @profile\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to quit_user_profile_path , notice: \"Profile: #{I18n.t('helpers.saved')}\" }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @profile = Profile.find(params[:id])\n @profile.user_id = current_user.id\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = 'Profile was successfully updated.'\n format.html { redirect_to(show_user_path(current_user.username)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update_profile(body)\n post(\"user/#{user_id}/profile.json\", body)\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n format.js\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @profile = current_user.profile\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = \"Ваш профиль успешно обновлён\"\n format.html { redirect_to(profile_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @profile = Profile.find(params[:id])\n\t\t\n\t\t# Check to see if this user matches the profile, if not don't let them do anything\n\t\tif @profile.id != Profile.find_by_user_id(current_user.id).id\n \tredirect_to :permission_error\n end\n\t\t\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = 'Your profile was successfully updated'\n format.html { render action: 'edit', notice: 'Profile was successfully updated' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n # byebug\n if @profile.update(profile_params)\n format.html { redirect_to vendor_path(current_user.username), notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: t(\"controller.shared.flash.update.notice\", model: pick_model_from_locale(:profile)) }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n current_user.profile.update_attributes(profile_params)\n redirect_to '/profiles'\n end", "def update\n @profile_attribute = current_user.profile_attributes.find(params[:id])\n\n respond_to do |format|\n if @profile_attribute.update_attributes(params[:profile_attribute])\n format.html { redirect_to(@profile_attribute, :notice => 'Profile attribute was successfully updated.') }\n format.xml { head :ok }\n format.json { render :json => {:profile_attribute => @profile_attribute} }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile_attribute.errors, :status => :unprocessable_entity }\n format.json { render :json => {:error => @profile_attribute.errors.full_messages} }\n end\n end\n end", "def update_profile\n \t@user = User.find_by_id(params[:id])\n \tif @user.nil?\n render :json => {:message => \"User not exists\"}, :status => :not_acceptable\n else\n \tbegin\n\t @user.update_attributes(params[:user])\n\t @user.save!\n\t render :json => {:success => true, :message => \"User updated\", :user =>@user}, :status => :ok\n\t rescue Exception => e\n\t \tp e.backtrace\n\t render :json => {:success => false, :message => e.backtrace}, :status => :not_acceptable\n\t end\n end\n end", "def update\n respond_to do |format|\n if @client_profile.update(client_profile_params)\n format.json { render :show, status: :ok, location: @client_profile }\n else\n format.json { render json: @client_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :update, @profile\n respond_to do |format|\n if @user.update_attributes(params[:user].permit(:username)) && @profile.update_attributes(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n # puts \"profile_params: #{profile_params[:sport_ids]}\"\n\n respond_to do |format|\n begin\n if current_user != @profile.user\n performing_follow?\n @profile.user.toggle_followed_by(current_user)\n # the next two lines are all about the redirecting or the 'resheshing' of a page so that you can see the result of follow and unfollow without having to refresh.\n format.html { redirect_to @profile.user }\n format.json { render :show, status: :ok, location: @profile }\n end\n\n @profile.update(profile_params)\n # add skill objects and save to db\n # profile_params[:sport_ids].each do |sport_id|\n # Skill.create!(profile_id: @profile.user.id, sport_id: sport_id)\n # end\n format.html { redirect_to profile_url, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n rescue\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @profile = Profile.find_by_user_id(params[:user_id])\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = 'Profile was successfully updated.'\n format.html { redirect_to profile_url(@profile) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors.to_xml }\n end\n end\n end", "def update\n @profile = Profile.find(params[:id])\n @profile.update_attributes(profile_params)\n @profile = Profile.all\n respond_to do |page|\n page.js\n end\n end", "def update_profile(options = {}) \n # query profile info\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(URI_PROFILES, :params => { 'filter[name]' => options[:name] })\n if response.status.success?\n responseObj = JSON.parse(response.body)\n queried_profile_list = responseObj[\"data\"]\n if queried_profile_list.length() > 0\n profile = queried_profile_list[0]\n end\n else\n Asca::Tools::Log.error(response.body)\n return\n end\n \n if !profile\n Asca::Tools::Log.error(\"No profile named #{options[:name]} found\")\n return\n end\n # create new profile\n profile_type = profile[\"attributes\"][\"profileType\"]\n \n # get bundle id\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(profile[\"relationships\"][\"bundleId\"][\"links\"][\"self\"])\n bundle_id = JSON.parse(response.body)[\"data\"][\"id\"]\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(profile[\"relationships\"][\"certificates\"][\"links\"][\"self\"])\n certificate_ids = JSON.parse(response.body)[\"data\"].map { |cer| cer[\"id\"] }\n \n # get all device ids\n device_ids = Asca::REST::Provisioning::Devices.list_devices.map { |device|\n device[\"id\"]\n }\n \n # delete old prifile\n delete_profile :name => options[:name]\n \n if profile_type.include? 'APP_STORE'\n create_new_profile :name => options[:name], :type => profile_type, :bundle_id => bundle_id, :certificate_ids => certificate_ids\n else\n create_new_profile :name => options[:name], :type => profile_type, :bundle_id => bundle_id, :device_ids => device_ids, :certificate_ids => certificate_ids\n end\n \n return true\n end", "def update\n respond_to do |format|\n if @user_profile.update(user_profile_params)\n format.html { redirect_to @user_profile, notice: 'User profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_profile }\n else\n format.html { render :edit }\n format.json { render json: @user_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @user_profile.update(user_profile_params)\n format.html { redirect_to @user_profile, notice: 'User profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_profile }\n else\n format.html { render :edit }\n format.json { render json: @user_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @profile = Profile.find(params[:id])\n\n if @profile.update_attributes(params[:profile])\n redirect_to @profile, notice: 'Profile was successfully updated.'\n else\n render action: \"edit\"\n end\n end", "def update\n begin\n @profile.update!(metadata_profile_params)\n rescue => e\n render partial: \"shared/validation_messages\",\n locals: { object: @profile.errors.any? ? @profile : e },\n status: :bad_request\n else\n toast!(title: \"Profile updated\",\n message: \"The metadata profile \\\"#{@profile.name}\\\" has been \"\\\n \"updated.\")\n render \"shared/reload\"\n end\n end", "def update\n @profile = Profile.find(params[:id])\n work_name\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to(@profile, :notice => 'Profile ha sido modificado.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @user_profile.update(user_profile_params)\n format.html { redirect_to @user_profile, notice: \"User profile was successfully updated.\" }\n format.json { render :show, status: :ok, location: @user_profile }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @user_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @profile.update(req_params)\n redirect_to show_path, notice: 'Profile was successfully updated.'\n else\n respond_with_submission_error(@profile.errors.messages, edit_path)\n end\n end", "def create_or_update_profile_configuration(args = {}) \n id = args['profileId']\n temp_path = \"/profiles.json/{profileId}/configuration\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"profileId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend" ]
[ "0.7385554", "0.7121749", "0.7113102", "0.7096679", "0.7091465", "0.7091465", "0.7091465", "0.7076842", "0.707045", "0.7063198", "0.70600575", "0.7022012", "0.70120174", "0.699651", "0.6985236", "0.6985236", "0.6985236", "0.6985236", "0.6979028", "0.697453", "0.6968044", "0.6967269", "0.69600093", "0.6953779", "0.6948602", "0.6940231", "0.6940231", "0.6940231", "0.6940231", "0.6940231", "0.6940231", "0.6940231", "0.6940231", "0.6940231", "0.6940231", "0.6940231", "0.6940231", "0.6940231", "0.6940231", "0.6940231", "0.6928283", "0.692623", "0.6923915", "0.69152933", "0.69120854", "0.6905072", "0.6905072", "0.6870408", "0.6863119", "0.68528676", "0.68429637", "0.6834663", "0.682247", "0.68176895", "0.6814143", "0.680932", "0.68059534", "0.6783105", "0.6760196", "0.6758649", "0.6743165", "0.67362434", "0.67348063", "0.67336524", "0.67280525", "0.6714092", "0.6712624", "0.6702015", "0.6691855", "0.6672218", "0.6657492", "0.6657492", "0.665591", "0.6643084", "0.66245157", "0.6615003", "0.65870106", "0.65640306", "0.6560384", "0.6551966", "0.6543359", "0.6539523", "0.6537327", "0.6534612", "0.6533719", "0.6527972", "0.6524115", "0.65115166", "0.65014225", "0.6499302", "0.6497949", "0.64870906", "0.64701694", "0.64701694", "0.6459732", "0.6457896", "0.6442181", "0.6436961", "0.6430309", "0.6425514" ]
0.6652365
73
Use callbacks to share common setup or constraints between actions.
def set_profile @stakeholder = Stakeholder.find(params[:stakeholder_id]) @profile = @stakeholder.profile end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def profile_params params.require(:profile).permit(:logo, :banner, :website_url, :facebook_url, :youtube_url, :twitter_url, :instagram_url, :name, :email, :phone, :street, :city, :state, :zip, :about_us) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def valid_params_request?; end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def url_whitelist; end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def url_params\n params[:url].permit(:full)\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.6979893", "0.6781746", "0.6746611", "0.6742344", "0.6735229", "0.6592651", "0.65027124", "0.6498011", "0.648163", "0.647716", "0.64556813", "0.64386255", "0.63784456", "0.63756156", "0.636574", "0.6319542", "0.63004524", "0.6299559", "0.62925464", "0.62923217", "0.6289894", "0.6289475", "0.62831545", "0.6242381", "0.6240358", "0.6217451", "0.6214354", "0.62098235", "0.61918235", "0.6177287", "0.61755854", "0.61712915", "0.61620486", "0.6151379", "0.61510575", "0.6145169", "0.61207956", "0.6115647", "0.6107701", "0.61030304", "0.60909295", "0.60797", "0.60701567", "0.6062068", "0.60203075", "0.60167485", "0.60125494", "0.6009718", "0.6007027", "0.6007027", "0.6000283", "0.59990394", "0.5996995", "0.59915864", "0.59914654", "0.59912056", "0.5979621", "0.596686", "0.5959418", "0.59585625", "0.59583765", "0.5958032", "0.5952298", "0.5951678", "0.5941885", "0.59378815", "0.59376645", "0.59376645", "0.5933908", "0.59302104", "0.5924862", "0.5923981", "0.59165645", "0.5909916", "0.590986", "0.5908378", "0.5904956", "0.5897421", "0.58970135", "0.5894611", "0.5893914", "0.58927566", "0.5891277", "0.5885355", "0.58825094", "0.58783555", "0.58728755", "0.58686864", "0.5867015", "0.58660764", "0.58659357", "0.5864526", "0.58634263", "0.5861585", "0.5861255", "0.5858771", "0.58579147", "0.5854071", "0.5853147", "0.58498794", "0.58492327" ]
0.0
-1
belongs_to :dependent => :destroy does not work yet. Rails ticket 1079. Workaround method for now.
def after_destroy # Check to see if other notes still reference the article. If not, the destroy the article, too. if self.article.nil? return end if !Note.find(:first, :conditions => {:article_id => self.article_id}) art = Article.find(self.article_id) if !art.nil? art.destroy end end SyncLog.note_destroy(self.graph.id, self.id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_from(associated_model)\n self.send(associated_model.class.to_s.foreign_key + '=', nil)\n save(false)\n end", "def save_belongs_to_association(reflection)\n association = association_instance_get(reflection.name)\n record = association && association.load_target\n if record && !record.destroyed?\n autosave = reflection.options[:autosave]\n\n if autosave && record.marked_for_destruction?\n self[reflection.foreign_key] = nil\n record.destroy\n elsif autosave != false\n saved = record.save(:validate => !autosave) if record.new_record? || (autosave && record.changed_for_autosave?)\n\n if association.updated?\n # CPK: Use the existing function to set the key\n #association_id = record.send(reflection.options[:primary_key] || :id)\n #self[reflection.foreign_key] = association_id\n association.send(:replace_keys, record)\n association.loaded!\n end\n\n saved if autosave\n end\n end\n end", "def test_destroy_dependents\n # Establish dependent relationship between Person and PersonalLegacyThing\n add_counter_column_to(Person, \"personal_legacy_things_count\")\n PersonalLegacyThing.reset_column_information\n\n # Make sure that counter incrementing doesn't cause problems\n p1 = Person.new(first_name: \"fjord\")\n p1.save!\n t = PersonalLegacyThing.new(person: p1)\n t.save!\n p1.reload\n assert_equal 1, p1.personal_legacy_things_count\n assert p1.destroy\n assert_equal true, p1.frozen?\n assert_raises(ActiveRecord::RecordNotFound) { Person.find(p1.id) }\n assert_raises(ActiveRecord::RecordNotFound) { PersonalLegacyThing.find(t.id) }\n ensure\n remove_counter_column_from(Person, \"personal_legacy_things_count\")\n PersonalLegacyThing.reset_column_information\n end", "def after_destroy\n super\n touch_associations\n end", "def destroy\n ret_val = error_if_exists('destroy')\n # Rails.logger.debug (\"* Models::Deactivated.destroy - destroy error check ret_val: #{ret_val}\")\n super if ret_val\n return ret_val\n rescue ActiveRecord::InvalidForeignKey => e\n if errors\n errors.add(:base, I18n.translate('errors.error_dependencies' ) )\n end\n end", "def delete(object)\n object.send(:\"#{@foreign_key}=\", nil)\n object.save\n super\n end", "def save_belongs_to_association(reflection)\n association = association_instance_get(reflection.name)\n record = association && association.load_target\n if record && !record.destroyed?\n autosave = reflection.options[:autosave]\n\n if autosave && record.marked_for_destruction?\n self[reflection.foreign_key] = nil\n record.destroy\n elsif autosave != false\n saved = record.save(:validate => !autosave) if record.new_record? || (autosave && record.changed_for_autosave?)\n\n if association.updated?\n # it will fail to use \"#record.send(reflection.options[:primary_key] || :id)\" for CPK\n association_id = record.read_attribute(reflection.options[:primary_key] || :id)\n self[reflection.foreign_key] = association_id\n association.loaded!\n end\n\n saved if autosave\n end\n end\n end", "def handle_belongs_to(model, associated)\n __method = __method__\n # trace __FILE__, __LINE__, self, __method__, \" : model.class=#{model.class} associated=#{associated.class} has?=#{has?}\"\n associated = [associated] unless associated.is_a?(Array)\n # trace __FILE__, __LINE__, self, __method__, \" : associated.size=#{associated.size}\"\n if has?\n associated.each do |associate|\n # trace __FILE__, __LINE__, self, __method, \" : model.class=#{model.class} associate=#{associate.class}\"\n inverse = associate.class.belongs_to_association(collection)\n # trace __FILE__, __LINE__, self, __method, \" : model.class=#{model.class} associate=#{associate.class}\"\n if inverse\n # trace __FILE__, __LINE__, self, __method, \" : setting inverse associate.class##{inverse.local_attr} to #{model.class}\"\n associate.send(:\"#{inverse.local_attr}=\", model)\n # trace __FILE__, __LINE__, self, __method\n end\n end\n end\n end", "def remove_references_before_destroy\n return if self.id.nil?\n\n substitute = User.anonymous\n Attachment.update_all ['author_id = ?', substitute.id], ['author_id = ?', id]\n Comment.update_all ['author_id = ?', substitute.id], ['author_id = ?', id]\n Issue.update_all ['author_id = ?', substitute.id], ['author_id = ?', id]\n Issue.update_all 'assigned_to_id = NULL', ['assigned_to_id = ?', id]\n Journal.update_all ['user_id = ?', substitute.id], ['user_id = ?', id]\n JournalDetail.update_all ['old_value = ?', substitute.id.to_s], [\"property = 'attr' AND prop_key = 'assigned_to_id' AND old_value = ?\", id.to_s]\n JournalDetail.update_all ['value = ?', substitute.id.to_s], [\"property = 'attr' AND prop_key = 'assigned_to_id' AND value = ?\", id.to_s]\n Message.update_all ['author_id = ?', substitute.id], ['author_id = ?', id]\n News.update_all ['author_id = ?', substitute.id], ['author_id = ?', id]\n # Remove private queries and keep public ones\n Query.delete_all ['user_id = ? AND is_public = ?', id, false]\n Query.update_all ['user_id = ?', substitute.id], ['user_id = ?', id]\n TimeEntry.update_all ['user_id = ?', substitute.id], ['user_id = ?', id]\n Token.delete_all ['user_id = ?', id]\n Watcher.delete_all ['user_id = ?', id]\n WikiContent.update_all ['author_id = ?', substitute.id], ['author_id = ?', id]\n WikiContent::Version.update_all ['author_id = ?', substitute.id], ['author_id = ?', id]\n end", "def delete\n self.class.db.delete_with_id(self.class.collection_name, id).to_promise_then do\n @deleted = true\n if cache && !cache.includes?(self.class, id)\n msg = \"#{__FILE__}[#{__LINE__}] : #{self.class.name} : expected model with id #{id} to be in cache - cannot delete\"\n Robe.logger.error(msg)\n raise DBError, msg\n end\n cache.delete(self) if cache\n results = []\n self.class.has_one_associations.each do |assoc|\n if assoc.owner\n send(assoc.local_attr).to_promise_then do |one|\n results << one.delete\n end\n end\n end\n results.to_promise_when\n end.to_promise_then do\n results = []\n self.class.has_many_associations.each do |assoc|\n if assoc.owner\n assoc_results = []\n results << send(assoc.local_attr).to_promise.to_promise_then do |many|\n many.each do |one|\n # trace __FILE__, __LINE__, self, __method__, \" deleting associated : #{one}\"\n assoc_results << one.delete\n end\n assoc_results.to_promise_when_on_client\n end\n end\n end\n results.to_promise_when.then do\n self\n end\n end\n end", "def before_destroy; raise ActiveRecord::ReadOnlyRecord; end", "def destroy\n @dependent_representative = DependentRepresentative.find(params[:id])\n @dependent_representative.destroy\n\n respond_to do |format|\n format.html { redirect_to(dependent_representatives_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @model_association = ModelAssociation.find(params[:id])\n @primary_model_id = @model_association.primary_model_id\n @model_association.destroy\n\n respond_to do |format|\n format.html { redirect_to new_model_association_path(:primary_model_id => @primary_model_id), notice: 'You just destroyed a model association! Not feeling too social today, are we?' }\n format.json { head :ok }\n end\n end", "def delete_relation_for association\n @relations.reject!{ |r| r.association == association || r.association == association.singularize}\n end", "def removing_plan_relation(transaction, parent, child, relations); end", "def belongs_to_with_foreign_key_migrations(*args)\n options = args.extract_options!\n options[:references] = nil if options[:polymorphic]\n belongs_to_without_foreign_key_migrations(*args.push(options))\n end", "def belongs_to_with_foreign_key_migrations(*args)\n options = args.extract_options!\n options[:references] = nil if options[:polymorphic]\n belongs_to_without_foreign_key_migrations(*args.push(options))\n end", "def destroy(options = {})\n call_hooks 'destroy' do\n options = options.dup\n options[:omit_model_identifiers] ||= {}\n options[:omit_model_identifiers][model_identifier] = self\n self.class.association_columns.each do |name, col|\n delete_candidates = get_attr(name)\n Array(delete_candidates).each do |candidate|\n next if options[:omit_model_identifiers][candidate.model_identifier]\n if col.dependent == :destroy\n candidate.destroy(options)\n elsif col.dependent == :delete\n candidate.delete(options)\n end\n end\n end\n delete\n end\n self\n end", "def nullify\n target.send(metadata.foreign_key_setter, nil)\n target.send(:remove_instance_variable, \"@#{metadata.inverse(target)}\")\n base.send(:remove_instance_variable, \"@#{metadata.name}\")\n target.save\n end", "def test_relationship_deletion\n #This is a superwork work rel\n rel = Relationship.find(309)\n n_superwork_rels = SuperworkRelationship.count\n n_work_rels = WorkRelationship.count\n \n rel.destroy\n assert_raise ActiveRecord::RecordNotFound do\n rel.reload\n end\n \n #check dependent columns are deleted\n assert_equal n_superwork_rels-1, SuperworkRelationship.count\n assert_equal n_work_rels -1, WorkRelationship.count\n end", "def delete(obj)\n association.delete_target(obj)\n end", "def save_belongs_to_association(reflection)\n association = association_instance_get(reflection.name)\n return unless association && association.loaded? && !association.stale_target?\n\n record = association.load_target\n if record && !record.destroyed?\n autosave = reflection.options[:autosave]\n\n if autosave && record.marked_for_destruction?\n foreign_key = Array(reflection.foreign_key)\n foreign_key.each { |key| self[key] = nil }\n record.destroy\n elsif autosave != false\n saved = record.save(validate: !autosave) if record.new_record? || (autosave && record.changed_for_autosave?)\n\n if association.updated?\n primary_key = Array(compute_primary_key(reflection, record)).map(&:to_s)\n foreign_key = Array(reflection.foreign_key)\n\n primary_key_foreign_key_pairs = primary_key.zip(foreign_key)\n primary_key_foreign_key_pairs.each do |primary_key, foreign_key|\n association_id = record._read_attribute(primary_key)\n self[foreign_key] = association_id unless self[foreign_key] == association_id\n end\n association.loaded!\n end\n\n saved if autosave\n end\n end\n end", "def delete_record\n self.remote_attributes = self.class.identify(self).delete_instance if persisted?\n @destroyed = true\n end", "def destroy\n @dependent_relationship = DependentRelationship.find(params[:id])\n @dependent_relationship.destroy\n\n respond_to do |format|\n format.html { redirect_to dependent_relationships_url }\n format.json { head :no_content }\n end\n end", "def destroy\n run_callbacks :destroy do \n self.update_column(:deleted, true)\n end\n end", "def destroy\n run_callbacks :destroy do \n self.update_column(:deleted, true)\n end\n end", "def destroy\n run_callbacks :destroy do \n self.update_column(:deleted, true)\n end\n end", "def destroy\n @foreign_key.destroy\n respond_to do |format|\n format.html { redirect_to foreign_keys_url, notice: 'Foreign key was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def remove_relation\n relation_scope.where(@id_key => deleted_remote_objects_ids)\n end", "def destroy_associations\n end", "def destroy\n self.update_attribute :deleted, true\n end", "def fk_to_meth(fk)\n public_send(fk.remove(\"_id\"))\n end", "def test_foreign_key_violations_on_delete_are_translated_to_specific_exception\n insert_into_fk_test_has_fk fk_id: 1\n\n error = assert_raises(ActiveRecord::InvalidForeignKey) do\n @connection.execute \"DELETE FROM fk_test_has_pk WHERE pk_id = 1\"\n end\n\n assert_not_nil error.cause\n end", "def link_belongs_to(reflection)\n reflection.foreign_key.to_sym\n end", "def remove_before_destroy?\n true\n end", "def cascade!(document)\n return unless persistable?\n\n case _association.dependent\n when :delete_all\n document.delete\n when :destroy\n document.destroy\n else\n document.save\n end\n end", "def destroy_owner!\n\t\tif not ActiveRecord::Base.connection.table_exists? 'model_owners'\n\t\t\treturn\n\t\tend\n\t\towner = ModelOwner.where(:inki_model_name => self.class.table_name, :model_id => self.id).first\n\t\towner.delete if owner\n\tend", "def stores_foreign_key?; false; end", "def stores_foreign_key?; false; end", "def destroy(*records)\n if self.class.name == \"ActiveRecord::Associations::HasManyThroughAssociation\"\n through_association.load_target\n records.each do |record|\n through_records_for(record).each do |through_record|\n through_record.before_remove if through_record.respond_to? :before_remove\n end\n end\n end\n super(*records)\n end", "def remove_foreign_key(from_table, from_column, to_table)\n constraint_name = \"fk_#{from_table}_#{from_column}\"\n # check if constraint already exist\n count = ActiveRecord::Base.connection.select_value(\"select count(1) from pg_constraint where conname='#{constraint_name}'\")\n\n unless count.to_i == 0\n execute %{ALTER TABLE #{from_table} DROP CONSTRAINT #{constraint_name}}\n end\n end", "def cascade\n if relation\n if relation.is_a?(Enumerable)\n relation.entries\n relation.each { |doc| doc.destroy }\n else\n relation.destroy\n end\n end\n end", "def destroy\n run_callbacks :destroy do \n self.update_column(:deleted, true)\n end\n end", "def remove_associated_object(opts, o)\n raise(Sequel::Error, 'model object does not have a primary key') unless pk\n raise(Sequel::Error, 'associated object does not have a primary key') if opts.need_associated_primary_key? && !o.pk\n return if run_association_callbacks(opts, :before_remove, o) == false\n send(opts._remove_method, o)\n @associations[opts[:name]].delete_if{|x| o === x} if @associations.include?(opts[:name])\n remove_reciprocal_object(opts, o)\n run_association_callbacks(opts, :after_remove, o)\n o\n end", "def destroy_association?\n destroy_association.to_i == 1\n end", "def foreign_key\n association.foreign_key \n end", "def belongs_to?; false; end", "def delete( object )\n\n write_targets do |target|\n rel = rel_for_object( object )\n target.reject! { |l| l['rel'] == rel }\n end\n\n if (c = @klass.correlation_for( object )) && c.recipocal?\n if self.owner && object.respond_to?( :links )\n if object.links.recipocal?( self.owner )\n object.links.delete( self.owner )\n object.save unless object.new? || @recipocating\n end\n end\n end\n\n self.owner.save if self.owner && !self.owner.new? && !@recipocating\n\n self\n end", "def delete_layer(layer_name)\n @cascade.delete(layer_name)\n end", "def destroy\n @author.destroy\n rescue ActiveRecord::InvalidForeignKey\n render json: {\n error: 'Cannot delete Author with dependents'\n }, status: :unprocessable_entity\n end", "def destroy\n @through_reference = ThroughReference.find(params[:id])\n @through_reference.destroy\n\n respond_to do |format|\n format.html { redirect_to through_references_url }\n format.json { head :no_content }\n end\n end", "def macro\n :belongs_to_related\n end", "def test_xml_should_not_destroy_project_with_fk\n assert_no_difference('Project.count') do\n delete :destroy, :id => 1, :format => 'xml'\n end\n assert_response :ok\n assert_select \"errors:root>error\", ERRORS[:foreign_key_problem]\n end", "def before_destroy\n\n end", "def destroyed_by_association\n @destroyed_by_association\n end", "def remove_child child\n throw 'Removing self as child' if child == self\n\n if self.categoryChilds\n self.categoryChilds.all(target_id: child.id).destroy\n end\n\n if child.categoryParent\n if child.categoryParent.source_id == self.id\n child.categoryParent.destroy\n end\n end\n\n self.reload\n self\n end", "def disassociate_target(object)\n case target_class.associations[target_association][:type]\n when :has_one, :belongs_to\n object.update_attribute(target_attribute, nil)\n when :has_many, :has_and_belongs_to_many\n object.update_attribute(target_attribute, object.send(target_attribute) - Array(source.id))\n end\n end", "def destroy_model(model)\n log_destroy(model)\n model.destroy\n end", "def relation_destroy(kind = nil, sibling_id = nil)\n query = { :note_id => self.id }\n query[:kind] = kind if kind\n query[:sibling_id] = sibling_id if sibling_id\n Relation.destroy_all(query)\n end", "def test_following_belongs_to_when_nil_gives_nil\n Project.create()\n\n project = Project.find_version(1, 1)\n assert_nil project.main_use_case\n end", "def delete?\n id = association.klass.extract_id_field(attributes)\n destroyable? && !id.nil?\n end", "def before_destroy\n raise ActiveRecord::ReadOnlyRecord\n end", "def before_destroy\n raise ActiveRecord::ReadOnlyRecord\n end", "def remove_before_destroy?\n false\n end", "def delete(obj_or_pk, klass = nil, cascade = true)\n unless obj_or_pk.is_a? Model\n # create an instance to keep the og_delete\n # method as an instance method like the other lifecycle\n # methods. This even allows to call og_delete aspects\n # that use instance variable (for example, sophisticated\n # cache sweepers).\n #\n # gmosx: the following is not enough!\n # obj = klass.allocate\n # obj.pk = obj_or_pk\n obj = klass[obj_or_pk]\n obj.og_delete(self, cascade)\n else\n obj_or_pk.og_delete(self, cascade)\n end\n end", "def belongs_to(name, scope = nil, **options)\n # args << options.except(:null_object)\n # Call the real belongs_to so that the association gets defined.\n super(name, scope, **options.except(:null_object))\n\n # Modify the association if need be.\n if options[:null_object]\n add_null_object_support(name, options)\n end\n end", "def destroy\n return unless destroyable?\n super\n end", "def remove_inverse_instance(record)\n if inverse = inverse_association_for(record)\n inverse.inversed_from(nil)\n end\n end", "def destroy\n @independent = @member.independents.find(params[:id])\n @independent.destroy\n\n respond_to do |format|\n format.html { redirect_to(member_independents_url(@member)) }\n format.xml { head :ok }\n end\n end", "def destroy\n @belonging = Belonging.find(params[:id])\n @belonging.destroy\n\n respond_to do |format|\n format.html { redirect_to(belongings_url) }\n format.xml { head :ok }\n end\n end", "def after_soft_delete; end", "def perform_some_actions\n # It is to be called while destroying a Child record\n # But must not be called while destroying the parent record\n unless self.parent.destroyed?\n\n end\n end", "def test_override_apply_orphan_strategy\n AncestryTestDatabase.with_model orphan_strategy: :destroy do |model, roots|\n root = model.create!\n child = model.create!(:parent => root)\n model.class_eval do\n def apply_orphan_strategy\n # disabling destoy callback\n end\n end\n assert_difference 'model.count', -1 do\n root.destroy\n end\n # this should not throw an ActiveRecord::RecordNotFound exception\n assert child.reload.root_id == root.id\n end\n end", "def destroy\n run_callbacks :destroy do\n self.update_column(:deleted, true)\n end\n end", "def destroy\n run_callbacks :destroy do\n self.update_column(:deleted, true)\n end\n end", "def _delete_without_checking\n # SEQUEL5: Remove\n if use_prepared_statements_for?(:delete)\n _set_prepared_statement_server(model.send(:prepared_delete)).call(pk_hash)\n else\n super\n end\n end", "def preserve_has_one_associations_to(new_version)\n # Preserve simple has_one reflections\n self.class.reflections.select { |_, reflection|\n reflection.macro == :has_one\n }.each do |key, reflection|\n if !reflection.foreign_key.kind_of?(Array)\n new_version.send(\"#{key}=\", self.send(key))\n end\n end\n end", "def stores_foreign_key?; true; end", "def type\n :belongs_to\n end", "def _delete_without_checking\n if sql = (m = model).fast_instance_delete_sql\n sql = sql.dup\n ds = use_server(m.dataset)\n ds.literal_append(sql, pk)\n ds.with_sql_delete(sql)\n else\n _delete_dataset.delete \n end\n end", "def _delete_without_checking\n if sql = (m = model).fast_instance_delete_sql\n sql = sql.dup\n ds = use_server(m.dataset)\n ds.literal_append(sql, pk)\n ds.with_sql_delete(sql)\n else\n _delete_dataset.delete \n end\n end", "def og_delete(store, cascade = true)\n pk_field = self.class.primary_key\n pk_field = self.class.ann(pk_field, :field) || pk_field\n pk = instance_variable_get(\"@#{pk_field}\")\n\n transaction_raise do |tx|\n if cascade && descendants = self.class.ann(:self, :descendants)\n descendants.each do |descendant|\n case descendant\n when ManyToMany\n # delete all entries in the join table pointing to current obj\n tx.exec \"DELETE FROM #{descendant.join_table} WHERE #{descendant.owner_key}=#{store.quote(pk)}\"\n when BelongsTo\n # delete all objecs belonging to the current obj\n descendant.owner_class.find(:where => \"#{descendant.foreign_key} = #{store.quote(pk)}\", :extra_condition => nil).each {|x| x.delete }\n end\n end\n end\n # delete obj itself\n tx.exec \"DELETE FROM #{self.class.table} WHERE #{pk_field}=#{store.quote(pk)}\"\n end\n end", "def down\n remove_column :users, :company_id\n end", "def delete(object)\n key_name = attributes.key[0].name\n key_value = object.public_send(key_name)\n relation.delete(key_name => key_value)\n object\n end", "def remove_segment_association(segment)\r\n group_messages_segment = self.group_messages_segments.where(:segment_id => segment.id).first\r\n group_messages_segment.news_feed_link_segment.destroy\r\n end", "def destroy\n family = @child.family\n @child.destroy\n respond_to do |format|\n format.html { redirect_to family, notice: tr(\"child_deleted\") }\n end\n end", "def _delete_reference_to_id(id)\n @data.delete_if do |v|\n v && v.respond_to?(:is_poxreference?) && v.id == id\n end\n @store.cache.cache_write(self)\n end", "def belongs_to(table, options = {})\n options = options.merge(:references => table)\n options[:on_delete] = options.delete(:dependent) if options.has_key?(:dependent)\n column(\"#{table.to_s.singularize}_id\".to_sym, :integer, options)\n end", "def dependent\n Dependent.find_by(id: self.dependent_id)\n end", "def destroy\n assert_source_saved 'The source must be saved before mass-deleting the collection'\n super\n end", "def destroy\n assert_source_saved 'The source must be saved before mass-deleting the collection'\n super\n end", "def stop_delete\r\n if self.id && self.id < 11\r\n raise ActiveRecord::Rollback\r\n end\r\n end", "def test_belongs_to\n bimba = Car.create! :name => \"Bimba\", :kind => \"Compact\", :color => \"Yellow\"\n ferrari = Car.create! :kind => \"Sports\", :color => \"Yellow\"\n# yellow = CarColor.find_by_name \"Yellow\"\n# assert_equal 2, yellow.cars.size\n end", "def did_destroy\n @destroyed = true\n self.class.identity_map.delete self.id\n self.class.all.delete self\n\n trigger_events(:destroy)\n end", "def destroy\n @child_model = ChildModel.find(params[:id])\n @child_model.destroy\n\n respond_to do |format|\n format.html { redirect_to(child_models_url) }\n format.xml { head :ok }\n end\n end", "def remove_associated_object(opts, o, *args)\n klass = opts.associated_class\n if o.is_a?(Integer) || o.is_a?(String) || o.is_a?(Array)\n o = remove_check_existing_object_from_pk(opts, o, *args)\n elsif !o.is_a?(klass)\n raise(Sequel::Error, \"associated object #{o.inspect} not of correct type #{klass}\")\n elsif opts.remove_should_check_existing? && send(opts.dataset_method).where(o.pk_hash).empty?\n raise(Sequel::Error, \"associated object #{o.inspect} is not currently associated to #{inspect}\")\n end\n raise(Sequel::Error, \"model object #{inspect} does not have a primary key\") if opts.dataset_need_primary_key? && !pk\n raise(Sequel::Error, \"associated object #{o.inspect} does not have a primary key\") if opts.need_associated_primary_key? && !o.pk\n return if run_association_callbacks(opts, :before_remove, o) == false\n return if !send(opts._remove_method, o, *args) && opts.handle_silent_modification_failure?\n associations[opts[:name]].delete_if{|x| o === x} if associations.include?(opts[:name])\n remove_reciprocal_object(opts, o)\n run_association_callbacks(opts, :after_remove, o)\n o\n end", "def down\n add_column :cate_item_associations, :cate_item_id, :integer\n end", "def after_destroy\n super\n @destroyed = true\n end", "def destroy_if_isolated(target_count=0)\n if belongs_to_count == target_count\n destroy!\n end\n end", "def soft_deleting_work\n # be sure to clear plan_member_id\n self.plan_member.destroy if self.plan_member\n self.update_attribute(:deleted_at, Time.now)\n end", "def belongs_to(goal, options = { })\n self.foreign_keys[goal.foreign_key] = \"references\"\n self.validates(:presence_of, goal.foreign_key)\n self.associate(:belongs_to, goal, options)\n end" ]
[ "0.5809686", "0.5802263", "0.5767624", "0.57599175", "0.57586217", "0.57054025", "0.5661682", "0.5620454", "0.55914825", "0.55906016", "0.55398196", "0.5537824", "0.5488921", "0.54496455", "0.54417133", "0.54247713", "0.54247713", "0.5417846", "0.5413322", "0.5402081", "0.53744835", "0.5350342", "0.5337009", "0.53356445", "0.53260213", "0.53260213", "0.53260213", "0.53045887", "0.5299871", "0.52873063", "0.5275272", "0.52689874", "0.52513653", "0.5248014", "0.52446896", "0.5242584", "0.5230543", "0.52156794", "0.52156794", "0.5208687", "0.52046925", "0.51995456", "0.5183512", "0.51623064", "0.51566786", "0.51556623", "0.5153409", "0.5152251", "0.51463825", "0.51432747", "0.51413465", "0.51396215", "0.51241314", "0.5122771", "0.51160973", "0.51131785", "0.51113486", "0.50971556", "0.50958675", "0.5091594", "0.508737", "0.507332", "0.507332", "0.5072318", "0.50721633", "0.50635505", "0.50592136", "0.5051913", "0.5049971", "0.5047001", "0.50464535", "0.504403", "0.50331944", "0.5031077", "0.5031077", "0.50272423", "0.502333", "0.5020351", "0.50063765", "0.49994463", "0.49994463", "0.4999106", "0.49975777", "0.49952114", "0.4995033", "0.49912867", "0.49867585", "0.4980699", "0.4978673", "0.49769253", "0.49769253", "0.49709976", "0.4970753", "0.497018", "0.49693492", "0.49687514", "0.49651182", "0.49597326", "0.49576455", "0.49548936", "0.49485013" ]
0.0
-1
why two levels? because for now commandobjects don't point to anything but primitives
def dup_two_levels self.class.new @klass, self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def command(type)\n end", "def subcommands(cmd); end", "def subcommands(cmd); end", "def subcommands() __subcommands__ end", "def commands; end", "def set_commands; end", "def command; end", "def command; end", "def command; end", "def command; end", "def command; end", "def command; end", "def supercommand!() __supercommand__ end", "def commandChat _obj, _args\n \"_obj commandChat _args;\" \n end", "def commandFSM _obj, _args\n \"_obj commandFSM _args;\" \n end", "def subcommands!() __subcommands__! end", "def commands\n {\n }\n end", "def camCommand _obj, _args\n \"_obj camCommand _args;\" \n end", "def commandTarget _obj, _args\n \"_obj commandTarget _args;\" \n end", "def subcommands\n Properties[self.class] ||= {}\n return Properties[self.class][:subcmds] || []\n end", "def command_builder; end", "def commands\n self.class.commands\n end", "def __subcommands__()\n __subcommands__!.last&.__uid__&.to_sym\n end", "def commandFollow _obj, _args\n \"_obj commandFollow _args;\" \n end", "def subcommand() __subcommand__ end", "def __subcommands__!()\n ::Algorithm.follow(self.__subcommand__!, :__subcommand__!).to_a\n end", "def add_commands\n end", "def __subcommand__!() @__subcommand__ end", "def commands\n abstract!\n end", "def commandRadio _obj, _args\n \"_obj commandRadio _args;\" \n end", "def unknown_command(object, connection, command)\n\t\tobject\n\tend", "def cmd; end", "def subcommands\n @subcommands ||= []\n end", "def subcommands\n @subcommands ||= []\n end", "def assignAsCommander _obj, _args\n \"_obj assignAsCommander _args;\" \n end", "def commands\n\t\t{ }\n\tend", "def command_object\n @command_object ||= GitPusshuTen::Command.new(cli, configuration, hooks, environment)\n end", "def commands\n load_commands unless @commands\n @commands\n end", "def commandFire _obj, _args\n \"_obj commandFire _args;\" \n end", "def command_name; end", "def commands\n COMMANDS\n end", "def commands\n {}\n end", "def __subcommand__() @__subcommand__&.__ident__ end", "def set_commands\n ConsoleCommand::Properties.each do |cmd_class,data|\n next if data[:debug_only] && !$DEBUG\n next if data[:outside_game]\n next if (data[:session] || 'shell') != self.name\n next if data[:mkxp_only] && !$MKXP\n @commands[data[:name]] = cmd_class.new(self) unless data[:hidden]\n end \n end", "def commandMove _obj, _args\n \"_obj commandMove _args;\" \n end", "def subcommand!() __subcommand__! end", "def set_commands\n ConsoleCommand::Properties.each do |cmd_class,data|\n next if data[:debug_only] && !$DEBUG\n next if data[:in_game]\n next if (data[:session] || 'shell') != self.name\n next if data[:mkxp_only] && !$MKXP\n @commands[data[:name]] = cmd_class.new(self) unless data[:hidden]\n end \n end", "def add_original_commands; end", "def sendSimpleCommand _obj, _args\n \"_obj sendSimpleCommand _args;\" \n end", "def commands\n @commands ||=\n if superclass.respond_to? :commands\n superclass.commands.clone\n else\n {}\n end\n end", "def parent_command; end", "def command?(name)\n __getobj__.present?(name)\n end", "def commands\n raise NotImplementedError, \"`command' is not implemented by #{self.class.name}\"\n end", "def method_missing(method, *args, &block)\n commands.send(method, *args, &block)\n end", "def commands\n @commands ||= []\n end", "def add_main_commands\n add_command(Vocab::item, :item, main_commands_enabled)\n add_command(Vocab::skill, :skill, main_commands_enabled)\n add_command(Vocab::equip, :equip, main_commands_enabled)\n add_command(Vocab::status, :status, main_commands_enabled)\n end", "def commands\n self.class.command_classes\n end", "def command_factory\n end", "def composite_class\n Command::Composite\n end", "def cmdarg; end", "def cmdarg; end", "def cmdarg; end", "def set_commands\n super\n @commands['clear'] = ConsoleCommand_Clear.new(self)\n @commands['confirm'] = ConsoleCommand_Confirm.new(self)\n end", "def dev_commands args\n if args.inputs.keyboard.key_down.m || args.inputs.controller_one.key_down.a\n new_ball args\n end\n\n # commented out because breaks game (type = \"h\")\n # if args.inputs.keyboard.key_down.h || args.inputs.controller_one.key_down.b\n # heavy_ball args\n # end\n\n if args.inputs.keyboard.key_down.one || args.inputs.controller_one.key_down.x\n new_ball1 args\n end\n\n if args.inputs.keyboard.key_down.two || args.inputs.controller_one.key_down.y\n new_ball2 args\n end\n\n if args.inputs.keyboard.key_down.r || args.inputs.controller_one.key_down.start\n reset args\n end\nend", "def commandArtilleryFire _obj, _args\n \"_obj commandArtilleryFire _args;\" \n end", "def command(*args, &b)\r\n\t$gamemode.command(*args, &b)\r\nend", "def method_missing(m, *args, &block)\n @commands.send(m, *args, &block)\n end", "def moveInCommander _obj, _args\n \"_obj moveInCommander _args;\" \n end", "def commands\n @@commands.dup\n end", "def command\n @command ||= Class.new.send(:include, Command)\n end", "def nMenuItems _obj, _args\n \"_obj nMenuItems _args;\" \n end", "def main_command_window\r\n # Make command window\r\n s1 = SDK::Scene_Commands::Scene_Menu::Item\r\n s2 = SDK::Scene_Commands::Scene_Menu::Skill\r\n s3 = SDK::Scene_Commands::Scene_Menu::Equip\r\n s4 = SDK::Scene_Commands::Scene_Menu::Status\r\n s5 = SDK::Scene_Commands::Scene_Menu::Save\r\n s6 = SDK::Scene_Commands::Scene_Menu::End_Game\r\n @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])\r\n @command_window.index = @menu_index\r\n # If number of party members is 0\r\n if $game_party.actors.size == 0\r\n # Disable items, skills, equipment, and status\r\n @command_window.disable_item(0)\r\n @command_window.disable_item(1)\r\n @command_window.disable_item(2)\r\n @command_window.disable_item(3)\r\n end\r\n # If save is forbidden\r\n if $game_system.save_disabled\r\n # Disable save\r\n @command_window.disable_item(4)\r\n end\r\n end", "def commands\n\n {\n 'TODO' => \"This one shout take its sub commands from current(headers/body) variables and the key value should be the command description\n This one should depend on current context\"\n }\n\n end", "def add_original_commands\n end", "def get_commands\n return nil\n end", "def commands\r\n @help_commands\r\n end", "def formulate_command\n @command\n end", "def cmd_default\n cmd_info\n cmd_tree\n end", "def cmds\n pry(Git::Multi::Commands)\nend", "def make_command_list\n add_command(NEW_ICON, :new)\n add_command(ITEM_ICON, :item)\n add_command(WEAPON_ICON, :weapon)\n add_command(ARMOR_ICON, :armor)\n add_command(HEAD_ICON, :head)\n add_command(ARM_ICON, :arm)\n add_command(ACCESSORY_ICON, :accessory)\n add_command(FOOD_ICON, :food)\n add_command(MATERIAL_ICON, :material)\n add_command(KEY_ITEM_ICON, :key_item)\n end", "def related_commands(*cmdlist)\n @related = cmdlist\n end", "def command_type\n case @current[0]\n when '@'\n :A_COMMAND\n when '('\n :L_COMMAND\n else\n :C_COMMAND\n end\n end", "def command\n\n h.fields['__command__']\n end", "def command_start; end", "def command_start; end", "def command_start; end", "def proccess_command(command)\n # branch based on command type\n case command[0]\n when COMScript # script [code]\n # evaluate script\n result = eval(command[1])\n when COMWait # wait [int]\n # decrease wait counter by 1\n command[1] -= 1\n # proceed if wait time is up\n return command[1] <= 0\n when COMMove # move [int, int]\n # add to move commands\n @moves.push(command)\n when COMTurn # turn [int]\n # add to move commands\n @moves.push(command)\n when COMJump # jump [int, int]\n # add to move commands\n @moves.push(command)\n when COMAttack # attack\n # use attack\n @ch.use_attack\n when COMSkill # skill [int]\n # use skill\n @ch.use_skill($data_skills[command[1]])\n when COMItem # item [int]\n # use item\n @ch.use_item($data_items[command[1]])\n when COMDefend # defend [int]\n # decrease time\n time = command[1] - 1\n # use defend\n @ch.use_defend\n # set penalty\n @ch.set_action(1)\n # if not done with command\n if time > 0\n # update the command counter\n command[1] = time\n # do not proceed\n return false\n end\n when COMCharacter # character [CH, value]\n # handle based on sub-command\n case command[1]\n when CHSpeed # move speed\n # set movement speed\n @ch.move_speed = command[2]\n when CHFrequency # move frequency\n # set movement frequency\n @ch.move_frequency = command[2]\n when CHSprite # change sprite\n # set sprite\n @ch.character_name = command[2]\n when CHAnimation # play animation\n # set animation\n @ch.animation_id = command[2]\n when CHFix # direction fix\n # set direction fix flag\n @ch.direction_fix = command[2]\n when CHThrough # through\n # set through flag\n @ch.through = command[2]\n when CHOnTop # always on top\n # set always on top flag\n @ch.always_on_top = command[2]\n when CHOpacity # opacity\n # set opacity\n @ch.opacity = command[2] \n end\n when COMInput # create input window [int, [keys], IN, int]\n # create new input window\n @inputs[command[1]] = [command[2], command[3], command[4], false]\n when COMVariable # variable [VAR, value1, '=', VAR, value2]\n val1 = get_variable(command[1], command[2])\n val2 = get_variable(command[4], command[5])\n # branch handling based on operator type\n case command[3]\n when '+=' then val2 = val1 + val2 # add\n when '-=' then val2 = val1 - val2 # subtract\n when '*=' then val2 = val1 * val2 # multiply\n when '/=' then val2 = val1 / val2 # divide\n when '%=' then val2 = val1 % val2 # modulo\n end\n # set the variable\n set_variable(command[1], command[2], val2)\n when COMCondition # condition [VAR, value1, '==', VAR, value2]\n # initialize result\n result = false\n # initialize values\n val1 = get_variable(command[1], command[2])\n val2 = get_variable(command[4], command[5])\n # branch handling based on operator type\n case command[3]\n when '==' # equal to\n # result is value 1 equal to value 2\n result = val1 == val2\n when '!=' # not equal to\n # result is value 1 not equal to value 2\n result = val1 != val2\n when '>' # greater than\n # result is value 1 equal to value 2\n result = val1 > val2\n when '>=' # greater than or equal to\n # result is value 1 not equal to value 2\n result = val1 >= val2\n when '<=' # less than\n # result is value 1 equal to value 2\n result = val1 < val2\n when '<=' # less than or equal to\n # result is value 1 not equal to value 2\n result = val1 <= val2\n end \n # if input or script\n if command[1] == VARInput || command[1] == VARScript\n # value 1 contains the result\n result = val1\n # do not proceed if waiting on an input window\n if command[1] == VARInput && @inputs[command[2]][2] > 0 && !result\n return false\n end\n end\n # skip next command if exists and condition not met\n @commands.delete_at(1) if !result && @commands.size > 1\n when COMFreeze # freeze input [bool]\n # set freeze input flag\n @freeze_character = command[1]\n when COMCompletion # wait for move completion\n # proceed if no more moves and character no longer moving\n return @moves.size == 0 && [email protected]?\n when COMGoTo # go to action [int]\n raise 'ERROR: Invalid action' if !is_valid_action?(command[1])\n # setup the action\n setup_action(command[1])\n # do not proceed - new set of commands\n return false\n when COMAbort # abort\n # set ended flag\n @ended = true\n end\n return true\n end", "def commands\n @commands.keys.sort\n end", "def cmdarg_stack; end", "def cmdarg_stack; end", "def cmdarg_stack; end", "def set_available_commands\n hash = {}\n Command.descendants.each do |child|\n mod, command = child.to_s.split('::')\n next if command.nil?\n mod = ConsoleProgram.base_module if mod == 'ConsoleProgram'\n hash[mod.downcase.to_sym] ||= {}\n hash[mod.downcase.to_sym][child.command_reference] = child\n child.alternate_commands.each{|cmd| hash[mod.downcase.to_sym][cmd] = child } unless child.alternate_commands.nil?\n end\n #= TODO (Maybe) find a better way to store the hash. -shosang\n # => A custom class that acts a lot like a hash?\n @@commands = hash\n end", "def command_name=(_arg0); end", "def cmd(*args) self.class.cmd(*args) end", "def link_commands\n # We can't use Command#[] at this point so we collect the commands here\n h = {}\n @grammar.traverse(Grammar::Command) { |command|\n h[command.path] = command\n # TODO: Pick up parent-less commands\n }\n\n # Command to link\n link = []\n\n # Create implicit commands\n h.sort { |l,r| l.size <=> r.size }.each { |path, command|\n path = path[0..-2]\n while !h.key?(path)\n cmd = Grammar::Command.new(nil, command.token)\n cmd.set_name(path.last.to_s.sub(/!/, \"\"), path.dup)\n link << cmd\n h[cmd.path] = cmd\n path.pop\n end\n }\n\n # Find commands to link\n #\n # Commands are linked in two steps because the behaviour of #traverse is\n # not defined when the data structure changes beneath it. (FIXME: Does it\n # change when we don't touch the parent/child relationship?)\n @grammar.traverse(Grammar::Command) { |command|\n if command.path.size > 1 && command.parent && command.parent.path != command.path[0..-2]\n# if command.path.size > 1 && command.parent.path != command.path[0..-2]\n link << command\n else\n command.instance_variable_set(:@command, command.parent)\n end\n }\n\n # Link commands but do not change parent/child relationship\n link.each { |command|\n path = command.path[0..-2]\n path.pop while (supercommand = h[path]).nil?\n command.parent.commands.delete(command) if command.parent\n supercommand.commands << command\n command.instance_variable_set(:@command, supercommand)\n }\n end", "def command\n attributes.fetch(:command)\n end", "def command\n attributes.fetch(:command)\n end", "def command(*a)\n command = Command.new(*a)\n command.node = self\n command\n end", "def call(*command); end", "def command_found; end", "def make_command_list\n add_command(Vocab::SKILLS, :skills, main_commands_enabled)\n add_command(Vocab::CAPACITIES, :capacities, main_commands_enabled)\n add_command(Vocab::EQUIP, :equip, main_commands_enabled)\n add_command(Vocab::LEARNING, :learning, main_commands_enabled)\n add_command(Vocab::LIBRAIRIES, :librairies, main_commands_enabled)\n add_command(Vocab::ITEM, :item, main_commands_enabled)\n add_command(Vocab::CRAFTING, :crafting, main_commands_enabled)\n add_command(Vocab::STRATEGY, :strategy, main_commands_enabled)\n add_command(Vocab::COOKING, :cooking, main_commands_enabled)\n add_command(Vocab::SYSTEM, :system, main_commands_enabled)\n end" ]
[ "0.6768826", "0.6708912", "0.6708912", "0.6667368", "0.66593695", "0.6626346", "0.6579591", "0.6579591", "0.6579591", "0.6579591", "0.6579591", "0.6579591", "0.65385306", "0.65354", "0.6531205", "0.65148884", "0.6487029", "0.64765877", "0.6465257", "0.6436495", "0.64042646", "0.6403157", "0.63875407", "0.63715225", "0.63608664", "0.6358139", "0.62784845", "0.627488", "0.6263185", "0.6251901", "0.6244352", "0.62170213", "0.6212999", "0.6212999", "0.620377", "0.6193998", "0.6177319", "0.6176777", "0.6170786", "0.6165354", "0.61597055", "0.61577463", "0.61559284", "0.6131946", "0.61089677", "0.6077189", "0.60616654", "0.6058133", "0.6048925", "0.5977041", "0.5960904", "0.5944165", "0.5938567", "0.59298307", "0.59165215", "0.5914642", "0.59143364", "0.59127414", "0.58955395", "0.58954966", "0.58954966", "0.58954966", "0.5888675", "0.586244", "0.5854124", "0.57880276", "0.578134", "0.5773303", "0.57455206", "0.5742324", "0.57338524", "0.5728856", "0.5717029", "0.57131296", "0.57112455", "0.57076013", "0.56993407", "0.5696663", "0.56950647", "0.5693532", "0.5680231", "0.567284", "0.5668269", "0.5654119", "0.5654119", "0.5654119", "0.564091", "0.56337994", "0.5632016", "0.5632016", "0.5632016", "0.5629398", "0.56202596", "0.5615992", "0.56036884", "0.5600466", "0.5600466", "0.55948436", "0.55886656", "0.558723", "0.55850667" ]
0.0
-1
We determine if we are equal to another command only by if we have equal values for all of our strict setter getters
def == o return false unless o.kind_of? self.class self.class.defined_accessors.each do |pair| name, attrib = *pair return false unless send(name) == o.send(name) end return true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eql?(other)\n self.class.equal?(other.class) &&\n @command == other.command &&\n @options == other.options\n end", "def ==(other)\n return false unless other.is_a? CommandArgs\n @args == other.args && @kwargs == other.kwargs\n end", "def equals(other)\n return false if not super(other)\n return self.opts == other.opts\n end", "def set?\n self == :set\n end", "def == other\n return false unless other.kind_of? self.class\n attribute_of.all? do |key, val|\n val.get == other.__send__(key)\n end\n end", "def eql?(other)\n return true if equal?(other)\n\n # two instances for different models cannot be equivalent\n return false unless other.kind_of?(model)\n\n # two instances with different keys cannot be equivalent\n return false if key != other.key\n\n # neither object has changed since loaded, so they are equivalent\n return true if repository == other.repository && !dirty? && !other.dirty?\n\n # get all the loaded and non-loaded properties that are not keys,\n # since the key comparison was performed earlier\n loaded, not_loaded = properties.select { |p| !p.key? }.partition do |property|\n attribute_loaded?(property.name) && other.attribute_loaded?(property.name)\n end\n\n # check all loaded properties, and then all unloaded properties\n (loaded + not_loaded).all? { |p| p.get(self) == p.get(other) }\n end", "def assignment_method?\n !comparison_method? && method_name.to_s.end_with?('=')\n end", "def === other\n self.to_sym === other.to_sym || super(other)\n end", "def attr_equal?(o)\n self == o and\n self.instance_variables_compare(o).empty? and\n self.attributes == o.attributes\n end", "def ==(other)\n # Important: ArrayCommands may be created over and over during type inference.\n # It is important that we compare values and not identities!\n \n return self.class == other.class &&\n block_size == other.block_size &&\n input == other.input &&\n keep == other.keep &&\n block_def_node == other.block_def_node\n end", "def eql?(other) self.class == other.class and target==other.target and source==other.source; end", "def eql?(other) self.class == other.class and target==other.target and source==other.source; end", "def ==(other)\n @key == other.key && @target == other.target\n end", "def ==(op)\n return false if not self.class == op.class\n return false if not (@name == op.name and @x.uniq == op.x.uniq)\n true\n end", "def matches?(other)\n operable_values == other.operable_values\n end", "def eql? other\n self.object_id == other.object_id ||\n (self.class.eql?(other.class) && specification == other.specification && pointcuts == other.pointcuts)\n end", "def command?(command=RC.current_command)\n return true if self.command.nil?\n self.command == command.to_s\n end", "def eq=(value)\n self === value\n end", "def eql?(other)\n self.class.eql?(other.class) &&\n self.name.eql?(other.name) &&\n self.args.eql?(other.args)\n end", "def object_equal(obj1, obj2)\n vars1 = obj1.instance_variables\n vars2 = obj2.instance_variables\n return false unless vars1.length == vars2.length\n # if they don't have exactly the same instance_variables names then return false\n return false unless vars1.map(&:to_s).sort.to_s == vars2.map(&:to_s).sort.to_s\n\n equal = true\n some(vars1, proc { |v|\n val1 = obj1.instance_variable_get(v)\n val2 = obj2.instance_variable_get(v)\n if val1 != val2\n equal = false\n true\n else\n false\n end\n })\n equal\nend", "def ==(other)\n if self.class === other\n self.value == other.value && self.visible_params == other.visible_params && self.tzid == other.tzid\n else\n super\n end\n end", "def == other\n self.class == other.class and\n self.name == other.name and\n self.rw == other.rw and\n self.singleton == other.singleton\n end", "def meta_send_op_equal\n <<-CODE\n t1 = stack_pop();\n t2 = stack_back(0);\n /* If both are not references, compare them directly. */\n if(!REFERENCE_P(t1) && !REFERENCE_P(t2)) {\n stack_set_top((t1 == t2) ? Qtrue : Qfalse);\n } else {\n _lit = global->sym_equal;\n t2 = Qnil;\n j = 1;\n goto perform_no_ss_send;\n }\n CODE\n end", "def ==(otherHelp)\n return(super(otherHelp) && @column == otherHelp.column && @cell == otherHelp.cell && @row == otherHelp.row)\n\tend", "def method_missing(method, *args)\n if method.to_s =~ /^(\\w+)\\?$/\n v = self.class.find_by_symbol($1)\n raise NameError unless v\n other = v.to_sym\n self.class.class_eval { define_method(method) { self.to_sym == other }}\n return self.to_sym == other\n end\n super\n end", "def ==(other)\n other.class == Method and\n @receiver.equal?(other.receiver) and\n @executable == other.executable\n end", "def should_skip_copy(key)\n key == \"valid_setters\"\n end", "def eql?(other)\n other.class == self.class &&\n other.id == self.id &&\n other.operands.sort_by(&:to_s) == self.operands.sort_by(&:to_s)\n end", "def == other\n (self.start_value == other.start_value) &&\n (self.value_changes == other.value_changes)\n end", "def command_matches?(command)\n case command\n when Numeric then\n return false unless self.command.to_s.to_i == command.to_i\n when Symbol then\n return false unless self.command == command.to_sym\n else\n return false unless self.command.to_s == command.to_s\n end\n\n return true\n end", "def ==(other)\n res = true\n ASSIGNABLE_MEMBERS.each do |k|\n l_val = send(\"#{k}\")\n r_val = other.send(\"#{k}\")\n res = false if l_val != r_val\n end\n res\n end", "def sh_opts_equal?( o1, o2 )\n SH_OPT_KEYS.each do |k|\n return false if o1[k] != o2[k]\n end\n true\n end", "def ==(other)\n if equal?(other)\n return true\n end\n\n unless [ :repository, :model, :fields, :links, :conditions, :order, :offset, :limit, :reload?, :unique?, :add_reversed? ].all? { |method| other.respond_to?(method) }\n return false\n end\n\n cmp?(other, :==)\n end", "def command_is?(command)\n @command.to_s == command\n end", "def eql?(*) end", "def ==(other)\n return super unless other.is_a?(self.class)\n\n attributes.all? { |name, value| value == other.send(name) }\n end", "def ==(other)\n super && @statements == other.statements\n end", "def unchanged?(other)\n self == other ||\n parser.unchanged?(other.parser)\n end", "def ==(other)\n self.class.valid_attrs.each do |attr|\n return false if read(attr) != other.read(attr)\n end\n true\n end", "def eql?(other)\n other.is_a?(self.class) && !self.class.comparison_attrs.find{|a| send(a) != other.send(a)}\n end", "def command?\n @properties.key?(:command) && !@properties[:command].empty?\n end", "def eql?(other)\n return self.instance_variables.all?{ |v|\n self.instance_variable_get(v).hash == other.instance_variable_get(v).hash\n }\n end", "def eql?(obj)\n (obj.class == model) && (obj.values == @values)\n end", "def eql?(obj)\n (obj.class == model) && (obj.values == @values)\n end", "def ==(other)\n properties.all? do |_, property|\n attr_name = property.name\n public_send(attr_name) == other.public_send(attr_name)\n end\n end", "def changed?(other)\n !unchanged?(other)\n end", "def ==(other)\n return false if other.class != self.class\n attr_hash == other.attr_hash\n end", "def dirty?\n orig_repr.properties != repr.properties ||\n sans_anon(orig_repr.all_links) != sans_anon(repr.all_links) ||\n raw_anons(orig_repr.all_links) != raw_anons(repr.all_links)\n end", "def equal?(other)\n other.respond_to?(:mol) && mol.equal?(other.mol) && id == other.id \n end", "def assignment_method?\n false\n end", "def ==(other)\n super || object == other\n end", "def <=>(other)\n return unless self.class <= CommandEntry\n return if self.d.nil? || other.d.nil?\n (self.b <=> other.b).nonzero? ||\n (Rational(self.n, self.d) <=> Rational(other.n, other.d))\n end", "def ===(other)\n reload\n other === @target\n end", "def ===(other)\n other === @target\n end", "def eql?(other)\n self.class == other.class && value == other.value &&\n position == other.position\n end", "def eql?(other)\n self.class == other.class && value == other.value &&\n position == other.position\n end", "def eql?(other)\n self.class == other.class && value == other.value &&\n position == other.position\n end", "def equal?(other)\n return false unless type == other.type\n return false unless power == other.power\n return false unless prefix == other.prefix\n return true\n end", "def ==(other)\n other.kind_of?(self.class) &&\n @name == other.name && @columns == other.columns && @unique == other.unique?\n end", "def test_is_set_72_false\n # Create card objects\n card1 = Card.new(@@colors[0], @@shapes[2], @@numbers[2], @@shadings[2])\n card2 = Card.new(@@colors[1], @@shapes[0], @@numbers[1], @@shadings[2])\n card3 = Card.new(@@colors[2], @@shapes[1], @@numbers[1], @@shadings[1])\n # Call method under test\n assert(!@@table.is_set(card1, card2, card3))\n end", "def ==(obj)\n self.class == obj.class and self.val == obj.val\n end", "def ==(other)\n if other.nil?\n false\n else\n @guid == other.guid &&\n @name == other.name &&\n @last_update === other.last_update\n end\n end", "def equals( t2 )\n t1 = self.clone\n t1.toK\n t2.toK\n if t1.value == t2.value then return true\n else return false\n end\n end", "def test_multiple_updates_on_same_object\n # we start with dhh as owner and alexander as user/creator\n @presentation.name = \"new name\"\n @presentation.owner = @alexander\n @presentation.save\n \n assert_equal \"new name\", @presentation.name\n assert_equal @alexander, @presentation.owner\n assert_equal @alexander, @presentation.user\n \n assert [email protected]_owner_of?(@presentation)\n assert @alexander.is_owner_of?(@presentation)\n \n # ---- owner is now alexander, user/creator also alexander\n \n @presentation.name = \"new name 2\"\n @presentation.save\n \n assert_equal \"new name 2\", @presentation.name\n assert_equal @alexander, @presentation.owner\n assert_equal @alexander, @presentation.user\n \n assert [email protected]_owner_of?(@presentation)\n assert @alexander.is_owner_of?(@presentation)\n \n assert [email protected]_creator_of?(@presentation)\n assert @alexander.is_creator_of?(@presentation)\n \n # --- no change. owner: alexander, user/creator: alexander.\n \n @presentation.name = \"new name 3\"\n @presentation.user = @dhh\n @presentation.save\n \n assert_equal \"new name 3\", @presentation.name\n assert_equal @alexander, @presentation.owner\n assert_equal @dhh, @presentation.user\n \n assert [email protected]_owner_of?(@presentation)\n assert @alexander.is_owner_of?(@presentation)\n \n assert [email protected]_creator_of?(@presentation)\n assert @dhh.is_creator_of?(@presentation)\n \n # --- owner is still alexander, but user/creator is now dhh.\n \n @presentation.name = \"new name 4\"\n @presentation.owner = @dhh\n @presentation.save\n \n assert_equal \"new name 4\", @presentation.name\n assert_equal @dhh, @presentation.owner\n assert_equal @dhh, @presentation.user\n \n assert [email protected]_owner_of?(@presentation)\n assert @dhh.is_owner_of?(@presentation)\n \n assert [email protected]_creator_of?(@presentation)\n assert @dhh.is_creator_of?(@presentation)\n \n # --- owner is now also dhh, user/creator is still dhh.\n \n @presentation.name = \"new name 5\"\n @presentation.owner = @alexander\n @presentation.save\n # @presentation.reload\n \n assert_equal \"new name 5\", @presentation.name\n assert_equal @alexander, @presentation.owner\n assert_equal @dhh, @presentation.user\n \n assert [email protected]_owner_of?(@presentation)\n assert @alexander.is_owner_of?(@presentation)\n \n assert [email protected]_creator_of?(@presentation)\n assert @dhh.is_creator_of?(@presentation)\n \n \n end", "def eql?(o)\n if o.instance_of? self.class\n self.instance_variables.each do |v|\n return false if self.instance_variable_get(v) != o.instance_variable_get(v)\n end\n true\n else\n false\n end\n end", "def eql?(other)\n other.is_a?( Chamber::Settings) &&\n self.data == other.data &&\n self.namespaces == other.namespaces\n end", "def test_is_set_26_false\n # Create card objects\n card1 = Card.new(@@colors[0], @@shapes[1], @@numbers[1], @@shadings[1])\n card2 = Card.new(@@colors[2], @@shapes[1], @@numbers[1], @@shadings[1])\n card3 = Card.new(@@colors[2], @@shapes[1], @@numbers[0], @@shadings[1])\n # Call method under test\n assert(!@@table.is_set(card1, card2, card3))\n end", "def ==(other)\n super || @hash == other.hash\n end", "def test_is_set_59_false\n # Create card objects\n card1 = Card.new(@@colors[0], @@shapes[1], @@numbers[1], @@shadings[2])\n card2 = Card.new(@@colors[1], @@shapes[1], @@numbers[1], @@shadings[2])\n card3 = Card.new(@@colors[2], @@shapes[0], @@numbers[1], @@shadings[2])\n # Call method under test\n assert(!@@table.is_set(card1, card2, card3))\n end", "def test_is_set_27_false\n # Create card objects\n card1 = Card.new(@@colors[1], @@shapes[1], @@numbers[2], @@shadings[0])\n card2 = Card.new(@@colors[2], @@shapes[1], @@numbers[0], @@shadings[2])\n card3 = Card.new(@@colors[2], @@shapes[1], @@numbers[2], @@shadings[0])\n # Call method under test\n assert(!@@table.is_set(card1, card2, card3))\n end", "def ===(other)\n load_target\n other === @target\n end", "def test_is_set_71_false\n # Create card objects\n card1 = Card.new(@@colors[0], @@shapes[0], @@numbers[1], @@shadings[2])\n card2 = Card.new(@@colors[1], @@shapes[1], @@numbers[0], @@shadings[2])\n card3 = Card.new(@@colors[2], @@shapes[2], @@numbers[1], @@shadings[2])\n # Call method under test\n assert(!@@table.is_set(card1, card2, card3))\n end", "def validate_hashes\n super unless BYPASS_COMMANDS.include?(command)\n end", "def eql?(other)\n super\n end", "def eql?(other)\n super\n end", "def ==(*)\n true\n end", "def test_is_set_73_false\n # Create card objects\n card1 = Card.new(@@colors[0], @@shapes[2], @@numbers[1], @@shadings[1])\n card2 = Card.new(@@colors[1], @@shapes[1], @@numbers[2], @@shadings[2])\n card3 = Card.new(@@colors[2], @@shapes[0], @@numbers[1], @@shadings[0])\n # Call method under test\n assert(!@@table.is_set(card1, card2, card3))\n end", "def eql?(other)\n\t if other.zero?\n\t\[email protected]?\n\t elsif other.respond_to?(:units)\n\t\tif other.respond_to? :value\n\t\t @units.eql?(other.units) and @value.eql?(other.value)\n\t\telse\n\t\t other == self\n\t\tend\n\t else\n\t\[email protected]? and @value.eql?(other)\n\t end\n\tend", "def test_is_set_39_false\n # Create card objects\n card1 = Card.new(@@colors[2], @@shapes[0], @@numbers[0], @@shadings[1])\n card2 = Card.new(@@colors[1], @@shapes[0], @@numbers[1], @@shadings[2])\n card3 = Card.new(@@colors[2], @@shapes[1], @@numbers[2], @@shadings[2])\n # Call method under test\n assert(!@@table.is_set(card1, card2, card3))\n end", "def test_is_set_69_false\n # Create card objects\n card1 = Card.new(@@colors[0], @@shapes[1], @@numbers[1], @@shadings[2])\n card2 = Card.new(@@colors[1], @@shapes[2], @@numbers[1], @@shadings[2])\n card3 = Card.new(@@colors[2], @@shapes[0], @@numbers[1], @@shadings[0])\n # Call method under test\n assert(!@@table.is_set(card1, card2, card3))\n end", "def test_is_set_61_false\n # Create card objects\n card1 = Card.new(@@colors[0], @@shapes[1], @@numbers[1], @@shadings[0])\n card2 = Card.new(@@colors[1], @@shapes[0], @@numbers[1], @@shadings[2])\n card3 = Card.new(@@colors[2], @@shapes[0], @@numbers[1], @@shadings[1])\n # Call method under test\n assert(!@@table.is_set(card1, card2, card3))\n end", "def == x\n return false unless self.class === x\n @advice == x.advice && @mod == x.mod && @meth == x.meth && @kind == x.kind\n end", "def test_is_set_28_false\n # Create card objects\n card1 = Card.new(@@colors[2], @@shapes[0], @@numbers[0], @@shadings[1])\n card2 = Card.new(@@colors[1], @@shapes[0], @@numbers[0], @@shadings[2])\n card3 = Card.new(@@colors[2], @@shapes[0], @@numbers[2], @@shadings[0])\n # Call method under test\n assert(!@@table.is_set(card1, card2, card3))\n end", "def test_is_set_46_false\n # Create card objects\n card1 = Card.new(@@colors[2], @@shapes[1], @@numbers[0], @@shadings[1])\n card2 = Card.new(@@colors[1], @@shapes[0], @@numbers[1], @@shadings[2])\n card3 = Card.new(@@colors[2], @@shapes[2], @@numbers[0], @@shadings[0])\n # Call method under test\n assert(!@@table.is_set(card1, card2, card3))\n end", "def test_is_set_29_false\n # Create card objects\n card1 = Card.new(@@colors[2], @@shapes[0], @@numbers[1], @@shadings[1])\n card2 = Card.new(@@colors[1], @@shapes[0], @@numbers[0], @@shadings[1])\n card3 = Card.new(@@colors[2], @@shapes[0], @@numbers[2], @@shadings[1])\n # Call method under test\n assert(!@@table.is_set(card1, card2, card3))\n end", "def ==(o)\n o.is_a?(self.class) && db == o.db && opts == o.opts\n end", "def test_is_set_63_false\n # Create card objects\n card1 = Card.new(@@colors[0], @@shapes[2], @@numbers[2], @@shadings[2])\n card2 = Card.new(@@colors[1], @@shapes[2], @@numbers[1], @@shadings[2])\n card3 = Card.new(@@colors[2], @@shapes[0], @@numbers[1], @@shadings[0])\n # Call method under test\n assert(!@@table.is_set(card1, card2, card3))\n end", "def test_is_set_22_false\n # Create card objects\n card1 = Card.new(@@colors[2], @@shapes[1], @@numbers[0], @@shadings[1])\n card2 = Card.new(@@colors[2], @@shapes[0], @@numbers[1], @@shadings[2])\n card3 = Card.new(@@colors[2], @@shapes[2], @@numbers[2], @@shadings[1])\n # Call method under test\n assert(!@@table.is_set(card1, card2, card3))\n end", "def ==(other)\n return false unless other\n return false unless other.respond_to?(:target_org)\n return @target_org == other.target_org && @feeling == other.feeling \n end", "def eql?(other)\n return false unless self.class == other.class\n self.key_attributes == other.key_attributes\n end", "def ==(other); false; end", "def eql?(other)\n return false unless super(other)\n return false unless attributes == other.attributes\n return false unless content == other.content\n\n true\n end", "def test_is_set_41_false\n # Create card objects\n card1 = Card.new(@@colors[2], @@shapes[0], @@numbers[0], @@shadings[1])\n card2 = Card.new(@@colors[1], @@shapes[2], @@numbers[0], @@shadings[1])\n card3 = Card.new(@@colors[2], @@shapes[1], @@numbers[0], @@shadings[1])\n # Call method under test\n assert(!@@table.is_set(card1, card2, card3))\n end", "def ==(other)\n return false unless other.is_a?(Key)\n name == other.name && operator == other.operator && expanded == other.expanded\n end", "def valid_command?(val, target=binding)\n !!(command_matched(val, target)[0])\n end", "def test_is_set_19_false\n # Create card objects\n card1 = Card.new(@@colors[2], @@shapes[1], @@numbers[0], @@shadings[0])\n card2 = Card.new(@@colors[2], @@shapes[0], @@numbers[0], @@shadings[2])\n card3 = Card.new(@@colors[2], @@shapes[2], @@numbers[2], @@shadings[0])\n # Call method under test\n assert(!@@table.is_set(card1, card2, card3))\n end", "def test_is_set_38_false\n # Create card objects\n card1 = Card.new(@@colors[2], @@shapes[0], @@numbers[0], @@shadings[1])\n card2 = Card.new(@@colors[1], @@shapes[1], @@numbers[1], @@shadings[1])\n card3 = Card.new(@@colors[2], @@shapes[0], @@numbers[2], @@shadings[1])\n # Call method under test\n assert(!@@table.is_set(card1, card2, card3))\n end", "def test_is_set_43_false\n # Create card objects\n card1 = Card.new(@@colors[2], @@shapes[1], @@numbers[2], @@shadings[1])\n card2 = Card.new(@@colors[1], @@shapes[2], @@numbers[2], @@shadings[2])\n card3 = Card.new(@@colors[2], @@shapes[0], @@numbers[2], @@shadings[0])\n # Call method under test\n assert(!@@table.is_set(card1, card2, card3))\n end", "def test_is_set_37_false\n # Create card objects\n card1 = Card.new(@@colors[2], @@shapes[0], @@numbers[1], @@shadings[1])\n card2 = Card.new(@@colors[1], @@shapes[1], @@numbers[1], @@shadings[0])\n card3 = Card.new(@@colors[2], @@shapes[0], @@numbers[2], @@shadings[0])\n # Call method under test\n assert(!@@table.is_set(card1, card2, card3))\n end", "def ==(obj)\n if obj.instance_of?(self.class)\n compare_attributes = [\"category_id\", \"combo_item_id\", \"quantity\", \"sequence\"]\n compare_attributes.each do |field|\n if self.send(field) != obj.send(field)\n return false\n end\n end\n return true\n end\n return false\n end" ]
[ "0.693559", "0.65374565", "0.6099364", "0.5918105", "0.58485764", "0.5826577", "0.58264095", "0.5817626", "0.5803594", "0.5798009", "0.57391334", "0.57391334", "0.572498", "0.57180285", "0.562436", "0.5605937", "0.55946475", "0.55626386", "0.5556086", "0.5549214", "0.55379796", "0.5528058", "0.55113196", "0.55103296", "0.5509884", "0.5502201", "0.5497521", "0.54847217", "0.5474371", "0.54687744", "0.5462542", "0.5458939", "0.54581696", "0.5455976", "0.54502296", "0.54439825", "0.54432034", "0.5441875", "0.5438477", "0.54319865", "0.54298395", "0.54193205", "0.5405827", "0.5405827", "0.5402426", "0.53912884", "0.53851193", "0.5383555", "0.5383231", "0.53804207", "0.5378668", "0.5373144", "0.5368523", "0.53652644", "0.53645253", "0.53645253", "0.53645253", "0.5358739", "0.53549504", "0.5350032", "0.53492767", "0.53480774", "0.53477544", "0.53449744", "0.5339372", "0.5339196", "0.53385574", "0.53341365", "0.5333655", "0.53313303", "0.53312016", "0.5330957", "0.53301287", "0.5329129", "0.5329129", "0.5324586", "0.5319034", "0.5318694", "0.5318305", "0.53144586", "0.5314257", "0.5312135", "0.5312058", "0.531203", "0.5311144", "0.5309117", "0.53065205", "0.53026384", "0.530132", "0.52996856", "0.52946204", "0.52942663", "0.5293829", "0.52937293", "0.52921456", "0.52917016", "0.529148", "0.52880627", "0.5287345", "0.52856463" ]
0.5305994
87
eclipse_iu (installable unit) is eclipsespeak for the fully qualified name of the plugin
def eclipse_iu @resource[:install_options][0]['plugin_name'] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def translate_plugin_name(name); end", "def translate_plugin_names; end", "def unoconv_pname\n 'LibreOffi'\n end", "def plugin(name); end", "def plugin_name\n 'imip'\n end", "def plugin_name\n 'browser'\n end", "def load_plugin(name); end", "def plugin_name\n 'core'\n end", "def plugin_name\n @@name || self.class.name\n end", "def name\n self.class.name.split(\"Ohai::NamedPlugin::\")[1].to_sym\n end", "def custom_plugin_name(conf_element)\n if KNOWN_PLUGINS.key?(conf_element.name) &&\n KNOWN_PLUGINS[conf_element.name].include?(conf_element['@type'])\n \"#{conf_element.name}/#{conf_element['@type']}\"\n else\n conf_element.name.to_s\n end\n end", "def plugin_directory; end", "def plugin_name\n name.split('::').last.underscore.to_sym\n end", "def plugin_manager; end", "def plugin_manager=(_arg0); end", "def get_plugin(name); Ricer::Plugin.by_name(name); end", "def plugin_name\n instance[:name]\n end", "def plugin_id; end", "def plugin_human_name\n @plugin_human_name ||= \"#{provider_name.titleize} Provider\"\n end", "def plugin_name\n s = @event.at('@pluginName').inner_text\n\n @plugin_name ||= if s.empty?\n false\n else\n @event.at('@pluginName').inner_text\n end\n\n return @plugin_name\n end", "def plugin_name\n @plugin_name ||= instance[:name]\n end", "def target\n Pathname(\"/etc/munin/plugins/#{name}\")\n end", "def subsystem\n \"unknown\"\n end", "def describePlatform\n TC.name.gsub(' ', '_')\nend", "def instancename classname\n\t\t\t'i'+classname\n\t\tend", "def masculine_name; end", "def plugin_setup!; end", "def plugin(name)\n @__cinch_name = name\n end", "def plugin(str)\n # copied stright from the Rails underscore helper\n str = str.to_s\n str.gsub!(/::/, '/')\n str.gsub!(/([A-Z]+)([A-Z][a-z])/,'\\1_\\2')\n str.gsub!(/([a-z\\d])([A-Z])/,'\\1_\\2')\n str.tr!(\"-\", \"_\")\n str.downcase!\n begin\n raise LoadError.new if irb?\n require File.join(File.dirname(@screenplay_path),\"plugins\",\"#{str}.rb\")\n rescue LoadError\n require File.join(LIBPATH, \"plugins\", \"#{str}.rb\")\n end\n # copied stright from the Rails camelize helper\n str = str.to_s.gsub(/\\/(.?)/) { \"::\" + $1.upcase }.gsub(/(^|_)(.)/) { $2.upcase }\n extend eval(\"Castanaut::Plugin::#{str}\")\n end", "def apphelp_site_name\n t( :'uk.org.pond.canvass.site_name' )\n end", "def plugin_name\n self.class.to_s\n end", "def provider\n return \"Jenkins Test Suit\"\n end", "def plugin_icon(plugin)\n registered = {\n petition: 'hand-rock-o',\n thermometer: 'neuter',\n survey: 'edit',\n text: 'paragraph',\n fundraiser: 'money',\n email_tool: 'envelope-o',\n email_pension: 'university',\n call_tool: 'phone'\n }\n name = plugin.name.underscore.to_sym\n registered.fetch(name, 'cubes')\n end", "def default_plugin_name(conf_element)\n case conf_element['@type']\n when 'syslog'\n \"#{conf_element.name}/syslog/#{conf_element['protocol_type']}\"\n when 'tail'\n \"#{conf_element.name}/tail/#{File.basename(conf_element['pos_file'], '.pos')}\"\n else\n \"#{conf_element.name}/#{conf_element['@type']}\"\n end\n end", "def integration_name; end", "def uwi\n self.well_info.uwi || self.well_info.api\n end", "def plugin_str\n '/usr/lib/openvpn/plugins/okta/defer_simple.so ' \\\n \"/usr/lib/openvpn/plugins/okta/okta_openvpn.py\\n\" \\\n 'tmp-dir \"/etc/openvpn/tmp\"'\n end", "def plugins=(_arg0); end", "def plugins_path; end", "def iar_ide\r\n @iar_ide_pm ||= RubyIAR::Toolchain::Executables::IarIde.new(name: name, dir: dir)\r\n end", "def project_name\n locales_CEW.websiteName\n end", "def plugin_description\n @plugin_description ||= \"#{Vmdb::Appliance.PRODUCT_NAME} plugin for the #{provider_name.titleize} provider.\"\n end", "def get_module_name\n return :core_plugins\n end", "def get_plugin_file(pname)\n plugindir = Dir.new(\"#{$pwd}/plugins\")\n pname += '.rb' unless pname.end_with? '.rb'\n plugindir.each do |filename|\n return \"#{plugindir.path}/#{filename}\" if pname.casecmp(filename).zero?\n end\n end", "def about_us; end", "def uiNamespace \n \"uiNamespace\" \n end", "def load_plugins; end", "def family\n @plugin_family ||= @event.at('@pluginFamily').inner_text\n end", "def binary\n Pathname(Gem.bindir) + \"gitorious-munin-plugin\"\n end", "def name\n\t\t\"Interface Fingerprinter\"\n\tend", "def cloud\n ext_management_system.provider.cloud_ems.first\n end", "def name(_prefix = false)\n 'Providers'\n end", "def load_gem_plugins; end", "def plugin_host(host = T.unsafe(nil)); end", "def all_plugins; end", "def plugins; end", "def plugins; end", "def plugins; end", "def plugins; end", "def plugin_type\n\t\tbase = Pluggability.plugin_base_class( self ) or\n\t\t\traise PluginError, \"Couldn't find plugin base for #{self.name}\"\n\n\t\tif base.name =~ /^.*::(.*)/\n\t\t\treturn $1\n\t\telse\n\t\t\treturn base.name\n\t\tend\n\tend", "def cama_language_editor_on_upgrade(plugin)\n end", "def test_provided_example\n assert_equal \"tknk\", @system.base.name\n end", "def progname; \"Disorganizer\"; end", "def plugin_gem_location_old(plugin)\n \"sequel_#{plugin}\"\n end", "def get_satellite_eyes_app_name()\n app_name = \"Satellite Eyes\"\n return app_name\nend", "def description\n ::I18n.translate(['refinery', 'plugins', name, 'description'].join('.'))\n end", "def full_name\n if platform == Gem::Platform::RUBY or platform.nil?\n \"#{name}-#{version}\".dup.tap(&Gem::UNTAINT)\n else\n \"#{name}-#{version}-#{platform}\".dup.tap(&Gem::UNTAINT)\n end\n end", "def main_class\n ## find file\n main_utf = nil\n self.user_turnin_files.each do |utf|\n main_utf = utf if utf.main\n end\n return '' if main_utf.nil?\n \n ## calculate nesing\n classpath = \"#{parent_utf_package( main_utf )}.#{main_utf.filename}\"\n classpath = classpath.gsub('..','.')\n \n while classpath[0...1].eql?('.')\n classpath = classpath[1...classpath.length]\n end\n \n if classpath.reverse[0...5].eql?(\"avaj.\")\n classpath = classpath[0...classpath.length-5]\n end\n \n return classpath\n end", "def ova_name\n \"puppet-#{pe_version}-learning-#{PTB_VERSION[:major]}.#{PTB_VERSION[:minor]}.ova\"\nend", "def plugin_path\n ::LittlePlugger.default_plugin_path(self)\n end", "def plugin_name\n 'carddav'\n end", "def pbTrainerPC\n Kernel.pbMessage(_INTL(\"\\\\se[computeropen]{1} booted up the PC.\",$Trainer.name))\n pbTrainerPCMenu\n pbSEPlay(\"computerclose\")\n $PokemonTemp.dependentEvents.refresh_sprite\nend", "def getUIversion\n GameUniverseToUI.new(@currentSpaceStation, @currentEnemy)\n end", "def target_name\n aff_short_name\n end", "def ohai_plugin_path\n \"/etc/chef/ohai_plugins\"\n end", "def plugin(name)\n @plugins[name]\n end", "def upc_e; end", "def initPlugin\n initTestCase do\n require \"WEACEToolkit/Slave/Adapters/#{@ProductID}/#{@ToolID}/#{@ScriptID}\"\n lActionPlugin = eval(\"WEACE::Slave::Adapters::#{@ProductID}::#{@ToolID}::#{@ScriptID}.new\")\n yield(lActionPlugin)\n end\n end", "def load_plugin_failed(name, exception); end", "def caption\n \"#{self.programme.description}::#{self.organisation.name}\"\n end", "def display_name\n self.imap_provider_code\n end", "def pbStorageCreator\n return _INTL(\"The Jermon Team\")\nend", "def find_unit ς\n puts \"searching for unit #{ς}\" if SY::DEBUG\n known_units.find do |u|\n u.name.to_s.downcase == ς.downcase &&\n ( ς == ς.downcase || ς == ς.upcase ) ||\n u.short.to_s == ς\n end\n end", "def progname; \"Dis-organizer\"; end", "def progname; \"Dis-organizer\"; end", "def progname; \"Dis-organizer\"; end", "def iqn\n \"iqn.2010-09.com.example:01:#{datacenter.name}.#{hostname}\"\n end", "def studio\n studio_id.get_object.name\n end", "def project_name\n \"Ruby/Extensions\"\n end", "def cop_name; end", "def cop_name; end", "def plugin_name(path)\r\n File.basename(path)\r\n end", "def generate\n name_plugin\n end", "def use_technology_preview=(_arg0); end", "def new_project_unit\n end", "def scrub_plugin_name name\n\t\t\t\t\treturn name.gsub(\"(remote check)\", \"\").gsub(\"(uncredentialed check)\", \"\").gsub(/(\\(\\d.*\\))/, \"\")\n\t\t\t\tend", "def openCuratorInterface \n \"openCuratorInterface\" \n end", "def display_name\n return name unless %w(maven gradle).include?(package_manager)\n name.split(\":\").last\n end", "def window_name\n 'HSTrackerPlayer'\n end", "def name\n \"hipchat-extensions\"\n end" ]
[ "0.6125613", "0.5993675", "0.57985467", "0.5708009", "0.5597193", "0.55517554", "0.54875267", "0.54254454", "0.5411678", "0.53928643", "0.5374364", "0.53740096", "0.53325003", "0.5275204", "0.5268606", "0.5260224", "0.52281547", "0.52163553", "0.5210662", "0.5203994", "0.51601946", "0.51269835", "0.511386", "0.5111898", "0.51055324", "0.5080896", "0.50805086", "0.50758094", "0.506916", "0.5065627", "0.5062104", "0.5003388", "0.49604067", "0.49238607", "0.49183023", "0.49182585", "0.49144885", "0.49051732", "0.49042955", "0.4904114", "0.48792186", "0.48774242", "0.48725188", "0.48593888", "0.48530802", "0.4852266", "0.48433393", "0.4838551", "0.48225093", "0.48133352", "0.4809411", "0.47956365", "0.47721794", "0.47635502", "0.47545168", "0.47514728", "0.47514728", "0.47514728", "0.47514728", "0.4732949", "0.47215235", "0.47174442", "0.471699", "0.47163653", "0.47100708", "0.4706251", "0.4701543", "0.46949685", "0.4688073", "0.46873072", "0.46822795", "0.46775308", "0.4669865", "0.46697468", "0.46671477", "0.4665257", "0.4664954", "0.46604565", "0.4658349", "0.46572706", "0.46543774", "0.4646196", "0.46460184", "0.4637499", "0.4637499", "0.4637499", "0.46288523", "0.46257037", "0.46239918", "0.46167237", "0.46167237", "0.46159422", "0.46058342", "0.45999783", "0.45998773", "0.45990726", "0.45951465", "0.4576419", "0.45760116", "0.45713365" ]
0.7475672
0
validates :solution_description, presence: true
def assigned_user User.find_by_id(assigned_id).full_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solution_params\n params.require(:solution).permit(:issue_id, :description)\n end", "def description_present\n if description.blank?\n errors.add(:description, \"Can't be empty\")\n end\n end", "def solution_params\n params.require(:solution).permit(:description, :status, :ref)\n end", "def solution_params\n params.require(:solution).permit(:solution_id, :user_id, :service_id, :description)\n end", "def description_presence\n return if self[:description].present?\n\n self.flag_type = self[:flag_type].try(:to_i)\n\n case self.flag_type\n when FLAG_TYPE['terms_of_use_violation']\n errors.add(:description, I18n.t(\"image_flag.missing_description_terms_of_use_violation\"))\n when FLAG_TYPE['copyright']\n errors.add(:description, I18n.t(\"image_flag.missing_description_copyright\"))\n else\n errors.add(:description, \"Unknown violation type!\")\n end\n end", "def _validate_description(d)\n if d == spec.summary\n results.add_warning('description', 'The description is equal to' \\\n ' the summary.')\n end\n\n if d.strip.empty?\n results.add_error('description', 'The description is empty.')\n elsif spec.summary && d.length < spec.summary.length\n results.add_warning('description', 'The description is shorter ' \\\n 'than the summary.')\n end\n end", "def problem_params\n params.require(:problem).permit(:description)\n end", "def is_valid?(feature)\n !feature.description.blank?\n end", "def verify_project_desc(test_data)\n verify_values_match(test_data[UseOfCollections::PROJECT_DESC.name], element_value(project_desc_text_area))\n end", "def verify_project_desc(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::PROJECT_DESC.name], element_value(project_desc_text_area))\n end", "def validate_project\n\n # project name should be 10 to 30 length, and 5 words or fewer\n validate_length_words 'Project Name', self.project_name, 10, 30, 0, 5\n\n # vision should be 1 sentence\n validate_sentences_length 'Vision', self.vision, 30, 100, 1\n\n # goal should be 1 sentence\n validate_sentences_length 'Goal', self.goal, 30, 100, 1\n\n # description, and scope should be 5 sentences!\n validate_sentences_length 'Description', self.description, 100, 500, 5\n validate_sentences_length 'Scope', self.scope, 100, 500, 5\n\n # advice needed\n validate_sentences_length 'Advice Required', self.advice_required, 50, 200, 3\n\n # randomize program and train complaints!\n validate_random_day 'Program', self.program.name\n validate_random_day 'Train', self.train.name\n end", "def the_event_must_have_at_least_one_description\n if des_es.empty? && des_eu.empty? && des_en.empty? && des_fr.empty?\n errors.add(:des_es, \"Please fill in the desciption at least in one language\")\n end\n if title_es.empty? && title_eu.empty? && title_en.empty? && title_fr.empty?\n errors.add(:des_es, \"Please fill in the desciption at least in one language\")\n end\n end", "def solution_params\n params.require(:solution).permit(:text, :provider, :event_id)\n end", "def test_necessary_existence_of_description\n @composer.role_type_desc = nil\n assert [email protected]\n check_for_error_messages([\"can't be blank\", \"is too short (minimum is 2 characters)\"], @composer, :role_type_desc)\n end", "def solution_params\n params.require(:solution).permit(:user_id, :body, :language, :assignment_id, :code_type)\n end", "def check_description(description)\r\n # Return error message if description is blank.\r\n return \"Description cannot be blank.\" if description == \"\"\r\n # Return error message if description is too long.\r\n if description.length > 140\r\n return \"Description was #{description.length} characters long; cannot exceed 140.\"\r\n end\r\n # Otherwise \"ok\"\r\n return \"ok\"\r\n end", "def lecture_rule_params\n params.require(:lecture_rule).permit(:description)\n end", "def objective_params\n params.require(:objective).permit(:description)\n end", "def public_requirements\n if is_public then\n errors.add( :description, I18n.t( 'pcp_comments.msg.descr_mssng' )) \\\n if description.blank? && !PcpItem.closed?( assessment )\n end\n end", "def violation_description_params\n params.require(:violation_description).permit(:violation_code, :violation_description, :restaurant_id)\n end", "def problem_params\n params.require(:problem).permit(:name, :description, :max_score, :optional)\n end", "def blank?\n self.solution_type.blank? ? true : false\n end", "def description_length\n \tif description.length > 80\n \t\terrors.add(:description, \"La descripción no puede ser mayor a 80 caracteres\")\n \tend\n end", "def validate\n validates_presence([:title, :body])\n end", "def solution_params\n params.require(:solution).permit(:correctanswer)\n end", "def validate_text\n errors.add(:text, :must_be_null_in_this_slide) if !self.allows_text? && !self.text.nil?\n end", "def description\n \"validate successfully\"\n end", "def problem_params\n params.require(:problem).permit(:title, :summary, :input_description, :output_description, :skeleton)\n end", "def code_solution_params\n params.require(:code_solution).permit(:content, :user_id, :code_case_id)\n end", "def _validate_summary(s)\n if s.length > 140\n results.add_warning('summary', 'The summary should be a short ' \\\n 'version of `description` (max 140 characters).')\n end\n if s =~ /A short description of/\n results.add_warning('summary', 'The summary is not meaningful.')\n end\n end", "def goal_params\n params.require(:goal).permit(:description)\n end", "def problem_params\n params.require(:problem).permit(:name, :description)\n end", "def create\n @problem_solution = ProblemSolution.new(params[:problem_solution])\n\n respond_to do |format|\n if @problem_solution.save\n format.html { redirect_to @problem_solution.problem ? solutions_by_problem_path(@problem_solution.problem) : :problem_solutions, notice: 'Решение проблемы успешно создано.' }\n else\n format.html { render action: 'new' }\n end\n end\n end", "def solution_params\n params.require(:solution).permit(:micropost_id, :content, :image)\n end", "def create\n @violation_description = ViolationDescription.new(violation_description_params)\n\n respond_to do |format|\n if @violation_description.save\n format.html { redirect_to @violation_description, notice: 'Violation description was successfully created.' }\n format.json { render :show, status: :created, location: @violation_description }\n else\n format.html { render :new }\n format.json { render json: @violation_description.errors, status: :unprocessable_entity }\n end\n end\n end", "def check_description\n @repo_data ? @repo_data['description'] : nil\n end", "def solution_params\n params.require(:solution).permit(:problem_id, :code, :language_id, :block_editor, :block_xml)\n end", "def test_should_require_description\n archive = create(:description => nil)\n assert archive.errors.invalid?(:description), \":description should be required\"\n assert_invalid archive, \"archive shouldn't be created\"\n end", "def solution_params\n params.require(:solution).permit(:title, :description, :picture, :num_validation, :validated, \n :status, :industry_branch_ids, industry_branches_attributes: [:id, :industry_id, :name])\n end", "def has_description?\n @desc && @desc.is_a?(String) && [email protected]?\n end", "def description_params\n params.require(:description).permit(:content)\n end", "def project_params\n params.require(:project).permit(:description)\n end", "def create\n @solution = Solution.new(params[:solution])\n\n respond_to do |format|\n if @solution.save\n format.html { redirect_to @solution, notice: 'Solution was successfully created.' }\n format.json { render json: @solution, status: :created, location: @solution }\n else\n format.html { render action: \"new\" }\n format.json { render json: @solution.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_description?\n description.nil? || description.empty?\n end", "def requirement_params\n params.require(:requirement).permit(:name, :description)\n end", "def has_description?\n !error.description.to_s.empty?\n end", "def challenge_solution_params\n params.require(:challenge_solution).permit(:user_id, :integer, :name, :string, :challenge_id, :integer, :destription, :string)\n end", "def has_description?\n true\n end", "def solution_params\n params.permit(:solution, :training, :user_id)\n end", "def valid?\n title_or_description.to_s != ''\n end", "def validate\n\tvalidate_unexpected_assets_not_present && validate_expected_asset_present && validate_snippet_and_description\nend", "def test_should_require_description\n link = create(:description => nil)\n assert link.errors.invalid?(:description), \":description should be required\"\n assert_invalid link, \"link shouldn't be created\"\n end", "def create\n # @solution = Solution.new(solution_params)\n # @goal = Goal.find(params[:goal_id])\n @solution = @goal.solutions.new(solution_params)\n\n\n respond_to do |format|\n if @solution.save\n format.html { redirect_to project_goal_path(@project, @goal), notice: 'Solution was successfully created.' }\n format.json { render :show, status: :created, location: @solution }\n else\n format.html { render :new }\n format.json { render json: @solution.errors, status: :unprocessable_entity }\n end\n end\n end", "def stepstone_params\n params.require(:stepstone).permit(:description)\n end", "def job_description_params\n params.require(:job_description).permit(:name, :discipline)\n end", "def requirement_params\n params.require(:requirement).permit(:description, :hours_required, :requirement_id)\n end", "def validate_data_description(function_name,data_description,description_required=true)\n if (data_description[\"position\"].nil?)\n @errors << \"[Warning] #{function_name} - Y Labels are not set.\"\n data_description[\"position\"] = \"name\"\n end\n\n if (description_required)\n if ((data_description[\"description\"].nil?))\n @errors << \"[Warning] #{function_name} - Series descriptions are not set.\"\n data_description[\"values\"].each do |value|\n if data_description[\"description\"].nil?\n data_description[\"description\"]={value=> value}\n else\n data_description[\"description\"]=data_description[\"description\"].merge(value=>value)\n end\n end\n end\n\n data_desc_count = data_description[\"values\"].is_a?(Array) ? data_description[\"values\"].count : 1\n if ((data_description[\"description\"].count) < data_desc_count)\n @errors << \"[Warning] #{function_name} - Some series descriptions are not set.\"\n data_description[\"values\"].each do |value|\n data_description[\"description\"][value] = value if ( data_description[\"description\"][value].nil?)\n end\n end\n end\n return data_description\n end", "def problem_params\n params.require(:problem).permit(:title, :content)\n end", "def description(description)\n rules.last.description = description\n end", "def handle_nil_description\n self.description = \"\" if description.nil?\n end", "def handle_nil_description\n self.description = \"\" if description.nil?\n end", "def handle_nil_description\n self.description = \"\" if description.nil?\n end", "def description_greater_than_three_letters\n errors.add :description, \"must be greater than three letters long\" if description.length < 3 unless description.blank?\n end", "def test_validate_reason_code_with_space_only\n reason_code1 = ReasonCode.new\n reason_code1.reason_code = \" \"\n reason_code1.save\n assert !reason_code1.valid?, reason_code1.errors.full_messages.to_s\n end", "def solution\n @solution ||= if @event.at('solution')\n @event.at('solution').inner_text\n else\n false\n end\n end", "def is_valid_description?(description)\n description && !description.include?('http://')\n end", "def description?\n !description.nil? && !description.empty?\n end", "def description_item_params\n params.require(:description_item).permit(:title, :long_description, :project_id)\n end", "def description_params\n params.require(:description).permit(:task_id)\n end", "def answer_params\n params.require(:answer).permit(:description)\n end", "def design_case_params\n params.require(:design_case).permit(:title, :description, :design_problem, :questions, :solution_1, :solution_2, :solution_3, :listed, :date_assigned)\n end", "def training_workshop_params\n params.require(:training_workshop).permit(:description)\n end", "def create\n @code_solution = CodeSolution.new(code_solution_params)\n\n respond_to do |format|\n if @code_solution.save\n format.html { redirect_to @code_solution, notice: 'Code solution was successfully created.' }\n format.json { render :show, status: :created, location: @code_solution }\n else\n format.html { render :new }\n format.json { render json: @code_solution.errors, status: :unprocessable_entity }\n end\n end\n end", "def solution_correct?\n current = params[:solution].strip\n current.gsub!(/\\/\\*[\\w\\s]*\\*\\//,\"\") \n current.gsub!(/--.*\\n/,\"\")\n existing = format_str(@lesson.solution.strip)\n current = format_str(current.strip)\n if existing == current\n return true\n else\n existing_arr = existing.split\n current_arr = current.split\n len= existing_arr.length\n err =[]\n j=0 \n for i in 0..len\n if existing_arr[i]!=current_arr[i]\n err[j]= existing_arr[i]\n j=j+1 \n end\n end\n return err\n end \n end", "def description\n ''\n end", "def check_title_and_description(params)\n if params[:title] == nil\n @errors << \"Title can't be empty\"\n end\n if params[:description] == nil\n @errors << \"You need to add description\"\n elsif params[:description].length < 20\n @errors << \"description can't be less than 20 characters\"\n end\nend", "def short_description\n if self.description.nil?\n nil\n else\n self.description[%r{^[^\\n\\r]*}]\n end\n end", "def description?\n !(@description.nil? || @description.empty?)\n end", "def description_params\n params.require(:description).permit(:title,:content)\n end", "def validate_data_description(function_name,data_description,description_required=true)\r\n if (data_description[\"position\"].nil?)\r\n #$this->Errors[] = \"[Warning] \".function_name.\" - Y Labels are not set.\";\n puts \"#{function_name} Y labels are not set\"\r\n data_description[\"position\"] = \"name\";\r\n end\r\n if (description_required)\r\n \r\n if ((data_description[\"description\"].nil?))\r\n #$this->Errors[] = \"[Warning] \".function_name.\" - Series descriptions are not set.\";\n puts \"#{function_name} Series Description are not set\"\r\n data_description[\"values\"].each do |value|\n if data_description[\"description\"].nil?\n data_description[\"description\"]={value=> value}\n else\n data_description[\"description\"]=data_description[\"description\"].merge(value=>value)\n end \r\n end\r\n end\r\n\r\n if ((data_description[\"description\"].count) < (data_description[\"values\"].count))\r\n \r\n #$this->Errors[] = \"[Warning] \".function_name.\" - Some series descriptions are not set.\";\n puts \"#{function_name} Some Series description are not set\"\r\n data_description[\"values\"].each do |value|\n \r\n data_description[\"description\"] = {value=> value} if ( !data_description[\"description\"][value].nil?)\r\n end\r\n end\r\n end\n return data_description\r\n end", "def includes_description?\n !long_desc.empty? || !desc.empty?\n end", "def clean_description\n ActionView::Base.full_sanitizer.sanitize(description)\n end", "def create\n @description = Description.new(description_params)\n\n respond_to do |format|\n if @description.save\n format.html { redirect_to @description, notice: 'Description was successfully created.' }\n format.json { render :show, status: :created, location: @description }\n else\n format.html { render :new }\n format.json { render json: @description.errors, status: :unprocessable_entity }\n end\n end\n end", "def description\n description = \"\"\n end", "def create_correction\n Contestcorrection.create(:contestsolution => self, :content => \"-\")\n end", "def projet_params\n params.require(:projet).permit(:description)\n end", "def update\n respond_to do |format|\n if @violation_description.update(violation_description_params)\n format.html { redirect_to @violation_description, notice: 'Violation description was successfully updated.' }\n format.json { render :show, status: :ok, location: @violation_description }\n else\n format.html { render :edit }\n format.json { render json: @violation_description.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @solution = @idea.solutions.new(feature: params[:toSent]) #@idea.solutions.new(params[:solution])\n\n if @solution.save\n render json: { text: \"success\", id: \"#{@solution.id}\" }\n else\n render json: { text: \"fail\"}\n end\n end", "def initialize(solution)\n @solution = solution\n end", "def new\n @problem.description = <<-HERE.strip_heredoc\n Your problem:\n -------------\n\n Items that **must** have:\n\n 1. house\n 3. table\n 2. fridge\n\n Items to be _solved_:\n\n - It would be good to have a nice Ipad\n - and an Apple TV\n - an a Time capsule\n\n [Link to Apple](http://www.apple.com/)\n\n > Knowing others is intelligence; knowing yourself is true wisdom. Mastering others is strength; mastering yourself is true power. If you realize that you have enough, you are truly rich.\n\n This is a preformatted text1\n This is a preformatted text2\n HERE\n\n @preview = BlueCloth.new(@problem.description).to_html.html_safe\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @problem }\n end\n end", "def description_name\n !self.description.blank? ? self.description : NOT_SET\n end", "def slide_params\n params.require(:slide).permit(:description)\n end", "def description?\n non_empty?(@description)\n end", "def create\n @description = Description.new(description_params2)\n @description.company_id = description_params[:company_id]\n\n if Company.find(params[:company_id]).description != nil\n respond_to do |format|\n format.html { redirect_to company_path(@description.company_id), notice: 'No se puede guardar, ya existe una descripción' }\n end\n else\n respond_to do |format|\n if @description.save\n format.html { redirect_to company_path(@description.company_id), notice: 'Description was successfully created.' }\n format.json { render :show, status: :created, location: @description }\n else\n format.html { render :new }\n format.json { render json: @description.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def requirement_params\n params.require(:requirement).permit(:content, :storypoint)\n end", "def new\n @solution = @idea.solutions.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @solution }\n end\n end", "def pr_description\n danger_file.warn('Please provide a summary in the Pull Request description') if danger_file.github.pr_body.length < 3 && danger_file.git.lines_of_code > 10\n end", "def puzzle_params\n params.require(:puzzle).permit(:name, :status, :description, :flavortext, :expected_ttc, :destination_id, :owner_id, :include_bearing)\n end", "def test_validate_reason_code_with_valid_data\n reason_code1 = ReasonCode.new\n reason_code1.reason_code = \"RC.S-A_\"\n reason_code1.save\n assert reason_code1.valid?, reason_code1.errors.full_messages.to_s\n end", "def full_description\n self.study_detail.try(:full_description)\n end", "def game_status_params\n params.require(:game_status).permit(:description)\n end" ]
[ "0.70381117", "0.6889956", "0.6611981", "0.65406346", "0.6515827", "0.63699317", "0.6369792", "0.6284803", "0.6272712", "0.6241582", "0.6195921", "0.6152266", "0.6119486", "0.6103676", "0.6086614", "0.6074591", "0.6045454", "0.6024478", "0.60225934", "0.59844095", "0.5983743", "0.5969461", "0.5958644", "0.59329075", "0.5921098", "0.5892004", "0.5886836", "0.586928", "0.5856333", "0.58421075", "0.58387065", "0.5826293", "0.5811121", "0.5805281", "0.5795028", "0.5787662", "0.57862926", "0.57512546", "0.57506835", "0.57447994", "0.57373244", "0.5734449", "0.57106614", "0.5705856", "0.569602", "0.56946903", "0.5684675", "0.5663574", "0.563692", "0.5630764", "0.5627436", "0.5625448", "0.56163394", "0.56149316", "0.560675", "0.5585712", "0.5582077", "0.55796164", "0.5573514", "0.5573112", "0.5573112", "0.5573112", "0.55669326", "0.5562066", "0.55601084", "0.55500984", "0.55498534", "0.5542048", "0.5522614", "0.5509652", "0.5504131", "0.5489542", "0.5488373", "0.5487781", "0.54719317", "0.54686403", "0.54684925", "0.5460127", "0.54561466", "0.5455884", "0.5434811", "0.5428951", "0.5415671", "0.54072523", "0.5395804", "0.53932756", "0.53921324", "0.53914464", "0.5388861", "0.538437", "0.53832656", "0.5373932", "0.5370699", "0.53682166", "0.5348172", "0.53462195", "0.5343045", "0.53398633", "0.53346413", "0.5334425", "0.53337574" ]
0.0
-1
Complete the maxXor function below.
def maxXor(arr, queries) # solve here # build a trie with each element of arr as leaf # binary tree left = "0", right = "1" # 30 levels trie_root = TrieNode.new arr.each do |x| p = trie_root xb = '%030b' % x xb.each_char do |bit| if bit == "0" # go left if p.left p = p.left else nn = TrieNode.new p.left = nn p = p.left end else # go right if p.right p = p.right else nn = TrieNode.new p.right = nn p = p.right end end end end ans_seq = [] queries.each do |q| # walk down the trie to leaf leaf = "" p = trie_root qb = '%030b' % q qb.each_char do |bit| # prefer opposite of bit if bit == "0" # try go right ("1") if p.right p = p.right leaf << "1" else p = p.left leaf << "0" end else # try to go left ("0") if p.left p = p.left leaf << "0" else p = p.right leaf << "1" end end end a = leaf.to_i(2) ans_seq << (a^q) end return ans_seq end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maxXor(l, r)\n return 2**((l^r).to_s(2).size) - 1\nend", "def maximizingXor(l, r)\n range = (l..r).to_a\n range.product(range).map{ |a, b| a ^ b }.max \nend", "def max_opac\n unless states.empty?\n return states.collect do |state|\n state.max_opac\n end.min\n end\n return 255\n end", "def xor_c\n end", "def max; end", "def max; end", "def bits(num, table) \n max = 0\n\n i_max = num / 2\n for i in 0..i_max\n cand = table[i] + table[num-i]\n if max < cand\n max = cand\n end\n end\n\n return max\nend", "def eqp_r_max(item)\n end", "def cusmax(array)\r\n return array.sort.max\r\nend", "def xor_e\n end", "def find_max_value(array)\nx = 0 \n array.length.times { |index|\n if array[index] > x \n x = array[index]\n end\n }\n x\n end", "def get_max_value()\n temp = @symtable.values\n temp.keep_if { |x| x.to_i < 16384 }\n temp.max\n end", "def xor_l\n end", "def find_max_value(array)\n x = 0\n array.length.times { |index| x = array[index] if array[index] > x }\n x\nend", "def max\n end", "def max\n end", "def max\n (count * sides + increment) * multiplier\n end", "def max _obj, _args\n \"_obj max _args;\" \n end", "def chmax(x, y) x > y ? x : y end", "def xor_b\n end", "def max \n @list.reduce(0){ |memo,v| (v>memo ? v : memo) }\n end", "def find_largest_chain \n n = 999999\n until n < 700000\n collatz_evaluate_sequence(n)\n n -= 1\n end\n puts @solutions.max_by { |k,v| v } \nend", "def get_max()\n end", "def max\n self.reduce('lambda{|memo, item| memo > item ? memo : item }')\n end", "def find_max_value(array)\n x = array[0]\narray.length.times {|index|\n if array[index] > x\n x = array[index]\n end\n\n}\nx\nend", "def get_max\n @max ||= calculate_max\n end", "def max_rot(n)\n count = 1\n n_array = [n]\n n_chars = n.to_s.chars\n while count <= (n_chars.length - 1)\n n_chars.each_with_index do |char, index|\n n_chars.push(n_chars[index])\n n_chars.delete_at(index)\n n_array << n_chars.join.to_i\n count += 1\n end\n end\n return n_array.uniq.max\nend", "def zpopmax(key, count = T.unsafe(nil)); end", "def zero_one_memoized_aux(w, c, max_weight, n, r)\n if n == 0 || max_weight == 0\n q = 0\n elsif w[n-1] > max_weight\n q = r[n-1][max_weight] ||= zero_one_memoized_aux(w, c, max_weight, n-1, r).first\n else\n q = [\n c[n-1] +\n r[n-1][max_weight - w[n-1]] ||= zero_one_memoized_aux(w, c, max_weight - w[n-1], n-1, r).first,\n r[n-1][max_weight] ||= zero_one_memoized_aux(w, c, max_weight, n-1, r).first\n ].max\n end\n r[n][max_weight] = q\n [q, r]\n end", "def custom_max(array)\n array.max\nend", "def fourteen\n max = 0\n index = 0\n for i in 1..1000000\n if ((temp = collatz(i)) > max)\n max = temp\n index = i\n puts \"The max so far is i=#{index} producing a chain n=#{temp} long\"\n end\n end\n return index\nend", "def xor_a\n end", "def xor(x, y)\n\nend", "def product_right\n unless @col > 16 \n product = @arr[@row][@col] * @arr[@row][@col + 1] * @arr[@row][@col + 2] * @arr[@row][@col + 3]\n check_new_max(product)\n end \nend", "def my_max(array)\n\t\n\tarray.max\n\nend", "def max_hops; end", "def ordv\n large = Array.new([0,0,0,0,0,0,0,0,0,1])\n (1..7830457).each do |n|# digit represents ,2^n\n passover = 0\n 9.downto(0).each do |i|\n large[i] *= 2\n large[i] += passover\n if large[i] >= 10\n large[i] %= 10\n passover = 1\n else\n passover = 0\n end\n end\n end\n (28433 * large.join.to_i + 1)%100000000000\nend", "def max_rot(n)\n count = n.to_s.chars.count\n i = 0\n arr = []\n arr.push(n)\n \n until i == count - 1\n n = n.to_s.chars\n n = (n[0...i] + n[i..-1].rotate).join.to_i\n arr.push(n)\n i += 1\n end\n \n arr.max\nend", "def lcs_phase_two(arr)\n return arr.max if arr.max < 0 #edge case\n\n current = 0\n largest = 0\n\n arr.each do |ele|\n current += ele\n current = 0 if current < 0 #bookmark\n largest = current if largest < current\n end\n\n largest\nend", "def find_max_value (array)\n array.max # Add your solution here\nend", "def max(items)\n#(was not sure if instructions meant the method.max. this is my solution only restricting the method: max)\n max = items.sort.last\nend", "def get_max_key()\n \n end", "def max=\n end", "def best_result(triplet)\n triplet.max\nend", "def p4\n\tarray = (800..999).to_a\n\tarray = array.map{|x| array.map{|y| x * y}}.flatten.uniq\n\tarray = array.select{|x| palindrome?(x)}\n\tarray.max\nend", "def max_rotation(original_num)\ncount = original_num.to_s.size\ncount.downto(2) do |num|\noriginal_num = rotate_rightmost_digits(original_num, num)\nend\noriginal_num\nend", "def xor_d\n end", "def max\n return -1 if @count == 0\n return @array[0]\n end", "def max\n maxes = []\n\n maxes << @in.max unless @in.empty?\n maxes << @out.max unless @out.empty?\n\n maxes.max\n end", "def max(*args)\n args.max\n end", "def max_palidrome_product(min, max)\r\n lrg_pal = 0\r\n max.downto(min) do |i|\r\n i.downto(min) do |j|\r\n product = i * j\r\n if product > lrg_pal && product.to_s == product.to_s.reverse #it's a palindrome\r\n # puts \"i = #{i}\"\r\n # puts \"j = #{j}\"\r\n lrg_pal = product\r\n end\r\n end\r\n end\r\n lrg_pal\r\nend", "def max\n @max ||= define_min_and_max && @max\n end", "def find_max()\r\n self.max\r\n end", "def highest_product_of_three(array)\n negative_count = array.select { |value| value < 0 }\n array.map! { |value| value.abs }.sort! if negative_count.length.even?\n solution = 1\n array.max(3).each { |max| solution *= max }\n p solution\nend", "def max_opac\n return @battler.max_opac if @battler\n return 255\n end", "def maximum( arr, &prc )\n return nil if arr.length == 0\n\n test_case = arr.inject(0) {|x,ele| x = prc.call(ele) if prc.call(ele) > x }\n p test_case\n arr.reverse.each do |ele|\n if prc.call(ele) == test_case\n return ele\n end\n end\n\nend", "def max_entropy\n Math.log2(@alphabet.num_symbols)\n end", "def maxy\n main.maxy\n end", "def max_value(our_array)\n\treference = -100000\n\tour_array.each do |number|\n\t\tif number > reference\n\t\t\treference = number\n\t\tend\n\tend\n\treference\nend", "def find_max(array)\n max = 0\n array.each do |subarray|\n subarray.each_cons(4) do |chunk|\n product = quad_product(chunk)\n max = product if product > max\n end\n end\n max\n end", "def find_max_value(array)\n max_element = 0\n array.length.times { |index|\n if max_element < array[index]\n max_element = array[index]\n end\n }\n return max_element\nend", "def bit_or\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 51 )\n return_value = BitOrReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal235 = nil\n bit_xor234 = nil\n bit_xor236 = nil\n\n tree_for_char_literal235 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 589:5: bit_xor ( '|' bit_xor )*\n @state.following.push( TOKENS_FOLLOWING_bit_xor_IN_bit_or_3894 )\n bit_xor234 = bit_xor\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, bit_xor234.tree )\n end\n # at line 589:13: ( '|' bit_xor )*\n while true # decision 54\n alt_54 = 2\n alt_54 = @dfa54.predict( @input )\n case alt_54\n when 1\n # at line 589:15: '|' bit_xor\n char_literal235 = match( PIPE, TOKENS_FOLLOWING_PIPE_IN_bit_or_3898 )\n if @state.backtracking == 0\n\n tree_for_char_literal235 = @adaptor.create_with_payload( char_literal235 )\n root_0 = @adaptor.become_root( tree_for_char_literal235, root_0 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_bit_xor_IN_bit_or_3902 )\n bit_xor236 = bit_xor\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, bit_xor236.tree )\n end\n\n else\n break # out of loop for decision 54\n end\n end # loop for decision 54\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 51 )\n\n end\n \n return return_value\n end", "def bitMaxMin n\n l=2**n\n min=-l/2\n max=-min-1\n return max,min\nend", "def basic_5 (array_iterate)\n array_iterate.max\nend", "def max_amount(array_of_coins)\n case array_of_coins.length\n when 0 then 0\n when 1 then array_of_coins.first\n when 2 then [array_of_coins.first, array_of_coins.last].max\n else\n [\n array_of_coins.last + max_amount(array_of_coins[0..-3]),\n max_amount(array_of_coins[0..-2])\n ].max\n end\nend", "def max list = @alt\n values = self[list]\n values.reduce(0){ |memo,v| (v>memo ? v : memo) }\n end", "def find_max_value(array)\n array.max { |item|\n return array.max\n }\n \nend", "def max(board)\n #Generate moves array\n moves = minmax_moves(board, self)\n #Placeholder for max score, even the worst score is > -2\n max = -2\n #Find terminal and check terminal nodes and delete them from move array. If any of them are 1 instantly return\n moves.delete_if do |index, board|\n if over?(board)\n #If board is terminal get score\n res = minmax_score(board)\n #If terminal is winning instantly return it\n return res if res == 1\n max = res if res > max\n true\n else\n false\n end\n end\n\n #Else get worst scores of new states\n moves.each do |index, board|\n res = min(board)\n return res if res == 1\n max = res if res > max\n end\n max\n end", "def max_rotation(num)\n num.to_s.size.downto(2) do |rotators|\n num = rotate_rightmost_digits(num, rotators)\n end\n num\nend", "def max_rot(n)\n result = n\n n = n.to_s.chars\n len = n.length - 1\n n.each.with_index do |_value, i|\n n.push(n[i])\n n.delete_at(i)\n temp = n.join('').to_i\n if temp > result\n result = temp\n elsif i == len\n puts result\n return result\n end\n end\nend", "def solution(a)\n \n max = 0\n # write your code in Ruby 2.2\n max if a.nil? || a.length == 0\n \n if a.length < 4\n max = 1\n a.each do |item|\n max = max * item\n end\n max\n end\n \n # order first => nlogn + left and right edge max three\n a.sort!\n \n # - - -\n # + + +\n if a[0] >= 0 || a[-1] <= 0 || a[1] >= 0\n max = a[-1] * a[-2] * a[-3]\n max\n end\n \n # n = 4\n max = a[0] * a[1] * a[2]\n max = [max,a[0] * a[1] * a[-1]].max\n max = [max,a[0] * a[-2] * a[-1]].max\n max = [max,a[-3] * a[-2] * a[-1]].max\n max\n end", "def get_max(arr)\n arr.inject do |memo, x|\n if memo < x\n x\n else\n memo\n end\n end\nend", "def max_by(arr)\n return nil if arr.empty?\n memo = arr[0]\n 0.upto( arr.size - 1 ) do |idx|\n memo = yield(arr[idx]) > yield(memo) ? arr[idx] : memo\n end\n memo\nend", "def max\n @keys[@keys.size-1]\n end", "def find_max_value(array)\n array.max \nend", "def clever_octopus(array)\n max = nil\n array.each_with_index do |el, i|\n if max == nil || max.length < el.length\n max = el\n end\n end\n max\nend", "def max_product(nums)\n return 0 if !nums or nums.length <= 0\n maxherepre, minherepre, maxsofar = nums[0], nums[0], nums[0]\n\n 1.upto(nums.length-1) do |i|\n item = nums[i]\n minhere, maxhere = [maxherepre*item, minherepre*item, item].minmax\n maxsofar = maxhere if maxhere > maxsofar\n minherepre, maxherepre = minhere, maxhere\n end\n\n maxsofar\nend", "def mode(array)\n hash = Hash.new(0)\n array.each do |x|\n hash[x] += 1\n end\n result = []\n hash.each { |x,y|\n if y == hash.values.max\n result.push(x)\n end\n }\n return result\nend", "def greatest_product(n)\r\n\r\n num_array = n.gsub(/\\n/,'').split('').map(&:to_i)\r\n max = 0\r\n i = 0\r\n while i < num_array.length - 13\r\n sum = num_array[i..i+12].reduce(:*)\r\n if sum > max\r\n max = sum\r\n end\r\n i += 1\r\n end\r\n max\r\nend", "def maximum\n sides.map(&:value).max\n end", "def max\n if valid?\n max_value\n end\n end", "def mode(a)\n b = Hash.new(0)\n final = []\n max = 1\n a.each do |x|\n b[x] +=1\n if b[x] >= max\n max = b[x]\n end\n end\n\n b.each do |x,y|\n if max == y\n final<< x\n end\n end\n return final\nend", "def GetLargestPalindromic\r\n @product = 0\r\n \r\n @size.downto(1) { |i|\r\n @size.downto(1) { |j|\r\n @product = i * j\r\n \r\n if IsPalindromic(@product)\r\n puts \"Largest Palindromic = #{@product}\"\r\n return\r\n end\r\n }\r\n }\r\n\r\n puts \"Largest Palindromicaa = #{@product}\"\r\n end", "def find_max_value(array)\n return array.max\nend", "def maximize; end", "def max_2_sum(array)\n res= array.max.to_i\n (array.delete(array.max))\n res+=array.max.to_i\nend", "def winner\n @hash.key(@hash.values.max)\n end", "def xor_d8\n end", "def max_rotation(num)\n arr_size = num.digits.size\n arr_size.times do |idx|\n sign_idx = arr_size.odd? ? idx : -idx\n num = rotate_rightmost_digits(num, sign_idx)\n end\n num\nend", "def odd_duplicates(array)\n xor = array.reduce(0, :^)\nend", "def max_rob(houses)\n houses.each_with_index.reduce(0) do |robbed_money, (house_money, index)|\n next robbed_money if !index.zero? && index % 2 == 0\n\n robbed_money += house_money\n end\nend", "def rob(nums)\n money = Array.new(nums.length + 2, 0)\n (2...money.length).each do |i|\n money[i] = [money[i - 2] + nums[i - 2], money[i - 1]].max\n end\n money.last\nend", "def t_max\n @temp.max\n end", "def mode(array) \n hash = Hash.new(0) \n array.each do |x| \n hash[x] += 1\n end\n mode_array = []\n hash.each do |k,v|\n if v == hash.values.max\n mode_array << k\n end\n end\n mode_array\nend", "def max\n @max ||= begin\n maxes = []\n options[:max].times { |t| maxes << dup_for(max: nil, change: nil, series: nil, extend_cache_life: options[:max] - t, period: period.prev(t + 1)).compute }\n maxes.max\n end if options[:max]\n end", "def find_max_value(array)\n array.sort!\n return array[-1]\nend", "def clever_octopus(arr)\n i = 0\n j = arr.length-1\n\n max = arr[0]\n while i != j\n if arr[i].length < arr[j].length\n max = arr[j]\n i += 1\n elsif arr[j].length <= arr[i].length\n max = arr[i]\n j -= 1\n end\n end\n max \nend", "def bitfield_max column_name\n @@bitfields[column_name].values.sum.max\n end", "def max_poss\n res = 1\n @poss.each { |p| res *= p.length }\n res\n end", "def solution(a)\n return a.count(a.max)\nend" ]
[ "0.80217206", "0.76717645", "0.6227789", "0.59065086", "0.5899728", "0.5899728", "0.5819309", "0.58088714", "0.57880455", "0.577485", "0.5754974", "0.5733791", "0.56739765", "0.5667797", "0.56393474", "0.56393474", "0.5636227", "0.5629259", "0.5609958", "0.5605941", "0.5579613", "0.55564386", "0.555531", "0.55551064", "0.5547005", "0.5539342", "0.55031264", "0.5481406", "0.5470573", "0.5445102", "0.54197526", "0.5388104", "0.5381595", "0.5380292", "0.53733677", "0.5372367", "0.5368758", "0.5368183", "0.5363919", "0.5361125", "0.53540456", "0.5342265", "0.5337924", "0.5334885", "0.53270704", "0.5314041", "0.5310918", "0.53100127", "0.5309939", "0.5308092", "0.53027266", "0.52972823", "0.5296334", "0.52933466", "0.52842945", "0.52822703", "0.5280346", "0.52791506", "0.52684236", "0.5267655", "0.52675885", "0.5264708", "0.5262833", "0.5243863", "0.52436966", "0.52423036", "0.52415615", "0.524013", "0.5235778", "0.52337664", "0.52329403", "0.5228862", "0.5228072", "0.52259177", "0.5219053", "0.52106446", "0.5203035", "0.5201011", "0.5199309", "0.51987904", "0.5196289", "0.51933646", "0.5187804", "0.51851624", "0.51829267", "0.5181205", "0.5180776", "0.51799047", "0.5159518", "0.51523703", "0.51513964", "0.514336", "0.5142979", "0.5117955", "0.5116275", "0.51118493", "0.5110845", "0.51005703", "0.5095283", "0.5095037" ]
0.59604686
3
If byebug (ruby >= 2.0) or debugger (ruby < 2.0) are installed, start the debugger now.
def start_debugger # First try the more modern 'byebug' begin require "byebug" byebug rescue LoadError # If that fails, try the older debugger begin require 'debugger' debugger rescue LoadError self.log.info "No debugger found, can't break on failures." end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dbg\nbegin\n require 'rubygems'\n require 'ruby-debug'\n debugger\nrescue LoadError\nend\nend", "def _dbg\r\n require 'rubygems'\r\n require 'pp' # who would want debug without pp? not I\r\n begin\r\n require 'ruby-debug'\r\n debugger\r\n rescue LoadError => e\r\n throw \"unable to load ruby-debug gem for _dbg... #{e}\"\r\n end\r\n end", "def debug it\n PryByebug::BreakCommand.new.send :add_breakpoint, \"Testo::Test#run\", nil\n # How to \"next next step\" automatically when the breakpoint is hit?\n\n begin\n run it\n raise \"Cannot reproduce. It might be a heisebug.\"\n rescue\n $!\n end\nend", "def load_debugger\n pid = Process.fork do\n STDOUT.close\n STDERR.close\n\n debug_loop = ENV[\"TM_BUNDLE_SUPPORT\"] + \"/lib/debug_loop.rb\"\n `ruby #{e_sh debug_loop} #{@output_swf} #{e_sh @flex_sdk_bin} &> /dev/null &`\n end\n Process.detach pid\n\n sleep 0.6 # Give the debugger a moment to load\nend", "def test_debugger_base\n assert_equal(false, Debugger.started?, \n 'Debugger should not initially be started.')\n Debugger.start_\n # we need to add the breakpoint to force enabling trace points\n Debugger.add_breakpoint(__FILE__, 1)\n assert(Debugger.started?, \n 'Debugger should now be started.')\n assert_equal(false, Debugger.debug,\n 'Debug variable should not be set.')\n assert_equal(false, Debugger.post_mortem?,\n 'Post mortem debugging should not be set.')\n a = Debugger.contexts\n assert_equal(1, a.size, \n 'There should only be one context.')\n assert_equal(Array, a.class, \n 'Context should be an array.')\n ensure\n Debugger.stop\n assert_equal(false, Debugger.started?, \n 'debugger should no longer be started.')\n end", "def enable_advanced_debugging_tools; end", "def debug_program\n error = Byebug.debug_load(program, stop)\n puts \"#{error}\\n#{error.backtrace}\" if error\n end", "def console\n puts 'Entering debug console.'\n if RUBY_VERSION == '2.0.0'\n require 'byebug'\n byebug\n else\n require 'ruby-debug'\n Debugger.start\n debugger\n end\n puts 'Leaving debug console.'\n end", "def enable_advanced_debugging_tools=(_arg0); end", "def checkdebug\n begin\n if ENV['FACTER_DEBUG'] == 'true'\n Facter.debugging(true)\n end\n rescue\n end\nend", "def checkdebug\n begin\n if ENV['FACTER_DEBUG'] == 'true'\n Facter.debugging(true)\n end\n rescue\n end\nend", "def debug\n ::RSpec.configure do |config|\n config.add_setting :debugger_proc\n config.debugger_proc = ->(ex) do\n exception = ex.exception\n defined?(Pry) ? binding.pry : debugger # rubocop:disable Debugger\n end\n config.after(debug: true) do |ex|\n instance_exec(ex, &config.debugger_proc) if ex.exception\n end\n end\n end", "def run\n Byebug.mode = :standalone\n\n option_parser.order!($ARGV)\n return if non_script_option? || error_in_script?\n\n $PROGRAM_NAME = program\n\n Byebug.run_init_script if init_script\n\n loop do\n debug_program\n\n break if quit\n\n ControlProcessor.new(nil, interface).process_commands\n end\n end", "def load_debugger(new_argv)\n path_to_rdebug = \"/home/user/Ruby/ruby-debug-ide/bin/rdebug-ide\"\n\n old_argv = ARGV.clone\n ARGV.reject {|x| true}\n new_argv.each do |x|\n ARGV << x\n end\n \n old_0 = $0.clone\n $0 = path_to_rdebug\n\n load path_to_rdebug\n\n $0 = old_0\n ARGV.reject {|x| true}\n old_argv.each do |x|\n ARGV << x\n end\nend", "def testCommandLineDebug\n # Make sure we don't break debug\n lDebugMode = debug_activated?\n begin\n executeSlave( [ '--debug' ] )\n rescue Exception\n activate_log_debug(lDebugMode)\n raise\n end\n activate_log_debug(lDebugMode)\n end", "def testCommandLineDebugShort\n # Make sure we don't break debug\n lDebugMode = debug_activated?\n begin\n executeSlave( [ '-d' ] )\n rescue Exception\n activate_log_debug(lDebugMode)\n raise\n end\n activate_log_debug(lDebugMode)\n end", "def debugger_address; end", "def show\n# byebug\n end", "def started?\n raise NotImplementedException.new \"Debugger.started? not implemented\"\n end", "def set_debugger\n @debugger = Debugger.find(params[:id])\n end", "def breakpoint binding; IRB.start_with_binding binding end", "def initialize\n # HACK readline causes `rake spec` to hang in ioctl()\n require 'readline-native'\n\n @breakpoint_tracker = BreakpointTracker.new do |thread, ctxt, bp|\n activate_debugger thread, ctxt, bp\n end\n\n # Register this debugger as the default debug channel listener\n Rubinius::VM.debug_channel = @breakpoint_tracker.debug_channel\n\n @quit = false\n @breakpoint_listener = Thread.new do\n thrd = nil\n until @quit do\n @done = false\n begin\n thrd = @breakpoint_tracker.wait_for_breakpoint\n @breakpoint_tracker.wake_target(thrd) unless @quit # defer wake until we cleanup\n rescue Error => e\n puts \"An exception occured while processing a breakpoint:\"\n puts e\n end\n end\n # Release singleton, since our loop thread is exiting\n Debugger.__clear_instance\n\n # Remove all remaining breakpoints\n @breakpoint_tracker.clear_breakpoints\n\n # De-register debugger on the global debug channel\n Rubinius::VM.debug_channel = nil\n\n if thrd\n # thrd will be nil if debugger was quit from other than a debug thread\n puts \"[Debugger exiting]\"\n @breakpoint_tracker.wake_target(thrd)\n end\n @breakpoint_tracker.release_waiting_threads\n end\n Thread.pass until waiting_for_breakpoint?\n end", "def debug_program(dbgr, ruby_path, program_to_debug)\n\n # Make sure Ruby script syntax checks okay.\n # Otherwise we get a load message that looks like trepanning has \n # a problem. \n output = `#{ruby_path} -c #{program_to_debug.inspect} 2>&1`\n if $?.exitstatus != 0 and RUBY_PLATFORM !~ /mswin/\n puts output\n exit $?.exitstatus \n end\n # print \"\\032\\032starting\\n\" if Trepan.annotate and Trepan.annotate > 2\n\n dbgr.trace_filter << self.method(:debug_program)\n dbgr.trace_filter << Kernel.method(:load)\n\n old_dollar_0 = $0\n\n # Without the dance below to set $0, setting it to a signifcantly\n # longer value will truncate it in some OS's. See\n # http://www.ruby-forum.com/topic/187083\n $progname = program_to_debug\n alias $0 $progname\n dollar_0_tracker = lambda {|val| $program_name = val} \n trace_var(:$0, dollar_0_tracker)\n\n dbgr.debugger(:hide_stack=>true) do\n dbgr.core.processor.hidelevels[Thread.current] = \n RubyVM::ThreadFrame.current.stack_size + 1\n Kernel::load program_to_debug\n end\n\n # The dance we have to undo to restore $0 and undo the mess created\n # above.\n $0 = old_dollar_0\n untrace_var(:$0, dollar_0_tracker)\n end", "def activate_debugger(thread, ctxt, bp)\n puts \"[Debugger activated]\" unless bp.kind_of? StepBreakpoint\n @debug_thread = thread\n @eval_context = @debug_context = ctxt\n\n # Load debugger commands if we haven't already\n load_commands unless @commands\n\n file = @debug_context.file.to_s\n line = @debug_context.line\n\n puts \"\"\n puts \"#{file}:#{line} (#{@debug_context.method.name}) [IP:#{@debug_context.ip}]\"\n output = Output.new\n output.set_line_marker\n output.set_color :cyan\n if bp.kind_of? StepBreakpoint and bp.step_by == :ip\n bc = @debug_context.method.decode\n inst = bc[bc.ip_to_index(@debug_context.ip)]\n output.set_columns([\"%04d:\", \"%-s \", \"%-s\"])\n output << [inst.ip, inst.opcode, inst.args.map{|a| a.inspect}.join(', ')]\n else\n lines = source_for(file)\n unless lines.nil?\n output.set_columns(['%d:', '%-s'])\n output << [line, lines[line-1].chomp]\n end\n end\n output.set_color :clear\n puts output\n\n @prompt = \"\\nrbx:debug> \"\n until @done do\n inp = Readline.readline(@prompt)\n inp.strip!\n if inp.length > 0\n process_command(inp)\n @last_inp = inp\n elsif @last_inp\n process_command(@last_inp)\n end\n end\n\n # Clear any references to the debuggee thread and context\n @debug_thread = nil\n @debug_context = nil\n @eval_context = nil\n end", "def test_basic\n Dir.chdir(SRC_DIR) do \n assert_equal(true, \n run_debugger(\"info\", \n \"--script info.cmd -- gcd.rb 3 5\"))\n end\n end", "def debug?; run_options[:debug]; end", "def debug(progname = nil, &block)\n add(DEBUG, nil, progname, &block)\n end", "def restart_debug\n restart do\n debug\n end\n end", "def open_active_debugger(pid)\n ITwibDebugger.new(@connection, @device_id, send(Command::OPEN_ACTIVE_DEBUGGER, [pid].pack(\"Q<\")).wait_ok.object_ids[0])\n end", "def manual_debug_code(program)\n print(\"[Starting a Debug Session with @#{caller.first}]\\n\")\n write_temp_file(strip_line_num(program))\n remote_info = setup_unix_doman_socket_remote_debuggee\n\n while !File.exist?(remote_info.sock_path)\n sleep 0.1\n end\n\n DEBUGGER__::Client.new([socket_path]).connect\n ensure\n kill_remote_debuggee remote_info\n end", "def minimal_program\n <<-RUBY\n module Byebug\n byebug\n\n \"Hello world\"\n end\n RUBY\n end", "def debugging?\n ENV['DEBUG'] && ENV['DEBUG'] != ''\nend", "def debug?\n @debug || to_bool( ENV['LAUNCHY_DEBUG'] )\n end", "def enable_breakpoint(bp)\n bp.enable\n end", "def activate_debugger(thread, ctxt, bp_list)\n @debug_thread = thread\n @interface.at_breakpoint(self, thread, ctxt, bp_list)\n end", "def setup\n # Each debugger test has its own debugger instance.\n @debugger = Google::Cloud::Debugger.new\n debugger_credentials = @debugger.service.credentials\n debugger_channel_cred = GRPC::Core::ChannelCredentials.new.compose \\\n GRPC::Core::CallCredentials.new debugger_credentials.client.updater_proc\n @vtk_debugger_client = Google::Cloud::Debugger::V2::Debugger::Client.new do |config|\n config.credentials = debugger_channel_cred\n end\n\n @debugger.start\n\n refute_nil @debugger, \"You do not have an active debugger to run the tests.\"\n refute_nil @vtk_debugger_client, \"You do not have an active debugger vtk client to run the tests.\"\n super\n end", "def debugger_address=(_arg0); end", "def fire!(argv=ARGV)\n $DEBUG = argv.include?('--debug') || $DEBUG\n return fire if $DEBUG\n begin\n fire\n rescue => err\n puts \"#{$0}: error #{err}\"\n end\n end", "def debugger_check(file_name)\n # File.extname method will grab the extension. If the extension is for a JS/CoffeeScript file, we want to do a check for debugger statements\n if File.extname(file_name) === '.js' || File.extname(file_name) === '.coffee'\n puts \"Checking for debugger statements left behind...\"\n\n # open each JS file and run through prompt\n File.open(file_name, 'r').each_with_index { |line, idx|\n # skip over file if the lines begin with a comment, single quote, or double quote\n next if line =~ /^$|\\\"|\\'|\\/|\\#/\n\n #if we find a debugger statement\n if line =~ /debugger/\n # give an opportunity for user to view the debugger statement for context\n print \" found debugger in #{file_name} would you like to see instance [y/n]: \"\n response = STDIN.gets.chomp.downcase\n case response\n when 'y'\n print file_name + \":#{idx+1} \"\n # if the instance is towards the beginning or end of file (so there are not 2 lines above or 2 lines below), then print just the single line\n if idx < 2 || idx > IO.readlines(file_name).size-2\n puts line\n else\n # print two lines and two lines below debugger statement\n puts IO.readlines(file_name)[idx-2..idx+2].join()\n end\n end\n\n # ask user if they want to automatically remove the debugger statement\n print \"> Remove this debugger statement? [y/n] Ctrl-c to exit and abort push at any time: \"\n response = STDIN.gets.chomp.downcase\n\n case response\n # if the user wants to automatically make a change, this block will open up the current file and sub 'debugger' or 'debugger;' with an empty string.\n # This does not currently remove the new line created by the debugger statement in the first place\n when 'y'\n newer_contents = File.read(file_name).gsub(/debugger;|debugger/, \"\")\n File.open(file_name, \"w\") {|file| file.puts newer_contents }\n puts 'replaced!'\n file_changes_made = true\n end\n end\n }\n end # end statement for JS/CoffeeScript extension conditional\nend", "def breakpoint()\n #This is a stub, used for indexing\n end", "def debug? ; $DEBUG ; end", "def enable_debug(file = nil)\n set_debug_file(file.to_s)\n end", "def enter_debug_mode_delay!\n if dut.respond_to?('enter_debug_mode_delay!'.to_sym)\n cc 'Using DUT-defined #enter_debug_mode_delay! for core to enter debug mode'\n dut.enter_debug_mode_delay!\n else\n cc \"Delaying #{enter_debug_mode_delay_cycles} cycles for core to enter debug mode\"\n tester.cycle(repeat: enter_debug_mode_delay_cycles)\n end\n end", "def include_debug_build_modes(bundle_name=nil)\n env = environment_for(bundle_name) || {}\n [(env[:include_debug] || :development)].flatten\n end", "def debug?\n true\n end", "def debug?\n true\n end", "def do_debug\n # debugging = true\n debugging = false\n puts yield if debugging\n end", "def binstub\n cmd = \"exe/byebug\"\n return [cmd] unless Gem.win_platform?\n\n [RbConfig.ruby, cmd]\n end", "def show\n #debugger\n end", "def yield_debugger\n <<-CODE\n cpu_yield_debugger(state, c);\n CODE\n end", "def debug! \n $DEBUG = true\n end", "def run(&_block)\n @state ||= Byebug::RegularState.new(\n Byebug.current_context,\n [],\n Byebug.current_context.frame_file,\n interface,\n Byebug.current_context.frame_line\n )\n\n return_value = nil\n\n command = catch(:breakout_nav) do # Throws from PryByebug::Commands\n return_value = yield\n {} # Nothing thrown == no navigational command\n end\n\n # Pry instance to resume after stepping\n @pry = command[:pry]\n\n perform(command[:action], command[:options])\n\n return_value\n end", "def connect\n begin\n port = get_debugger_port\n rescue\n # Sometimes this will fail if we don't wait long enough, try one more time\n sleep(2)\n port = get_debugger_port\n end\n connect_host_port(\"localhost\", port)\n end", "def breakpoint?\n type == :breakpoint\n end", "def in_debug_mode(with_core_halted: false)\n enter_debug_mode(halt_core: with_core_halted)\n yield\n exit_debug_mode(release_core: with_core_halted)\n end", "def debug?; end", "def debug?; end", "def enable_debug(file = nil)\n set_debug_file(file.to_s)\n self\n end", "def show\n # byebug\n end", "def test_close_on_error\n debugger = fdb :debugger do |t|\n t.kill_on_fault = true\n t.file = @exception_swf\n t.run\n t.continue\n end\n \n assert_raises Sprout::FDBTaskError do\n debugger.invoke\n end\n \n end", "def debug_through?\r\n return false\r\n end", "def initialize\n @breakpoint_tracker = BreakpointTracker.new do |thread, ctxt, bp|\n activate_debugger thread, ctxt, bp\n end\n\n # Register this debugger as the default debug channel listener\n Rubinius::VM.debug_channel = @breakpoint_tracker.debug_channel\n\n @quit = false\n @breakpoint_listener = Thread.new { handle_breakpoints }\n Thread.pass until waiting_for_breakpoint?\n end", "def print_debug(s)\n config = BeEF::Core::Configuration.instance\n if config.get('beef.debug') || BeEF::Core::Console::CommandLine.parse[:verbose]\n puts Time.now.localtime.strftime(\"[%k:%M:%S]\")+'[>]'.yellow+' '+s.to_s\n end\nend", "def debug_mode\n @@debug_mode == 1\n end", "def debug?\n debugging || !ENV['DEBUG'].nil?\n end", "def debug?\n @debug || ENV['HATCHET_DEBUG'] || false\n end", "def debug?\n puts \"Debug mode is #{@shell_debug ? 'ON' : 'OFF'}\\n\\n\"\n nil\nend", "def wait_for_debugger\n {\n method: \"Page.waitForDebugger\"\n }\n end", "def start_pry(binding, file = nil, header = nil)\n PryDebug.synchronize do\n puts header if header\n\n ret = catch(:resume_debugging!) do\n Pry.start(binding, :commands => ShortCommands)\n end\n\n if ret == :next\n PryDebug.stepped_file = file\n end\n\n # In case trace_func was changed\n set_trace_func trace_proc\n end\n end", "def run_byebug(*args, input: \"\")\n run_program([*binstub, *args], input)\n end", "def is_breakpoint_deferred(ip)\r\n if !ip.kind_of? String\r\n return false\r\n end\r\n\r\n m,f = ip.split('!')\r\n\r\n if f.nil? or m.nil?\r\n return true\r\n end\r\n\r\n modules.each do |d|\r\n if d.szModule.to_s.match(/#{m}/)\r\n return false\r\n end\r\n end\r\n\r\n return true\r\n end", "def activate_compiler_deps\n dependency \"rake-compiler\", \"~> 1.0\", :development\n\n gem \"rake-compiler\", \"~> 1.0\"\n rescue LoadError\n warn \"Couldn't load rake-compiler. Skipping. Run `rake newb` to fix.\"\n end", "def set_breakpoint(source, pos, condition = nil)\n #This is a stub, used for indexing\n end", "def debugging?\n debugging = ENV[\"DEBUG\"]\n if defined?(Rails) && Rails.respond_to?(:env)\n debugging = true if [\"development\", \"test\"].include? Rails.env\n end\n debugging\n end", "def trigger_breakpoint\n local_var = 6 * 7\n local_var\n end", "def debug_on(debug=true)\n ap \"Debugging is ON\"\n @debug = debug\n end", "def blockdev?() end", "def debug?\n false\n end", "def call_pry\n return unless Rails.env.development? && @debug\n Ncurses.def_prog_mode\n Ncurses.reset_shell_mode\n binding.pry # rubocop:disable Lint/Debugger\n Ncurses.reset_prog_mode\n end", "def toggle_debug\n @debug = @debug == false ? true : false\n end", "def show\n # debugger\n end", "def debugger_statement(var_env)\n return nil unless eql_lit?(ECMA262::ID_DEBUGGER)\n if semicolon(var_env)\n ECMA262::StDebugger.new\n else\n raise ParseError.new(\"no semicolon at end of debugger statement\", self)\n end\n end", "def start(settings = {:immediate => false})\n @settings = @settings.merge(settings)\n skip_loader if @settings[:skip_loader]\n spinup_thread\n @debugee_thread = @thread\n if @settings[:hide_level]\n @processor.hidelevels[@thread] = @settings[:hide_level]\n end\n\n # Feed info to the debugger thread!\n locs = Rubinius::VM.backtrace(@settings[:offset] + 1, true)\n\n method = Rubinius::CompiledMethod.of_sender\n\n event = settings[:immediate] ? 'debugger-call' : 'start'\n bp = Trepanning::Breakpoint.new('<start>', method, 0, 0, 0, \n {:event => event}\n )\n channel = Rubinius::Channel.new\n\n @local_channel.send Rubinius::Tuple[bp, Thread.current, channel, locs]\n\n # wait for the debugger to release us\n channel.receive\n\n Thread.current.set_debugger_thread @thread\n self\n end", "def rungdb\n gdbcmd = \"gdb --batch --quiet -x \\\"#{@cmdfilepath}\\\" \\\"#{@dsymfile}\\\"\"\n gdbout = `#{gdbcmd}`\n gdbout\n end", "def run(args, temp=false)\n\n arg_str = args.size == 1 ? @proc.frame.line.to_s : @proc.cmd_argstr\n cm, file, line, position_type, expr, negate = \n @proc.breakpoint_position(arg_str, true)\n if file.nil?\n unless @proc.context\n errmsg 'We are not in a state that has an associated file.'\n return \n end\n file = @proc.frame.file\n if line.nil? \n # Set breakpoint at current line\n line = @proc.frame.line\n end\n end\n\n if line\n if LineCache.cache(file, settings[:reload_source_on_change])\n last_line = LineCache.size(file)\n if line > last_line\n errmsg(\"There are only %d lines in file \\\"%s\\\".\" % [last_line, \n @proc.canonic_file(file)]) \n return\n end\n syntax_errors = Trepan::ruby_syntax_errors(file)\n if syntax_errors\n msg [\"File #{file} is not a syntactically correct Ruby program.\",\n \"Therefore we can't check line numbers.\"]\n return unless confirm('Set breakpoint anyway?', false)\n else\n unless LineCache.trace_line_numbers(file).member?(line)\n errmsg('Line %d is not a stopping point in file \"%s\".' % \n [line, @proc.canonic_file(file)])\n return\n end\n end\n else\n errmsg('No source file named %s' % @proc.canonic_file(file))\n return unless confirm('Set breakpoint anyway?', false)\n end\n \n unless @proc.context\n errmsg 'We are not in a state we can add breakpoints.'\n return \n end\n\n expr = \"!(#{expr})\" if negate\n if temp\n @proc.state.context.set_breakpoint(file, line, expr)\n msg(\"Temporary breakpoint set at file %s, line %d\" % [file, line])\n else \n b = Debugger.add_breakpoint file, line, expr\n msg(\"Breakpoint %d file %s, line %d\" % \n [b.id, @proc.canonic_file(file), line])\n end\n # unless syntax_valid?(expr)\n # errmsg(\"Expression \\\"#{expr}\\\" syntactically incorrect; breakpoint disabled.\\n\")\n # b.enabled = false\n # end\n # else\n # method = line.intern.id2name\n # b = Debugger.add_breakpoint class_name, method, expr\n # print \"Breakpoint %d at %s::%s\\n\", b.id, class_name, method.to_s\n end\n end", "def remote_debug args\n require 'pry-remote'\n remote(args) do |ssh|\n ssh.forward.local 9876, '127.0.0.1', 9876\n ssh.forward.remote 9877, '127.0.0.1', 9877\n debugging = true\n Thread.new { ssh.loop { debugging } }\n PryRemote::CLI.new(['-P', '9877']).run\n debugging = false\n end\n end", "def debugging?\n Options[:debug]\n end", "def update_call_debug\r\n # If debug mode is ON and F9 key was pressed\r\n if $DEBUG and Input.press?(Input::F9)\r\n # Set debug calling flag\r\n $game_temp.debug_calling = true\r\n end\r\n end", "def debug(*args, &block)\n add_with_options(DEBUG, *args, &block)\n end", "def __debug(*args, **opt, &block)\n __debug_impl(*args, **opt, &block)\nend", "def debugging?\n\t\t(datastore['DEBUG'] || '') =~ /^(1|t|y)/i\n\tend", "def set_debugger_thread(thr)\n raise TypeError, \"Must be another Thread\" unless thr.kind_of?(Thread)\n\n @debugger_thread = thr\n end", "def debug_handler ctx\n bc = ByteCodes.new\n bc.codes = [:spy, :halt, :iret]\n return bc, ctx\nend", "def get_debugger_port\n throw \"Could not get devices from adb\" if @adb.getDevices.size == 0\n dev = @adb.getDevices[0]\n sleep(1)\n throw \"Could not get clients for device (#{dev})\" if dev.getClients.size == 0\n dev.getClients.each do |cli|\n $DEBUG and puts(\"Found process: #{cli}\")\n if(cli.getClientData.getDebuggerConnectionStatus.to_s == \"WAITING\")\n $DEBUG and puts(\"Found process waiting for debugger: #{cli} : #{cli.getDebuggerListenPort}\")\n return(cli.getDebuggerListenPort)\n end\n end\n throw(\"Could not find a process waiting for debugger.\")\n return(nil)\n end", "def symbolicate!\n return if @isSymbolicated\n buildgdbcommandfile\n gdbout = rungdb\n @symbols = []\n gdbout.lines.each do |l|\n @symbols << Symbolized.new(l)\n end\n \n addresses.each do |a|\n @symbols.each do |s|\n if s.startaddress && a >= s.startaddress && a <= s.endaddress\n report.gsub!(/(0x.*#{a.to_s(16)}) (.*)/, \"#{$1} #{s.symbol} (#{s.filename}:#{s.line})\")\n end # address matches\n end # @symbols.each\n end# addresses.each\n @isSymbolicated = true\n end", "def remove_debugger_frames(bindings); end", "def install_docopt\n # Check for docopt gem. Use system gem, not rbenv or rvm.\n # The OS X services will require use of system Ruby.\n begin\n require 'docopt'\n docopt_status = true\n rescue LoadError => e\n docopt_status = false \n end\n\n unless docopt_status\n puts \"Docopt gem does not appear to be installed.\"\n puts \"Installing...\"\n `sudo /usr/bin/gem install docopt --no-document 2> /dev/null`\n if $?.success?\n puts\n puts \"Docopt installed successfully.\"\n else\n puts \"Docopt gem failed to install.\"\n puts \"Check your Ruby configuration and try again.\"\n exit\n end\n end \nend", "def start\n require File.dirname(__FILE__) + '/wirb/irb' if defined?(IRB)\n @running = true\n rescue LoadError\n warn \"Couldn't activate Wirb\"\n end", "def update!(**args)\n @enable_debugging = args[:enable_debugging] if args.key?(:enable_debugging)\n end", "def update!(**args)\n @enable_debugging = args[:enable_debugging] if args.key?(:enable_debugging)\n end" ]
[ "0.7490139", "0.68619466", "0.6566678", "0.6399796", "0.63815385", "0.6379341", "0.6299939", "0.60801005", "0.59769017", "0.5965962", "0.5965962", "0.58396", "0.58355117", "0.5805803", "0.57630837", "0.56930465", "0.562789", "0.56140256", "0.54856664", "0.5480241", "0.54628813", "0.54330343", "0.5415934", "0.5384171", "0.5345085", "0.53426313", "0.53409755", "0.534049", "0.5333135", "0.5306303", "0.52772135", "0.52605283", "0.5187489", "0.51857513", "0.5159586", "0.51378596", "0.5117303", "0.5116175", "0.5098764", "0.5093823", "0.50924206", "0.50468767", "0.50438637", "0.5022901", "0.5022565", "0.5022565", "0.4985234", "0.49566683", "0.4942619", "0.49385223", "0.49349886", "0.49267668", "0.49219024", "0.49162993", "0.4914123", "0.49102885", "0.49102885", "0.49069816", "0.4903128", "0.48953545", "0.4889866", "0.48876348", "0.48838618", "0.48819226", "0.48698592", "0.48591697", "0.48565987", "0.4853388", "0.4842244", "0.48403367", "0.48371193", "0.4816964", "0.48164365", "0.481521", "0.48150745", "0.48150727", "0.48022443", "0.47965863", "0.4792458", "0.47891688", "0.47842398", "0.47764805", "0.47695956", "0.4758896", "0.47571352", "0.47549248", "0.4733122", "0.47279269", "0.4721523", "0.4701329", "0.46988365", "0.46917126", "0.46637312", "0.46604636", "0.4650907", "0.4639026", "0.4631064", "0.46277976", "0.46257696", "0.46257696" ]
0.8706907
0
GET /song_likes/1 GET /song_likes/1.json
def show @song_like = SongLike.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @song_like } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_likes media_id\n url = API + \"media/#{media_id}/likes?access_token=\" + @access_token\n get(url)['data'].map {|data| data}\n end", "def user_likes\n user = User.find(params[:user_id])\n likes = user.likes\n render json: likes\n\nend", "def index\n @likes = Like.all\n render json: @likes, status: 200\n end", "def index\n @music_likes = MusicLike.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @music_likes }\n end\n end", "def get_liked(username, track_id)\n @client.get(\"/users/#{username}/favorites/#{track_id}\")\n rescue SoundCloud::ResponseError\nend", "def postlikes\n render json: @likes.length, status: 200\n end", "def liked\n get '/users/self/media/liked', auth_params\n end", "def show\n render json: Like.find(params[\"id\"])\n end", "def show\n @music_like = MusicLike.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @music_like }\n end\n end", "def increment_likes\n sneaker = find_sneaker\n sneaker.update(likes: sneaker.likes + 1)\n render json: sneaker\n end", "def index\n @user_likes = UserLike.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_likes }\n end\n end", "def liking?(song)\n likes.include?(song)\n end", "def like_or_dislike\n\t\tresponse.headers['Content-Type'] = 'text/javascript' # Tells Rails/Redis that content is JavaScript\n\t\troom = current_user.room\n\t\tusers = room.users.length\n\t\tcurrent_song = Song.where(currently_playing: true).first\n\t\tlikes = current_song.likes\n\t\tdislikes = current_song.dislikes\n\t\t# --- Increments either like or dislike to all users depending on which is clicked ---\n\t\tif params[:vote] == 'like'\n\t\t\tlikes += 1\n\t\t\tcurrent_song.update_attributes(likes: likes)\n\t\t\t$redis.publish(\"like_or_dislike_#{room.id}\", {vote: 'like', sc_ident: current_song.sc_ident, users: users, likes: likes}.to_json)\n\t\telsif params[:vote] == 'dislike'\n\t\t\tdislikes += 1\n\t\t\tcurrent_song.update_attributes(dislikes: dislikes)\n\t\t\t$redis.publish(\"like_or_dislike_#{room.id}\", {vote: 'dislike', sc_ident: current_song.sc_ident, users: users, dislikes: dislikes}.to_json)\n\t\tend\n\t\t# --- end ---\n\t\trender nothing: true\n\tend", "def moment_likes(moment_id)\n get(\"/v1/moments/#{moment_id}/likes\")\n end", "def likes\n Like.where(:song_path => path).group(:user_id)\n end", "def index\n @c_likes = CLike.all\n if params[:comment_id].present?\n like = CLike.find_by(user_id: current_user.id, comment_id: params[:comment_id])\n render json: {status: 'success', like: like, counts: CLike.where(comment_id: params[:comment_id]).count, liked: like.present?}\n end\n end", "def like\n like = API.like(params[:id], params[:access_token], params[:token_secret])\n if like['photo'].nil?\n render :json => like\n else\n render :json => {success: true}\n end\n end", "def like!\n connection.post(\"/photos/#{id}/like\")\n true\n end", "def show\n @like = Like.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @like }\n end\n end", "def show\n @like = Like.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @like }\n end\n end", "def set_liked_song\n @liked_song = LikedSong.find(params[:id])\n end", "def set_likes\n @likes = likes.find(params[:id])\n end", "def likes(options = {})\n urn = options.delete(:urn)\n path = \"/socialActions/#{urn}/likes\"\n get(path, options)\n end", "def show\n @likes = Like.where(tweet_id: @tweet)\n end", "def index\n @like_system_likes = LikeSystem::Like.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @like_system_likes }\n end\n end", "def show\n @user_like = UserLike.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_like }\n end\n end", "def music_list\n @musics = Music.find_musics_by_user(current_user.id)\n \n music_like = MusicLike.new\n music_like.user_id = current_user.id\n hash = params[:like]\n if hash != nil\n hash_invert = hash.invert\n music_like.music_id = hash_invert.values_at(\"like\").first.to_i\n music_like.save\n\n music = music_like.music\n sql = ActiveRecord::Base.connection()\n sql.execute(\"UPDATE musics SET musics.popularity = musics.popularity + 1 WHERE musics.id = \" + music.id.to_s)\n end\n \n redirect_to '/musics/home'\n end", "def venue_likes(id)\n get(\"venues/#{id}/likes\").likes\n end", "def like_album(album_id,liker_id)\n response = put(\"albums/#{album_id}/likers/#{liker_id}\",true) \n end", "def like!\n self.like_count = self.like_count + 1\n self.save\n logger.debug \"Song :: #{self.title} liked.\"\n end", "def show\n @tweet_likes = @tweet.likes\n end", "def new\n @song_like = SongLike.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @song_like }\n end\n end", "def likes( params={} )\n likes = get_connections(\"likes\", params)\n return map_connections likes, :to => Facebook::Graph::Like\n end", "def quote_like\n @quote = set_quote\n @quote.cnt += 1\n respond_to do |format|\n if @quote.save\n #format.html { redirect_to @quote, notice: 'Quote was successfully liked.' }\n #format.json { render :show, status: :created, location: @quote }\n format.json { render json: {:data => { :quotes => @quote}, :result => { :errorcode => \"\", :messages => \"ok\", :rstatus => 1 }} }\n else\n #format.html { render :new }\n #format.json { render json: @quote.errors, status: :unprocessable_entity }\n format.json { render json: { :result => { :errorcode => \"\", :messages => @quote.errors, :rstatus => 0 }} }\n end\n end\n end", "def quote_like\n @quote = set_quote\n @quote.cnt += 1\n respond_to do |format|\n if @quote.save\n #format.html { redirect_to @quote, notice: 'Quote was successfully liked.' }\n #format.json { render :show, status: :created, location: @quote }\n format.json { render json: {:data => { :quotes => @quote}, :result => { :errorcode => \"\", :messages => \"ok\", :rstatus => 1 }} }\n else\n #format.html { render :new }\n #format.json { render json: @quote.errors, status: :unprocessable_entity }\n format.json { render json: { :result => { :errorcode => \"\", :messages => @quote.errors, :rstatus => 0 }} }\n end\n end\n end", "def likes(username, opts={})\n opts = opts.merge({:https => @https})\n Likes.likes(username, @api_key, opts)\n end", "def fb_likes_url(access_token)\n \"https://graph.facebook.com/#{self.fb_object_id}?\" \\\n \"access_token=#{access_token}&fields=id,likes&\" \\\n \"likes.limit=50\"\n end", "def show\n @music = Music.find(params[:id], :include => [{:comments => :user}, :user])\n if session[:user_id] and @rating = @music.ratings.find_by_user_id(session[:user_id])\n @my_rating = @rating.stars\n end\n\n unless session[:hits] and session[:hits].include? @music.id\n session[:hits] ||= []\n session[:hits] << @music.id\n\n @music.hits += 1\n @music.save\n end\n\n @playlists = Playlist.where(:user_id => session[:user_id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @music }\n end\n end", "def show\n @likesforreply = Likesforreply.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @likesforreply }\n end\n end", "def likes( params={} )\n likes = get_connections(\"likes\", params)\n return map_connections likes, :to => Facebook::Graph::Generic\n end", "def show\n @like_system_like = LikeSystem::Like.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @like_system_like }\n end\n end", "def like_hello\n @client.search(\"#{@hashtbonjour}\", result_type: \"recent\").take(25).collect do |tweet|\n @client.favorite(tweet)\n end\n end", "def likes\n\t\t@likes ||= fetch_likes\n\tend", "def getSong\n\t\tid = params[:songId]\n\t\tresult = GetSongFromSpotify.build.call(id)\n\t\trender json: result\n\tend", "def songs\n \t@songs = Album.find(params[:id])\n songs = RSpotify::Track.search(@songs.name)\n \t@songs = songs.map do |s_songs|\n \tSong.new_from_spotify_song(s_songs)\n end\n render json: {data:@songs}\n end", "def index\n @likes = Like.all\n end", "def index\n @likes = Like.all\n end", "def likes\n @likes = @person.likes\n end", "def object_likes(uid, options = {})\n fetch_all = options.delete(:fetch_all)\n\n params = { \n :owner_id => user.identifier,\n :count => 1000, \n :type => \"post\", \n :item_id => uid,\n :offset => 0\n }\n params.merge!(options)\n \n if fetch_all\n return fetch_all_method_items(\"likes.getList\", params)\n end\n\n\n user.likes.getList(params)\n end", "def show\n @song = Song.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @song }\n end\n end", "def show\n @post_like = PostLike.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post_like }\n end\n end", "def likes\n likes_response = client.get(\"/venues/#{id}/likes\")[\"response\"]\n @likes = {}\n if likes_response[\"likes\"]\n @likes.merge!(likes_response[\"likes\"])\n if @likes[\"groups\"]\n @likes[\"groups\"].each do |group|\n group[\"items\"].map!{|item| Foursquared::Response::User.new(client, item)}\n end\n end\n end\n @likes\n end", "def like\n @id = params[:id]\n if photo_service.like(@id)\n Like.find_or_create_by(user_id: session[:uid], photo_id: @id)\n end\n respond_to do |format|\n format.html { redirect_to root_path }\n format.js {}\n end\n end", "def find_like\n @like = @post.likes.find(params[:id])\n end", "def show\n @photo = Photo.find(params[:id])\n liked_status = \"\"\n liked_status = (current_user.liked? @photo) if current_user\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo.as_json(liked_status, current_user) }\n \n end\n end", "def index\n @likes = Like.in_conference(current_conference).all\n end", "def like\n if @vote\n authorize! :like, @vote\n @vote.like\n else \n authorize! :create_vote, @votable.votes.new\n @votable.votes.create(user: current_user, nominal: 'like')\n end\n\n rating_respond_with_json\n end", "def get_likes(id, type)\r\n\t\treturn Like.where(user_id: self.id, likeable_type: type, likeable_id: id)\r\n\tend", "def create\n @song_like = SongLike.new(params[:song_like])\n\n respond_to do |format|\n if @song_like.save\n format.html { redirect_to @song_like, notice: 'Song like was successfully created.' }\n format.json { render json: @song_like, status: :created, location: @song_like }\n else\n format.html { render action: \"new\" }\n format.json { render json: @song_like.errors, status: :unprocessable_entity }\n end\n end\n end", "def get_random_like(client)\n likes = client.favorites(self.get_uid_int, options = {count: 5})\n like = likes.sample\n end", "def show\n @article = Article.find(params[:id])\n if current_account\n @like = @article.likes.where(:account_id => current_account).first\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @article }\n end\n end", "def index\n @likes = target.likes.includes(:author => :profile)\n @people = @likes.map(&:author)\n\n respond_to do |format|\n format.all { render :layout => false }\n format.json { render :json => @likes.as_api_response(:backbone) }\n end\n end", "def index\n @songs = Song.page(page).per(per_page)\n render jsonapi: @songs,\n include: include_params,\n meta: {\n **total_count_meta_for(@songs)\n },\n links:{\n **pagination_links_for(@songs,request.url)\n },\n fields: fields_params\n end", "def likes\n UserReaction.where(note_id: self.id, like: 1).count\n end", "def index\n @hitcher_likes = HitcherLike.all\n end", "def who_likes(url)\n track = resolve_url(url)\n if track && track.kind == \"track\"\n @users.map {|username|\n if get_liked(username, track.id)\n username\n end\n }.compact\n else # TODO: handle if track isn't found\n []\n end\nend", "def like?\n response[\"like\"]\n end", "def show\n @song = Song.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @song }\n end\n end", "def show\n @song = Song.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @song }\n end\n end", "def show\n @song = Song.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @song }\n end\n end", "def show\n @song = Song.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @song }\n end\n end", "def likes_given(user_id)\n likes = Like.where(user_id: user_id)\n end", "def show\n @tweet = Tweet.find(params[:id]) #Encontramos el tweet segun el ID\n @tweet_likes = @tweet.likes #Creamos la variable para mostrar los usuarios que le dieron el like\n end", "def show\n @liked_item = LikedItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @liked_item }\n end\n end", "def destroy\n @song_like = SongLike.find(params[:id])\n @song_like.destroy\n\n respond_to do |format|\n format.html { redirect_to song_likes_url }\n format.json { head :no_content }\n end\n end", "def likes\n query = \"SELECT COUNT(*) AS num_likes FROM likes WHERE post_id = #{id}\"\n result = DATABASE.execute(query)[0]\n return result[\"num_likes\"]\n end", "def index\n @question_likes = QuestionLike.all\n end", "def share_likes(update_key, options={})\n path = \"#{person_path(options)}/network/updates/key=#{update_key}/likes\"\n simple_query(path, options)\n end", "def likes\n return (@likes.present?) ? @likes : ActiveRecord::Base.connection.execute(\"SELECT COUNT(news_id) AS count FROM newslikes WHERE news_id = #{self.id.to_s}\")[0][\"count\"]\n end", "def index\n @songs = Song.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @songs }\n end\n end", "def liked_song_params\n params.fetch(:liked_song, {})\n end", "def index\n \n @songs = Song.order 'id'\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @songs }\n end\n end", "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @song }\n end\n end", "def likes\n @page.like_count\n end", "def venue_likes venue_id\n response = get(\"/venues/#{venue_id}/similar\")[\"response\"][\"similarVenues\"]\n response[\"items\"].map!{|item| Foursquared::Response::Venue.new(self, item)}\n response\n end", "def verb\n \"like\"\n end", "def show\n @song = Song.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @song }\n end\n end", "def index\n # @songs = Song.find_by_artist_id params[:artist_id]\n @songs = Song.find_all_by_artist_id params[:artist_id]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @songs }\n end\n end", "def show\n @love = Love.find(params[:id])\n render json: @love\n end", "def likes\n Activity.joins(:activity_verb).where('activity_verbs.name' => \"like\").\n joins(:activity_objects).where('activity_objects.id' => activity_object_id)\n end", "def update\n render json: Like.update(params[\"id\"], params[\"like\"])\n end", "def index\n @likes = Like.where(tweet_id: params[:tweet_id])\n @tweets = Tweet.paginate(page: params[:page], per_page: 10)\n end", "def user_screams\n # Update the user for the current item he checks that he likes the item.\n # Return JSON with ok if the updation is done succesfully else return a error status to the user.\n if current_user\n Rails.logger.debug { \"The current loged in user is #{current_user.email}\" }\n audio = Audio.find(params[:id])\n current_user.screams << audio\n render nothing: true , status: 200\n else\n render nothing: true , status: 400\n end\n end", "def index\n @script_likes = ScriptLike.all\n end", "def show\n @song = Song.find(:id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @song }\n end\n end", "def index\n @songs = Song.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @songs }\n end\n end", "def im_feeling_lucky(query)\n # Check if we need a new Grooveshark session\n if session_expired?\n init_grooveshark\n end\n query.strip!\n\n # Ask Grooveshark for a song\n songs = []\n begin\n songs = @grooveshark_client.search_songs(query)\n rescue Exception\n end\n song = songs.first\n\n # If we got a song, play it\n unless song.nil?\n play_song_with_id(song.id)\n return song.to_json\n else\n return nil\n end\n end", "def home\n # /controllers/musics_controller/music_list\n @musics = Music.find_musics_by_user(current_user.id)\n \n music_like = MusicLike.new\n music_like.user_id = current_user.id\n hash = params[:like]\n if hash != nil\n hash_invert = hash.invert\n music_like.music_id = hash_invert.values_at(\"like\").first.to_i\n music_like.save\n\n music = music_like.music\n sql = ActiveRecord::Base.connection()\n sql.execute(\"UPDATE musics SET musics.popularity = musics.popularity + 1 WHERE musics.id = \" + music.id.to_s)\n end\n\n end", "def get_likes\n Like.all.select {|like| like.dog_id == self.id}\n end", "def get_likes\n Like.all.select {|like| like.dog_id == self.id}\n end" ]
[ "0.74144506", "0.7113796", "0.69737786", "0.6957806", "0.68721765", "0.677707", "0.67316383", "0.67182994", "0.66611516", "0.6635103", "0.6554324", "0.6549576", "0.65431774", "0.65418196", "0.65213966", "0.6510953", "0.64888287", "0.6461324", "0.6431884", "0.6431884", "0.6405729", "0.6393303", "0.63795483", "0.6353112", "0.63470376", "0.6339106", "0.6337733", "0.63230485", "0.63129944", "0.6303789", "0.62773395", "0.62731767", "0.6260996", "0.62541634", "0.62541634", "0.6238587", "0.62382644", "0.62373966", "0.6222019", "0.62109476", "0.6206247", "0.61991894", "0.6192994", "0.6190198", "0.6186183", "0.6165074", "0.6165074", "0.6142536", "0.61401606", "0.61255634", "0.6103428", "0.6091999", "0.6077544", "0.60717046", "0.6060314", "0.60397416", "0.6035539", "0.6024768", "0.60091394", "0.5998044", "0.59718454", "0.59683514", "0.596526", "0.5957189", "0.5951537", "0.59319377", "0.5931809", "0.59282166", "0.59282166", "0.59282166", "0.59282166", "0.5926305", "0.59133655", "0.5905053", "0.59022725", "0.5895039", "0.58894515", "0.5887574", "0.5885475", "0.58836746", "0.5865929", "0.5865576", "0.5865084", "0.58633953", "0.5849895", "0.5848277", "0.58455473", "0.584445", "0.5840881", "0.5837853", "0.5834784", "0.58248043", "0.58223945", "0.58209413", "0.58158064", "0.58100474", "0.5793215", "0.57801145", "0.5774765", "0.5774765" ]
0.72974855
1
GET /song_likes/new GET /song_likes/new.json
def new @song_like = SongLike.new respond_to do |format| format.html # new.html.erb format.json { render json: @song_like } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @like = Like.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @like }\n end\n end", "def create\n @song_like = SongLike.new(params[:song_like])\n\n respond_to do |format|\n if @song_like.save\n format.html { redirect_to @song_like, notice: 'Song like was successfully created.' }\n format.json { render json: @song_like, status: :created, location: @song_like }\n else\n format.html { render action: \"new\" }\n format.json { render json: @song_like.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @music_like = MusicLike.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @music_like }\n end\n end", "def new\n @song = @playlist.songs.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @song }\n end\n end", "def new\n @post_like = PostLike.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post_like }\n end\n end", "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @song }\n end\n end", "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @song }\n end\n end", "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @song }\n end\n end", "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @song }\n end\n end", "def new\n @user_like = UserLike.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_like }\n end\n end", "def create\n @music_like = MusicLike.new(params[:music_like])\n\n respond_to do |format|\n if @music_like.save\n format.html { redirect_to @music_like, :notice => 'Music like was successfully created.' }\n format.json { render :json => @music_like, :status => :created, :location => @music_like }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @music_like.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @song }\n end\n end", "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @song }\n end\n end", "def new\n @like_system_like = LikeSystem::Like.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @like_system_like }\n end\n end", "def new\n\t\t@like = current_user.likes.new\n\tend", "def create\n @song_link ||= params[:song][:link]\n if @song_link\n song = Song.find_or_create_by(link: @song_link)\n render json: song\n end\n end", "def new\n @liked_item = LikedItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @liked_item }\n end\n end", "def create\n @like = Like.new(like_params)\n\n respond_to do |format|\n if @like.save\n format.json { render json: @like, status: :created }\n else\n format.json { render json: @like.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @feed_dislike = FeedDislike.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @feed_dislike }\n end\n end", "def new\n @comment = @song.comments.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comment }\n end\n end", "def create_likes\n end", "def create_likes\n end", "def create_likes\n end", "def create\n @like = Like.new(like_params)\n\n respond_to do |format|\n if @like.save\n format.html { redirect_to @like, notice: 'Like was successfully created.' }\n format.json { render :show, status: :created, location: @like }\n else\n format.html { render :new }\n format.json { render json: @like.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @like = Like.new(like_params)\n if @like.save\n render json: @like, status: 201\n else\n render json: @like.errors, status: 422\n end\n end", "def new\n @music = Music.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @music }\n end\n end", "def new\n @music = Music.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @music }\n end\n end", "def new\n @music = Music.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @music }\n end\n end", "def create\n @like = Like.new(like_params)\n @like.user = current_user\n\n respond_to do |format|\n if @like.save\n format.html{ redirect_to @like.likable }\n format.json{ render :show, status: :created, location: @like }\n else\n format.html{ redirect_to @like.likable, notice: @like.errors.messages.values.flatten.join(', ') }\n format.json{ render json: @like.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @music = Music.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @music }\n end\n end", "def create\n @like = @likable.likes.build(liker_id: current_user.id )\n\n respond_to do |format|\n if @like.save\n format.js {}\n else\n flash[:error] = \"Whoops, we didn't get that like saved. Try again.\"\n format.js { }\n end\n\n format.html { redirect_back(fallback_location: current_user ) }\n end\n end", "def create\n @song = Song.new(params[:song])\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render json: @song, status: :created, location: @song }\n else\n format.html { render action: \"new\" }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n @song\n end", "def create\n @song = Song.new(params[:song])\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, :notice => 'Song was successfully created.' }\n format.json { render :json => @song, :status => :created, :location => @song }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @song.errors, :status => :unprocessable_entity }\n end\n end\n end", "def show\n @song_like = SongLike.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @song_like }\n end\n end", "def create\n unless current_user.likes.where(seek: Seek.find(params[:id])).first\n current_user.likes.create(seek: Seek.find(params[:id]))\n redirect_to \"/seeks\"\n else\n redirect_to \"/users/#{current_user.id}\"\n end\n end", "def create\n # debugger\n like = Like.new(like_params)\n\n if like.save\n render json: like\n else\n render json: like.errors.full_messages, status: 422\n end\n end", "def new\n @wish = Wish.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @wish }\n end\n end", "def new\n @playing = Playing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @playing }\n end\n end", "def new\n @favorite = Favorite.new\n\n respond_to do |format|\n format.html # new.html.erb\n #format.json { render json: @favorite }\n end\n end", "def new\n @song = Song.new\n\n respond_to do |format|\n format.js\n format.json { render json: @song }\n end\n end", "def create #new like\n\t\tcreate_like = Likeable.create(foody: current_foody, photo_id: set_current_photo.id, review: 2)\n\t\tcreate_like.save\n\tend", "def postlikes\n render json: @likes.length, status: 200\n end", "def new\n @song = Song.new\n @song.verses.build\n @song.regions.build\n\n @kinds = Kind.all()\n @regions = Region.all()\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @song }\n end\n end", "def create\n @question_like = QuestionLike.new(question_like_params)\n\n respond_to do |format|\n if @question_like.save\n format.html { redirect_to @question_like, notice: 'Question like was successfully created.' }\n format.json { render action: 'show', status: :created, location: @question_like }\n else\n format.html { render action: 'new' }\n format.json { render json: @question_like.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @song = Song.new(params[:song])\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render json: @song, status: :created, location: @song }\n else\n format.html { render action: \"new\" }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @song = Song.new(params[:song])\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render json: @song, status: :created, location: @song }\n else\n format.html { render action: \"new\" }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @music = Music.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @music }\n end\n \n end", "def create\n @song = @artist.songs.new(song_params)\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render action: 'show', status: :created, location: @song }\n else\n format.html { render action: 'new' }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @fav = Fav.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fav }\n end\n end", "def create\n @song = Song.new(song_params)\n\n if @song.save\n render :show, status: :created, location: @song\n else\n render json: @song.errors, status: :unprocessable_entity\n end\n end", "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n end\n end", "def new\n @Love = Love.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @Love }\n end\n end", "def create\n @song = Song.new(song_params)\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render action: 'show', status: :created, location: @song }\n else\n format.html { render action: 'new' }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @like = Like.new(params[:like])\n @photo = @like.photo\n @likes = Like.order('created_at DESC').where(\"photo_id = ?\", @like.photo_id)\n @like.save\n \n respond_to do |format|\n format.html { render :layout => false }# new.html.erb\n format.js\n format.json { render json: @like }\n #if @like.save\n # format.html { redirect_to @like, notice: 'Like was successfully created.' }\n # format.json { render json: @like, status: :created, location: @like }\n #else\n # format.html { render action: \"new\" }\n # format.json { render json: @like.errors, status: :unprocessable_entity }\n #end\n end\n end", "def create\n #@song = Song.new(song_params)\n @song = @artist.songs.new(song_params)\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render action: 'show', status: :created, location: @song }\n else\n format.html { render action: 'new' }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @playlist = Playlist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @playlist }\n end\n end", "def new\n @playlist = Playlist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @playlist }\n end\n end", "def new\n @song = Song.new\n end", "def new\n @song = Song.new\n end", "def new\n @song = Song.new\n end", "def new\n @song = Song.new\n end", "def new\n # @playlist = Playlist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: { playlist: @playlist } }\n end\n end", "def create\n @like = @video.likes.build(params[:like])\n @like.user_id = @user.id\n @like.video_id = @video.id\n respond_to do |format|\n if @like.save\n format.html { redirect_to([@client,@video,@like], :notice => 'like was successfully created.') }\n format.xml { render :xml => @like, :status => :created, :location => @like }\n format.json { render :json => @like.attributes, :status => :created}\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @like.errors, :status => :unprocessable_entity }\n format.json { render :json => @like.attributes.merge({:errors => @like.errors}), :status => :unprocessable_entity}\n end\n end\n end", "def create\n @todo_like = Todo::Like.new(todo_like_params)\n @todo_user.likes << @todo_like\n\n if @todo_like.save\n render :show, status: :created\n else\n render_error @todo_like, status: :unprocessable_entity\n end\n end", "def new\n @song = Song.new\n @song_number = Song.last.song_number + 1\n\n end", "def create\n photo = Photo.find(params[:photo_id])\n\n @like = Like.new(user: @current_user, photo: photo)\n if Like.all.where(:photo => photo, user: @current_user).length == 0\n if @like.save\n render_json({ ok: true })\n update_photo_rating(photo)\n else\n render_json({ ok: false, errors: @like.errors })\n end\n else\n render_json({ ok: false, errors: 'already liked' })\n end\n\n end", "def new\n @featured_song = FeaturedSong.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @featured_song }\n end\n end", "def create\n @like = @movie.likes.new(like_params)\n initialize_like\n if @like.save\n flash[:notice] = \"Added like to #{@movie.title}.\"\n else\n flash[:danger] = 'Failed to add new like.'\n end\n redirect_to @movie\n end", "def create\n @c_like = CLike.new(user_id: current_user.id, comment_id: params[:comment_id])\n\n respond_to do |format|\n if @c_like.save\n format.html { redirect_to :back, notice: 'Like was successfully created.' }\n format.json { render json: {status: 'success', like: @c_like, counts: CLike.where(comment_id: @c_like.comment_id).count, liked: true} }\n else\n format.html { render :new }\n format.json { render json: @c_like.errors, status: :unprocessable_entity }\n end\n end\nend", "def create\n @song = Song.new(song_params)\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render :show, status: :created, location: @song }\n else\n format.html { render :new }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @song = Song.new(song_params)\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render :show, status: :created, location: @song }\n else\n format.html { render :new }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @song = Song.new(song_params)\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render :show, status: :created, location: @song }\n else\n format.html { render :new }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\r\n @song = Song.new\r\n end", "def new\n @artist = Artist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @artist }\n end\n end", "def new\n @favor = Favor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @favor }\n end\n end", "def new\n @favor = Favor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @favor }\n end\n end", "def new\n @song_genre = SongGenre.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @song_genre }\n end\n end", "def new\n @tweet = Tweet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tweet }\n end\n end", "def new\n @tweet = Tweet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tweet }\n end\n end", "def create\n @song = Song.new(song_params)\n\n respond_to do |format|\n if @song.save\n flash[:success] = ' Song was successfully created.'\n format.html { redirect_to @song }\n format.json { render :show, status: :created, location: @song }\n else\n format.html { render :new }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @track = current_user.tracks.new\n\n respond_to do |format|\n format.html # new.html.haml\n format.json { render json: @track }\n end\n end", "def create\n @dislike = current_user.dislikes.build(dislike_params)\n\n respond_to do |format|\n if @dislike.save\n format.html { redirect_to @dislike, notice: 'Dislike was successfully created.' }\n format.json { render action: 'show', status: :created, location: @dislike }\n else\n format.html { render action: 'new' }\n format.json { render json: @dislike.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n pic_url = nil\n unless params[:user].nil?\n pic_url = \"https://graph.facebook.com/#{params[:user]}/picture?type=normal\"\n end\n @song = Song.new ( { :song => params[:song],\n :artist => params[:artist],\n :album => params[:album],\n :song_id => params[:song_id],\n :longitude => params[:longitude],\n :latitude => params[:latitude],\n :stream_url => params[:stream_url],\n :art_url => params[:art_url],\n :user => params[:user],\n :facebook_url => pic_url\n } )\n\n respond_to do |format|\n if @song.save\n format.json { render :json => @song, :status => :created, :location => @song }\n else\n format.json { render :json => @song.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @song }\n end\n end", "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @song }\n end\n end", "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @song }\n end\n end", "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @song }\n end\n end", "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @song }\n end\n end", "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @song }\n end\n end", "def index\n @music_likes = MusicLike.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @music_likes }\n end\n end", "def new\n @lightshow = Lightshow.new\n @songs = Song.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lightshow }\n end\n end", "def new\n @thought = Thought.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @thought }\n end\n end", "def new\n @like_button = LikeButton.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @like_button }\n end\n end", "def new\n @follow = Follow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @follow }\n end\n end", "def new\n @follow = Follow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @follow }\n end\n end", "def create\n @likesforreply = Likesforreply.new(params[:likesforreply])\n\n respond_to do |format|\n if @likesforreply.save\n format.html { redirect_to @likesforreply, notice: 'Likesforreply was successfully created.' }\n format.json { render json: @likesforreply, status: :created, location: @likesforreply }\n else\n format.html { render action: \"new\" }\n format.json { render json: @likesforreply.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @likes = Like.all\n render json: @likes, status: 200\n end", "def new\n @user_like = UserLike.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user_like }\n end\n end", "def new\n @wishlist = Wishlist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @wishlist }\n end\n end", "def new\n @wishlist = Wishlist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @wishlist }\n end\n end" ]
[ "0.7450175", "0.73725474", "0.72309136", "0.69829315", "0.69789696", "0.69555914", "0.69555914", "0.69555914", "0.69555914", "0.69380575", "0.6891648", "0.6863503", "0.6863503", "0.67949307", "0.6739666", "0.67055506", "0.667649", "0.66280884", "0.6565905", "0.6563619", "0.65527433", "0.65527433", "0.65527433", "0.65383744", "0.6514227", "0.64374095", "0.64374095", "0.64374095", "0.64344937", "0.64296037", "0.64043015", "0.6389439", "0.6382653", "0.6375526", "0.6369847", "0.6356568", "0.634666", "0.6333104", "0.6329357", "0.6323211", "0.632259", "0.63186085", "0.6313257", "0.6302294", "0.62983286", "0.62983286", "0.6292168", "0.6239724", "0.6236026", "0.6222436", "0.6215095", "0.6212285", "0.6203797", "0.6199764", "0.6183676", "0.6179652", "0.6179652", "0.6175888", "0.6175888", "0.6175888", "0.6175888", "0.61698174", "0.61568487", "0.6152014", "0.614211", "0.6139566", "0.6135815", "0.6134357", "0.61294365", "0.61278343", "0.61278343", "0.61278343", "0.6127638", "0.6123303", "0.61218005", "0.61218005", "0.6112547", "0.61099905", "0.61099905", "0.60987365", "0.60986227", "0.609772", "0.60968834", "0.6090133", "0.6090133", "0.6090133", "0.6090133", "0.6090133", "0.6090133", "0.6088558", "0.608715", "0.60866797", "0.607679", "0.60753244", "0.60753244", "0.6073389", "0.60729426", "0.6070856", "0.60672945", "0.60672945" ]
0.78610885
0
POST /song_likes POST /song_likes.json
def create @song_like = SongLike.new(params[:song_like]) respond_to do |format| if @song_like.save format.html { redirect_to @song_like, notice: 'Song like was successfully created.' } format.json { render json: @song_like, status: :created, location: @song_like } else format.html { render action: "new" } format.json { render json: @song_like.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def postlikes\n render json: @likes.length, status: 200\n end", "def create_likes\n end", "def create_likes\n end", "def create_likes\n end", "def like!\n self.like_count = self.like_count + 1\n self.save\n logger.debug \"Song :: #{self.title} liked.\"\n end", "def like!\n connection.post(\"/photos/#{id}/like\")\n true\n end", "def quote_like\n @quote = set_quote\n @quote.cnt += 1\n respond_to do |format|\n if @quote.save\n #format.html { redirect_to @quote, notice: 'Quote was successfully liked.' }\n #format.json { render :show, status: :created, location: @quote }\n format.json { render json: {:data => { :quotes => @quote}, :result => { :errorcode => \"\", :messages => \"ok\", :rstatus => 1 }} }\n else\n #format.html { render :new }\n #format.json { render json: @quote.errors, status: :unprocessable_entity }\n format.json { render json: { :result => { :errorcode => \"\", :messages => @quote.errors, :rstatus => 0 }} }\n end\n end\n end", "def quote_like\n @quote = set_quote\n @quote.cnt += 1\n respond_to do |format|\n if @quote.save\n #format.html { redirect_to @quote, notice: 'Quote was successfully liked.' }\n #format.json { render :show, status: :created, location: @quote }\n format.json { render json: {:data => { :quotes => @quote}, :result => { :errorcode => \"\", :messages => \"ok\", :rstatus => 1 }} }\n else\n #format.html { render :new }\n #format.json { render json: @quote.errors, status: :unprocessable_entity }\n format.json { render json: { :result => { :errorcode => \"\", :messages => @quote.errors, :rstatus => 0 }} }\n end\n end\n end", "def increment_likes\n sneaker = find_sneaker\n sneaker.update(likes: sneaker.likes + 1)\n render json: sneaker\n end", "def create\n @like = Like.new(like_params)\n\n respond_to do |format|\n if @like.save\n format.json { render json: @like, status: :created }\n else\n format.json { render json: @like.errors, status: :unprocessable_entity }\n end\n end\n end", "def likes_params\n params.require(:likes).permit(:user_id, :tweet_id)\n end", "def create\n @like = Like.new(like_params)\n if @like.save\n render json: @like, status: 201\n else\n render json: @like.errors, status: 422\n end\n end", "def create\n @like = @likable.likes.build(liker_id: current_user.id )\n\n respond_to do |format|\n if @like.save\n format.js {}\n else\n flash[:error] = \"Whoops, we didn't get that like saved. Try again.\"\n format.js { }\n end\n\n format.html { redirect_back(fallback_location: current_user ) }\n end\n end", "def music_list\n @musics = Music.find_musics_by_user(current_user.id)\n \n music_like = MusicLike.new\n music_like.user_id = current_user.id\n hash = params[:like]\n if hash != nil\n hash_invert = hash.invert\n music_like.music_id = hash_invert.values_at(\"like\").first.to_i\n music_like.save\n\n music = music_like.music\n sql = ActiveRecord::Base.connection()\n sql.execute(\"UPDATE musics SET musics.popularity = musics.popularity + 1 WHERE musics.id = \" + music.id.to_s)\n end\n \n redirect_to '/musics/home'\n end", "def create\n @like = Like.new(like_params)\n @like.user = current_user\n\n respond_to do |format|\n if @like.save\n format.html{ redirect_to @like.likable }\n format.json{ render :show, status: :created, location: @like }\n else\n format.html{ redirect_to @like.likable, notice: @like.errors.messages.values.flatten.join(', ') }\n format.json{ render json: @like.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @music_like = MusicLike.new(params[:music_like])\n\n respond_to do |format|\n if @music_like.save\n format.html { redirect_to @music_like, :notice => 'Music like was successfully created.' }\n format.json { render :json => @music_like, :status => :created, :location => @music_like }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @music_like.errors, :status => :unprocessable_entity }\n end\n end\n end", "def like_album(album_id,liker_id)\n response = put(\"albums/#{album_id}/likers/#{liker_id}\",true) \n end", "def like\n if @vote\n authorize! :like, @vote\n @vote.like\n else \n authorize! :create_vote, @votable.votes.new\n @votable.votes.create(user: current_user, nominal: 'like')\n end\n\n rating_respond_with_json\n end", "def create\n @todo_like = Todo::Like.new(todo_like_params)\n @todo_user.likes << @todo_like\n\n if @todo_like.save\n render :show, status: :created\n else\n render_error @todo_like, status: :unprocessable_entity\n end\n end", "def create\n unless current_user.likes.where(seek: Seek.find(params[:id])).first\n current_user.likes.create(seek: Seek.find(params[:id]))\n redirect_to \"/seeks\"\n else\n redirect_to \"/users/#{current_user.id}\"\n end\n end", "def create\n photo = Photo.find(params[:photo_id])\n\n @like = Like.new(user: @current_user, photo: photo)\n if Like.all.where(:photo => photo, user: @current_user).length == 0\n if @like.save\n render_json({ ok: true })\n update_photo_rating(photo)\n else\n render_json({ ok: false, errors: @like.errors })\n end\n else\n render_json({ ok: false, errors: 'already liked' })\n end\n\n end", "def like_or_dislike\n\t\tresponse.headers['Content-Type'] = 'text/javascript' # Tells Rails/Redis that content is JavaScript\n\t\troom = current_user.room\n\t\tusers = room.users.length\n\t\tcurrent_song = Song.where(currently_playing: true).first\n\t\tlikes = current_song.likes\n\t\tdislikes = current_song.dislikes\n\t\t# --- Increments either like or dislike to all users depending on which is clicked ---\n\t\tif params[:vote] == 'like'\n\t\t\tlikes += 1\n\t\t\tcurrent_song.update_attributes(likes: likes)\n\t\t\t$redis.publish(\"like_or_dislike_#{room.id}\", {vote: 'like', sc_ident: current_song.sc_ident, users: users, likes: likes}.to_json)\n\t\telsif params[:vote] == 'dislike'\n\t\t\tdislikes += 1\n\t\t\tcurrent_song.update_attributes(dislikes: dislikes)\n\t\t\t$redis.publish(\"like_or_dislike_#{room.id}\", {vote: 'dislike', sc_ident: current_song.sc_ident, users: users, dislikes: dislikes}.to_json)\n\t\tend\n\t\t# --- end ---\n\t\trender nothing: true\n\tend", "def create\n @like = Like.new(like_params)\n\n respond_to do |format|\n if @like.save\n format.html { redirect_to @like, notice: 'Like was successfully created.' }\n format.json { render :show, status: :created, location: @like }\n else\n format.html { render :new }\n format.json { render json: @like.errors, status: :unprocessable_entity }\n end\n end\n end", "def user_likes\n user = User.find(params[:user_id])\n likes = user.likes\n render json: likes\n\nend", "def create\n @like = @video.likes.build(params[:like])\n @like.user_id = @user.id\n @like.video_id = @video.id\n respond_to do |format|\n if @like.save\n format.html { redirect_to([@client,@video,@like], :notice => 'like was successfully created.') }\n format.xml { render :xml => @like, :status => :created, :location => @like }\n format.json { render :json => @like.attributes, :status => :created}\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @like.errors, :status => :unprocessable_entity }\n format.json { render :json => @like.attributes.merge({:errors => @like.errors}), :status => :unprocessable_entity}\n end\n end\n end", "def create\n @c_like = CLike.new(user_id: current_user.id, comment_id: params[:comment_id])\n\n respond_to do |format|\n if @c_like.save\n format.html { redirect_to :back, notice: 'Like was successfully created.' }\n format.json { render json: {status: 'success', like: @c_like, counts: CLike.where(comment_id: @c_like.comment_id).count, liked: true} }\n else\n format.html { render :new }\n format.json { render json: @c_like.errors, status: :unprocessable_entity }\n end\n end\nend", "def liked_song_params\n params.fetch(:liked_song, {})\n end", "def like!(options = {})\n post(options.merge(:connection => :likes))\n end", "def liking?(song)\n likes.include?(song)\n end", "def create\n # debugger\n like = Like.new(like_params)\n\n if like.save\n render json: like\n else\n render json: like.errors.full_messages, status: 422\n end\n end", "def like\n \n Like.create( id_api: params[:id_api], user: current_user)\n render json: {text: \"create\"}\n \n \n \nend", "def like\n @id = params[:id]\n if photo_service.like(@id)\n Like.find_or_create_by(user_id: session[:uid], photo_id: @id)\n end\n respond_to do |format|\n format.html { redirect_to root_path }\n format.js {}\n end\n end", "def like\n\n @like = @shoe.likes.build(user_id: current_user.id)\n if @like.save\n flash[:notice] = \"You liked this shoe!\"\n redirect_to shoes_path\n else\n flash[:notice] = \"You already liked this shoe!\"\n redirect_to shoes_path\n end\n end", "def add_like\n post = Post.find(params[:id])\n post.add_like\n render nothing: true\n end", "def create\n @listing.likes.create(user_id: current_user.id)\n redirect_to listings_path \n end", "def create\n @post_like = PostLike.new(post_like_params)\n\n respond_to do |format|\n if @post_like.save\n format.html { redirect_to @post_like, notice: 'Post like was successfully created.' }\n format.json { render :show, status: :created, location: @post_like }\n else\n format.html { render :new }\n format.json { render json: @post_like.errors, status: :unprocessable_entity }\n end\n end\n end", "def get_likes media_id\n url = API + \"media/#{media_id}/likes?access_token=\" + @access_token\n get(url)['data'].map {|data| data}\n end", "def like(user)\n likes.create(user: user)\n end", "def create\n\t\tif already_liked?\n\t\t\tflash[:notice] = \"you can't like more than once\"\n\t\telse\n\t\t\t\n\t\t\t@like = @post.likes.create(:user_id => current_user.id)\n\t\tend\n\t\tredirect_to post_path(@post)\n\t\t\n\tend", "def like\n \t\t@likes = Like.first\n \t\[email protected](:counter)\n \t\[email protected]\n \t\tredirect_to '/'\n \tend", "def post_like(payload, request)\n request.set_form_data(with_credentials(payload))\n\n run request\n end", "def set_likes\n @likes = likes.find(params[:id])\n end", "def like\n tweet = Tweet.find(params[:tweet_id]) #id del tweet\n flash[:notice] = \"NO puedes dar dos likes sobre el mismo tweet\" if tweet.likes.pluck(:user_id).include? (current_user.id)\n new_like = Like.create(tweet: tweet, user: current_user)#nos permite crear el like\n redirect_to root_path #redirecciona al index\n end", "def upvote\n set_song()\n respond_to do |format|\n if @song.user != current_user\n format.html { redirect_to songs_url, notice: 'You can not show songs of other users.' }\n format.json { head :no_content }\n else\n @song.rating += 1\n @song.save\n format.html\n format.json { render json: @song }\n end\n end\n end", "def create\n @like = @movie.likes.new(like_params)\n initialize_like\n if @like.save\n flash[:notice] = \"Added like to #{@movie.title}.\"\n else\n flash[:danger] = 'Failed to add new like.'\n end\n redirect_to @movie\n end", "def create\n\t\tif @like.save\n\t\t\tflash[:success] = \"Liked!\"\n\t\telse\n\t\t\tflash[:error] = \"Error! Unable to like!\"\n\t\tend\n\n\t\tredirect_to :back\n\tend", "def create\n @question_like = QuestionLike.new(question_like_params)\n\n respond_to do |format|\n if @question_like.save\n format.html { redirect_to @question_like, notice: 'Question like was successfully created.' }\n format.json { render action: 'show', status: :created, location: @question_like }\n else\n format.html { render action: 'new' }\n format.json { render json: @question_like.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @like = Like.new(like_params)\n @like.liker_id = current_user.id\n @like.dog_id = params[:dog_id]\n\n respond_to do |format|\n if @like.save\n @dog = Dog.find(params[:dog_id])\n\n format.html { redirect_to @dog } \n format.json { render :show, status: :created, location: @dog }\n\n else\n format.json { render json: @like.errors.full_messages, status: 422 }\n end\n end\n\n end", "def create\n if Like.where(user_id: session[:user_id], idea_id: params[:id]).count < 1\n @like = Like.create(user_id: session[:user_id], idea_id: params[:id])\n else\n flash[:notice] = \"You've already liked this idea!\"\n end\n # session[:idea_id] = Idea.find(params[:id])\n @like_count = Like.where(user_id: params[:id]).all\n puts @like_count\n redirect_to '/bright_ideas'\n end", "def like\n self.likes += 1\n save\n end", "def create\n respond_to do |f|\n if already_liked?\n f.html {redirect_to :back, notice: \"Already liked.\"}\n else\n @post.likes.create(user_id: current_user.id)\n end\n f.html {redirect_to :back}\n end\n end", "def create\n @likesforreply = Likesforreply.new(params[:likesforreply])\n\n respond_to do |format|\n if @likesforreply.save\n format.html { redirect_to @likesforreply, notice: 'Likesforreply was successfully created.' }\n format.json { render json: @likesforreply, status: :created, location: @likesforreply }\n else\n format.html { render action: \"new\" }\n format.json { render json: @likesforreply.errors, status: :unprocessable_entity }\n end\n end\n end", "def likes_params\n params.require(:like).permit(:value, :likable_id, :likable_type, :user)\n end", "def liked\n get '/users/self/media/liked', auth_params\n end", "def like_params\n params.require(:like).permit(:author_id, :question_id, :answer_id, :like)\n end", "def create\n @song_link ||= params[:song][:link]\n if @song_link\n song = Song.find_or_create_by(link: @song_link)\n render json: song\n end\n end", "def create\n Like.create like_params\n redirect_to \"/secrets\"\n end", "def create\n if params[:post_id].present? && Post.find_by_id(params[:post_id].to_i)\n like = Like.new(post_id: params[:post_id].to_i, user_id: @user.id)\n if like.save\n render json: { message: \"Post has been liked successfully..!\" }, status: 200\n else\n render json: { errors: like.errors.messages }, status: 400\n end\n else\n render json: { message: \"Post id invalid or empty..!\" }, status: 400\n end\n rescue StandardError => e\n render json: { message: \"Error: Something went wrong... \" }, status: :bad_request\n end", "def comment_like(comment)\n comment_likes.create(comment_id: comment.id)\n end", "def update_likes\n @wish.update(like_params)\n end", "def new\n @song_like = SongLike.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @song_like }\n end\n end", "def create\n\t\t@comment = Comment.find_by(id: params[:comment_id])\n\t\t@like = current_user.comment_likes.new(comment: @comment)\n\t\tif @like.save\n\t\t\trespond_to do |format|\n\t\t\t\tformat.js\n\t\t\tend\n\t\tend\n\tend", "def create\n like = Like.new(like_params)\n like.user_id = @authenticated_user.id\n createdLike = Like.create_or_restore(like)\n if createdLike.post.user.id != createdLike.user.id\n notification = Notification.new(\n for_user_id: createdLike.post.user.id,\n by_user_id: createdLike.user.id,\n post_id: createdLike.post.id,\n notification_type: Notification::NOTIFICATION_TYPE[:like_post],\n notification_text: createdLike.user.first_name + \" \" + createdLike.user.last_name + \" liked your post\"\n )\n notification.save\n end\n render json: Like.render_json_user(like)\n end", "def create\n if already_liked?\n flash[:danger] = \"You can't like more than once\"\n else\n @gossip.likes.create(user_id: current_user.id)\n end\n redirect_to gosssips_path\n\n end", "def like_params\n params.permit(:totalLikes, :user_id, :post_id)\n end", "def like_post!(post)\n likes.create!(epost_id: post.id, like: 1)\n end", "def like\n like = API.like(params[:id], params[:access_token], params[:token_secret])\n if like['photo'].nil?\n render :json => like\n else\n render :json => {success: true}\n end\n end", "def like\n @dream = Dream.find(params[:id])\n @user = User.find_by_id(session[:remember_token])\n @likee = @dream.user_id\n @dream.rank +=1\n #record the like to 1. update the like btn to unlike btn, & 2. prevent repeated votes\n @like = Like.new(:user_id=>@user.id, :likee_id=>@likee, :dream_id=>params[:id])\n @like.save\n if(@dream.save! && @like.save)\n redirect_to :action=>'show', :id => @dream.id\n else\n flash.now[:error] = \"illegal input!\"\n end\n end", "def updated_likes\n @post = Post.find_by_id(params[:id])\n @current_like = @post.likes\n @post.update(likes: (@current_like + 1))\n redirect_to post_path\n end", "def index\n @likes = Like.all\n render json: @likes, status: 200\n end", "def update\n @like = Like.find(params[:id])\n if current_user.already_likes?(@like.post)\n user_likeship = UserLikeship.find_by_user_id current_user.id, conditions: ['like_id = ?', @like.id]\n user_likeship.destroy\n @like.update_attribute(:count, \"#{@like.count - 1}\")\n else\n user_likeship = UserLikeship.create( like: @like, user: current_user )\n @like.update_attribute(:count, \"#{@like.count + 1}\")\n end\n respond_to do |format|\n format.js\n format.html { redirect_to index_url, notice: 'Like was successfully updated.' }\n end\n end", "def like_params\n params.require(:like).permit(:tweet_id, :user_id)\n end", "def create\n @user_like = UserLike.new(params[:user_like])\n\n respond_to do |format|\n if @user_like.save\n format.html { redirect_to \"/user_shares/\"+@user_like.user_shares_id.to_s, notice: 'User like was successfully created.' }\n format.json { render json: @user_like, status: :created, location: @user_like }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_like.errors, status: :unprocessable_entity }\n end\n end\n end", "def post_like_params\n params.require(:post_like).permit(:postable_id, :count)\n end", "def create\n # Get the user ID and links that have been sent from the extension\n name = params[\"name\"] # String which is the user's name\n likes_hash = params[\"likes_array\"].to_unsafe_h.to_hash\n likes_hash.each { |hash, data| data[\"friend_likes\"] = data[\"friend_likes\"].to_i }\n # Find the corresponding user\n user = User.find_by(name: name)\n # binding.pry\n # Iterate over each of the hashes if received something\n if likes_hash\n # binding.pry\n user.like_data = likes_hash\n user.save\n end\n end", "def update\n respond_to do |format|\n if @like.update(like_params)\n format.json { render json: @like, status: :ok }\n else\n format.json { render json: @like.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @user_post_like = UserPostLike.new(user_post_like_params)\n\n respond_to do |format|\n if @user_post_like.save\n format.html { redirect_to @user_post_like, notice: 'User post like was successfully created.' }\n format.json { render :show, status: :created, location: @user_post_like }\n else\n format.html { render :new }\n format.json { render json: @user_post_like.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @music_likes = MusicLike.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @music_likes }\n end\n end", "def likes\n Like.where(:song_path => path).group(:user_id)\n end", "def add_selected_song_to_liked_songs\n song_instance = Song.all.find do |song|\n song.title == @selected_song\n end \n\n Playlist.create(user: @user, song_id: song_instance.id)\n puts \"Great choice!, We've added '#{@selected_song}' to your 'Liked' songs.\"\n \n question_1\n end", "def like_params\n params.permit(:id, :likable_id, :likable_type, :user_id)\n end", "def update\n if params.has_key? :like\n @client.put(\"/me/favorites/#{params[:id]}\")\n head :ok and return\n end\n\n if params.has_key? :unlike\n @client.delete(\"/me/favorites/#{params[:id]}\")\n head :ok and return\n end\n\n if params.has_key? :repost\n @client.put(\"/me/track_reposts/#{params[:id]}\")\n head :ok and return\n end\n\n if params.has_key? :unpost\n @client.delete(\"/me/track_reposts/#{params[:id]}\")\n head :ok and return\n end\n\n head :bad_request\n end", "def create\n @song = @album.songs.new(song_params)\n authorize @song\n\n if @song.save\n @song.add_attributes_to_array(@song, params[\"song\"][\"mood\"], params[\"song\"][\"timbre\"], params[\"song\"][\"intensity\"], params[\"song\"][\"tone\"])\n @song.new_average(@song)\n respond_to do |format|\n format.html { redirect_to user_album_path(@user, @album), notice: 'Song was successfully created!' }\n format.json { render action: 'show', status: :created, location: @song }\n end\n else\n respond_to do |format|\n format.html { render action: 'new' }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_liked_song\n @liked_song = LikedSong.find(params[:id])\n end", "def likes(username, opts={})\n opts = opts.merge({:https => @https})\n Likes.likes(username, @api_key, opts)\n end", "def home\n # /controllers/musics_controller/music_list\n @musics = Music.find_musics_by_user(current_user.id)\n \n music_like = MusicLike.new\n music_like.user_id = current_user.id\n hash = params[:like]\n if hash != nil\n hash_invert = hash.invert\n music_like.music_id = hash_invert.values_at(\"like\").first.to_i\n music_like.save\n\n music = music_like.music\n sql = ActiveRecord::Base.connection()\n sql.execute(\"UPDATE musics SET musics.popularity = musics.popularity + 1 WHERE musics.id = \" + music.id.to_s)\n end\n\n end", "def like_article\n @article = Article.find(params[:article_id])\n @like = Like.new(like_params)\n @like.article = @article\n @like.save\n \n end", "def create\n @like_list = LikeList.new(like_list_params)\n\n respond_to do |format|\n if @like_list.save\n format.html { redirect_to @like_list, notice: 'Like list was successfully created.' }\n format.json { render :show, status: :created, location: @like_list }\n else\n format.html { render :new }\n format.json { render json: @like_list.errors, status: :unprocessable_entity }\n end\n end\n end", "def liked_track_params\n params.require(:liked_track).permit(:feed_id, :track_id)\n end", "def like_tag \n @researcher = Researcher.find(params[:id])\n tag = params[:tag]\n respond_to do |format|\n if tag\n @researcher.liked_tag_list.add(tag)\n @researcher.disliked_tag_list.remove(tag)\n if @researcher.save\n format.json { render json: { :success => \"Researcher was successfully updated. Liked tag: #{tag}\" } }\n format.html { redirect_to @researcher, notice: \"Researcher was successfully updated. Liked tag: #{tag}\" }\n else\n format.json { render json: @researcher.errors, status: :unprocessable_entity }\n format.html { redirect_to @researcher, alert: \"Failed to like tag: #{tag.inspect}. Error: #{@researcher.errors.full_messages.join(', ')}\" }\n end\n else\n @researcher.errors.add(:liked_tags, \"Can't like tag, as no tag was provided\")\n format.json { render json: @researcher.errors, status: :unprocessable_entity }\n format.html { redirect_to @researcher, alert: \"Failed to like tag. Error: #{@researcher.errors.full_messages.join(', ')}\" }\n end\n end\n end", "def create\n like = Like.like(current_user, @resource)\n p 'the like was not saved' unless like\n redirect_to root_url\n end", "def set_postlike\n @likes = Like.where(post_id: params[:post_id])\n end", "def update\n render json: Like.update(params[\"id\"], params[\"like\"])\n end", "def likes( params={} )\n likes = get_connections(\"likes\", params)\n return map_connections likes, :to => Facebook::Graph::Like\n end", "def create\n logger.error \"=-=-=-=-=-=-=-=-=--=-=-=-=-==-=-=-=-=-=-=-\"\n logger.error params[:micropost_id]\n @post_like = PostLike.create(:micropost_id => params[:micropost_id])\n logger.error \"=-=-=-=-=-=-=-=-=--=-=-=-=-==-=-=-=-=-=-=-\"\n respond_to do |format|\n format.html { redirect_to root_path }\n format.js\n end\n end", "def like_params\n params.require(:like).permit(:id, :user_id, :post_id)\n end", "def liked_post_params\n params.require(:liked_post).permit(:positive, :creation_date, :post_id, :user_id)\n end", "def likes( params={} )\n likes = get_connections(\"likes\", params)\n return map_connections likes, :to => Facebook::Graph::Generic\n end", "def create\n @dislike = current_user.dislikes.build(dislike_params)\n\n respond_to do |format|\n if @dislike.save\n format.html { redirect_to @dislike, notice: 'Dislike was successfully created.' }\n format.json { render action: 'show', status: :created, location: @dislike }\n else\n format.html { render action: 'new' }\n format.json { render json: @dislike.errors, status: :unprocessable_entity }\n end\n end\n end", "def user_screams\n # Update the user for the current item he checks that he likes the item.\n # Return JSON with ok if the updation is done succesfully else return a error status to the user.\n if current_user\n Rails.logger.debug { \"The current loged in user is #{current_user.email}\" }\n audio = Audio.find(params[:id])\n current_user.screams << audio\n render nothing: true , status: 200\n else\n render nothing: true , status: 400\n end\n end" ]
[ "0.70101535", "0.67654824", "0.67654824", "0.67654824", "0.6746579", "0.67283636", "0.66585207", "0.66585207", "0.660296", "0.65758544", "0.6545449", "0.65244824", "0.65118456", "0.64997584", "0.6426476", "0.64153594", "0.6369961", "0.63651836", "0.63579744", "0.63438296", "0.6335103", "0.63344264", "0.6322309", "0.6306328", "0.63061506", "0.6280454", "0.6257921", "0.6253764", "0.6253203", "0.623535", "0.62195736", "0.6195023", "0.6179002", "0.6169373", "0.615798", "0.6149481", "0.61473286", "0.6144945", "0.61263806", "0.6108535", "0.60941136", "0.6090915", "0.60850376", "0.6074429", "0.60640216", "0.60523593", "0.60470736", "0.6041095", "0.60362405", "0.60297567", "0.60247403", "0.600306", "0.59986573", "0.5981445", "0.5979521", "0.59747046", "0.597448", "0.5960365", "0.5948224", "0.5947223", "0.59387004", "0.5926498", "0.59227514", "0.5918949", "0.59130275", "0.59097147", "0.59055763", "0.5892769", "0.5888437", "0.5888242", "0.5879844", "0.58750826", "0.58726454", "0.58716434", "0.58644515", "0.586441", "0.58576155", "0.58492696", "0.5847658", "0.58442056", "0.5830858", "0.5830431", "0.58295614", "0.582424", "0.5824034", "0.58232176", "0.58188885", "0.5811108", "0.58105934", "0.5809522", "0.5806098", "0.5805098", "0.5794913", "0.5792735", "0.57850033", "0.5770481", "0.5762896", "0.5761077", "0.5755703", "0.5753211" ]
0.70278025
0
PUT /song_likes/1 PUT /song_likes/1.json
def update @song_like = SongLike.find(params[:id]) respond_to do |format| if @song_like.update_attributes(params[:song_like]) format.html { redirect_to @song_like, notice: 'Song like was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @song_like.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n render json: Like.update(params[\"id\"], params[\"like\"])\n end", "def increment_likes\n sneaker = find_sneaker\n sneaker.update(likes: sneaker.likes + 1)\n render json: sneaker\n end", "def update\n if params.has_key? :like\n @client.put(\"/me/favorites/#{params[:id]}\")\n head :ok and return\n end\n\n if params.has_key? :unlike\n @client.delete(\"/me/favorites/#{params[:id]}\")\n head :ok and return\n end\n\n if params.has_key? :repost\n @client.put(\"/me/track_reposts/#{params[:id]}\")\n head :ok and return\n end\n\n if params.has_key? :unpost\n @client.delete(\"/me/track_reposts/#{params[:id]}\")\n head :ok and return\n end\n\n head :bad_request\n end", "def like!\n self.like_count = self.like_count + 1\n self.save\n logger.debug \"Song :: #{self.title} liked.\"\n end", "def update_likes\n @wish.update(like_params)\n end", "def update\n respond_to do |format|\n if @like.update(like_params)\n format.json { render json: @like, status: :ok }\n else\n format.json { render json: @like.errors, status: :unprocessable_entity }\n end\n end\n end", "def upvote\n set_song()\n respond_to do |format|\n if @song.user != current_user\n format.html { redirect_to songs_url, notice: 'You can not show songs of other users.' }\n format.json { head :no_content }\n else\n @song.rating += 1\n @song.save\n format.html\n format.json { render json: @song }\n end\n end\n end", "def update\n @music_like = MusicLike.find(params[:id])\n\n respond_to do |format|\n if @music_like.update_attributes(params[:music_like])\n format.html { redirect_to @music_like, :notice => 'Music like was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @music_like.errors, :status => :unprocessable_entity }\n end\n end\n end", "def like\n self.likes += 1\n save\n end", "def set_liked_song\n @liked_song = LikedSong.find(params[:id])\n end", "def update_song\n head :ok\n end", "def set_likes\n @likes = likes.find(params[:id])\n end", "def updated_likes\n @post = Post.find_by_id(params[:id])\n @current_like = @post.likes\n @post.update(likes: (@current_like + 1))\n redirect_to post_path\n end", "def music_list\n @musics = Music.find_musics_by_user(current_user.id)\n \n music_like = MusicLike.new\n music_like.user_id = current_user.id\n hash = params[:like]\n if hash != nil\n hash_invert = hash.invert\n music_like.music_id = hash_invert.values_at(\"like\").first.to_i\n music_like.save\n\n music = music_like.music\n sql = ActiveRecord::Base.connection()\n sql.execute(\"UPDATE musics SET musics.popularity = musics.popularity + 1 WHERE musics.id = \" + music.id.to_s)\n end\n \n redirect_to '/musics/home'\n end", "def update\n @like = Like.find(params[:id])\n if current_user.already_likes?(@like.post)\n user_likeship = UserLikeship.find_by_user_id current_user.id, conditions: ['like_id = ?', @like.id]\n user_likeship.destroy\n @like.update_attribute(:count, \"#{@like.count - 1}\")\n else\n user_likeship = UserLikeship.create( like: @like, user: current_user )\n @like.update_attribute(:count, \"#{@like.count + 1}\")\n end\n respond_to do |format|\n format.js\n format.html { redirect_to index_url, notice: 'Like was successfully updated.' }\n end\n end", "def like_album(album_id,liker_id)\n response = put(\"albums/#{album_id}/likers/#{liker_id}\",true) \n end", "def update \n @idea = @agenda.ideas.find(params[:id])\n @like = Like.find_by_sql([\"select * from likes where user_id = ? and agenda_id = ? and idea_id = ?\", current_user.id, @agenda.id, @idea.id])\n if @like.size == 0\n @like_new = Like.new(params[:like])\n @like_new.user_id = current_user.id\n @like_new.agenda_id = @agenda.id\n @like_new.idea_id = @idea.id\n @like_new.save\n if @idea.likes == nil\n @idea.likes = 1\n else\n @idea.likes += 1\n end \n @idea.update_attribute(:likes, @idea.likes)\n redirect_to agenda_path(@agenda)\n else\n flash[:error] = 'You have already liked the idea.'\n redirect_to agenda_path(@agenda)\n end\n end", "def update\n \n \n respond_to do |format|\n updated_params = song_params\n if (@song.artist != song_params[:artist] || @song.songname != song_params[:songname])\n uri = 'http://developer.echonest.com/api/v4/song/search?api_key=6XUOAXHJOW28GGGRH&format=json&results=1&artist=' + Rack::Utils.escape(song_params[:artist]) + '&title=' + Rack::Utils.escape(song_params[:songname]) + '&bucket=audio_summary'\n result = open(uri).read\n parsed = JSON.parse(result)\n if parsed[\"response\"][\"songs\"].length > 0\n updated_params[:bpm] = parsed[\"response\"][\"songs\"][0][\"audio_summary\"][\"tempo\"]\n updated_params[:key] = parsed[\"response\"][\"songs\"][0][\"audio_summary\"][\"key\"]\n notice = \"Song found on EchoNest!\"\n else\n notice = \"Could not find updated song on EchoNest.\"\n end\n \n end\n if @song.update(updated_params)\n format.html { redirect_to @song, notice: \"#{notice} #{updated_params} \" }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def quote_like\n @quote = set_quote\n @quote.cnt += 1\n respond_to do |format|\n if @quote.save\n #format.html { redirect_to @quote, notice: 'Quote was successfully liked.' }\n #format.json { render :show, status: :created, location: @quote }\n format.json { render json: {:data => { :quotes => @quote}, :result => { :errorcode => \"\", :messages => \"ok\", :rstatus => 1 }} }\n else\n #format.html { render :new }\n #format.json { render json: @quote.errors, status: :unprocessable_entity }\n format.json { render json: { :result => { :errorcode => \"\", :messages => @quote.errors, :rstatus => 0 }} }\n end\n end\n end", "def quote_like\n @quote = set_quote\n @quote.cnt += 1\n respond_to do |format|\n if @quote.save\n #format.html { redirect_to @quote, notice: 'Quote was successfully liked.' }\n #format.json { render :show, status: :created, location: @quote }\n format.json { render json: {:data => { :quotes => @quote}, :result => { :errorcode => \"\", :messages => \"ok\", :rstatus => 1 }} }\n else\n #format.html { render :new }\n #format.json { render json: @quote.errors, status: :unprocessable_entity }\n format.json { render json: { :result => { :errorcode => \"\", :messages => @quote.errors, :rstatus => 0 }} }\n end\n end\n end", "def change_like_count\n activity_object.increment(:like_count).save\n end", "def update\n respond_to do |format|\n if @like.update(like_params)\n format.html { redirect_to @like, notice: 'Like was successfully updated.' }\n format.json { render :show, status: :ok, location: @like }\n else\n format.html { render :edit }\n format.json { render json: @like.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @song.update(song_params)\n render :show, status: :ok, location: @song\n else\n render json: @song.errors, status: :unprocessable_entity\n end\n end", "def update\n @like = Like.find(params[:id])\n\n respond_to do |format|\n if @like.update_attributes(params[:like])\n format.html { redirect_to @like, notice: 'Like was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @like.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @song_like = SongLike.new(params[:song_like])\n\n respond_to do |format|\n if @song_like.save\n format.html { redirect_to @song_like, notice: 'Song like was successfully created.' }\n format.json { render json: @song_like, status: :created, location: @song_like }\n else\n format.html { render action: \"new\" }\n format.json { render json: @song_like.errors, status: :unprocessable_entity }\n end\n end\n end", "def user_screams\n # Update the user for the current item he checks that he likes the item.\n # Return JSON with ok if the updation is done succesfully else return a error status to the user.\n if current_user\n Rails.logger.debug { \"The current loged in user is #{current_user.email}\" }\n audio = Audio.find(params[:id])\n current_user.screams << audio\n render nothing: true , status: 200\n else\n render nothing: true , status: 400\n end\n end", "def setLike(value)\n @likes = value\n end", "def update\n#require 'logger'\n\n\t\tparams = song_params\n\t\tsongkey = params['song_key']\n\t\tparams.delete('song_key')\n\n songtags = params['tags']\n params.delete('tags')\n\n\t\trespond_to do |format|\n\t\t\tif @song.update(params)\n\n\t\t\t\tif songkey.to_s.length > 0\n\t\t\t\t\[email protected]_keys = [SongKey.find(songkey)]\n\t\t\t\telse\n\t\t\t\t\[email protected]_keys.destroy_all\n\t\t\t\tend\n\n @song.tags.destroy_all\n\n if !songtags.nil?\n @tags = []\n for tagid in songtags\n @tags.push(Tag.find(tagid))\n end\n @song.tags = @tags\n end\n\n#\t\t\t\tformat.html { redirect_to songs_url, notice: \"#{@song.name} was successfully updated!\" }\n\t\t\t\tformat.html { redirect_to song_url, notice: \"#{@song.name} was successfully updated!\" }\n\t\t\t\tformat.json { render :show, status: :ok, location: @song }\n\t\t\telse\n\t\t\t\tformat.html { render :edit }\n\t\t\t\tformat.json { render json: @song.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def update\n params[:song][:song_type] = params[:song][:songs].content_type.chomp\n params[:song][:song_in] = params[:song][:songs].read\n respond_to do |format|\n if @song.update(song_params)\n format.html { redirect_to @song, :flash => {:success => 'Song was successfully updated.'} }\n format.json { render :show, status: :ok, location: @song }\n else\n format.html { render :edit,:flash => {:danger => 'Song was failed to update.'} }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @like.update(like_params)\n format.html { redirect_to @like, notice: 'Like was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @like.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @song = Song.find(params[:id])\n @song.name = \"#{@song.title} by #{@song.user.name}\"\n\n respond_to do |format|\n if @song.update_attributes(params[:song])\n format.html { redirect_to user_song_path(@song.user, @song), notice: 'Song was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @song = Song.find(params[:id])\n\n respond_to do |format|\n if @song.update_attributes(params[:song])\n format.html { redirect_to @song, :notice => 'Song was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @song.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @song.update(song_params)\n album_id = params[\"album\"]\n \n if not album_id.nil?\n album = Album.find_by(id: album_id)\n if not album.nil?\n album.songs << @song\n album.save\n\n artist = album.artist\n\n if not artist.nil?\n artist_id = artist.id\n if not artist_id.nil?\n artist.songs << @song\n artist.save\n end\n end\n end\n end\n \n format.html { redirect_to @song, notice: 'Song was successfully updated.' }\n format.json { render :show, status: :ok, location: @song }\n else\n format.html { render :edit }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @song = Song.find(params[:id])\n respond_to do |format|\n if @song.update(song_params)\n format.html { redirect_to @song, notice: 'Song was successfully updated.' }\n format.json { render :show, status: :ok, location: @song }\n else\n format.html { render :edit }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def play(track, token)\n body = {\"uris\": [track[:id]]}\n headers = {\n \"Accept\": \"application/json\",\n \"Authorization\": \"Bearer #{token}\"\n }\n putResponse = HTTParty.put(\"https://api.spotify.com/v1/me/player/play\", :body => body.to_json, :headers => headers)\n\n # 204 indicates a success\n if putResponse.code == 204\n return \"Playing #{track[:name]} by #{track[:artist]}\"\n else\n return \"Error!\"\n end\nend", "def likes_params\n params.require(:likes).permit(:user_id, :tweet_id)\n end", "def like_or_dislike\n\t\tresponse.headers['Content-Type'] = 'text/javascript' # Tells Rails/Redis that content is JavaScript\n\t\troom = current_user.room\n\t\tusers = room.users.length\n\t\tcurrent_song = Song.where(currently_playing: true).first\n\t\tlikes = current_song.likes\n\t\tdislikes = current_song.dislikes\n\t\t# --- Increments either like or dislike to all users depending on which is clicked ---\n\t\tif params[:vote] == 'like'\n\t\t\tlikes += 1\n\t\t\tcurrent_song.update_attributes(likes: likes)\n\t\t\t$redis.publish(\"like_or_dislike_#{room.id}\", {vote: 'like', sc_ident: current_song.sc_ident, users: users, likes: likes}.to_json)\n\t\telsif params[:vote] == 'dislike'\n\t\t\tdislikes += 1\n\t\t\tcurrent_song.update_attributes(dislikes: dislikes)\n\t\t\t$redis.publish(\"like_or_dislike_#{room.id}\", {vote: 'dislike', sc_ident: current_song.sc_ident, users: users, dislikes: dislikes}.to_json)\n\t\tend\n\t\t# --- end ---\n\t\trender nothing: true\n\tend", "def like!\n connection.post(\"/photos/#{id}/like\")\n true\n end", "def update\n respond_to do |format|\n if @song.update(song_params)\n format.html { redirect_to dashboard_songs_url, notice: \"歌曲更新成功。\" }\n format.json { render :show, status: :ok, location: @song }\n else\n format.html { render :edit }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update \n @song = Song.find_by(id: params[:id])\n if @song.update(song_params)\n \n render 'api/songs/show'\n else\n # debugger\n render json: @song.errors.full_messages, status: 401\n end\n end", "def update\n @song = Song.find(params[:id])\n\n respond_to do |format|\n if @song.update_attributes(params[:song])\n format.html { redirect_to @song, :notice => 'Song was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @song.errors, :status => :unprocessable_entity }\n end\n end\n end", "def put_like(object_id, options = {})\n # Likes the given post.\n self.put_object(object_id, \"likes\", {}, options)\n end", "def update\n @song = Song.find(params[:id])\n respond_to do |format|\n if @song.update_attributes(params[:song])\n format.html { redirect_to @song, notice: 'Song was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @song = Song.find(params[:id])\n\n respond_to do |format|\n if @song.update_attributes(params[:song])\n format.html { redirect_to @song, notice: 'Song was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @song = Song.find(params[:id])\n\n respond_to do |format|\n if @song.update_attributes(params[:song])\n format.html { redirect_to @song, notice: 'Song was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @song = Song.find(params[:id])\n\n respond_to do |format|\n if @song.update_attributes(params[:song])\n format.html { redirect_to @song, notice: 'Song was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\t\[email protected](song_params)\n\t\tredirect_to song_path(@song)\n\tend", "def update\n respond_to do |format|\n if @song.update(song_params)\n format.html { redirect_to @song, notice: 'Song was successfully updated.' }\n format.json { render :show, status: :ok, location: @song }\n else\n format.html { render :edit }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @song.update(song_params)\n format.html { redirect_to @song, notice: 'Song was successfully updated.' }\n format.json { render :show, status: :ok, location: @song }\n else\n format.html { render :edit }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @song.update(song_params)\n format.html { redirect_to @song, notice: 'Song was successfully updated.' }\n format.json { render :show, status: :ok, location: @song }\n else\n format.html { render :edit }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @song.update(song_params)\n format.html { redirect_to @song, notice: 'Song was successfully updated.' }\n format.json { render :show, status: :ok, location: @song }\n else\n format.html { render :edit }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @song.update(song_params)\n format.html { redirect_to @song, notice: 'Song was successfully updated.' }\n format.json { render :show, status: :ok, location: @song }\n else\n format.html { render :edit }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @song.update(song_params)\n format.html { redirect_to @song, notice: 'Song was successfully updated.' }\n format.json { render :show, status: :ok, location: @song }\n else\n format.html { render :edit }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @song.update(song_params)\n format.html { redirect_to @song, notice: 'Song was successfully updated.' }\n format.json { render :show, status: :ok, location: @song }\n else\n format.html { render :edit }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @song.update(song_params)\n format.html { redirect_to @song, notice: 'Song was successfully updated.' }\n format.json { render :show, status: :ok, location: @song }\n else\n format.html { render :edit }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @song.artist = get_artist(params)\n respond_to do |format|\n if @song.update(song_params)\n format.html { redirect_to @song, notice: 'Song was successfully updated.' }\n format.json { render :show, status: :ok, location: @song }\n else\n format.html { render :edit }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @question_like.update(question_like_params)\n format.html { redirect_to @question_like, notice: 'Question like was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @question_like.errors, status: :unprocessable_entity }\n end\n end\n end", "def like\n \t\t@likes = Like.first\n \t\[email protected](:counter)\n \t\[email protected]\n \t\tredirect_to '/'\n \tend", "def create\n unless current_user.likes.where(seek: Seek.find(params[:id])).first\n current_user.likes.create(seek: Seek.find(params[:id]))\n redirect_to \"/seeks\"\n else\n redirect_to \"/users/#{current_user.id}\"\n end\n end", "def create_likes\n end", "def create_likes\n end", "def create_likes\n end", "def unlike!\n new_count = self.like_count - 1\n if new_count < 0\n logger.error \"Song :: #{self.attributes.inspect} unliked by 1 \" <<\n \"would result in negative likes. Defaulting to 0 likes.\"\n new_count = 0\n end\n\n self.like_count = new_count\n self.save\n logger.debug \"Song :: #{self.title} unliked by 1.\"\n end", "def update\n respond_to do |format|\n if @song.update_attributes(params[:song])\n format.html { redirect_to playlist_song_path(@playlist,@song), notice: 'Song was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize @song\n\n respond_to do |format|\n if @song.update(song_params)\n format.html { redirect_to user_album_path(@user, @album), notice: 'Song was successfully updated!' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def postlikes\n render json: @likes.length, status: 200\n end", "def destroy\n @song_like = SongLike.find(params[:id])\n @song_like.destroy\n\n respond_to do |format|\n format.html { redirect_to song_likes_url }\n format.json { head :no_content }\n end\n end", "def update_like_count\n Recommendable.redis.set \"#{redis_key}:like_count\", liked_by.count\n end", "def update\n redirect_to @song, alert: \"You can't edit that song.\" and return unless can?(:edit, @song)\n respond_to do |format|\n if @song.update(song_params)\n format.html { redirect_to @song, notice: 'Song was successfully updated.' }\n format.json { render :show, status: :ok, location: @song }\n else\n format.html { render :edit }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def user_likes\n user = User.find(params[:user_id])\n likes = user.likes\n render json: likes\n\nend", "def update\n @song = Song.find(params[:id])\n @song.name = params[:song][:name]\n if params[:song][:audio]\n @song.audio = params[:song][:audio]\n end\n respond_to do |format|\n if @song.save\n format.js\n format.html { redirect_to root_url }\n format.json { head :no_content }\n else\n format.js\n format.html { render action: \"edit\" }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def like\n\n @like = @shoe.likes.build(user_id: current_user.id)\n if @like.save\n flash[:notice] = \"You liked this shoe!\"\n redirect_to shoes_path\n else\n flash[:notice] = \"You already liked this shoe!\"\n redirect_to shoes_path\n end\n end", "def update\n \n set_publishable_params(params[:song], @song)\n @song.assign_attributes(song_params)\n \n respond_to do |format|\n if @song.update(song_params)\n format.html { redirect_to @song, notice: 'Song was successfully updated.' }\n format.json { render :show, status: :ok, location: @song }\n else\n format.html { render :edit }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @post_like = PostLike.find(params[:id])\n\n respond_to do |format|\n if @post_like.update_attributes(params[:post_like])\n format.html { redirect_to @post_like, notice: 'Post like was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post_like.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @user_like = UserLike.find(params[:id])\n\n respond_to do |format|\n if @user_like.update_attributes(params[:user_like])\n format.html { redirect_to @user_like, notice: 'User like was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_like.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @photo = Photo.find(params[:id])\n # url = @photo.song_url\n url = params[:photo][:song_url]\n embedly_photo(url)\n \n @photo.save\n\n respond_to do |format|\n if @photo.update_attributes(params[:photo])\n format.html { redirect_to @photo, notice: 'Photo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @photo.errors, status: :unprocessable_entity }\n end\n end\n end", "def like_share(update_key)\n path = \"/people/~/network/updates/key=#{update_key}/is-liked\"\n put(path, 'true', \"Content-Type\" => \"application/json\")\n end", "def update\n respond_to do |format|\n if @song.update(song_params)\n format.html { redirect_to @song, notice: 'Song was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @song.update(song_params)\n format.html { redirect_to @song, notice: 'Song was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @song.update(song_params)\n format.html { redirect_to @song, notice: 'Song was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @song.update(song_params)\n format.html { redirect_to @song, notice: 'Song was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @song.update(song_params)\n format.html { redirect_to artist_album_song_url(@artist,@album,@song), notice: 'song was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def like #todo not working properly and should be benchmarked\n item = Item.find(params[:id])\n like = Like.like(item, current_user) #should return these should be called thru Item model(let this = same here)\n\n if like && item.update_attributes(tot_likes: item.likes.size )\n item.reload #todo find a better way to do this please\n # if request.xhr? #will always be true\n render json: { likes: item.tot_likes, id: params[:id] }\n # end\n else\n redirect_to items_path\n end\n end", "def show\n @song_like = SongLike.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @song_like }\n end\n end", "def practice\n set_song()\n respond_to do |format|\n if @song.user != current_user\n format.html { redirect_to songs_url, notice: 'You can not show songs of other users.' }\n format.json { head :no_content }\n else\n @song.last_practiced = DateTime.now\n @song.number_of_practices += 1\n @song.save\n format.html\n format.json { render json: @song }\n end\n end\n end", "def update\n @like_system_like = LikeSystem::Like.find(params[:id])\n\n respond_to do |format|\n if @like_system_like.update_attributes(params[:like_system_like])\n format.html { redirect_to @like_system_like, notice: 'Like was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @like_system_like.errors, status: :unprocessable_entity }\n end\n end\n end", "def like\n if @vote\n authorize! :like, @vote\n @vote.like\n else \n authorize! :create_vote, @votable.votes.new\n @votable.votes.create(user: current_user, nominal: 'like')\n end\n\n rating_respond_with_json\n end", "def add_selected_song_to_liked_songs\n song_instance = Song.all.find do |song|\n song.title == @selected_song\n end \n\n Playlist.create(user: @user, song_id: song_instance.id)\n puts \"Great choice!, We've added '#{@selected_song}' to your 'Liked' songs.\"\n \n question_1\n end", "def update\n\n artist_id = update_artist_exist_or_new(params[:artist_name])\n\n album_id = update_album_exist_or_new(params[:album_name], params[:genre], artist_id)\n\n respond_to do |format|\n\n @song.album_id = album_id\n a = @song.album\n a.artist_id = artist_id\n a.save\n\n if @song.update(song_params)\n format.html { redirect_to @song, notice: 'Song was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @post_like.update(post_like_params)\n format.html { redirect_to @post_like, notice: 'Post like was successfully updated.' }\n format.json { render :show, status: :ok, location: @post_like }\n else\n format.html { render :edit }\n format.json { render json: @post_like.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @song = Song.find(params[:id])\n\n redirect_to @song, notice: 'Song was successfully updated.'\n render action: \"edit\"\n end\n\n # DELETE /songs/1\n # DELETE /songs/1.json\n def destroy\n @song = Song.find(params[:id])\n @song.destroy\n redirect_to songs_path\n end", "def update\n respond_to do |format|\n if @user_song.update(user_song_params)\n format.html { redirect_to @user_song, notice: 'User song was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_song }\n else\n format.html { render :edit }\n format.json { render json: @user_song.errors, status: :unprocessable_entity }\n end\n end\n end", "def increase_post_likes_counter\n Post.find(self.post_id).increment(:total_likes_count).save\n end", "def like \n activity=Activity.find(params[:id]) \n activity.update_attribute(\"like\",activity.like+1)\n flash[:notice]=\"U Liked The Activity:#{activity.activity_name}\"\n redirect_to :action=>\"home\"\n end", "def update\n respond_to do |format|\n if @idea_like.update(idea_like_params)\n format.html { redirect_to @idea_like, notice: 'Idea like was successfully updated.' }\n format.json { render :show, status: :ok, location: @idea_like }\n else\n format.html { render :edit }\n format.json { render json: @idea_like.errors, status: :unprocessable_entity }\n end\n end\n end", "def home\n # /controllers/musics_controller/music_list\n @musics = Music.find_musics_by_user(current_user.id)\n \n music_like = MusicLike.new\n music_like.user_id = current_user.id\n hash = params[:like]\n if hash != nil\n hash_invert = hash.invert\n music_like.music_id = hash_invert.values_at(\"like\").first.to_i\n music_like.save\n\n music = music_like.music\n sql = ActiveRecord::Base.connection()\n sql.execute(\"UPDATE musics SET musics.popularity = musics.popularity + 1 WHERE musics.id = \" + music.id.to_s)\n end\n\n end", "def set_like\n @like = Like.find(params[:id])\n end", "def set_like\n @like = Like.find(params[:id])\n end", "def set_like\n @like = Like.find(params[:id])\n end", "def change_like_count\n activity_object.decrement(:like_count).save\n end" ]
[ "0.6959894", "0.6898369", "0.6873039", "0.68421626", "0.6819684", "0.6679967", "0.66037256", "0.6493382", "0.64887947", "0.6461779", "0.63956606", "0.635596", "0.63480604", "0.6314305", "0.6271089", "0.62648445", "0.6236434", "0.6209488", "0.6203045", "0.6203045", "0.61980945", "0.61944234", "0.6193312", "0.61811924", "0.6158458", "0.61461097", "0.61060077", "0.6099788", "0.6094671", "0.6083141", "0.6055853", "0.6051014", "0.60435164", "0.6039795", "0.6029425", "0.60229963", "0.6009102", "0.5998638", "0.5993392", "0.5992264", "0.59919924", "0.59881634", "0.59685487", "0.5966886", "0.5966886", "0.5966886", "0.5962544", "0.59448934", "0.59448934", "0.59448934", "0.59448934", "0.59448934", "0.59448934", "0.59448934", "0.59448934", "0.5942563", "0.5935733", "0.5907027", "0.5893042", "0.5872219", "0.5872219", "0.5872219", "0.58680373", "0.5855533", "0.58549035", "0.58456147", "0.58440024", "0.58370185", "0.58368003", "0.58295196", "0.5809601", "0.57973886", "0.579694", "0.57939917", "0.5790711", "0.57885283", "0.57862717", "0.5786214", "0.5785229", "0.5785229", "0.5785229", "0.57819766", "0.57816464", "0.57790715", "0.5777081", "0.57706755", "0.57704115", "0.5764899", "0.5764757", "0.576182", "0.5761195", "0.5756521", "0.5756193", "0.57496685", "0.57481015", "0.57411474", "0.5738224", "0.5738224", "0.5738224", "0.5738037" ]
0.7112842
0
DELETE /song_likes/1 DELETE /song_likes/1.json
def destroy @song_like = SongLike.find(params[:id]) @song_like.destroy respond_to do |format| format.html { redirect_to song_likes_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n render json: Like.delete(params[\"id\"])\n end", "def destroy\n @music_like = MusicLike.find(params[:id])\n @music_like.destroy\n\n respond_to do |format|\n format.html { redirect_to music_likes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @like = Like.find(params[:id])\n @like.destroy\n\n respond_to do |format|\n format.html { redirect_to likes_url }\n format.json { head :no_content }\n end\n end", "def delete_likes\n end", "def delete_likes\n end", "def delete_likes\n end", "def destroy\n @like = Like.find(like_params[:id])\n\n @like.destroy\n respond_to do |format|\n format.html{ redirect_to @like.likable }\n format.json{ head :no_content }\n end\n end", "def destroy\n @post_like = PostLike.find(params[:id])\n @post_like.destroy\n\n respond_to do |format|\n format.html { redirect_to post_likes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @like.destroy\n respond_to do |format|\n format.html { redirect_to likes_url, notice: 'Like was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @like.destroy\n respond_to do |format|\n format.html { redirect_to likes_url, notice: 'Like was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @song = Song.find(params[:id])\n @song.destroy\n\n respond_to do |format|\n format.html { redirect_to songs_url }\n format.json { head :ok }\n end\n end", "def destroy\n @song = Song.find(params[:id])\n @song.destroy\n\n respond_to do |format|\n format.html { redirect_to user_songs_path(@song.user)}\n format.json { head :ok }\n end\n end", "def destroy\n @song = Song.find(params[:id])\n @song.destroy\n\n respond_to do |format|\n format.html { redirect_to songs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @song = Song.find(params[:id])\n @song.destroy\n\n respond_to do |format|\n format.html { redirect_to songs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @song = Song.find(params[:id])\n @song.destroy\n\n respond_to do |format|\n format.html { redirect_to songs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @song = Song.find(params[:id])\n @song.destroy\n\n respond_to do |format|\n format.html { redirect_to songs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @song = Song.find(params[:id])\n @song.destroy\n\n respond_to do |format|\n format.html { redirect_to songs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @song = Song.find(params[:id])\n @song.destroy\n\n respond_to do |format|\n format.html { redirect_to songs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_like = UserLike.find(params[:id])\n @user_like.destroy\n\n respond_to do |format|\n format.html { redirect_to user_likes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @song = Song.find(params[:id])\n #@song.remove_file_path!\n @song.destroy\n\n respond_to do |format|\n format.html { redirect_to songs_url }\n format.json { head :ok }\n end\n end", "def destroy\n @question_like.destroy\n respond_to do |format|\n format.html { redirect_to question_question_likes_path(@question) }\n format.json { head :no_content }\n end\n end", "def destroy\n @song_up_vote = SongUpVote.find(params[:id])\n @song_up_vote.destroy\n\n respond_to do |format|\n format.html { redirect_to song_up_votes_url }\n format.json { head :no_content }\n end\n end", "def delete(songpos)\n send_request('delete %s' % songpos)\n end", "def destroy\n @song.destroy\n respond_to do |format|\n format.html { redirect_to songs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @song.destroy\n respond_to do |format|\n format.html { redirect_to songs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @song.destroy\n respond_to do |format|\n format.html { redirect_to songs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @song.destroy\n respond_to do |format|\n format.html { redirect_to songs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @song.destroy\n respond_to do |format|\n format.html { redirect_to songs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @song.destroy\n respond_to do |format|\n format.html { redirect_to songs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @song.destroy\n respond_to do |format|\n format.html { redirect_to songs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @like = Like.find(params[:id])\n @like.destroy\n end", "def destroy\n @dislike.destroy\n respond_to do |format|\n format.html { redirect_to dislikes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @liked_item = LikedItem.find(params[:id])\n @liked_item.destroy\n\n respond_to do |format|\n format.html { redirect_to liked_items_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @like.destroy\n respond_to do |format|\n flash[:success] = 'link deletado com Sucesso.'\n format.html { redirect_to new_like_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @song.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_songs_url, notice: \"歌曲刪除成功。\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @like_system_like = LikeSystem::Like.find(params[:id])\n @like_system_like.destroy\n\n respond_to do |format|\n format.html { redirect_to like_system_likes_url }\n format.json { head :ok }\n end\n end", "def destroy\n @song.destroy\n respond_to do |format|\n format.html { redirect_to songs_url, notice: \"#{@song.name} was successfully deleted!\" }\n format.json { head :no_content }\n end\n end", "def destroy\n\t\t@like = Like.find(params[:id])\n\t\t@likable = @like.likable\n\t\[email protected]\n\t\trespond_to do |format|\n\t\t\tformat.json { head :no_content }\n\t\t\tformat.js\n\t\tend\n\tend", "def destroy\n @song.destroy\n respond_to do |format|\n format.html { redirect_to user_path(current_user), notice: 'La musique a bien été supprimée.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @likesforreply = Likesforreply.find(params[:id])\n @likesforreply.destroy\n\n respond_to do |format|\n format.html { redirect_to likesforreplies_url }\n format.json { head :ok }\n end\n end", "def destroy\n @user = current_user\n @review_like = ReviewLike.find(params[:id]).delete\n render json: { msg: \"Delete Successful\" }\n end", "def destroy\n @song = Song.find(params[:id])\n @song.destroy\n respond_to do |format|\n format.html { redirect_to songs_url, notice: 'Song was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @like = Like.find(params[:id])\n @likes = Like.where(\"photo_id = ?\", @like.photo_id)\n @photo = @like.photo\n @like.destroy\n\n respond_to do |format|\n format.html { redirect_to likes_url }\n format.js { render action: \"create\" }\n format.json { head :no_content }\n end\n end", "def destroy\n authorize @song\n\n @song.mp3 = nil\n @song.destroy\n respond_to do |format|\n format.html { redirect_to user_album_path(@user, @album), notice: 'Song was successfully deleted!' }\n format.json { head :no_content }\n end\n end", "def destroy\n @song.destroy\n\n respond_to do |format|\n format.html { redirect_to playlist_songs_url(@playlist) }\n format.json { head :no_content }\n end\n end", "def destroy_like\n @like = Like.where(likeable_id: params[:comment_id], likeable_type: \"Comment\", user_id: current_user.id).first\n @like.destroy\n render 'api/likes/destroy_like.json.jbuilder'\n end", "def destroy\n @song = Song.find(params[:id])\n @song.destroy\n\n respond_to do |format|\n format.html { redirect_to(songs_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @song = Song.find(params[:id])\n @song.destroy\n\n respond_to do |format|\n format.html { redirect_to(songs_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @song = Song.find(params[:id])\n @song.destroy\n\n respond_to do |format|\n format.html { redirect_to(songs_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @song = Song.find(params[:id])\n @song.destroy\n\n respond_to do |format|\n format.html { redirect_to(songs_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @song = Song.find(params[:id])\n @song.destroy\n\n respond_to do |format|\n format.html { redirect_to(songs_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post_like.destroy\n respond_to do |format|\n format.html { redirect_to post_likes_url, notice: 'Post like was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @song.destroy\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'Song was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @look_a_like.destroy\n respond_to do |format|\n format.html { redirect_to look_a_likes_url, notice: \"Look a like was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @rapper_song.destroy\n respond_to do |format|\n format.html { redirect_to rapper_songs_url, notice: 'Rapper song was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @like_list.destroy\n respond_to do |format|\n format.html { redirect_to like_lists_url, notice: 'Like list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @song.destroy\n respond_to do |format|\n format.html { redirect_to songs_url, notice: 'Song was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @song.destroy\n respond_to do |format|\n format.html { redirect_to songs_url, notice: 'Song was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @song.destroy\n respond_to do |format|\n format.html { redirect_to songs_url, notice: 'Song was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @song.destroy\n respond_to do |format|\n format.html { redirect_to songs_url, notice: 'Song was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @song.destroy\n respond_to do |format|\n format.html { redirect_to songs_url, notice: 'Song was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @song.destroy\n respond_to do |format|\n format.html { redirect_to songs_url, notice: 'Song was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @song.destroy\n respond_to do |format|\n format.html { redirect_to songs_url, notice: 'Song was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @song.destroy\n respond_to do |format|\n format.html { redirect_to songs_url, notice: 'Song was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @song.destroy\n respond_to do |format|\n format.html { redirect_to songs_url, notice: 'Song was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @song.destroy\n respond_to do |format|\n format.html { redirect_to songs_url, notice: 'Song was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @master_song = MasterSong.find(params[:id])\r\n @master_song.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to master_songs_url }\r\n format.json { head :ok }\r\n end\r\n end", "def destroy\n @tags_songs = TagsSongs.find(params[:id])\n @tags_songs.destroy\n\n respond_to do |format|\n format.html { redirect_to(tags_songs_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @song = Song.find(params[:id])\n @song.destroy\n\n respond_to do |format|\n format.html { redirect_to songs_url }\n\n end\n end", "def destroy\n @script_like.destroy\n respond_to do |format|\n format.html { redirect_to script_likes_url, notice: 'Script like was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n #since there is only one unique like record per @user, we can find it without passing the like.id from params\n @like = Like.where(:user_id => @user.id, :video_id => @video.id).first\n begin\n @like.destroy\n respond_to do |format|\n format.html { redirect_to(client_video_likes_path(@video)) }\n format.xml { head :ok }\n format.json { render :json => {:deleted => true}, :status => :ok}\n end\n rescue => e\n respond_to do |format|\n format.json { render :json => {:errors => e.to_s}, :status => :unprocessable_entity}\n end\n\n end\n end", "def destroy\n @feed_dislike = FeedDislike.find(params[:id])\n @feed_dislike.destroy\n\n respond_to do |format|\n format.html { redirect_to feed_dislikes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @album_follow.destroy\n respond_to do |format|\n format.html { redirect_to album_follows_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @c_like = CLike.find_by(user_id: current_user.id, comment_id: params[:comment_id])\n @c_like.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Like was successfully destroyed.' }\n format.json { render json: {status: 'success', like: @c_like, counts: CLike.where(comment_id: params[:comment_id]).count}, liked: false }\n end\n end", "def deleteid(songid)\n send_request('deleteid %s' % songid)\n end", "def destroy\n @music = Music.find(params[:id])\n @music.destroy\n\n respond_to do |format|\n format.html { redirect_to home_url }\n format.json { head :ok }\n end\n end", "def destroy\n authorize @song\n @song.destroy\n respond_to do |format|\n format.html { redirect_to songs_url, notice: 'Song was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n #File.delete(\"app/assets/songs/\"[email protected])\n @song.destroy\n respond_to do |format|\n format.html { redirect_to songs_url, :flash => {:success => 'Song was successfully destroyed.'} }\n format.json { head :no_content }\n end\n end", "def destroy\n @musica.audios.purge\n @musica.destroy\n respond_to do |format|\n format.html { redirect_to musicas_url, notice: 'Álbum apagado com sucesso!' }\n format.json { head :no_content }\n end\n end", "def unlike!\n connection.delete(\"/photos/#{id}/like\")\n true\n end", "def destroy\n @song = Song.find(params[:id])\n @song_id = params[:id]\n @song.destroy\n\n respond_to do |format|\n format.js\n format.json { head :no_content }\n end\n end", "def destroy\n @like = Like.find(params[:id])\n @like.destroy\n redirect_to root_url, notice: 'Like was successfully destroyed.'\n end", "def destroy\n @music.destroy\n\t\tflash[:notice] = \"Song has been deleted.\"\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @song.destroy\n redirect_to root_path\n end", "def destroy\n @music = Music.find(params[:id])\n @music.destroy\n\n respond_to do |format|\n format.html { redirect_to musics_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @music = Music.find(params[:id])\n @music.destroy\n\n respond_to do |format|\n format.html { redirect_to musics_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @music = Music.find(params[:id])\n @music.destroy\n\n respond_to do |format|\n format.html { redirect_to musics_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @musician = Musician.find(params[:id])\n @musician.destroy\n\n respond_to do |format|\n format.html { redirect_to musicians_url }\n format.json { head :ok }\n end\n end", "def destroy\n @notifylike.destroy\n respond_to do |format|\n format.html { redirect_to notifylikes_url, notice: 'Notifylike was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n redirect_to @song, alert: \"You can't delete that song.\" and return unless can?(:destroy, @song)\n @song.destroy\n respond_to do |format|\n format.html { redirect_to songs_url, notice: 'Song was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @idea_like.destroy\n respond_to do |format|\n format.html { redirect_to idea_likes_url, notice: 'Idea like was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_like = UserLike.find(params[:id])\n @user_like.destroy\n\n respond_to do |format|\n format.html { redirect_to(scaffold_user_likes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @verse = Verse.find(params[:id])\n @verse.destroy\n\n respond_to do |format|\n format.html { redirect_to :controller => 'songs', :action => 'show', :id => params[:song_id] }\n format.json { head :no_content }\n end\n end", "def destroy\n @go_slim = GoSlim.find(params[:id])\n @go_slim.destroy\n\n respond_to do |format|\n format.html { redirect_to go_slims_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @song.destroy\n end", "def destroy\n @featured_song = FeaturedSong.find(params[:id])\n @featured_song.destroy\n\n respond_to do |format|\n format.html { redirect_to featured_songs_url }\n format.json { head :ok }\n end\n end", "def destroy\n @music.destroy\n respond_to do |format|\n format.html { redirect_to musics_url, notice: 'Удалена запись о музыке.' }\n format.json { head :no_content }\n end\n end", "def destroy\n current_user.likes.find(params[:id]).destroy\n redirect_to posts_path\n end", "def destroy\n @song_alias.destroy\n respond_to do |format|\n format.html { redirect_to song_aliases_url, notice: 'Song alias was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @trans_like.destroy\n respond_to do |format|\n format.html { redirect_to trans_likes_url, notice: \"Trans like was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end" ]
[ "0.75393754", "0.7517691", "0.72948146", "0.7235361", "0.7235361", "0.7235361", "0.70959437", "0.7031776", "0.70234346", "0.70234346", "0.69898784", "0.69769585", "0.6947355", "0.6947355", "0.6947355", "0.6947355", "0.6947355", "0.6947355", "0.69064605", "0.69032913", "0.6902218", "0.68827003", "0.6877767", "0.6877399", "0.6877399", "0.6877399", "0.6877399", "0.6877399", "0.6877399", "0.6877399", "0.6856789", "0.68353003", "0.68133813", "0.6791719", "0.67832965", "0.6775756", "0.6752818", "0.6748017", "0.67465943", "0.67303765", "0.6730064", "0.6715636", "0.67036027", "0.6700072", "0.6686572", "0.66830623", "0.6682327", "0.6682327", "0.6682327", "0.6682327", "0.6682327", "0.66822875", "0.6680641", "0.6675352", "0.6641582", "0.66363424", "0.66278476", "0.66278476", "0.66278476", "0.66278476", "0.66278476", "0.66278476", "0.66278476", "0.66278476", "0.66278476", "0.66278476", "0.6627712", "0.6616698", "0.6611658", "0.6601598", "0.6587682", "0.657418", "0.6574137", "0.6566263", "0.65636814", "0.6558254", "0.6557832", "0.655459", "0.654733", "0.6547007", "0.6516059", "0.65129596", "0.6508955", "0.65084267", "0.6507076", "0.6507076", "0.6507076", "0.65031266", "0.64996904", "0.6481369", "0.64812666", "0.64809275", "0.6480706", "0.64792854", "0.6466783", "0.64639133", "0.6462968", "0.64591056", "0.64557505", "0.6452691" ]
0.78860813
0
Loading queue object from yaml files results in not properly initialized queue and a type error when using it. Skip queue when converting to yaml. Will be nil after loading from yaml and must be recreated.
def to_yaml_properties super - [:@queue] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_queues\n if queue_file? && File.exists?(queue_file)\n @entries = YAML.load(File.new(queue_file).read)\n\n File.unlink(queue_file)\n end\n end", "def initialize\n @queue_options = {}\n @queue_configs = []\n end", "def load_config\n @config = YAML.safe_load(ERB.new(File.read(config_path)).result)\n @queue_ahead = @config[\"queue_ahead\"] || Task::DEFAULT_QUEUE_AHEAD_MINUTES\n @queue_name = @config[\"queue_name\"] || \"default\"\n @time_zone = @config[\"tz\"] || Time.zone.tzinfo.name\n @config.delete(\"queue_ahead\")\n @config.delete(\"queue_name\")\n @config.delete(\"tz\")\n end", "def setup_queue\n queue = Queue.find self.queue_name\n unless queue\n queue = Queue.create _id: self.queue_name\n end\n end", "def pop\n while true\n message = @queue.pop\n return YAML::load(message.to_s) unless message.nil?\n sleep 5\n end\n end", "def queue\n @queue ||= produce_queue\n end", "def initialize(name=nil)\n TaskQueue.convert_exceptions do\n if name.nil?\n @queue = QueueFactory.default_queue\n else\n @queue = QueueFactory.get_queue(name)\n end\n end\n end", "def initial_queue_for(processing_queue, data, options = {})\n if has_external_dependencies_for?(data)\n return Pipeline::AWAITING_EXTERNAL_DEPENDENCY_QUEUE\n end\n\n options_queue = options[:queue]\n return options_queue if options_queue && processing_queue == :plines\n\n processing_queue\n end", "def queue(queue = 'default')\n get_queue(queue)\n end", "def queue\n @queue ||= Queue.new\n end", "def restore(config_file, queen_save_file)\n Configuration.config(config_file)\n hash = YAML::load_file(queen_save_file)\n @@queen = Queen.new\n @@queen.tap{|q| q.from_hash(hash)}\n end", "def pop(options={})\n message = queue.pop\n\n if message\n if options[:raw]\n payload = message.body\n else\n payload = YAML.load(message.body) \n payload.queue = self\n end\n end\n\n payload\n end", "def default_queue=(queue)\n @queues[nil] = queue\n end", "def unserialize(queue, message, options = {})\n begin\n received_at = Time.now.to_f\n packet = @serializer.method(:load).arity.abs > 1 ? @serializer.load(message, queue) : @serializer.load(message)\n if options.key?(packet.class)\n unless options[:no_log] && logger.level != :debug\n re = \"RE-\" if packet.respond_to?(:tries) && !packet.tries.empty?\n packet.received_at = received_at if packet.respond_to?(:received_at)\n log_filter = options[packet.class] unless logger.level == :debug\n logger.info(\"#{re}RECV #{@alias} #{packet.to_s(log_filter, :recv_version)} #{options[:log_data]}\")\n end\n packet\n else\n category = options[:category] + \" \" if options[:category]\n logger.error(\"Received invalid #{category}packet type from queue #{queue} on broker #{@alias}: #{packet.class}\\n\" + caller.join(\"\\n\"))\n nil\n end\n rescue StandardError => e\n # TODO Taking advantage of Serializer knowledge here even though out of scope\n trace, track = case e.class.name.sub(/^.*::/, \"\")\n when \"SerializationError\" then [:caller, e.to_s !~ /MissingCertificate|MissingPrivateKey|InvalidSignature/]\n when \"ConnectivityFailure\" then [:caller, false]\n else [:trace, true]\n end\n logger.exception(\"Failed unserializing message from queue #{queue.inspect} on broker #{@alias}\", e, trace)\n @exception_stats.track(\"receive\", e) if track\n @options[:exception_on_receive_callback].call(message, e) if @options[:exception_on_receive_callback]\n update_non_delivery_stats(\"receive failure\", e)\n nil\n end\n end", "def queue() = @queue ||= CommandQueue.new", "def parse_queue_file\n @job_queue = JobQueue.new(@queue_file)\n puts \"#{@job_queue.length} jobs found\"\n @queue_file.close\n end", "def setup_queue\n Thread.current[:carrot] = Carrot.new(:host=>'mediashelf1.dtic.dk')\n @q = Carrot.queue(@queue_name)\n end", "def default_queue\n @queues[nil]\n end", "def pop_from_queue(queue)\n prioritized?(queue) ? z_pop_from_queue(queue) : super\n end", "def push(*args)\n payload = nil\n\n if args.first.class == Payload\n payload = args.first\n payload.queue = nil\n else\n payload = Payload.new(*args)\n end\n\n queue.push(payload.to_yaml)\n end", "def initialize\n @queue = []\n end", "def queuedump\n queuefile = YAML.load_file(\"/config/queue.yml\")\n puts queuefile['queue']\n queuefile['last_update'] = \"text\"\n File.open('/config/queue.yml','w') do |h| \n h.write queuefile.to_yaml\n end\nend", "def from_yaml\n YAML.load(self)\n end", "def queue(queue)\n @configuration.queue = queue\n end", "def queue\n @queue ||= QueueManager.fetch(@name,@visibility)\n end", "def queue_reload(queue)\n raise NotImplementedError\n end", "def initialize()\n @queue = Queue.new\n end", "def next_message_from(queue)\n delivery_info, properties, body = queue.pop\n return nil if body.nil?\n Bunny::Message.new(delivery_info, properties, body)\n end", "def from_yaml\n\t\tdata = YAML.load File.read(\"save.yaml\")\n\t\t@board = Board.new(data[:board], data[:positions])\n\t\t@current_turn = data[:current_turn]\n\t\t@ai_on = data[:ai_on]\t\t\n\tend", "def queue(file, type)\n label = run_cmd(cmd(\"getlabel\", file)).join(\"\\n\").strip\n \n if label != COPIED\n if type == :music\n queue_music(file)\n elsif type == :video\n queue_video(file)\n end\n end\nend", "def load(uuid)\n path = get_path_from_uuid(uuid)\n yaml = nil\n\n begin\n Zlib::GzipReader.open(path) do |zf|\n puts \"Loading #{path}\"\n yaml = YAML.load zf\n end\n rescue => e\n puts e\n puts e.backtrace\n nil\n end\n\n if yaml['version'] == 0\n block = Kiara::NoteBlock::create\n block.from_a yaml['data']\n block\n else\n nil\n end\n end", "def initialize(queue: nil, queue_name: nil, adapter: nil, type: :all, klass: nil)\n if queue and queue.is_a?(Queue)\n self.queue = queue\n self.adapter = queue.adapter\n elsif queue_name\n self.adapter = adapter || default_adapter\n self.queue = Queue.new(name: \"default\", adapter: self.adapter)\n end\n raise ArgumentError, \"You must provide a queue or a queue_name\" unless self.queue\n self.type = type\n self.klass = klass\n end", "def initialize options\n super\n\n @group = 'Queue'\n @name = options[:name]\n @type = 'Queue'\n\n @queue = Queue.new\n @last_description = Time.at 0\n @last_size = 0\n end", "def initialize( engine, queue = nil )\r\n\r\n self.class.queue = queue if queue\r\n\r\n RuoteAMQP.start!\r\n\r\n MQ.queue( self.class.queue, :durable => true ).subscribe do |message|\r\n if AMQP.closing?\r\n # Do nothing, we're going down\r\n else\r\n launchitem = decode_launchitem( message )\r\n engine.launch( *launchitem )\r\n end\r\n end\r\n end", "def work_once()\n json = @redis.rpop @queue\n raise @@EOQ unless json\n hash = JSON.parse(json)\n # Next bit is sort of ugly, \n klass = Object.const_get(hash[\"class\"])\n raise ArgumentError.new(\"Improper Class\") unless klass < QueuED::QueueAble\n obj = klass.new\n obj.from_hash!(hash)\n obj.do_task\n obj.queue_down(redis:@redis, queue:@queue)\n return obj\n end", "def queue(queue, klass, **options)\n check_exists\n SideJob.queue(queue, klass, options.merge({parent: self, by: \"job:#{id}\"}))\n end", "def decode(str)\n item = Resque.decode(str)\n Resque::Job.new(item['queue'], item['payload']) if item\n end", "def pop\n entry = queue.pop[:payload]\n if (entry != :queue_empty)\n Marshal.load(entry)\n else\n nil\n end\n end", "def initialize(redis, queues = [], options = {})\n options[:poll_interval] ||= 0.2\n @interval = Float(options[:poll_interval])\n\n @options = options\n @options[:redis] = redis\n @shutdown = false\n @mutex = {}\n @dequeue_count = 0\n\n queues = [ queues ] unless queues.is_a? Array\n @queues = queues.map do |klass_or_queue_name|\n if klass_or_queue_name.is_a? String\n queue_name = Boot::RedisHelper_.redis_key_by_tag(\"#{PREFIX}#{klass_or_queue_name}\")\n process_queue_name = \"#{queue_name}_process\"\n elsif klass_or_queue_name.is_a? Class\n queue_name = RedisMessageQueue::Queue.queue_from_class(klass_or_queue_name)\n process_queue_name = \"#{queue_name}_process\"\n else\n raise NoQueueError.new(\"Cannot infer queue name from arguments\")\n end\n\n unless queue_name and queue_name.length > PREFIX.length\n raise NoQueueError.new(\"Invalid queue name: #{queue_name}\")\n end\n\n @mutex[queue_name] = Mutex.new\n RedisQueue.new(queue_name, process_queue_name, @options)\n end\n\n if @queues.empty?\n raise NoQueueError.new(\"Please give each worker at least one queue.\")\n end\n end", "def queue\n @queue ||= channel.queue(queue_name)\n end", "def personal_queue\n unless (local_queues = self.queues).empty?\n local_queues[0]\n end\n end", "def from_yaml\n results = YAML.load(self)\n \n # Replace bad values\n if results == false or results == nil\n \"\"\n else\n results\n end\n end", "def rt_queue\n return(self.lang == 'en_US' ? queue : self.lang)\n end", "def queues(key=nil)\n return nil if @shutdown_mutex.locked?\n\n return @queues if key.nil?\n\n # First try to return the queue named 'key' if it's available.\n return @queues[key] if @queues[key]\n\n # If the queue wasn't available, create or get the mutex that will\n # wrap creation of the Queue.\n @queue_init_mutexes[key] ||= Mutex.new\n\n # Otherwise, check to see if another process is already loading\n # the queue named 'key'.\n if @queue_init_mutexes[key].locked?\n # return an empty/false result if we're waiting for the queue\n # to be loaded and we're not the first process to request the queue\n return nil\n else\n begin\n @queue_init_mutexes[key].lock\n # we've locked the mutex, but only go ahead if the queue hasn't\n # been loaded. There's a race condition otherwise, and we could\n # end up loading the queue multiple times.\n if @queues[key].nil?\n @queues[key] = PersistentQueue.new(@path, key)\n @stats[:current_bytes] += @queues[key].initial_bytes\n end\n rescue Object => exc\n puts \"ZOMG There was an exception reading back the queue. That totally sucks.\"\n puts \"The exception was: #{exc}. Backtrace: #{exc.backtrace.join(\"\\n\")}\"\n ensure\n @queue_init_mutexes[key].unlock\n end\n end\n\n return @queues[key]\n end", "def test_dequeueOnEmptyStack\n assert_equal( nil , @queue.dequeue )\n end", "def queue\n @queue ||= []\n end", "def queues\n\t\t\t@queues ||= {}\n\t\tend", "def setup(*)\n super\n @queue = Array.new\n end", "def queue(queue_name)\n @queues[queue_name]\n end", "def queue\n\n @queue ||= channel.queue(*(opt('queue') || [ '' ]))\n end", "def prioritized?(queue)\n queue = queue.to_s\n if @redis.client.is_a?(Redis::Pipeline)\n # To prevent unexpected values inside result block\n return queue.include?(Prioritize.prioritized_queue_postfix)\n end\n\n queue = queue.include?('queue:') ? queue : redis_key_for_queue(queue)\n queue_type = @redis.type(queue)\n # With type check we will handle the cases when queue postfix was renamed during\n # the work. So, it is the better practise. However, it doesn't work for empty queues.\n queue_type == 'zset' || \\\n # In case when queue is empty on type check, but not empty on the action (pop, in\n # the most cases), we could have an error.\n # So, in that cases we should check queue type by name.\n (queue_type == 'none' && queue.include?(Prioritize.prioritized_queue_postfix))\n end", "def create_queues\n queue\n exchange\n end", "def load\n # This could be generallized but for now lets just do this\n return if @cached.queue_name.nil?\n\n # logger.debug(\"CMB: load for #{self.to_param}\")\n time_now = Time.now\n\n # Pull the fields we need from the cached record into an options_hash\n options_hash = {\n :queue_name => @cached.queue_name,\n :h_or_s => @cached.h_or_s,\n :center => @cached.center.center\n }\n\n # :requested_elements is a special case\n requested_elements = Combined::Call.retain_fields.map { |field| field.to_sym }\n requested_elements << :ppg\n requested_elements << :p_s_b\n # logger.debug(\"CMB: requested_elements = #{requested_elements.inspect}\")\n options_hash[:requested_elements] = requested_elements\n\n # Create a Retain::Queue from the options cache.\n retain_queue = Retain::Queue.new(retain_user_connection_parameters, options_hash)\n retain_calls = retain_queue.calls\n\n # We know that the queue is valid or the calls method above\n # would have raised an expcetion. We are going to attach calls\n # to this queue and that does not work with a new record so we\n # go ahead and save it to the database.\n @cached.save if @cached.new_record?\n\n # retain_calls are the calls from retain while db_calls are the\n # calls that the database knows about.\n db_calls = @cached.calls\n\n # If retain says we have no calls, we delete the calls in the\n # database and go home.\n if retain_calls.length == 0\n # logger.debug(\"CMB: Queue is empty\")\n\n # If DB already says there are no calls, then there are no\n # calls to delete and, also, we do not need to touch\n # last_fetched.\n unless db_calls.length == 0\n @cached.calls.clear\n @cached.last_fetched = time_now\n end\n\n # We know that the queue is not dirty, set the updated_at\n # time, and save what has changed.\n @cached.dirty = false\n @cached.updated_at = time_now\n @cached.save\n return\n end\n\n # A new approach: Mark all the db calls as not used. Then walk\n # the retain call list. If the ppg and call_search_result both\n # equal, then we assume its the same call (I can't see how it\n # could not be) and mark it as used. Afterwards, we walk the db\n # call list and delete the unused calls.\n db_calls_hash = { }\n db_calls.each { |db_call|\n db_calls_hash[db_call.ppg] = db_call\n db_call.used = false\n }\n\n no_new = true\n slot = 0\n group_request = nil\n\n retain_calls.each do |retain_call|\n slot += 1\n db_call = db_calls_hash[retain_call.ppg]\n\n # Trust old call as the same\n if db_call && db_call.call_search_result == retain_call.call_search_result\n db_call.used = true\n db_call.slot = slot\n next\n end\n\n # first time through set these up\n if no_new\n no_new = false # at least one new call\n group_request = Combined::Call.retain_fields.map { |field| field.to_sym }\n group_request.freeze\n end\n\n # Make call fetch the fields we need\n retain_call.group_requests = group_request\n retain_call.send(group_request[0])\n\n # create or find the call\n call_options = Cached::Call.options_from_retain(retain_call)\n\n # If we have a call with the same ppg, we reuse it else we\n # find or create a new one. I don't see how the find could\n # not return a new record in the case that db_call was\n # originally null.\n db_call = @cached.calls.find_or_new(call_options) unless db_call\n\n # if an old record, update it with new info (If it is a new\n # record, this work will already been done.)\n unless db_call.new_record?\n db_call.attributes = call_options\n end\n\n db_call.used = true\n db_call.last_fetched = time_now if db_call.changed?\n db_call.slot = slot\n db_call.dirty = false\n\n # Make or find Cached PMR\n db_pmr = Pmr.find_existing_pmr(retain_call).unwrap_to_cached\n\n # I believe now that customer is not required for pmrs, we can \n # delete this code... To Be Done\n #\n # This code is duplicated three times presently. The problem\n # is that we do not want the center or other fields from the\n # call to enter in to the search or values for the customer.\n # So, we do a specific search for the customer by country and\n # customer number.\n #\n # Well, actually that is only half the problem. The bigger\n # problem with the PMR and customer is that we do not want to\n # fetch them from Retain until we need something from them.\n # That is why we construct the database objects in multiple\n # places.\n cust_options = {\n :country => retain_call.country,\n :customer_number => retain_call.customer_number\n }\n db_customer = Cached::Customer.find_or_new(cust_options)\n db_customer.save\n db_pmr.customer = db_customer\n db_pmr.save\n db_call.pmr = db_pmr\n\n # We just do the save which will cause updated_at to be\n # modified. It also causes the PMR and customer to be saved\n # if they are new.\n db_call.updated_at = time_now\n db_call.save\n end\n\n # delete any unused db_calls\n no_deletes = true\n db_calls.each do |db_call|\n unless db_call.used\n db_call.destroy\n no_deletes = false\n end\n end\n\n # mark as last_fetched if anything changed including adding or\n # deleting db calls.\n unless no_deletes && no_new && [email protected]?\n @cached.last_fetched = time_now\n end\n\n # Force the reload of the calls if we added or deleted db calls\n unless no_deletes && no_new\n @cached.calls(true)\n end\n @cached.dirty = false\n @cached.updated_at = time_now\n @cached.save\n end", "def [](queue_name_or_url)\n self.new queue_url(queue_name_or_url)\n end", "def config(queue, klass)\n config = SideJob.redis.hget \"workers:#{queue}\", klass\n config = JSON.parse(config) if config\n config\n end", "def load_yaml(filename); end", "def test_peekOnEmptyQueue\n assert_equal( nil, @queue.peek )\n end", "def work_queue(queue)\n if job = Riaque.reserve(queue)\n if klass = self.qualified_const_get(job.klass)\n klass.send(:perform, *job.payload)\n end\n\n job.dequeue\n end\n end", "def load yaml\n data = YAML::load yaml \n raise \"Cannot load YAML data\" unless data\n\n @raw = @data = @errors = @commands = nil\n @errors = data.delete('__ERRORS__')\n @commands = data.delete('__COMMANDS__')\n @raw = OpenStruct.new data\n @data = { }\n end", "def initialize(*queues)\n queues = [:default] if queues.size == 0\n @queues = queues\n RockQueue.logger.info \"=> Initializing...\"\n end", "def get_queue\n return @queue unless @queue.nil?\n\n Domo::Queue::Redis::JobQueue.active_queue(@redis_client, @dataset_id, @stream_id, pipeline_id)\n end", "def read_yaml(throw_missing: T.unsafe(nil), **kwd); end", "def queue\n # Probably should be a UUID in the real world\n @queue ||= channel.queue(self.object_id.to_s)\n end", "def get_queues\n @gem_queue = get_queue 'gem'\n @md5_queue = get_queue 'md5'\n @sha512_queue = get_queue 'sha512'\n end", "def queen(config_filename=nil)\n Configuration.config(config_filename) if config_filename\n @@queen ||= self.new\n end", "def build_queue(queue_name)\n QC::Queue.new(queue_name)\n end", "def initialize configuration\n @queue=Queue.new\n @parser=instantiate_class(configuration.parser,configuration) if configuration.parser\n if configuration.runner\n if configuration.runner[:class]\n @runner=configuration.runner[:class].new(configuration.context,@queue)\n else\n raise RutemaError,\"Runner settting overriden, but missing :class\"\n end\n else\n @runner=Rutema::Runners::Default.new(configuration.context,@queue)\n end\n raise RutemaError,\"Could not instantiate parser\" unless @parser\n @dispatcher=Dispatcher.new(@queue,configuration)\n @configuration=configuration\n end", "def add_queue(queue_name)\n queue = MockQueue.new(queue_name)\n data[queue_name] = queue\n queue\n end", "def load_object (path)\n\n o = YAML.load_file(path)\n File.delete(path)\n o\n end", "def enable_queue(queue_name)\n if const = find_queue_configurator_const(queue_name)\n config = const.new(queue_name)\n yield config if block_given?\n queue_configs << config\n else\n raise ArgumentError, \"'#{queue_name}' couldn't be found.\"\n end\n end", "def force_queue_to_vimeo\n self.queue_transfer_to_vimeo(true)\n true\n end", "def queue; end", "def queue; end", "def test_two\n digest = EZQ.enqueue_message((1..40000).to_a.to_yaml,{'EZQ'=>nil},'test_queue')\n print \"Test two (enqueue an oversized message): \"\n q = EZQ.get_queue('test_queue')\n if !q\n puts \"failed to get test_queue\"\n return nil\n end\n q.receive_message do |msg|\n pre = YAML.load(msg.body)\n if pre.has_key?('get_s3_file_as_body')\n puts 'pass'\n else\n puts 'fail'\n end\n end\n return nil\nend", "def queues\n register_classes\n register_bus\n sorted_queues\n end", "def init_attributes(queue_url)\n @@client.get_queue_attributes({\n queue_url: queue_url,\n attribute_names: [\"All\"]\n }).attributes\n rescue Aws::SQS::Errors::NonExistentQueue\n puts \"Queue #{queue_url} has been deleted. Please wait a few seconds until AWS updates the list of queues\"\n exit 1\n end", "def pop_from_queue(queue_class, user_id:, namespace:)\n queue_class\n .new(user_id: user_id, namespace: namespace)\n .pop\n end", "def pull_queue_pull\n return nil if self.pull_queue_names.length == 0\n \n puts \"pulling from queues #{self.pull_queue_names.join ', '}\"\n \n elt = nil\n elt = @redis.brpop(self.pull_queue_names, self.queue_wait_seconds) while elt == nil\n \n key = elt[0]\n val = elt[1]\n self.debug_out \"got data from pull queue #{key}\"\n Marshal.load val\n end", "def queue(_); end", "def queue(_); end", "def queue(*args)\n @queue = args.first unless args.empty?\n (@queue || :default).to_s\n end", "def load_yaml\n if has_file? \"#{name}.yml\"\n YAML.load_file(path / \"#{name}.yml\").apply_to self\n end\n end", "def parse_yaml(path)\n require 'yaml'\n\n str = Nitro::Template.new.render(File.read(path))\n\n if yaml = YAML::load(str)\n for name, data in yaml\n self[name] = instantiate(data)\n end\n end\n\n # sort the objects.\n\n str.scan(/^(\\w*?):$/).each do |key|\n @objects << self[key.to_s]\n end\n end", "def initialize name, redis, coder = Marshal\n super()\n @name = name\n @redis_name = \"queue:#{@name}\"\n @redis = redis\n @coder = coder\n @destroyed = false\n\n @redis.sadd(:queues, @name)\n end", "def queues\n @queues[0] == \"*\" ? RockQueue.queues : @queues\n end", "def dequeue\n end", "def mock_queue!(queue_name)\n mock_queue(queue_name) or raise NotFound.new\n end", "def validate_next_queue(user)\n if next_queue_editable.nil?\n load\n end\n v = pmr.next_queue.nil? ? \"blank\" : pmr.next_queue.to_param\n css_class, title, editable = [ next_queue_css, next_queue_message, next_queue_editable ]\n {\n :css_class => css_class,\n :title => title,\n :editable => editable,\n :name => v,\n :width => (Retain::Fields.field_width(:next_queue) + 1 # +1 for commma\n Retain::Fields.field_width(:h_or_s) + 1 +\n Retain::Fields.field_width(:next_center))\n }\n end", "def initialize\n @queue_for_storage = []\n @queue_for_removal = []\n @stored = []\n @removed = []\n end", "def autogenerated_queues\n @options['queues'] || []\n end", "def default_fail_queue_target\n true\n end", "def queue( name )\n Qup::Adapter::Kestrel::Queue.new( @addr, name )\n end", "def run_queue(env_vars, extra_vars, playbook_path, user_id, queue_opts)\n run_in_queue(\"run\", user_id, queue_opts, [env_vars, extra_vars, playbook_path])\n end", "def initialize(queue_name, messenger, options={})\n if queue_name.nil? || queue_name.empty?\n raise ArgumentError, 'Queue name must be present when creating a queue'\n end\n self.configure_logs\n @logical_queue_name = queue_name\n\n begin\n @queues = PRIORITY_LEVELS.map do |priority|\n create_queue(messenger, priority, options)\n end\n rescue AMQP::IncompatibleOptionsError\n raise AgniError,\n \"One of the queues needed to create #{@logical_queue_name} \" +\n \"has already been created with different options!\"\n end\n\n # The in-memory queue we use to prioritize incoming messages of\n # different priorities\n @queue_mutex = Mutex.new\n @memory_queue = Containers::MinHeap.new\n end", "def enqueue_to(queue, klass, *args); end", "def load\n if File.file?(@file_name)\n File.open(@file_name, 'r') do |file|\n YAML::load(file)\n end\n else\n default\n end\n end", "def queue\n @queue ||= SizedQueue.new @queue_size\n end", "def remove_from_queue(queue, data)\n prioritized?(queue) ? z_remove_from_queue(queue, data) : super\n end", "def mock_queue(queue_name)\n data[queue_name]\n end", "def queue(*queues)\n end" ]
[ "0.6867127", "0.61315984", "0.5848391", "0.58303875", "0.57183", "0.56485367", "0.5638957", "0.5626257", "0.56181365", "0.5597159", "0.5571965", "0.55402446", "0.5504034", "0.5495787", "0.5386772", "0.538522", "0.5379094", "0.5354643", "0.533328", "0.53209543", "0.5298629", "0.52931255", "0.52842075", "0.5270086", "0.5269288", "0.52581733", "0.5240497", "0.5230144", "0.5217075", "0.52006966", "0.51976657", "0.5190883", "0.5177772", "0.5168807", "0.5168571", "0.5166789", "0.51586425", "0.5157889", "0.5127572", "0.51233995", "0.51095617", "0.5072039", "0.5066531", "0.5059219", "0.5057278", "0.50508636", "0.5050498", "0.5040252", "0.5024509", "0.501886", "0.5009498", "0.49853522", "0.49703345", "0.49700308", "0.49684042", "0.49643424", "0.49556604", "0.49501258", "0.49492034", "0.49420285", "0.4941702", "0.49416393", "0.49374264", "0.4932634", "0.49238288", "0.4923807", "0.49196976", "0.49188665", "0.49134466", "0.4910712", "0.49103293", "0.4908601", "0.4908601", "0.49067956", "0.49014577", "0.48993716", "0.48970342", "0.48768634", "0.48759145", "0.48759145", "0.4870304", "0.4868181", "0.48670077", "0.4848929", "0.48451328", "0.4843136", "0.48353243", "0.48351258", "0.4834932", "0.48334402", "0.48286664", "0.48282441", "0.48260874", "0.4825041", "0.4823776", "0.48230305", "0.48164505", "0.48087105", "0.4807019", "0.48054874" ]
0.52762556
23
notify the waiting thread that a command_set has finished it's run
def notify_done @notify_mutex.synchronize do queue.push(1) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def finish\n @threads.each { |t| t.join }\n call_events(:finish, @command)\n @threads.clear\n end", "def wait\n @running.reset\n @waiting.set\n @running.wait\n end", "def wait_until_finished\n @active_requests.dup.each do |n|\n n.join\n end\n end", "def wait\n @t.each{|t| t.join}\n end", "def wait\n waitUntilStarted\n\n @resultsSemaphore.wait\n end", "def wait\n \n # If the command has not been sent, or a response was already received. a\n # call to this method doesn't make any sense.\n raise Exception.new(\"Can't wait for response. The command was not send yet, or a response was already received.\") if @response_received == nil\n \n # Wait until a response was received from the server.\n synchronize do\n @response_received.wait_until { response != nil }\n end\n \n end", "def wait; end", "def wait; end", "def wait; end", "def wait_until_finished()\n\t\t\[email protected] do |t| \n\t\t\t\tif (t.status==\"run\")\n\t\t\t\t\tt.join; # wait to finish\n\n\t\t\t\t\t# log\n\t\t\t\t\tif @logger!=nil\n\t\t\t\t\t\[email protected] \"action=stop|name=thread\"\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t# log\n\t\t\tif @logger!=nil\n\t\t\t\[email protected] \"transactions=#{@transactions}|threads=#{@num_threads}|failures=#{@failures}|duration=#{Time.now - @start_time}\"\n\t\t\tend\n\t\tend", "def wait\n @thread.join\n end", "def wait_done\n sleep 0.01 until done?\n end", "def done(command)\n end", "def wait_for_pending_sends; end", "def waiting; end", "def waiting; end", "def wait\n # it might be awaken by some other futures!\n mutex.synchronize{ condv.wait(mutex) until done? } unless done?\n end", "def wait\n\t\t\t\[email protected]\n\t\t\tend", "def wait\n # Here we use a loop-sleep combination instead of using\n # ThreadPoolExecutor's `wait_for_termination`. See issue #21 for more\n # information.\n loop do\n break if @executor.shutdown?\n sleep 0.1\n end\n end", "def wait\n if job = @queue.last\n EM::Synchrony.sync(job.request)\n EM::Synchrony.sync(job.response.body) if job.response\n end\n end", "def run(set)\r\n while set\r\n return if !get_command\r\n end\r\n end", "def finish(command)\n # called when the process finishes\n end", "def wait_async\n @wait_async = true\n end", "def wait\n\t\t\t\[email protected]\n\t\t\tend", "def finish\n @executor.shutdown\n @executor.wait_for_termination(0.25)\n end", "def run_completed\n end", "def wait\n @notifier.wait if @notifier\n end", "def wait\n @notifier.wait if @notifier\n end", "def wait\n\tend", "def wait_for_shutdown\n @rufus.join\n end", "def join\n @cond.wait if not finished?\n end", "def wait\n\t\t\t\[email protected]\n\t\t\tend", "def notify_complete\n @mutex.synchronize do\n @task_running = false\n @task_complete = true\n @token.broadcast\n end\n end", "def next_command_set(command_sets_to_run)\n @next_mutex.synchronize do\n ready_command_sets = command_sets_to_run.select{|n| n.state == :ready}\n return nil if ready_command_sets.empty?\n loop do\n return nil if state_failed? or signals[:stop]\n @notify_mutex.synchronize do\n queue.clear\n next_command_set = ready_command_sets.find{|cs| is_runnable?(cs.node)}\n unless next_command_set.nil?\n next_command_set.state_start\n return next_command_set\n end\n end\n queue.pop # wait until a thread notifies it has finished\n end\n end\n end", "def command_queue; end", "def wait\n true\n end", "def wait!\n Thread.pass until @pool.njobs == 0\n end", "def finish!\n @queue.push nil\n @thread.join\n end", "def notify_done(number)\n @complete_requests ||= 0\n @complete_requests += 1\n #NOTE: depending on a number... variable... not so smart.\n if @complete_requests == number\n EM.stop\n end\n puts \"done? #{@complete_requests}\"\n puts\nend", "def wait_for(*things)\n things.each do |thing|\n log \"DeferredJob #{@id} will wait for #{thing.inspect}\"\n with_redis { |redis| redis.sadd @set_key, thing }\n end\n end", "def wait\n @future.value\n end", "def await_completion\n @latch.wait(@options[:timeout]) || status.timeout!\n return unless status.result == :answer\n logger.debug \"Main calls were completed, waiting for any added calls: #{@waiters.inspect}\"\n @waiters.each(&:wait)\n logger.debug \"All calls were completed, unblocking.\"\n end", "def join\n @running_processes.each { |x| x.wait }\n end", "def wait_until_done\n return if !running?\n send_eof\n\n # TODO: handle case where command doesn't exit.\n start = Time.now\n @standard_output.read_until_eof(timeout)\n @standard_error.read_until_eof(timeout - (Time.now - start))\n pid, @status = Process::waitpid2(@pid)\n @pid = nil\n end", "def wait_for\n @mutex.synchronize { @token.wait(@mutex) unless @task_complete }\n end", "def action_complete() self.finished = true; end", "def wait(on=nil)\n []\n end", "def completed_it\n self.complete = true\n end", "def wait!\n wait\n raise @error if timeout?\n @messages\n end", "def wait_on_access\n if @server.running?\n @running_threads -= 1\n #puts \"waiting\"\n @condvar.wait(@mutex)\n #puts \"woken\"\n @running_threads += 1\n end\n end", "def sync\n event = :executed_command\n event\n end", "def wait\n\t\t\t\tif @count > 0\n\t\t\t\t\tFiber.yield\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tsucceeded?\n\t\t\tend", "def wait\n self.listener.wait if self.listener\n end", "def finish_exec\n listener.finished_successfully\n end", "def wait\n @wait.synchronize do\n sleep 1 while @count >= THREAD_MAX\n @count += 1\n end\n end", "def wait_until_complete\n tries = 0\n status = nil\n sleep 1\n while tries < 100\n status = self.status\n puts \"Waiting... status=\" + status[\"status\"]\n if status[\"status\"] != \"queued\" && status[\"status\"] != \"running\"\n break\n end\n sleep 2\n end\n status\n end", "def done\r\n @mutex.synchronize {\r\n @done = true\r\n @tasks.clear\r\n @resource.broadcast\r\n }\r\n end", "def wait_for_pending_sends\n send_pending\n while output.length > 0\n result = IO.select(nil, [self]) or next\n next unless result[1].any?\n\n send_pending\n end\n end", "def wait_until_not_full; end", "def wait\n # it might be awaken by some other futures!\n mutex.synchronize{ condv.wait(mutex) until resolved? } unless resolved?\n end", "def wait_for_complete\n @logger.debug(\"Waiting for workers to complete their work - #{@available_workers.length}\")\n count = 0\n while count < @workers.length\n @available_workers.pop\n count += 1\n @logger.debug(\"#{count} Worker(s) done, out of #{@workers.length}\")\n end\n\n # Put the workers back into the available workers pool\n @workers.each { |w| @available_workers.push(w) }\n\n @logger.debug(\"All workers done.\")\n end", "def _wait_tasks\n @wait_tasks\n end", "def finish\n @queue << \"finish\"\n end", "def deq\r\n @mutex.synchronize {\r\n while @tasks.empty? and not @done\r\n @resource.wait(@mutex)\r\n end\r\n @tasks.pop\r\n }\r\n end", "def run\n\t \tbegin \n\t \twrite_command_status(@cmd_queue_0)\n\t \t\n\t \[email protected] \"Processing command queue...\"\n\t \tloop do\n\t \t\tbegin\n\t \t\t\tstr = listen\n\t \t\trescue EOFError\n\t \t\t\[email protected] \"No more messages from pump\"\n\t \t\t\tbreak\n\t \t\tend\n\n\t \t\trep = parse_response(str)\n\n\t \t\t# Look at command response and wait or proceed on queue\n\n\t \t\t# Is it a status message\n\t \t\t# Yes\n\t \t\tif rep[:status]\n\t\t\t\tif process_status(rep)\n\t\t\t\t break\n\t\t\t\tend\n\t \t\t# No\n\t \t\telsif !rep[:status]\n\t \t\t\tprocess_command(rep)\n\t \t\telse\n\t \t\t\[email protected] \"Unknown message type\"\n\t \t\tend\n\t \tend\n\t \[email protected] \"...command queue complete\"\n\n\t \trescue IRB::Abort\n\t \t\[email protected] \"Abort\"\n\t\t\tsleep(0.25)\n\t\t\twrite_stop\n\t\t\t#flush comms?\n\t \trescue Interrupt\n\t \t\[email protected] \"Interupt\"\n\t \t\t#write_stop\n\t \tensure \n\t \t\[email protected] \"Closing\"\n\t\t\t#write_stop\n\t \tend\n\n\t end", "def finalize_exec\n thread_mgr.threads.each(&:join)\n end", "def wait(arg0)\n end", "def wait_for_download\n if @pending\n logger.info(\"Waiting for first sync\")\n logger.flush if logger.respond_to?(:flush)\n while @pending\n sleep(0.1)\n end\n end\n end", "def on_end_task\n mutex.synchronize do\n @completed_task_count += 1 #if success\n break unless running?\n end\n end", "def finish\n verify_not_closed\n wait_all_sent\n end", "def wait_for_set(nickname_substr, state)\n set = select_set(nickname_substr) \n state_wait(set, state)\n end", "def join\n wait_for_completion\n update_nodes\n end", "def wait\n @timer_thread.join\n end", "def finish_synchronize; end", "def wait_final_result()\n @queue.pop\n @pipeline.stop\n return @result\n end", "def flush\n mutex.synchronize do\n if thread && thread.alive?\n queue.push(marker)\n marker.wait(mutex)\n end\n end\n end", "def finish_response\n @channel.push(@response)\n @response = nil\n command\n end", "def collect &block\n start &block\n wait\n @status\n ensure\n @notifier.remove_listener self if @notifier\n end", "def broadcast\n signal_next until @waiting_threads.empty?\n self\n end", "def wait_until_ready\n # this method may be left unimplemented if that is applicable\n end", "def batch_finished\n end", "def complete\n @result_handler.call(*result) while @jobcount > 0\n end", "def sync\n\t\ttask = queue( Proc.new { } )\n\t\ttask.wait\n\tend", "def wait_for_sequence\n tsbs_wait_update\n tsbs_wait_update while @spriteset.busy?\n end", "def wait_for_launching\n sleep @delay\n end", "def finished; end", "def wait\n done = @ractor.take\n yield(self) if block_given?\n done\n end", "def wait\n #$_api_queue.clear\n wait_for(/>/)\nend", "def finish\n @Done = true \n end", "def join_async_world\n ap4r_helper.wait_all_done\n end", "def notify(response)\n\t\tself.response = response\n\n\t\tif (self.completion_routine)\n\t\t\tself.completion_routine.call(response, self.completion_param)\n\t\telse\n\t\t\tself.done = true\n\t\tend\n\tend", "def wait_until\n until yield\n wait\n end\n end", "def wait_while\n while yield\n wait\n end\n end", "def send_run_completion(opts)\n # If run_status is nil we probably failed before the client triggered\n # the run_started callback. In this case we'll skip updating because\n # we have nothing to report.\n return unless run_status\n\n send_to_data_collector(\n Chef::DataCollector::Messages.run_end_message(\n run_status: run_status,\n expanded_run_list: expanded_run_list,\n resources: all_resource_reports,\n status: opts[:status],\n error_descriptions: error_descriptions,\n deprecations: deprecations.to_a\n )\n )\n end", "def set\n return true if set?\n @mutex.synchronize do\n @set = true\n @waiters.each {|waiter| waiter.run if waiter.status == 'sleep'}\n end\n return true\n end", "def waiting\n @mootex.synchronize { @waiting.keys }\n end", "def make_command_waiting\r\n self.class.send :alias_method, :command, :command_and_wait\r\n yield\r\n self.class.send :alias_method, :command, :command_verbatim \r\n end", "def wait_for_cmd_or_ack(cmd_or_ack)\n log \"Waiting for #{cmd_or_ack}\"\n loop do\n last_line = last_chat_line\n return get_info(last_line, cmd_or_ack) if last_line.include?(cmd_or_ack)\n sleep 1\n end\n end", "def wait\n loop do\n refresh\n fail Exceptions::PushJobFailed, @job if timed_out?\n fail Exceptions::PushJobFailed, @job if failed?\n break if successful?\n pause\n end\n end", "def ready (synchable)\n\n synchable.ldebug do\n \"ready() called by #{synchable.fei.to_debug_s} \" +\n \"#{@unready_queue.length} wi waiting\"\n end\n\n queue = @unready_queue\n @unready_queue = nil\n synchable.store_itself\n\n queue.each { |workitem| break if do_reply(synchable, workitem) }\n #\n # do_reply() will return 'true' as soon as the\n # concurrence is over, if this is the case, the\n # queue should not be treated anymore\n end" ]
[ "0.65986747", "0.659157", "0.6320004", "0.6196379", "0.61831474", "0.61127913", "0.6080663", "0.6080663", "0.6080663", "0.607778", "0.6066604", "0.6042039", "0.60404724", "0.5970059", "0.59479135", "0.59479135", "0.593933", "0.5890548", "0.5884047", "0.5883875", "0.5862201", "0.58611643", "0.58507806", "0.5833098", "0.58302945", "0.57964265", "0.57935977", "0.57935977", "0.57905215", "0.5786755", "0.57851803", "0.5781284", "0.574332", "0.5734159", "0.5719607", "0.5714714", "0.5709821", "0.57078797", "0.5701881", "0.56782", "0.5662074", "0.56563884", "0.5624675", "0.5618203", "0.55986166", "0.55807424", "0.5576575", "0.5567784", "0.55646026", "0.5535071", "0.5524523", "0.5522473", "0.5522116", "0.5514664", "0.5512322", "0.54996777", "0.5480389", "0.5480081", "0.54764974", "0.54713804", "0.54675883", "0.5460867", "0.54556364", "0.5450476", "0.5446297", "0.5439569", "0.5438908", "0.5429439", "0.54293555", "0.5410074", "0.5398909", "0.53879994", "0.5379279", "0.5364751", "0.53480977", "0.53371865", "0.53297997", "0.5313955", "0.5312679", "0.53109777", "0.5309046", "0.5301919", "0.53011984", "0.5297211", "0.5295735", "0.5295008", "0.5294755", "0.5290394", "0.5287926", "0.5279924", "0.52767485", "0.52744174", "0.5263135", "0.52540976", "0.52500725", "0.52455115", "0.52312535", "0.523042", "0.52294624", "0.52249795" ]
0.6025436
13
This method returns the next command_set which is ready to run. If no node is ready because of constrains it will block the thread until notify_done was called from a finishing thread. If no command_set is in the state ready it will return nil.
def next_command_set(command_sets_to_run) @next_mutex.synchronize do ready_command_sets = command_sets_to_run.select{|n| n.state == :ready} return nil if ready_command_sets.empty? loop do return nil if state_failed? or signals[:stop] @notify_mutex.synchronize do queue.clear next_command_set = ready_command_sets.find{|cs| is_runnable?(cs.node)} unless next_command_set.nil? next_command_set.state_start return next_command_set end end queue.pop # wait until a thread notifies it has finished end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ready_task\n find do |task|\n task.ready?\n end\n end", "def ready (synchable)\n\n synchable.ldebug do\n \"ready() called by #{synchable.fei.to_debug_s} \" +\n \"#{@unready_queue.length} wi waiting\"\n end\n\n queue = @unready_queue\n @unready_queue = nil\n synchable.store_itself\n\n queue.each { |workitem| break if do_reply(synchable, workitem) }\n #\n # do_reply() will return 'true' as soon as the\n # concurrence is over, if this is the case, the\n # queue should not be treated anymore\n end", "def next\n # try to set next job to running (already running is ok)\n until ready_jobs.empty? || ready_jobs.first.running?\n unless set_to_running(ready_jobs.first)\n locked_jobs << ready_jobs.shift # some other executor running this\n end\n end\n if ready_jobs.empty?\n return nil\n else\n return ready_jobs.first.next_cucumber_test_case\n end\n end", "def try_allocate_next\n while not @waiting_list.empty? and @waiting_list.first[1] <= @free do\n first = @waiting_list.shift\n first[0].req(self, first[1])\n first[0].ready\n end\n end", "def next_command\n @commands_pending.shift\n end", "def next_available_task\n\t\tnat_candidate = next_available_immediate_task\n\t\tif nat_candidate && nat_candidate.has_subtasks?\n\t\t\tnat_candidate.next_available_task\n\t\telse\n\t\t\tnat_candidate\n\t\tend\n\tend", "def wait_until_ready\n\t\t\t\twhile true\n\t\t\t\t\tConsole.logger.debug(self) do |buffer|\n\t\t\t\t\t\tbuffer.puts \"Waiting for ready:\"\n\t\t\t\t\t\[email protected] do |child, state|\n\t\t\t\t\t\t\tbuffer.puts \"\\t#{child.class}: #{state.inspect}\"\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\tself.sleep\n\t\t\t\t\t\n\t\t\t\t\tif self.status?(:ready)\n\t\t\t\t\t\treturn true\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend", "def ready?\n return (self.select(0) != 0)\n end", "def wait_until_ready\n # this method may be left unimplemented if that is applicable\n end", "def execute_next(&block)\n @mutex.synchronize do\n if @active_thread\n condition_variable = ConditionVariable.new\n @waiting_threads.unshift(condition_variable)\n condition_variable.wait(@mutex)\n end\n @active_thread = true\n end\n return_value = yield\n ensure\n @mutex.synchronize do\n @active_thread = false\n next_waiting_thread = @waiting_threads.shift\n next_waiting_thread&.signal\n end\n end", "def get_node_ready(nodes)\n ready_nodes = nodes.select { |node| check_node_status(node) == \"ready\" }\n idle_nodes = []\n ready_nodes.each { |node| idle_nodes << node if !(DRbObject.new(nil, \"druby://#{node.ip}:9000\").executando_job) }\n idle_nodes.min{|a,b| DRbObject.new(nil, \"druby://#{a.ip}:9000\").cpu <=> DRbObject.new(nil, \"druby://#{b.ip}:9000\").cpu }\n end", "def query\n @response_mutex.synchronize do\n if @sent_command\n RightLinkLog.debug(format_log_message(\"Completed last command\"))\n @sent_command = false\n @response_event.signal\n end\n end\n RightLinkLog.debug(format_log_message(\"Command Ready??? #{!!@pending_command}\"))\n return !!@pending_command\n end", "def getNext\n tasks = @db[:tasks]\n query_statuses = [\n Task.getStatusValue(:not_started),\n Task.getStatusValue(:restarted),\n Task.getStatusValue(:waiting),\n ]\n db_task = tasks.where(:status => query_statuses).order(:wake).order(:created).first\n if !db_task.nil?\n if self.lock db_task[:id]\n begin\n require db_task[:path]\n task = Marshal::load(db_task[:data])\n task.id = db_task[:id]\n status = Task.getStatusValue :running\n tasks.where(:id => task.id).update :status => status\n return task\n rescue\n self.unlock db_task[:id]\n end\n else\n @logger.warn \"lock contention for task #{db_task[:id]}\"\n return nil\n end\n end\n end", "def wait\n # it might be awaken by some other futures!\n mutex.synchronize{ condv.wait(mutex) until resolved? } unless resolved?\n end", "def wait\n\t\t\t\[email protected]\n\t\t\tend", "def command_queue\n @_command_queue ||= begin\n ptr = MemoryPointer::new( CommandQueue )\n error = OpenCL.clGetEventInfo(self, COMMAND_QUEUE, CommandQueue.size, ptr, nil)\n error_check(error)\n pt = ptr.read_pointer\n if pt.null? then\n nil\n else\n CommandQueue::new( pt )\n end\n end\n end", "def ready?\r\n not select(0) == 0\r\n end", "def get_next_btcmd\r\n @game_cmd_bt_list.each do |bt|\r\n if bt[:status] == :not_used\r\n bt[:status] = :used \r\n return bt\r\n end \r\n end\r\n nil\r\n end", "def wait_for_free\n worker = @available_workers.pop\n @available_workers.push(worker)\n end", "def signal_next\n begin\n next_waiting_thread = @waiting_threads.shift\n next_waiting_thread.run if next_waiting_thread\n rescue ThreadError\n # Thread must be dead\n redo\n end\n nil\n end", "def wait\n # it might be awaken by some other futures!\n mutex.synchronize{ condv.wait(mutex) until done? } unless done?\n end", "def is_ready\n if self.tasks.empty? and not self.is_done # no tasks assigned for this\n false\n elsif (self.tasks.find_by is_done: false).nil? # can't find any false => all tasks are done\n self.update_attribute(:is_done, true)\n true\n else\n false\n end\n end", "def run(set)\r\n while set\r\n return if !get_command\r\n end\r\n end", "def wait\n @running.reset\n @waiting.set\n @running.wait\n end", "def wait\n # Here we use a loop-sleep combination instead of using\n # ThreadPoolExecutor's `wait_for_termination`. See issue #21 for more\n # information.\n loop do\n break if @executor.shutdown?\n sleep 0.1\n end\n end", "def next\n @mutex.synchronize do\n until @close_now\n a = @queue.shift\n @logger.debug(\"#{@name}'s queue shifted to: #{a}\")\n if !a.nil?\n @full.broadcast\n @empty.broadcast\n return a\n else\n @logger.debug(\"#{@name}'s queue is currently closed?: #{closed?}\")\n return nil if closed?\n\n @empty.wait(@mutex)\n end\n end\n end\n end", "def each_ready_task\n return to_enum(:each_ready_task) unless block_given?\n each_task do |task|\n yield task if task.ready?\n end\n end", "def wait_for_cmd_or_ack(cmd_or_ack)\n log \"Waiting for #{cmd_or_ack}\"\n loop do\n last_line = last_chat_line\n return get_info(last_line, cmd_or_ack) if last_line.include?(cmd_or_ack)\n sleep 1\n end\n end", "def get_next\n while next_item = @queue.peek\n if next_item.cancelled?\n @queue.shift\n else\n return next_item\n end\n end\n\n return nil\n end", "def ready?\n @future.instance_eval do\n @continuation.ready?\n end\n end", "def wait_until\n poll do\n transition! if yield\n end\n end", "def wait_for_ready\n sleep 0.1 until ready?\n end", "def wait_for\n @mutex.synchronize { @token.wait(@mutex) unless @task_complete }\n end", "def next_available_immediate_task\n\t\timmediate_tasks.select{ |t| !t.completed? }.sort_by(&:rank).first\n\tend", "def get_next_task\n if worker_key && !worker_key.empty?\n BdrbJobQueue.find_next(worker_name.to_s,worker_key.to_s)\n else\n BdrbJobQueue.find_next(worker_name.to_s)\n end\n end", "def next_available\n case @connection_handling\n when :stack\n @available_connections.pop\n else\n @available_connections.shift\n end\n end", "def next_available\n case @connection_handling\n when :stack\n @available_connections.pop\n else\n @available_connections.shift\n end\n end", "def wait_for\n raise TaskError, \"The group hasn't been started yet\" if @futures.nil?\n @futures.map do |future|\n future.value\n end\n end", "def wait(on=nil)\n []\n end", "def wait_next nonblock=nil\n # we wait on child threads since calling waitpid would produce a race condition.\n\n threads = {}\n @processes.each { |p|\n threads[p._child_thread] = p\n }\n\n thread = ThreadsWait.new(threads.keys).next_wait(nonblock)\n process = threads[thread]\n process.stop # otherwise process will be in an indeterminite state\n process\n end", "def ready\n return if @readyFlag\n raise SwapDmi::CacheSetupError.new if @save.nil?\n raise SwapDmi::CacheSetupError.new if @getMany.nil?\n\t\t\traise SwapDmi::CacheSetupError.new if @getOne.nil?\n @checkHas = Proc.new {|k| !self.getOne(k).nil? } if @checkHas.nil?\n self.instance_exec(&@ready) unless @ready.nil?\n @readyFlag = true\n self\n end", "def wait\n @lock.synchronize do\n @wait_count += 1\n if @wait_count == hosts.size\n @wait_count = 0\n @cond.broadcast\n else\n @cond.wait(@lock)\n end\n end\n end", "def state_wait(set, state)\n # do a special wait, if waiting for operational (for dns)\n if state == \"operational\"\n set.each { |server| server.wait_for_operational_with_dns }\n else\n set.each { |server| server.wait_for_state(state) }\n end\n end", "def ready?; peek_current_state && (peek_current_state != :PRE_OPERATIONAL) end", "def wait_until_ready\n # this method may be left unimplemented if that is applicable log\n end", "def ready?\n !@needs_reset && @start && @end\n end", "def ready?; @ready; end", "def ready?; @ready; end", "def busy?()\n\t\tcommand_center.busy?\n\tend", "def is_ready?\n return @ready\n end", "def ready?\n pending? and not dependencies_have_failed? and dependencies_are_ready? and concurrency_available?\n end", "def wait_until_complete\n tries = 0\n status = nil\n sleep 1\n while tries < 100\n status = self.status\n puts \"Waiting... status=\" + status[\"status\"]\n if status[\"status\"] != \"queued\" && status[\"status\"] != \"running\"\n break\n end\n sleep 2\n end\n status\n end", "def wait_until_available\n return unless @locked\n\n @mutex.lock\n @mutex.unlock\n end", "def waitable_for_current_thread\n Waitable.new(self)\n end", "def wait_writable\n if evented?\n Celluloid.current_actor.wait_writable(self.to_io)\n else\n Kernel.select([], [self.to_io])\n end\n end", "def wait\n done = @ractor.take\n yield(self) if block_given?\n done\n end", "def wait_for_set(nickname_substr, state)\n set = select_set(nickname_substr) \n state_wait(set, state)\n end", "def wait\n waitUntilStarted\n\n @resultsSemaphore.wait\n end", "def wait_until_available\n return unless locked?\n\n @mutex.synchronize {}\n end", "def waiting\n @mootex.synchronize { @waiting.keys }\n end", "def wait_one_cycle\n\t current_cycle = execute { cycle_index }\n\t while current_cycle == execute { cycle_index }\n\t\traise ExecutionQuitError if !running?\n\t\tsleep(cycle_length)\n\t end\n\tend", "def wait_for_sequence\n tsbs_wait_update\n tsbs_wait_update while @spriteset.busy?\n end", "def wait\n @future.value\n end", "def _wait_tasks\n @wait_tasks\n end", "def wait_until\n until yield\n wait\n end\n end", "def available\n next_available || make_new(:default)\n end", "def wait_until\n until yield\n wait\n end\n end", "def wait!\n Thread.pass until @pool.njobs == 0\n end", "def queue() = @queue ||= CommandQueue.new", "def find_initial_task_basis_plan\n kill_one_artificial until status.got_task?\n BasisPlan.new optimal_plan_real_part, real_task_basis\n end", "def ready?\n @latch.count == 0\n end", "def wait_until_not_full; end", "def wait_until\n until yield\n\twait\n end\n end", "def run_ready\n items = to_run.find_all(&:ready?)\n to_run.delete_if do |item|\n items.include?(item)\n end\n items.map do |item|\n begin\n item.run! unless item.cancelled?\n rescue DeadException\n item.cancel\n rescue => e\n Zoidberg.logger.error \"<#{self}> Timed action generated an error: #{e.class.name} - #{e}\"\n end\n item if item.recur\n end.compact.each do |item|\n to_run << item\n end\n current_self\n end", "def ready(worker)\n if @work_queue.empty?\n @workers.insert(0, worker) unless @workers.include?(worker)\n else\n job = @work_queue.pop()\n @add_thread.wakeup() unless @add_thread.nil?\n ask_worker(worker, job)\n end\n end", "def next\n (successors.length == 1) ? successors.first : nil\n end", "def wait_for_ready\n @logger.debug(\"Waiting for workers to be ready\")\n @workers.each(&:verify)\n @logger.debug(\"Workers are ready\")\n end", "def send_ready_signal()\n do_send(Erlang::Tuple.new([Erlang::Atom.new('ready')]))\n end", "def get_waiting\n raise NotImplementedError\n end", "def wait\n \n # If the command has not been sent, or a response was already received. a\n # call to this method doesn't make any sense.\n raise Exception.new(\"Can't wait for response. The command was not send yet, or a response was already received.\") if @response_received == nil\n \n # Wait until a response was received from the server.\n synchronize do\n @response_received.wait_until { response != nil }\n end\n \n end", "def getNextJob()\n\t\t\t\tjob = nil\n\t\t\t\t\n\t\t\t\tThread.exclusive {\n\t\t\t\t\ti = @jobs.index { |j| j.canStart() }\n\t\t\t\t\tjob = @jobs.delete_at( i ) if ( i != nil )\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn job\n\t\t\tend", "def wait_final_result()\n\t\[email protected]\n\t\[email protected]\n\t\treturn @result\n\tend", "def wait(seq)\n nseq = nil\n while not nseq\n nseq,data = read_data(seq)\n select\n end\n end", "def peek\n @nodeset[1]\n end", "def wait\n @notifier.wait if @notifier\n end", "def wait\n @notifier.wait if @notifier\n end", "def wait_readable\n if evented?\n Celluloid.current_actor.wait_readable(self.to_io)\n else\n Kernel.select([self.to_io])\n end\n end", "def next\n instance = nil\n while instance.nil? && [email protected]?\n action = actions.shift\n commands.each do |cmd|\n instance = action.attempt(actor, cmd, !@started)\n if instance\n @started = true\n break\n end\n end\n end\n instance\n end", "def ready?\n state == RUNNABLE_STATE\n end", "def que_target\n self\n end", "def any_waiting?\n synchronize do\n @num_waiting > 0\n end\n end", "def any_waiting?\n synchronize do\n @num_waiting > 0\n end\n end", "def next\n catch :done do\n while !(info = progress)\n # do nothing - waiting for token\n end\n return info # got token\n end\n return nil # got end of sequence\n end", "def ready?\n status == DONE_STATE\n end", "def ready?\n running?(status) && running?(phase)\n end", "def deq\n @queue.each {|gs|\n (gs.length-1).downto(0) {|i|\n unless gs[i].breakables.empty?\n group = gs.slice!(i, 1).first\n group.break\n return group\n end\n }\n gs.each {|group| group.break}\n gs.clear\n }\n return nil\n end", "def any_waiting?\n synchronize do\n @num_waiting > 0\n end\n end", "def next (timeout=NO_WAIT)\n return @_awaiter ? @_awaiter.next(timeout) : nil\n end", "def wait_for(event)\n @mootex.synchronize do\n (@waiting[event] ||= ConditionVariable.new).wait(@mootex)\n end\n self\n end", "def poll\n # can be optimised to swap out the queue \n # will require a mutex \n rval = Queue.new\n while @queue.length > 0 \n begin \n rval.enq @queue.deq(true) \n rescue ThreadError\n break \n end\n end\n rval \n end" ]
[ "0.58282214", "0.5764436", "0.56254214", "0.56079185", "0.54422027", "0.54138726", "0.5402031", "0.53995013", "0.53593653", "0.53116345", "0.5255581", "0.52510333", "0.52152413", "0.51235104", "0.51164097", "0.5114175", "0.5095715", "0.50788647", "0.5068217", "0.5062522", "0.504816", "0.50234145", "0.50030166", "0.49979052", "0.49891612", "0.4976668", "0.49701586", "0.49691746", "0.4948452", "0.49216694", "0.49214724", "0.4903647", "0.48876256", "0.4885149", "0.48840895", "0.4869584", "0.4869584", "0.48648593", "0.4861822", "0.486017", "0.48315394", "0.48231342", "0.48129767", "0.47989178", "0.4776216", "0.47749403", "0.47721672", "0.47721672", "0.47615397", "0.47568607", "0.4754939", "0.47541952", "0.47499126", "0.47221678", "0.47213066", "0.47127432", "0.47094268", "0.47057387", "0.47041455", "0.47037247", "0.46946737", "0.46859595", "0.46824452", "0.4681737", "0.46793452", "0.46786252", "0.4674637", "0.46710408", "0.4665733", "0.46572277", "0.4653498", "0.46505022", "0.46503767", "0.46414503", "0.46357626", "0.4635182", "0.46284512", "0.4627941", "0.46226907", "0.46221292", "0.46212333", "0.46176136", "0.46173415", "0.4616286", "0.46106312", "0.46106312", "0.46061668", "0.4605196", "0.4602181", "0.45967612", "0.45962715", "0.45962715", "0.4592768", "0.45847985", "0.45689023", "0.45599532", "0.45581007", "0.4556496", "0.45546463", "0.45526007" ]
0.781967
0
check if a node is runnable or if there are constrains which prevent it from running
def is_runnable?(node) if max_per_role > 0 running_groups[node.role] < max_per_role else true end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_vacancy(node)\n !(node.left && node.right)\n end", "def can_accept?(task)\n # logger.info(\n # puts \"can_accept : task = #{task.inspect}, name = #{self.name}\"\n return false if task.nil?\n return false if (self.name.eql?('localhost'))\n # status may change, so need to check\n # look at state and status \n node_state = NodeState.where(id: self.state_id).first\n #TODO handle different node types ?\n can_run = false\n # puts \"NODE state name = #{node_state.name}\"\n case node_state.name\n # HACK HACK HACK\n when 'idle', 'ready', 'pipeline_task'\n # when 'idle', 'ready', 'pipeline_task', 'updating'\n can_run = true\n end\n if ( can_run ) \n # NOTE: you could look at node_type and get number of cpus and memory to calculate max num jobs ...\n # 12/6/2012 - temporarily limited the max number of jobs to 4 to control process\n # collisions. \n if ((task.is_exclusive? && self.num_jobs > 1) || (self.num_jobs > 4) )\n can_run = false \n end\n end\n # puts \"Can_run? self.num_jobs=#{self.num_jobs} #{can_run}\"\n if ( can_run ) \n reqs = task.requirements\n # logger.warn(\"can_accept : requirements = #{reqs.inspect}\")\n can_run = true \n if ( !reqs.nil? )\n reqs.each do |req|\n # logger.warn(\"can_accept : req = #{req.inspect}\")\n if (!req.node_meets(self))\n can_run = false \n # logger.warn(\"can_accept : failed at req = #{req.inspect}\")\n\t # puts \"can_accept : failed at req = #{req.inspect}\"\n break\n end\n end\n end\n end\n # TODO: max num_jobs ?\n # TODO: look at load average\n # TODO: look at memory / swap etc\n # TODO: look at node and job \"type\" ? \n # TODO: idl ?\n # logger.warn(\"can_accept : result = #{can_run.inspect}\")\n return can_run\n end", "def get_node_ready(nodes)\n ready_nodes = nodes.select { |node| check_node_status(node) == \"ready\" }\n idle_nodes = []\n ready_nodes.each { |node| idle_nodes << node if !(DRbObject.new(nil, \"druby://#{node.ip}:9000\").executando_job) }\n idle_nodes.min{|a,b| DRbObject.new(nil, \"druby://#{a.ip}:9000\").cpu <=> DRbObject.new(nil, \"druby://#{b.ip}:9000\").cpu }\n end", "def has_failed_critical_nodes?\n failed_critical_nodes.any?\n end", "def has_failed_critical_nodes?\n failed_critical_nodes.any?\n end", "def should_run?\n val = (!all_nodes_ready? ||\n config_updated?)\n end", "def all_nodes_ready?\n if current_platform_spec.nodes.nil?\n false\n else\n true\n end\n end", "def restrict_when_referenced\n return false if nodes.count > 0\n end", "def ready_to_schedule?(node)\n # Ready to globally schedule\n\n node.outputs.to_nodes.all? do |i|\n globally_scheduled?(i)\n end\n end", "def allowing_other_threads; end", "def process_node(node)\n debug \"Process node: #{node}\"\n node.poll\n return unless node.online?\n ready_task = node.ready_task\n return unless ready_task\n ready_task.run\n end", "def do_not_thread; true; end", "def do_not_thread; true; end", "def do_not_thread; true; end", "def do_not_thread\n true\n end", "def allowable_use?(node)\n used_as_flag?(node) || message_chained_with_dot?(node) || assigned?(node) || or_lhs?(node)\n end", "def alive?\n nodes.map(&:state).all?{ |state| state == :running }\n end", "def do_not_thread\n true\n end", "def do_not_thread\n true\n end", "def do_not_thread\n\n true\n end", "def check(node); end", "def agent_should_start?\n !blacklisted_constants? &&\n !blacklisted_executables? &&\n !in_blacklisted_rake_task?\n end", "def validate_reachability\n node_has_path_to_terminal_node = Array.new( @task_list.size, false )\n work_stack = []\n work_stack.push @task_list.last # is always non-obsolete!\n begin\n t = work_stack.pop\n next if t.obsolete\n node_has_path_to_terminal_node[ t.id ] = true\n t.inflows.each do |f|\n next if f.obsolete\n if !node_has_path_to_terminal_node[ f.source_task_id ] then\n work_stack.push @task_list[ f.source_task_id ]\n end\n end\n end until work_stack.empty?\n e = 0\n node_has_path_to_terminal_node.each_with_index do |n,i|\n next if @task_list[ i ].nil?\n if !n and !@task_list[ i ].obsolete then\n puts \" task ##{ i } '#{ @task_list[i].label }' has no path to terminal task\"\n e += 1\n end\n end\n puts \" Validation of Reachability: #{ e > 0 ? 'failed' : 'OK' }\"\n @validation_errors += e\n end", "def isNodeReady(node)\n cougaar_node = nil\n if node.kind_of?(String)\n\tcougaar_node = @run.society.nodes[node]\n else\n\tcougaar_node = node\n end\n if cougaar_node == nil\n\[email protected]_message(\"No known node #{node} to look for.\")\n\treturn(true)\n else\n\tcougaar_node.each_agent do |agent|\n\t # If any agent on the node is not ready, then the node is not ready\n\t # Only require this for\n\t # agents that have an SDClientPlugin or ALDynamicSDClientPlugin\n\t hasPI = false\n\t agent.each_component do |comp|\n\t if ((@useSD && /SDClientPlugin/.match(comp.classname)) || (!@useSD && /GLSExpanderPlugin/.match(comp.classname)))\n#\t @run.info_message(\"Agent #{agent.name} had SDClient: #{comp.name}\")\n\t hasPI = true\n\t break\n\t end\n\t end\n\t if (hasPI && ! isAgentReady(agent))\n#\t @run.info_message(\"At least one agent (#{agent.name}) not ready yet.\")\n\t return (false)\n\t end\n\tend\n\t# No agent was not ready, so the node is ready\n\treturn true\n end # end of else block to actually check the node\n end", "def check \n @checker.check @program_node\n end", "def active?\n (not node_type_id.nil?) && (node_type_id != 3) && ( (not datacenter_id.nil?) or (not location_id.nil?) )\n end", "def timeout_given?\n !!node['redmine']['executor']['timeout']\n end", "def conditions_met?\n puts nodes.map { |node| connected_to(node).length }.min\n puts nodes.length.to_f / 2\n nodes.map { |node| connected_to(node).length }.min >= (nodes.length.to_f / 2)\n end", "def blocked?\n false\n end", "def construction_in_progress?\n !!@node[\"building_construction\"]\n end", "def any_waiting_threads?\n @condition_variable.any_waiting_threads?\n end", "def ok_to_run?\n # check the limit of max processes, if given\n @max_processes == 0 || ThreadGroup::Default.list.size <= @max_processes\n# !@args['max'] || @pids.size < @args['max']\nend", "def node?\n (self.forestify_right_position - self.forestify_left_position) > 1\n end", "def has_failed_nodes?\n failed_nodes.any?\n end", "def has_failed_nodes?\n failed_nodes.any?\n end", "def is_valid(node = @current_node)\n\t\treturn node != nil\n\tend", "def node(node)\n true\n end", "def check_node(node)\n\t\t\t@node = node\n\t\t\tself.class.get_callbacks(\"check_#{node.type}\".to_sym).each do |block|\n\t\t\t\tself.instance_exec(node, &block)\n\t\t\tend\n\t\tend", "def completely_probed?\n !(@probe_nodes.find{|node| node.nil?})\n end", "def scanned_node?(node); end", "def winning_node?(evaluator)\n end", "def reserved_net_checker; end", "def outside_control?\n\t t = thread\n\t !t || t != Thread.current\n\tend", "def safe?(lbd, condition)\n # if it's a draining operation\n # check for safety\n if condition == :draining\n # this inverts the result of the boolean statement\n # if these conditions are met, we are *NOT* safe\n # if there is onle one mode enabled: NOT SAFE\n # if any node is disabled/draining: NOT SAFE\n return !(lbd[:nodes_enabled] == 1 || lbd[:nodes_enabled] != lbd[:nodes].size)\n end\n\n # otherwise, it's safe\n true\n end", "def available_workers?\n true\n end", "def travel_nodes_confirmed?\n self.previous_travel_node.present? &&\n self.previous_travel_node.confirmed? &&\n self.current_travel_node.present? &&\n self.current_travel_node.confirmed? #&&\n # self.next_travel_node.present? &&\n # self.next_travel_node.confirmed?\n end", "def capable_tasks() @capable_tasks ||= Task.children; end", "def check_for_available_workers\n workers >= working_count\n end", "def thread?\n false\n end", "def eligible?(n)\n true\n end", "def failed?\n complete? && !all_nodes_succeeded?\n end", "def failed?\n complete? && !all_nodes_succeeded?\n end", "def node?\n node.present?\n end", "def any_waiting_threads?\n waiting_threads_count >= 1\n end", "def can_wait_objection?\n seconds.count >= 2\n end", "def blocked?\n fail NotImplementedError\n end", "def passable?(current_node)\r\n x = current_node.x\r\n y = current_node.y\r\n return (x >= 0 and x < WIDTH and y >= 0 and y < HEIGHT)\r\n end", "def can_work?\n @available_workers.length > 0\n end", "def has_waiting?\n raise NotImpelementedError\n end", "def dead?\n false\n end", "def check_that_no_text_run_is_active\n if @rt_run_context.inside_a_run\n raise \"Unexpected run! #{ @rt_run_context.inspect }\"\n end\n end", "def task_available\n return unless task\n\n validate_task_has_no_pending\n validate_task_has_no_approved\n end", "def are_too_many_instances_running?\n nodes(:status => \"running\").size > maximum_instances.to_i\n end", "def in_safe_space?\n not taking_damage? and not next_to_enemy?\n end", "def dead?\n lifespan < 0.0\n end", "def usable_in?(pool)\n true\n end", "def is_obstacle? \n return false\n end", "def evaluate_target_health\n false\n end", "def finished? nodes\n nodes.each { |k,v| return false if !v.done && v.distance != -1 }\n return true \n end", "def can_run?\n return false if locked_open?\n\n closed? || locked_closed? || half_open?\n end", "def busy?(purpose)\n (@exclusive_thread && @exclusive_thread != Thread.current) ||\n @waiting.any? { |k, v| k != Thread.current && !v.include?(purpose) } ||\n @sharing.size > (@sharing[Thread.current] > 0 ? 1 : 0)\n end", "def can_spawn?\n\t\t\n\tend", "def compatible_state?(task)\n\t finished? || !(running? ^ task.running?)\n\tend", "def reconstructable?(nodekey)\n node = node_stat(nodekey)\n ret = if node[State] == StateActive\n case node[Role]\n when RoleProxy\n false\n when RoleSlave\n true\n when RoleMaster\n # if the partition has at least one active slave, one of the slaves will take over the master.\n slaves_in_partition(node[StatPartition]).inject(false) do |r, slave_nodekey|\n r || node_stat(slave_nodekey)[State] == StateActive\n end\n else\n error \"unknown role: #{node[Role]}\"\n false\n end\n else\n false\n end\n ret\n end", "def tree_nodes_valid?\n (root_tree_node.present? || top_nav_node_info_cd.zero?) &&\n (branch_tree_node.present? || sub_nav_node_info_cd.zero?) &&\n (leaf_tree_node.present? || trd_nav_node_info_cd.zero?)\n end", "def valid_nbors board, dims, pos\n nbors( pos, dims ).reject {|i| is_wall(board, i[:node])}\nend", "def runnable?\n tool_class.public_instance_methods(false).include?(:run)\n end", "def busy?\n busy || (max_workers && work_units.count >= max_workers)\n end", "def validate!\n fail '-- error: nil elements detected' unless nodes.all? && edges.all?\n\n unless nodes.all?(&:name)\n causer = nodes.detect{|e| !e.name}\n fail \"-- error: node without name @#{causer}\"\n end\n end", "def lb_active?\n self.active? and self.node_type.node_type == 'load balancer' and self.pdus.length == 1 \n end", "def any_waiting?\n synchronize do\n @num_waiting > 0\n end\n end", "def any_waiting?\n synchronize do\n @num_waiting > 0\n end\n end", "def test_for_node\n raise \"Failing test #{@name} for #{@node}\" if Node.fail_for.key?(@name) && Node.fail_for[@name].include?(@node)\n\n sleep_time = Node.sleeps.dig(@name, @node)\n sleep sleep_time unless sleep_time.nil?\n Node.runs << [@name, @node]\n end", "def with_own_thread()\n true\n end", "def is_node?(); @type == GRT_NODE; end", "def background_run_allowed?\n true\n end", "def run_action?\n admin? || cluster_owner?\n end", "def blocked?\n !self.blocked.nil?\n end", "def can_walk_to?(transition); end", "def busy?; end", "def any_waiting?\n synchronize do\n @num_waiting > 0\n end\n end", "def should_come_to_life?(x, y)\n dead?(x,y) && neighbours(x,y) == 3\n end", "def globally_scheduled?(node)\n node.fixed? || node.op == :immediate || node.outputs.output_names.include?(:global_schedule)\n end", "def visible_check(_traversal_env)\n Result::DENY\n end", "def can_remove_no_wait?\n @queue.size > @num_waiting\n end", "def requestable?\n (ill? || available? || recallable? ||\n processing? || on_order? || offsite? || ezborrow?)\n end", "def primitive_is_running?(primitive, node = nil)\n return unless primitive_exists? primitive\n status = primitive_status primitive, node\n return status unless status\n %w(start master).include? status\n end", "def free_nodes\n nodes.select(&:is_free?)\n end", "def nodes_district_can_accept(dsum, node_capacity, active_gear_pct)\n # If a district is already idling more than expected, project using\n # its actual active_gear_pct\n active_gear_pct = adjusted_active_pct(dsum, node_capacity, active_gear_pct)\n max_nodes = suggested_nodes_per_district(node_capacity, active_gear_pct)\n return max_nodes if dsum.nodes.empty?\n return [0, max_nodes - dsum.nodes.size].max # avoid negative :)\n end", "def can_remove_no_wait?\n @queue.size > @num_waiting\n end" ]
[ "0.62046695", "0.61511564", "0.60998374", "0.6094818", "0.6094818", "0.596317", "0.595908", "0.5947867", "0.59345216", "0.58940107", "0.58813125", "0.5845774", "0.5845774", "0.5845774", "0.57739735", "0.5763119", "0.57498026", "0.5709097", "0.5709097", "0.5705307", "0.5679522", "0.5664192", "0.5636687", "0.55780303", "0.55671346", "0.5565868", "0.55510503", "0.5539613", "0.5533336", "0.5529848", "0.5522558", "0.5520869", "0.55067873", "0.5502538", "0.5502538", "0.5501598", "0.5486971", "0.54784834", "0.5453962", "0.5435329", "0.54267764", "0.54187375", "0.54139304", "0.5411369", "0.5410961", "0.5381547", "0.53732514", "0.53700864", "0.5363126", "0.53619426", "0.5358016", "0.5358016", "0.53562844", "0.5351268", "0.5337285", "0.53257954", "0.53076065", "0.5292441", "0.5290881", "0.5289447", "0.5279481", "0.52783626", "0.5273991", "0.5273469", "0.5262655", "0.52567303", "0.52564085", "0.52411515", "0.52284294", "0.5227382", "0.5224512", "0.5209434", "0.5207705", "0.5207509", "0.5207373", "0.5200082", "0.51967514", "0.5195353", "0.5193823", "0.51930606", "0.5192516", "0.5192516", "0.5192373", "0.5191194", "0.5188321", "0.51866275", "0.51815593", "0.5179808", "0.51691014", "0.5167998", "0.5160052", "0.51445895", "0.5143182", "0.5141874", "0.514173", "0.5135009", "0.5134319", "0.5133838", "0.51284087", "0.51279753" ]
0.6961505
0
return a hash with the group names as keys and the amount of running nodes as value
def running_groups role_counter = Hash.new(0) command_sets.each do |command_set| if [:running, :starting].include? command_set.state role_counter[command_set.node.role] += 1 end end role_counter end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def number_of_new_nodes\n \t{'New Nodes Added' => aw.node_added_count }\n \tend", "def number_of_new_nodes\n \t{'New Nodes Added' => aw.node_added_count }\n \tend", "def groups_in(node_name)\n @groups.data_for(node_name)['groups'] || {}\n end", "def aggregate\n counts = {}\n group.each_pair { |key, value| counts[key] = value.size }\n counts\n end", "def num_groups\n\t\t\[email protected]\n\t\tend", "def populated_groups\n @counts.keys\n end", "def current_num_nodes() ; info[:current_num_nodes] ; end", "def node_names\n @groups.inject(local_node_names) do |acc, g|\n acc.merge(g.node_names)\n end\n end", "def generate_hash\n @groups.flatten.inject([]) {|hash, stone| hash << stone.to_s}.sort.hash\n end", "def run_list_groups\n @run_list_info.keys.sort_by{|item| @run_list_info[item][:rank] }.group_by{|item| @run_list_info[item][:placement] }\n end", "def all_group_hash\n hash = {}\n for group in @all_groups\n hash[group] = {}\n end\n return hash\n end", "def graphs(n)\n {\n 'cpu' =>\n \"groupByNode(collectd.#{name(n)}.cpu.*.cpu.*.value, 5, 'sumSeries')\",\n\n 'memory' =>\n \"groupByNode(collectd.#{name(n)}.memory.memory.*.value,4,'sumSeries')\",\n\n 'interface_if_octets_rx' =>\n \"groupByNode(collectd.#{name(n)}.interface.if_octets.*.rx,4,'sumSeries')\",\n\n 'interface_if_octets_tx' =>\n \"groupByNode(collectd.#{name(n)}.interface.if_octets.*.tx,4,'sumSeries')\",\n\n 'qmail_filecount_files' =>\n \"groupByNode(collectd.#{name(n)}.filecount.*.files.value,3,'sumSeries')\",\n\n 'qmail_filecount_files_stacked' =>\n \"groupByNode(collectd.*.filecount.*.files.value,1,'sumSeries')\",\n\n 'qmail_filecount_files_derivative' =>\n \"groupByNode(collectd.#{name(n)}.filecount.*.files.value,3,'derivative')\",\n\n 'qmail_filecount_files_derivative_stacked' =>\n \"groupByNode(collectd.*.filecount.*.files.value,1,'derivative')\",\n\n 'qmail_filecount_files_integral' =>\n \"groupByNode(collectd.#{name(n)}.filecount.*.files.value,3,'integral')\",\n\n 'qmail_filecount_files_integral_stacked' =>\n \"groupByNode(collectd.*.filecount.*.files.value,1,'integral')\",\n\n 'qmail_filecount_size' =>\n \"groupByNode(collectd.#{name(n)}.filecount.*.bytes.value,3,'sumSeries')\",\n\n 'qmail_filecount_size_stacked' =>\n \"groupByNode(collectd.*.filecount.*.bytes.value,1,'sumSeries')\",\n }\n end", "def grouping\n @grouping ||= :clustered\n end", "def group_up (machines)\n groups = Hash.new\n machines.each do |machine|\n name = machine[:name]\n machine[:groups].each do |group|\n if !groups.has_key?(group)\n groups[group] = Array.new\n end\n group_list = groups[group]\n if !group_list.include?(name)\n group_list.push(name)\n end\n end\n end\n all_groups = Array.new\n groups.each do |k, v|\n all_groups.push(k)\n end\n groups[\"all_groups:children\"] = all_groups\n\n return groups\nend", "def group_up (machines)\n groups = Hash.new\n machines.each do |machine|\n name = machine[:name]\n machine[:groups].each do |group|\n if !groups.has_key?(group)\n groups[group] = Array.new\n end\n group_list = groups[group]\n if !group_list.include?(name)\n group_list.push(name)\n end\n end\n end\n all_groups = Array.new\n groups.each do |k, v|\n all_groups.push(k)\n end\n groups[\"all_groups:children\"] = all_groups\n\n return groups\nend", "def nodes\n state(metrics: \"nodes\").dig(\"nodes\")\n end", "def groups\n @groups ||= {}\n end", "def nodes\n @graph.keys.length\n end", "def threadgroups_threads_count_properties\n logger.debug { \"#{self.class}##{__method__}\" }\n if @threadgroups_threads_count_properties.nil?\n @threadgroups_threads_count_properties = []\n xpath = '/jmeterTestPlan//ThreadGroup[@enabled=\"true\"]/stringProp[@name=\"ThreadGroup.num_threads\"]'\n jmeter_document do |doc|\n doc.xpath(xpath).each do |element|\n property_name = extract_property_name(element.content)\n @threadgroups_threads_count_properties.push(property_name)\n end\n end\n end\n @threadgroups_threads_count_properties\n end", "def node_groups(graph)\n Rails.cache.fetch(\"#{graph.name}_node_group_list\") do\n graph.nodes.flat_map { |n| n.groups.to_a }.sort.uniq\n end\n end", "def active_on_cluster_count\n (waiting_count + running_count)\n end", "def nodes\n @grpc.node_count\n end", "def data_for group_label\n @entries[group_label].collect do |report|\n size = report.label.split(' ').last.to_i\n microseconds_per_iters = 1000000.0 / report.ips.to_f\n\n {label: size,\n microseconds_per_iters: microseconds_per_iters,\n ips: report.ips\n }\n end\n end", "def group_count\n respond_with json_response('group_count', Group.active.count)\n end", "def make_nodes\n nodes = {}\n @files.each_with_index do |file, ind|\n @ranks.each do |rank|\n symbol = \"#{file}#{rank}\".to_sym\n nodes[symbol] = Node.new([rank - 1, ind])\n end\n end\n nodes\n end", "def i_groups; end", "def calc_total_gpus\n @total_gpus = 0\n #if @cluster_title.eql?(\"Ruby\")\n # # For the Ruby cluster, pbsnodes takes into account two debug nodes with two GPUs along with the other Ruby GPU nodes. The debug nodes will not be considered in the total GPUs and unallocated GPUs calculation, as they cannot be allocated as part of a regular job request with other GPU nodes. Here np = 20 is the number of processors for a GPU node rather than a debug node (np = 16) in a Ruby cluster.\n # @total_gpus = nodes_info.scan(/np = 20/).size\n # else\n # @total_gpus = nodes_info.lines(\"\\n\\n\").size\n #end\n end", "def groups\n c = Hash.new\n @up.keys.each{|key|\n c.append(self.find(key),(key))\n }\n return c.values\n end", "def instance_count\n @group.instances.length\n end", "def source_nodename_map\n map = {}\n @prometheus.query('max_over_time(node_uname_info[1d])').each do |result|\n source = result['metric']['instance']\n nodename = result['metric']['nodename'].split('.', 2)[0]\n log.info(\"[node_exporter] instance: '#{source}', nodename: '#{nodename}'\")\n map[source] = nodename\n end\n log.warn('Unable to query the node_exporter intances from Prometheus') \\\n if map.empty?\n map\n end", "def num_threads\n logger.debug { \"#{self.class}##{__method__}\" }\n if @num_threads.nil?\n @num_threads = 0\n\n threadgroups_threads_count_properties.each do |property_name|\n value = properties_map[property_name]\n logger.debug(\"#{property_name} -> #{value}\")\n\n if serialize_threadgroups?\n @num_threads = value if value > @num_threads\n else\n @num_threads += value\n end\n end\n end\n @num_threads\n end", "def count(grp)\n @counts[grp] || 0\n end", "def nodes # :nodoc:\n return @nodes if defined?(@nodes) \n node_ids = (1..Configuration.numbers['total_nodes'])\n @nodes = node_ids.map do |id| \n {\n id: id,\n host: \"node_#{id}_#{Worker::VERSION}\"\n }.to_struct\n end\n end", "def get_njobs(nodes)\n\n # Reset job count on each input node\n nodes.each do |wn|\n wn[:njobs] = -1\n end\n\n begin\n pbsnodes_xml = REXML::Document.new( %x[ #{$cmd_pbsnodes} 2> /dev/null ] )\n rescue\n return\n end\n\n return if pbsnodes_xml.elements.empty?\n\n pbsnodes_xml.elements.each('//Data/Node') do |node_xml|\n\n name = node_xml.elements['name'].text\n is_offline = node_xml.elements['state'].text.include?('offline')\n is_down = node_xml.elements['state'].text.include?('down')\n\n jobs_xml = node_xml.elements['jobs']\n if jobs_xml\n njobs = jobs_xml.text.split(' ').length\n else\n njobs = 0\n end\n\n # Find matching input nodes: FQDN must be set, node must be up and offline\n nodes.each do |wn|\n next unless wn[:fqdn] and wn[:fqdn] == name and is_offline and !is_down\n wn[:njobs] = njobs\n end\n\n end\n\nend", "def number_of_groups\n empty? ? 0 : boundaries.size\n end", "def tasks_total_count\n inject(0) do |sum, node|\n sum + node.graph.tasks_total_count\n end\n end", "def tasks_total_count\n inject(0) do |sum, node|\n sum + node.graph.tasks_total_count\n end\n end", "def countNodeStatus(domain)\r\n nON = 0\r\n nOFF = 0\r\n nKO = 0\r\n d = (domain == \"default\") ? OConfig.GRID_NAME : domain\r\n url = \"#{OConfig[:tb_config][:default][:cmc_url]}/allStatus?domain=#{d}\"\r\n response = NodeHandler.service_call(url, \"Can't get node status from CMC\")\r\n doc = REXML::Document.new(response.body)\r\n doc.root.elements.each('//detail/*') { |e|\r\n attr = e.attributes\r\n state = attr['state']\r\n nON = (state.match(/^POWERON/)) ? nON + 1 : nON\r\n nOFF = (state.match(/^POWEROFF/)) ? nOFF + 1 : nOFF\r\n nKO = (state.match(/^NODE/)) ? nKO + 1 : nKO\r\n }\r\n puts \"-----------------------------------------------\"\r\n puts \"Testbed : #{d}\"\r\n puts \"Number of nodes in 'Power ON' state : #{nON}\"\r\n puts \"Number of nodes in 'Power OFF' state : #{nOFF}\"\r\n puts \"Number of nodes in 'Not Available' state : #{nKO}\"\r\n puts \"-----------------------------------------------\"\r\nend", "def get_group_members\n num_of_groups = RoundMember.where(round_id: self.id).order(:group_number).last.group_number\n group_members = {}\n\n 1.upto num_of_groups do |n|\n member_ids = RoundMember.where(round_id: self.id).where(group_number: n).pluck(:member_id)\n group_members[n] = Member.where(id: member_ids)\n end\n\n return group_members\n end", "def size\n\t\t\[email protected]\n\t\tend", "def job_names\n @nodes.keys\n end", "def counts\n count = Hash.new(0)\n self.each{|ele| count[ele] += 1}\n count\n end", "def num_gears\n num = 0\n group_instances.each { |g| num += g.gears.count}\n num\n end", "def index\n @sum = 0\n session[:node] = params[:name]\n if params.has_key?(:role)\n result = NodeObject.all #this is not efficient, please update w/ a search!\n @nodes = result.find_all { |node| node.role? params[:role] }\n if params.has_key?(:names_only)\n names = @nodes.map { |node| node.handle }\n @nodes = {:role=>params[:role], :nodes=>names, :count=>names.count}\n end\n else\n @groups = {}\n @nodes = {}\n raw_nodes = NodeObject.all\n get_node_and_network(params[:selected]) if params[:selected]\n raw_nodes.each do |node|\n @sum = @sum + node.name.hash\n @nodes[node.handle] = { :alias=>node.alias, :description=>node.description, :status=>node.status }\n group = node.group\n @groups[group] = { :automatic=>!node.display_set?('group'), :status=>{\"ready\"=>0, \"failed\"=>0, \"unknown\"=>0, \"unready\"=>0, \"pending\"=>0}, :nodes=>{} } unless @groups.key? group\n @groups[group][:nodes][node.group_order] = node.handle\n @groups[group][:status][node.status] = (@groups[group][:status][node.status] || 0).to_i + 1\n if node.handle === params[:name]\n @node = node\n get_node_and_network(node.handle)\n end\n end\n flash[:notice] = \"<b>#{t :warning, :scope => :error}:</b> #{t :no_nodes_found, :scope => :error}\" if @nodes.empty? #.html_safe if @nodes.empty?\n end\n respond_to do |format|\n format.html # index.html.haml\n format.xml { render :xml => @nodes }\n format.json { render :json => @nodes }\n end\n end", "def help_node_stats_data(name = nil)\n ns = __elasticsearch__.client.nodes.stats(:format => 'json')\n if name\n filtered_ns = ns['nodes'].keys.map do |k|\n [ k, ns['nodes'][k] ] if ns['nodes'][k]['name'] == name\n end.to_h\n ns['nodes'] = filtered_ns\n end\n\n\t\tns\n end", "def groups(array_of_names)\r\n\r\n\tnum_people = array_of_names.length \t\t#how many people do we have?\r\n\tgroups_5 = num_people % 4 \t#how many groups will have 5\r\n\tgroups_4 = (num_people - (groups_5 * 5)) / 4 # how many groups will have 4\r\n\ttotal_groups = groups_4 + groups_5 \t\t#how many total groups\r\n\r\n\tgroup_hash = Hash.new([])\t#new hash initialized to empty arrays\r\n\t\r\n\tnum_group = 0\r\n\tindex = 0\r\n\r\n\tgroups_5.times do\r\n\t\tpeople_in_group = []\r\n\t\t5.times do\r\n\t\t\tpeople_in_group << array_of_names[index]\r\n\t\t\tindex += 1\r\n\t\tend\r\n\t\tgroup_hash[\"Accountability Group #{num_group}\"] = people_in_group\r\n\t\tnum_group += 1\r\n\tend\r\n\r\n\tgroups_4.times do\r\n\t\tpeople_in_group = []\r\n\t\t4.times do\r\n\t\t\tpeople_in_group << array_of_names[index]\r\n\t\t\tindex += 1\r\n\t\tend\r\n\t\tgroup_hash[\"Accountability Group #{num_group}\"] = people_in_group\r\n\t\tnum_group += 1\r\n\tend\r\n\r\n\treturn group_hash\r\n\r\nend", "def total_hits_node\n {total_hits: total_hits_count}\n end", "def nodeCount\n count = 1\n\n if @children.size\n @children.each do |key, val|\n count += val.nodeCount\n end\n end\n\n count\n end", "def hash\n [host_list, total_matching, total_returned].hash\n end", "def getCounts\n result = {}\n @classes.each do |c|\n count = 0\n ObjectSpace.each_object(c){ count += 1 }\n result[c] = count\n end\n result\n end", "def count\n number_of_trees + number_of_networks\n end", "def tasks_finished_count\n inject(0) do |sum, node|\n sum + node.graph.tasks_finished_count\n end\n end", "def tasks_finished_count\n inject(0) do |sum, node|\n sum + node.graph.tasks_finished_count\n end\n end", "def total\n #use group matches instead of numFound for grouped response\n if response[:numFound].nil? \n self[:grouped][blacklight_config['index']['group']]['matches'].to_s.to_i \n else \n response[:numFound].to_s.to_i\n end\n end", "def total_count\n object.nodes.size\n end", "def overview\n data = { :clusters => [], :config => config }\n\n stats.each do |cluster_name, cluster_data|\n # Setting global server attributes ( like hostname, version etc...)\n unless cluster_data.is_a? Hash\n data[cluster_name] = cluster_data\n next\n end\n\n #next unless redis? cluster_name # skip memcached clusters\n\n aliases = node_aliases cluster_name\n cluster = { nodes: [], name: cluster_name }\n cluster_data.each do |node, node_value|\n # Adding node\n if node_value.kind_of? Hash\n node_data = cluster_data[node]\n node = aliases[node] || node\n url = ( node =~ /redis\\:\\/\\// ) ? node : \"redis://#{node}\"\n info = redis_info(url, config[cluster_name][\"redis_auth\"])\n cluster[:nodes] << {\n server_url: url, info: info, running: info.any?\n }.merge(node_data)\n else # Cluster attribute\n cluster[node] = node_value\n end\n end\n data[:clusters].push cluster\n end\n data\n end", "def occurences_count\n\t\t\t\t\t\tHash.new(0).tap do |result|\n\t\t\t\t\t\t each { |item| result[item] += 1 }\n\t\t\t\t\t\tend\n\t\t\t\tend", "def make_grp_prj_nodes\n grp = {}; prj = {}\n @nodes_fields.each do |node|\n grp[node] = '$' + node\n prj[node] = '$_id.' + node\n end\n return [grp, prj]\n end", "def nodetool_status()\n out = `/opt/cassandra/bin/nodetool status`\n raise 'nodetool status failed' if $? != 0\n rows = out.split(\"\\n\")\n hash = {}\n dc_exp = /Datacenter: (.*)/\n #vnode\n #-- Address Load Tokens Owns Host ID Rack\n #non-vnode\n #-- Address Load Owns Host ID Token Rack\n #node_ex = /^(?<status>[UD\\?][NLJM]) +(?<address>(?:[0-9]{1,3}\\.){3}[0-9]{1,3}) +(?<load>(\\d+\\.?\\d* (TB|GB|MB|KB|bytes))|\\?) +(?<tokens>\\d+) +(?<owns>(\\d+\\.?\\d*%|\\?)) +(?<hostid>[a-z0-9\\-]+) +(?<rack>.*)$/\n node_ex = /^([UD\\?][NLJM]) +((?:[0-9]{1,3}\\.){3}[0-9]{1,3}) +((?:\\d+\\.?\\d* (?:TB|GB|MB|KB|bytes))|\\?) +(\\d+) +(\\d+\\.?\\d*%|\\?) +([a-z0-9\\-]+) +(.*)$/\n datacenter = nil\n rows.each do |row|\n m = dc_exp.match(row)\n if m\n datacenter = m[1]\n next\n end\n m = node_ex.match(row)\n next if m == nil\n node = {'datacenter' => datacenter}\n hash[m[2]] = node\n i = 0\n %w(status address load tokens owns hostid rack).each do |name|\n node[name] = m[i += 1]\n end\n # m.names.each do |name|\n # node[name] = m[name]\n # end\n end\n return hash\n end", "def state_stats\n state_data = {}\n @file.each do |line|\n state = line[:state]\n if state_data[state].nil?\n state_data[state] = 1\n else\n state_data[state] += 1\n end\n\n end\n rank = state_data.sort_by{|state, counter| -counter}.collect{|state,counter| state unless state.nil?}\n state_data = state_data.select{|state, counter| state}.sort_by{|state,counter| state unless state.nil?}\n state_data.each do |state, counter|\n puts \"(#{rank.index(state)+1}) #{state}: #{counter}\"\n end\n end", "def number_of_nodes(node_name)\n nodes(node_name).count\nend", "def nodes\n @nodes ||= {}\n end", "def nodes\n @nodes ||= {}\n end", "def nodes\n return @nodes_structure if @nodes_structure\n @nodes_structure = {}\n cib_section_nodes_state.each do |node_state|\n node = attributes_to_hash node_state\n node_name = node['uname']\n next unless node_name\n lrm = node_state.elements['lrm']\n next unless lrm\n lrm_resources = cib_section_lrm_resources lrm\n next unless lrm_resources\n resources = decode_lrm_resources lrm_resources\n node.store 'primitives', resources\n @nodes_structure.store node_name, node\n end\n @nodes_structure\n end", "def load_per_cpu(_)\n cpu_per_source = {}\n @client.query(\n '(count(node_cpu{mode=\"system\"})by(instance))'\n ).each do |result|\n source = result['metric']['instance']\n cpu_per_source[source] = result['value'][1]\n end\n\n metrics = []\n @client.query('node_load5').each do |result|\n source = result['metric']['instance']\n value = result['value'][1].to_f.round(2)\n load_on_cpu = value / cpu_per_source[source].to_f\n log.debug(\n \"[load_per_cpu] value: '#{load_on_cpu}', source: '#{source}'\"\n )\n metrics << {\n 'source' => source,\n 'value' => load_on_cpu\n }\n end\n metrics\n end", "def gen_node_infos(cluster_yml)\n\n master_n = 1\n master_mem = cluster_yml['master_mem']\n master_cpus = cluster_yml['master_cpus']\n\n slave_n = cluster_yml['slave_n']\n slave_mem = cluster_yml['slave_mem']\n slave_cpus = cluster_yml['slave_cpus']\n\n master_ipbase = cluster_yml['master_ipbase']\n slave_ipbase = cluster_yml['slave_ipbase']\n\n master_infos = (1..master_n).map do |i|\n { :hostname => \"master#{i}\",\n :ip => master_ipbase + \"#{10+i}\",\n :mem => master_mem,\n :cpus => master_cpus\n }\n end\n\n slave_infos = (1..slave_n).map do |i|\n { :hostname => \"slave#{i}\",\n :ip => slave_ipbase + \"#{10+i}\",\n :mem => slave_mem,\n :cpus => slave_cpus\n }\n end\n\n analytics_node = cluster_yml['analytics_node']\n analytics_mem = cluster_yml['analytics_mem']\n analytics_cpus = cluster_yml['analytics_cpus']\n\n analytics_info = {\n :node => analytics_node,\n :mem => analytics_mem,\n :cpus => analytics_cpus\n }\n\n\n return { :master => master_infos, :slave=>slave_infos, :analytics=>analytics_info }\nend", "def target_num_nodes() ; info[:target_num_nodes] ; end", "def create_map_number_of_reviews_for_reviewer(reviewer_groups)\n number_of_reviews_for_reviewer = {}\n reviewer_groups.each do |reviewer|\n count = PeerReview.where(reviewer_id: reviewer['id']).count\n number_of_reviews_for_reviewer[reviewer['id']] = count\n end\n number_of_reviews_for_reviewer\n end", "def stats\n stats = {\n :servers => {}, \n :results => 0, \n :taken_tasks => 0, \n :untaken_tasks => 0,\n :taken_master_tasks => 0,\n :taken_task_tasks => 0, \n :untaken_master_tasks => 0,\n :untaken_task_tasks => 0,\n :failed_tasks => 0,\n :untaken_future_tasks => 0,\n :time => Time.now.to_f,\n }\n\n stats[:untaken_future_tasks] = SkynetWorkerQueue.connection.select_value(%{\n SELECT count(id)\n FROM #{message_queue_table}\n WHERE expire_time > #{Time.now.to_i} and tasktype = 'task' and payload_type = 'master' \n })\n\n stat_rows = SkynetWorkerQueue.connection.select_all(%{\n SELECT tasktype, payload_type, iteration, count(id) as number_of_tasks, expire_time\n FROM #{message_queue_table} \n WHERE expire_time <= #{Time.now.to_i} \n GROUP BY tasktype, payload_type, iteration \n }) \n stat_rows.each do |row|\n if row[\"tasktype\"] == \"result\" or row[\"payload_type\"] == \"result\"\n stats[:results] += row[\"number_of_tasks\"].to_i\n elsif row[\"tasktype\"] == \"task\" \n type_of_tasks = nil\n if row[\"payload_type\"] == \"master\"\n type_of_tasks = :master_tasks\n elsif row[\"payload_type\"] == \"task\"\n type_of_tasks = :task_tasks\n end\n if row[\"iteration\"].to_i == 0\n stats[\"untaken_#{type_of_tasks}\".to_sym] += row[\"number_of_tasks\"].to_i \n stats[:untaken_tasks] += row[\"number_of_tasks\"].to_i\n elsif row[\"expire_time\"].to_i < Time.now.to_i\n stats[:failed_tasks] += row[\"number_of_tasks\"].to_i \n else\n stats[\"taken_#{type_of_tasks}\".to_sym] += row[\"number_of_tasks\"].to_i \n stats[:taken_tasks] += row[\"number_of_tasks\"].to_i\n end\n end\n end\n\n stats[:time] = Time.now.to_f - stats[:time]\n stats\n end", "def calc_full_nodes_avail\n @full_nodes_available = 0\n #if @cluster_title.eql?(\"Ruby\")\n # # See line 62\n #@full_nodes_available = nodes_info.lines(\"\\n\\n\").select { |node| node.include?(\"dedicated_threads = 0\") && node.include?(\"np = 20\") && node.include?(\"gpu_state=Unallocated\")}.size\n #else\n #@full_nodes_available = nodes_info.lines(\"\\n\\n\").select { |node| node.include?(\"dedicated_threads = 0\") && node.include?(\"gpu_state=Unallocated\") }.size\n #end\n end", "def gen_node_infos(cluster_yml)\n master_n = 1\n master_mem = cluster_yml['master_mem']\n master_cpus = cluster_yml['master_cpus']\n slave_n = cluster_yml['slave_n']\n slave_mem = cluster_yml['slave_mem']\n slave_cpus = cluster_yml['slave_cpus']\n master_ipbase = cluster_yml['master_ipbase']\n slave_ipbase = cluster_yml['slave_ipbase']\n\n master_infos = (1..master_n).map do |i|\n { :hostname => \"master#{i}\",\n :ip => master_ipbase + \"#{10+i}\",\n :mem => master_mem,\n :cpus => master_cpus\n }\n end\n slave_infos = (1..slave_n).map do |i|\n { :hostname => \"slave#{i}\",\n :ip => slave_ipbase + \"#{10+i}\",\n :mem => slave_mem,\n :cpus => slave_cpus\n }\n end\n\n return { :master => master_infos, :slave=>slave_infos }\nend", "def log_nodes_count\n @max_nodes += 1\n end", "def groups; end", "def groups; end", "def groups; end", "def counts\n @counts ||=\n begin\n h = {}\n by_label.each do |label, notes|\n h[label] = notes.size\n end\n h\n end\n end", "def new_states_results_hash\n res = parts.each_with_object({}) do |(_part, test_cases), obj|\n test_cases.each do |test_case|\n next unless test_case\n test_case.test_steps.each do |test_step|\n test_step.results.each do |(_machine, value)|\n step_rewrited_name = @step_status_rewrite_callback.call(value)\n obj[step_rewrited_name] ||= 0\n obj[step_rewrited_name] += 1\n end\n end\n end\n end\n return { 'NotSet' => 1 } if res.empty?\n\n res\n end", "def total_visit\n parsed_result.each do |result|\n visit_hash[result.first] = result.last.count\n end\n visit_hash.sort_by{|k,v| v}.reverse.to_h\n end", "def returned_nodes_count\n @traversal_position.returnedNodesCount\n end", "def counters\n {\n files: files_count,\n apps: apps_count,\n workflows: workflows_count,\n jobs: jobs_count,\n members: members_count,\n }\n end", "def summarise()\n summary = Hash.new\n page_count = 0\n\n @nodes.each {|node|\n if summary.include?(node['content_type'])\n summary[node['content_type']] += 1\n else\n summary[node['content_type']] = 1\n end\n }\n\n summary.keys.sort.each {|node_type|\n count = summary[node_type].to_i\n page_count += count\n puts \"%-50s: %s\" % [node_type, count]\n }\n\n puts \"%-50s: %s\" % ['Total pages:', page_count]\n puts \"See output CSV in #{csv_output_path}\"\n end", "def length\n group.length\n end", "def tag_counts\n if @tag_counts.nil?\n @tag_counts = {}\n tasks.each do |task|\n task.tags.each do |tag|\n @tag_counts[tag] = (@tag_counts[tag] || 0) + 1\n end\n end\n end\n\n return @tag_counts\n end", "def bnodes(context = nil)\n bn = {}\n triples(Triple.new(nil, nil, nil), context) do |t, ctx|\n if t.subject.is_a?(BNode)\n bn[t.subject] ||= 0\n bn[t.subject] += 1\n end\n if t.predicate.is_a?(BNode)\n bn[t.predicate] ||= 0\n bn[t.predicate] += 1\n end\n if t.object.is_a?(BNode)\n bn[t.object] ||= 0\n bn[t.object] += 1\n end\n end\n bn\n end", "def group_up (machines)\n groups = Hash.new\n machines.each do |machine|\n name = machine[:name]\n machine[:groups].each do |group|\n if !groups.has_key?(group)\n groups[group] = Array.new\n end\n group_list = groups[group]\n if !group_list.include?(name)\n group_list.push(name)\n end\n end\n end\n return groups\nend", "def tasks_successful_count\n inject(0) do |sum, node|\n sum + node.graph.tasks_successful_count\n end\n end", "def tasks_successful_count\n inject(0) do |sum, node|\n sum + node.graph.tasks_successful_count\n end\n end", "def acct_groups(names)\r\n\r\n\tnum_groups = names.size / 4\r\n\r\n\tgroups_ary = Array.new(num_groups) { Array.new }\r\n\r\n\tnames.each_with_index do |name, index|\r\n\t\tgroups_ary[index % num_groups] << name\r\n\tend\r\n\r\n\tgroups_hash = Hash.new\r\n\tgroups_ary.each_with_index do |group_ary, index|\r\n\t\tgroups_hash[\"Accountability Group \" + (index+1).to_s] = group_ary\r\n\tend\r\n\r\n\treturn groups_hash\r\n\r\nend", "def machines_quantity_hash\n answer = {}\n owners = self.owners\n owners.each do |o|\n m = o.machine_id\n if answer[m].nil?\n answer[m] = 1\n else\n answer[m] += 1\n end\n end\n return answer\n end", "def nodes\n @cluster.nodes\n end", "def recipes(nodes)\n nodes.inject({}) do |memo, node|\n node.recipes.each do |recipe|\n memo[recipe.to_s] ||= 0\n memo[recipe.to_s] += 1\n end\n\n memo\n end\n end", "def get_groups\n `id -nG #{name}`.split(' ')\n end", "def system_usage_data\n {\n counts: {\n assignee_lists: count(List.assignee),\n boards: count(Board),\n ci_builds: count(::Ci::Build),\n ci_internal_pipelines: count(::Ci::Pipeline.internal),\n ci_external_pipelines: count(::Ci::Pipeline.external),\n ci_pipeline_config_auto_devops: count(::Ci::Pipeline.auto_devops_source),\n ci_pipeline_config_repository: count(::Ci::Pipeline.repository_source),\n ci_runners: count(::Ci::Runner),\n ci_triggers: count(::Ci::Trigger),\n ci_pipeline_schedules: count(::Ci::PipelineSchedule),\n auto_devops_enabled: count(::ProjectAutoDevops.enabled),\n auto_devops_disabled: count(::ProjectAutoDevops.disabled),\n deploy_keys: count(DeployKey),\n deployments: count(Deployment),\n successful_deployments: count(Deployment.success),\n failed_deployments: count(Deployment.failed),\n environments: count(::Environment),\n clusters: count(::Clusters::Cluster),\n clusters_enabled: count(::Clusters::Cluster.enabled),\n project_clusters_enabled: count(::Clusters::Cluster.enabled.project_type),\n group_clusters_enabled: count(::Clusters::Cluster.enabled.group_type),\n clusters_disabled: count(::Clusters::Cluster.disabled),\n project_clusters_disabled: count(::Clusters::Cluster.disabled.project_type),\n group_clusters_disabled: count(::Clusters::Cluster.disabled.group_type),\n clusters_platforms_gke: count(::Clusters::Cluster.gcp_installed.enabled),\n clusters_platforms_user: count(::Clusters::Cluster.user_provided.enabled),\n clusters_applications_helm: count(::Clusters::Applications::Helm.available),\n clusters_applications_ingress: count(::Clusters::Applications::Ingress.available),\n clusters_applications_cert_managers: count(::Clusters::Applications::CertManager.available),\n clusters_applications_prometheus: count(::Clusters::Applications::Prometheus.available),\n clusters_applications_runner: count(::Clusters::Applications::Runner.available),\n clusters_applications_knative: count(::Clusters::Applications::Knative.available),\n in_review_folder: count(::Environment.in_review_folder),\n groups: count(Group),\n issues: count(Issue),\n keys: count(Key),\n label_lists: count(List.label),\n lfs_objects: count(LfsObject),\n milestone_lists: count(List.milestone),\n milestones: count(Milestone),\n pages_domains: count(PagesDomain),\n projects: count(Project),\n projects_imported_from_github: count(Project.where(import_type: 'github')),\n projects_with_repositories_enabled: count(ProjectFeature.where('repository_access_level > ?', ProjectFeature::DISABLED)),\n projects_with_error_tracking_enabled: count(::ErrorTracking::ProjectErrorTrackingSetting.where(enabled: true)),\n protected_branches: count(ProtectedBranch),\n releases: count(Release),\n remote_mirrors: count(RemoteMirror),\n snippets: count(Snippet),\n suggestions: count(Suggestion),\n todos: count(Todo),\n uploads: count(Upload),\n web_hooks: count(WebHook)\n }\n .merge(services_usage)\n .merge(approximate_counts)\n }.tap do |data|\n if Feature.enabled?(:group_overview_security_dashboard)\n data[:counts][:user_preferences] = user_preferences_usage\n end\n end\n end", "def create_groups(people)\n number_people = people.length\n if number_people < 3\n group_quantity = 1\n else\n group_quantity = number_people / 3\n end\n group_number = 1\n groups_names = Hash.new(\"\")\n people.each do |name|\n if group_number <= group_quantity\n groups_names[group_number] += (name + \", \")\n group_number += 1\n else\n groups_names[1] += (name + \", \")\n group_number = 2\n end\n end\n groups_names.each do |group, name|\n print \"\\n\", \"Group \", group, \"\\n\"\n print name, \"\\n\"\n end\nend", "def find_groups\n initialize_groups\n @edges.each do |e|\n v1 = e[0]\n v2 = e[1]\n g1 = group_for_id(v1)\n g2 = group_for_id(v2)\n merge_groups(g1, g2)\n end\n end", "def get_nodegroups()\n nodemgr_rest_call(\"GET\", \"classifier\", \"groups\", $credentials)\nend", "def number_of_nodes_edited_by_new_mappers\n \t\tnodes_by_new_mappers = Node_Query.new(analysis_window: aw, constraints: {'user' => {'$in' => aw.new_contributors}}).run\n {'Nodes Edited by New Mappers' => nodes_by_new_mappers.first[:objects].length }\n \tend", "def number_of_nodes_edited_by_new_mappers\n \t\tnodes_by_new_mappers = Node_Query.new(analysis_window: aw, constraints: {'user' => {'$in' => aw.new_contributors}}).run\n {'Nodes Edited by New Mappers' => nodes_by_new_mappers.first[:objects].length }\n \tend", "def job_stats\n jobpath = Pathname.new(jobdir)\n std_out = jobpath + \"#{prefix}.o#{pid.split('.')[0]}\"\n\n nodes, elements, cputime, walltime = nil\n if std_out.exist?\n File.foreach(std_out) do |line|\n nodes = line.split[4] if line.include? \"MAXIMUM NODE NUMBER\"\n elements = line.split[4] if line.include? \"MAXIMUM ELEMENT NUMBER\"\n cputime = \"#{line.split[5]} s\" if line.include? \"CP Time\"\n walltime = \"#{line.split[5]} s\" if line.include? \"Elapsed Time\"\n end\n end\n Hash[\"Number of Nodes\" => nodes,\n \"Number of Elements\" => elements,\n \"CPU Time\" => cputime,\n \"Wall Time\" => walltime]\n end", "def job_stats\n jobpath = Pathname.new(jobdir)\n std_out = jobpath + \"#{prefix}.o#{pid.split('.')[0]}\"\n\n nodes, elements, cputime, walltime = nil\n if std_out.exist?\n File.foreach(std_out) do |line|\n nodes = line.split[4] if line.include? \"MAXIMUM NODE NUMBER\"\n elements = line.split[4] if line.include? \"MAXIMUM ELEMENT NUMBER\"\n cputime = \"#{line.split[5]} s\" if line.include? \"CP Time\"\n walltime = \"#{line.split[5]} s\" if line.include? \"Elapsed Time\"\n end\n end\n Hash[\"Number of Nodes\" => nodes,\n \"Number of Elements\" => elements,\n \"CPU Time\" => cputime,\n \"Wall Time\" => walltime]\n end" ]
[ "0.6236876", "0.6236876", "0.61504346", "0.61041445", "0.609233", "0.6012491", "0.59191734", "0.58675", "0.5833526", "0.57822907", "0.5715408", "0.5688855", "0.5686854", "0.5667679", "0.5667679", "0.5662057", "0.56484985", "0.5625404", "0.5625226", "0.5592638", "0.55853355", "0.5536006", "0.5506077", "0.5493794", "0.54901534", "0.54889035", "0.5479827", "0.54685783", "0.545965", "0.54558474", "0.5453303", "0.54421407", "0.54154015", "0.53899926", "0.5389588", "0.53812474", "0.53812474", "0.5362027", "0.53576314", "0.5353772", "0.5346563", "0.5343962", "0.5343209", "0.53299695", "0.5322466", "0.5320966", "0.5316386", "0.5315182", "0.5307019", "0.5301062", "0.5299826", "0.52906525", "0.52906525", "0.52836365", "0.5273464", "0.5272461", "0.52677876", "0.52591765", "0.5257857", "0.525729", "0.52510047", "0.5243815", "0.5243815", "0.5243043", "0.5240318", "0.52389604", "0.52325416", "0.52304643", "0.5226938", "0.52197415", "0.5218212", "0.52178216", "0.5217192", "0.5217192", "0.5217192", "0.5214722", "0.52132547", "0.5212425", "0.5204329", "0.52020496", "0.5197338", "0.5193177", "0.5188237", "0.5184825", "0.5179493", "0.51755613", "0.51755613", "0.5173027", "0.5167283", "0.51659673", "0.51605177", "0.51520276", "0.5150858", "0.514573", "0.51448137", "0.5142199", "0.5138785", "0.5138785", "0.51372147", "0.51368785" ]
0.69258225
0
Will be skipped when dumping yaml, therefore nil after loading from yaml.
def queue @queue ||= Queue.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_yaml_object\n nil\n end", "def to_yaml_object\n nil\n end", "def yaml_file?; end", "def yaml_object_type\n nil\n end", "def read_yaml(throw_missing: T.unsafe(nil), **kwd); end", "def from_yaml\n results = YAML.load(self)\n \n # Replace bad values\n if results == false or results == nil\n \"\"\n else\n results\n end\n end", "def load_database_yaml; end", "def load_database_yaml; end", "def bare_yaml\n return \"\" unless present?\n yaml = to_yaml\n\n # Detect single-line libyaml 0.2.1 scalar and remove trailing newline\n return yaml.sub(/\\A--- ([^\\n]+)\\n\\Z/m, '\\1') if yaml.single_line_ending_in_newline?\n\n yaml.sub(/\\A---[ \\n]/, \"\") # Handle header for multi-line yaml snippets\n .sub(/(\\n\\.\\.\\.\\n)?\\Z/m, \"\") # Handle libyaml 0.1.7 end of stream marker\n end", "def set_yaml_repr(dat)\n @data = dat unless dat.nil?\n end", "def read_yaml(_base, _name, _opts = {})\n self.content = self.output = \"\"\n self.data ||= DEFAULT_DATA.dup\n end", "def read_yaml(base, name, opts = T.unsafe(nil)); end", "def load_from_yaml(curr_all_info)\n reset_info\n begin\n @curr_all_info = {}\n @curr_all_info = YAML::load(curr_all_info) #YAML::load_file(yamlfilename) if File.exist?(yamlfilename)\n \n process_my_curr_all_info\n \n return !is_empty?\n rescue => detail\n\t str = \"Error load_from_yaml \\n\"\n\t str += detail.backtrace.join(\"\\n\")\n\t puts str\n reset_info\n return false\n end \n end", "def load_yaml(filename); end", "def load_yaml(data, safe: T.unsafe(nil), whitelist_classes: T.unsafe(nil), whitelist_symbols: T.unsafe(nil), aliases: T.unsafe(nil)); end", "def yaml(filename)\n YAML.load(IO.read(filename).gsub(/---\\z/, ''))\nend", "def take_yaml(yml)\n @data = YAML.load(yml)\n end", "def take_yaml(yml)\n @data = YAML.load(yml)\n end", "def meta_data\n return if @meta_end.nil?\n\n cur, meta_end, @meta_end = tell, @meta_end, nil\n seek 0\n return YAML.load(self)\n\n ensure\n @meta_end = meta_end if defined? meta_end and meta_end\n seek cur if defined? cur and cur\n end", "def load yaml\n data = YAML::load yaml \n raise \"Cannot load YAML data\" unless data\n\n @raw = @data = @errors = @commands = nil\n @errors = data.delete('__ERRORS__')\n @commands = data.delete('__COMMANDS__')\n @raw = OpenStruct.new data\n @data = { }\n end", "def read_yaml(base, name)\n self.content = File.read(File.join(base, name))\n\n if self.content =~ /^(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m\n self.content = $POSTMATCH\n\n begin\n self.data = YAML.load($1)\n rescue => e\n puts \"YAML Exception reading #{name}: #{e.message}\"\n end\n end\n\n self.data ||= {}\n end", "def yaml\n @yaml ||= has_yaml? ? YAML.load(@content) : {}\n end", "def fill_from_yaml(yaml)\n fill_from_hash(Psych.load(yaml))\n end", "def test_yaml_loads_5_1_dump\n body = File.open(schema_dump_path).read\n cache = YAML.unsafe_load(body)\n\n assert_no_queries do\n assert_equal 11, cache.columns(\"posts\").size\n assert_equal 11, cache.columns_hash(\"posts\").size\n assert cache.data_sources(\"posts\")\n assert_equal \"id\", cache.primary_keys(\"posts\")\n end\n end", "def to_yaml() end", "def handle_yaml(filename, &block) \n filedata = YAML.load_file(filename)\nrescue Errno::ENOENT\n puts \"The file with the file name #{filename} could not be found. Aborting.\"\n exit\nelse\n block_given? ? block.call(filedata) : filedata\nend", "def load_game\n begin\n player = YAML.load_file(\"player.yaml\")\n return player\n rescue\n return nil\n end\nend", "def yaml\n @yaml ||= YAML.load_file path\n rescue StandardError\n {}\n end", "def load(&_block)\n nil\n end", "def dump_null machine\n end", "def y(obj)\n puts obj.to_yaml\nend", "def y(obj)\n puts obj.to_yaml\nend", "def from_yaml\n\t\tdata = YAML.load File.read(\"save.yaml\")\n\t\t@board = Board.new(data[:board], data[:positions])\n\t\t@current_turn = data[:current_turn]\n\t\t@ai_on = data[:ai_on]\t\t\n\tend", "def yaml\n copy = {}\n @lock.synchronize do\n copy.merge!(@yaml)\n end\n copy\n end", "def value\r\n \tbase_value = read_attribute('value')\r\n \t#\r\n \tif ! base_value.nil?\r\n \treturn YAML::load(base_value)\r\n end\r\n return nil\r\n\tend", "def load_yaml(yaml_path, variables = nil)\n #puts \"load_yaml #{yaml_path}\"\n if variables\n YAML.load(ERB.new(File.read(yaml_path)).result(OpenStruct.new(variables).instance_eval { binding })) \n else\n YAML.load(ERB.new(File.read(yaml_path)).result)\n end\nend", "def nice_yaml(string)\n YAML.dump(string).gsub(/\\A---\\n/, '')\n end", "def pets\n load_yaml('personaje/pets')\nend", "def reserved\n @reserved ||= YAML.load_file(reserved_file)\n end", "def data_links\r\n puts \"pwd:\"\r\n puts Dir.pwd\r\n\r\n data = YAML.load_file( './data/links.yml' )\r\n puts data.inspect\r\n data\r\nend", "def yaml_file?\n false\n end", "def yaml_dump(val)\n yml = \"\\n\" + YAML.dump(val)\n yml.gsub(/ +\\n/, \"\\n\")\n end", "def read_yaml(base, name)\n begin\n text = File.read(File.join(base, name))\n data = {'layout'=>'default'}\n\n if page_yaml = transfiguration['page_yaml']\n data.merge!(page_yaml)\n end\n\n # commented metadata\n if text =~ /<!--\\s+---\\s*(.*?)-->\\s*$\\n?/m\n text.delete($0)\n data.merge!(YAML.safe_load($1))\n end\n\n self.content = text\n self.data = data\n rescue SyntaxError => e\n puts \"YAML Exception reading #{File.join(base, name)}: #{e.message}\"\n rescue Exception => e\n puts \"Error reading file #{File.join(base, name)}: #{e.message}\"\n end\n\n unless self.data['layout']\n self.data['layout'] = 'page'\n end\n\n return self.data\n end", "def clean_yaml(yaml_input)\n yaml_output = yaml_input\n\n # Had some issues with different versions of ruby giving different results\n yaml_output.gsub!(%r(!ruby/sym(bol)? ), ':')\n\n # Also, some versions appear to dump out trailing whitespace\n yaml_output.gsub!(/\\s+$/, '')\n\n return yaml_output\n end", "def meta_data=( data )\n return if data.nil? and @meta_end.nil?\n\n seek 0\n lines = readlines\n\n truncate 0\n unless data.nil?\n write YAML.dump(data)\n write \"--- #$/\"\n end\n lines.each {|line| write line}\n ensure\n @meta_end = end_of_meta_data\n seek 0, IO::SEEK_END\n end", "def preload\n nil\n end", "def from_yaml\n YAML.load(self)\n end", "def load_state file=nil\n file=App.outpath + \"save.rb\" if file.nil?\n f=File.open(file,'r')\n content=f.read\n # puts content\n App.out= YAML.load(content)\n f.close\nend", "def puppet_value; nil; end", "def dump\n File.open(@meta_data_file_location,'w') { |f| f.write(YAML.dump(@meta_data))}\n end", "def indented_yaml(preindent)\n return \"\" unless present?\n bare_yaml.indent_by(preindent)\n end", "def value\n YAML.load(self[:value]) if self[:value].present?\n end", "def dump(value)\n nil\n end", "def yaml_file_workaround(current_contents, delete_quotes)\n nested_map = current_contents[/^\\-\\s\\w+:/] ? true : false\n regex = nested_map ? /^(\\-?\\s+)/ : /^(\\s+\\-\\s)/\n if delete_quotes\n current_contents.delete!('\"')\n end\n current_contents.gsub!(regex, ' \\\\1')\n current_contents\n end", "def empty_yaml_object(opts = {})\n if output_type = opts[:output_type] || self.yaml_object_type\n FileGenerator::YamlObject.create(:output_type => output_type)\n elsif content_input = opts[:content_input]\n FileGenerator::YamlObject.create(:input => content_input)\n else\n raise Error, \"If opts[:content_input] is nil, self.yaml_object_type or opts[:output_type] must have a value\" \n end\n end", "def load_yml_data\n if File.exist? self.class.file_location\n # YAML.load_file returns false if the file exists but is empty. So\n # added the || {} to ensure we always return a hash from this method\n YAML.load_file(self.class.file_location) || {}\n else\n {}\n end\n end", "def load_library(path)\n # code goes here\n data = YAML.load_file(path)\n \n YAML.dump(\"foo\")\n { :a => 'b'}.to_yaml\n #data.map do |english, japanese|\n # binding.pry\n #end\n binding.pry\nend", "def set_yaml\n if @parent\n @yaml.has_key?(@parent) ? set(defaults.recursive_merge(@yaml[@parent])) : raise(Configarrr::OptionError, \"Please provide a valid parent value. #{@parent} does not exist.\")\n else\n set defaults.recursive_merge(@yaml)\n end\n end", "def generate_yaml_object?\n generate! unless skip_for_generation?\n end", "def load\n if File.file?(@file_name)\n File.open(@file_name, 'r') do |file|\n YAML::load(file)\n end\n else\n default\n end\n end", "def generate_yaml_object?\n generate?\n is_empty?(@yaml_object) ? nil : @yaml_object\n end", "def init\n Config.load_yaml\n Log.init\n reset\n end", "def load_yaml(args = {})\n file = File.read(args[:file] || CMUX_YAML)\n yaml = YAML.load(file)\n args[:key] ? yaml[args[:key]] : yaml\n rescue Psych::SyntaxError\n message = \"Make sure you've written #{file} in YAML Simple Mapping.\" \\\n ' Please check README.'\n raise message.red\n end", "def loadyaml(filename) YAML.load_file(filename) end", "def yaml_split\n data[0].gsub!(\"\\r\", \"\")\n ary = data[0].split(/\\n\\.\\.\\.\\n|\\n---\\n/,2)\n ary[1] = ary[1].lstrip\n ary\n end", "def paml(x)\n\n puts(YAML.dump(x))\nend", "def to_yaml_type \n YAML_TYPE\n end", "def load\n if File.exists? @file\n @main = YAML::load_file @file\n else\n self.load_defaults\n end\n end", "def test_load_from_yaml\n loaded = Syck.load(<<-eoyml)\n--- !set\nfoo: bar\nbar: baz\n eoyml\n assert_equal(@set, loaded)\n end", "def yaml_load(filename)\n\t\tbegin\n\t\t YAML::load(File.read filename)\n\t\trescue\n\t\t\tputs \"Unable to read from file '#{ filename }'.\"\n\t\t\tnil\n\t\tend\n\tend", "def _load(dump)\n self.contents = dump\n end", "def stop_on_error\n # This use of Yaml.load to convert a string to a boolean comes from\n # http://stackoverflow.com/a/21804027/6117745\n YAML.load(@data[\"stop_on_error\"])\n end", "def clean_value(yaml_content, start, finish)\n value = yaml_content.substring(start, finish)\n\n begin\n YAML.load(value)\n nil\n rescue Psych::SyntaxError => e\n if error_type = error_type_for(e)\n fix(error_type, yaml_content, start, finish, value)\n else\n raise e\n end\n end\n end", "def yaml_split\n body = @node.body.gsub(\"\\r\", \"\")\n ary = body.split(/\\n\\.\\.\\.\\n|\\n---\\n/,2)\n ary[1] = ary[1].lstrip\n ary\n end", "def load_state\n return YAML.load(self.state)\n end", "def to_yaml\n # write yaml\n end", "def to_yaml_s(include_auto_warning = false)\n super(false)\n end", "def loader\n\t\tsave = loader_helper\n\t\tif save\n\t\t\tFile.open(\"saves/#{save}\", 'r'){ |f|\n\t\t\t\treturn YAML.load(f)\n\t\t\t} \n\t\tend\n\t\tfalse\n\tend", "def config\n unless @config\n begin\n @config = YAML.load_file( @config_file )\n rescue => boom\n @config = nil\n raise \"Unable to grok yaml landscape file. #{boom}\"\n end\n end\n @config\n end", "def config\n unless @config\n begin\n @config = YAML.load_file( @config_file )\n rescue => boom\n @config = nil\n raise \"Unable to grok yaml landscape file. #{boom}\"\n end\n end\n @config\n end", "def load_yml(filename); end", "def plist; nil; end", "def plist; nil; end", "def generate_save\n YAML.dump(self)\n end", "def read_yaml(base, name, opts = {})\n begin\n self.content = File.read(File.join(base, name),\n merged_file_read_opts(opts))\n if content =~ /\\A(---\\s*\\n.*?\\n?)^((---|\\.\\.\\.)\\s*$\\n?)/m\n self.content = $POSTMATCH\n self.data = SafeYAML.load($1)\n end\n rescue SyntaxError => e\n Jekyll.logger.warn \"YAML Exception reading #{File.join(base, name)}: #{e.message}\"\n rescue Exception => e\n Jekyll.logger.warn \"Error reading file #{File.join(base, name)}: #{e.message}\"\n end\n\n self.data ||= {}\n end", "def before_dump(value)\n self.value = value if !value.nil?\n if [email protected]?\n value = @parent.instance_exec( self, :dump, &@block )\n end\n self.value = value if !value.nil?\n end", "def yaml_properties\n if directory?\n yaml_path = ::File.join(@node.path, @yaml_file)\n @node.repos.stat(yaml_path, @node.rev_num) ?\n YAML.load(@node.repos.file(yaml_path, @node.rev_num)[0]) :\n {}\n else\n has_yaml_props? ?\n YAML.load(yaml_split[0]) :\n {}\n end\n end", "def yaml_load\n if File.exist?(yaml_file) && !File.zero?(yaml_file)\n YAML.load_file(yaml_file).sort_by!(&:time).reverse!\n else\n []\n end\n end", "def load_yaml\n if has_file? \"#{name}.yml\"\n YAML.load_file(path / \"#{name}.yml\").apply_to self\n end\n end", "def prepare_from_yaml\n set(:db_file) { \"#{application}-dump.sql.bz2\" }\n set(:db_remote_file) { \"#{current_path}/backup/#{db_file}\" }\n set(:db_local_file) { \"tmp/#{db_file}\" }\n set(:db_user) { db_config[rails_env][\"username\"] }\n set(:db_pass) { db_config[rails_env][\"password\"] }\n set(:db_host) { db_config[rails_env][\"host\"] }\n set(:db_name) { db_config[rails_env][\"database\"] }\n end", "def parse_and_test(yaml)\n safe_result = parse(yaml)\n\n exception_thrown = nil\n\n unsafe_result = begin\n YAML.unsafe_load(yaml)\n rescue Exception => e\n exception_thrown = e\n end\n\n if exception_thrown\n # If the underlying YAML parser (e.g. Psych) threw an exception, I'm\n # honestly not sure what the right thing to do is. For now I'll just\n # print a warning. Should SafeYAML fail when Psych fails?\n Kernel.warn \"\\n\"\n Kernel.warn \"Discrepancy between SafeYAML and #{SafeYAML::YAML_ENGINE} on input:\\n\"\n Kernel.warn \"#{yaml.unindent}\\n\"\n Kernel.warn \"SafeYAML result:\"\n Kernel.warn \"#{safe_result.inspect}\\n\"\n Kernel.warn \"#{SafeYAML::YAML_ENGINE} result:\"\n Kernel.warn \"#{exception_thrown.inspect}\\n\"\n\n else\n expect(safe_result).to eq(unsafe_result)\n end\n end", "def format_local_yaml()\n prev = nil\n index_to_add = Array.new\n n = 0\n ifile = File.open( \"local.yaml\" )\n local_data = ifile.readlines\n ifile.close\n local_data.each_with_index { |line, index|\n if(index == 0)\n next\n end\n if(line =~ /^type:/)\n if not(prev =~ /---/)\n index_to_add.push(index+n)\n n=n+1\n end\n end\n prev = line\n }\n index_to_add.each { |i|\n local_data.insert(i, '---')\n }\n File.open(\"local.yaml\", \"w+\") do |f|\n f.puts(local_data)\n end\nend", "def parse_yaml(readable_obj)\n ::YAML.load(readable_obj)\n end", "def uninitialized?; end", "def dump() end", "def body\n return nil unless file?\n has_yaml_props? ?\n yaml_split[1] :\n data[0]\n end", "def set_default_value(opt1, opt2)\n return if @yaml[opt1][opt2].present?\n return if @record && @record[@yaml['name']].present?\n\n @yaml[opt1][opt2] = if @yaml['default'].class == Hash\n evaluate = @yaml['default']['eval']\n return if evaluate.blank?\n # add @parent if it's a method call and @parent is not present\n if evaluate[0] != evaluate[0].upcase && !evaluate.match('@parent')\n evaluate.prepend('@parent.')\n end\n eval(evaluate)\n else\n @yaml['default']\n end\nend", "def yaml\n config = fetch(@variable, {})\n stringified = if config.respond_to?(:deep_stringify_keys)\n config.deep_stringify_keys\n else\n # TODO: remove when dropping rails 3 support\n # two level stringify for rails 3 compatibility\n config.stringify_keys.each_value(&:stringify_keys!)\n end\n stringified.to_yaml\n end", "def _dump() end", "def dump_yaml!\n FileUtils.mkdir_p LOCALE_DIR\n File.open(STANDARD_LOCALE_FILE,'w+') { |f| YAML::dump(@translations, f) } \n end", "def to_yaml\n self.original.to_yaml\n end" ]
[ "0.70946413", "0.70946413", "0.6672679", "0.6570946", "0.644726", "0.6264", "0.6096333", "0.6096333", "0.6000598", "0.5930887", "0.5895997", "0.5894088", "0.58782274", "0.5864676", "0.5845689", "0.5831905", "0.5820957", "0.5820957", "0.5775356", "0.5741918", "0.57129604", "0.57006586", "0.562005", "0.5580065", "0.5574764", "0.55481946", "0.5540365", "0.55358124", "0.55260396", "0.55207306", "0.5518308", "0.5518308", "0.5500728", "0.54992527", "0.5476532", "0.54583603", "0.5435014", "0.5423358", "0.54007775", "0.53994405", "0.5397972", "0.537863", "0.5377514", "0.53754044", "0.5367567", "0.53613305", "0.53608555", "0.5348591", "0.53461903", "0.53457487", "0.53360546", "0.532829", "0.5327258", "0.53261966", "0.53124183", "0.52833635", "0.52831507", "0.52808625", "0.52756685", "0.52584076", "0.5238243", "0.5209428", "0.5208179", "0.5206867", "0.5194483", "0.5180026", "0.5164513", "0.51638937", "0.5161389", "0.5158871", "0.51576567", "0.51565564", "0.51533365", "0.51517624", "0.5151307", "0.5150574", "0.5140405", "0.51399785", "0.51399624", "0.51399624", "0.51389104", "0.5138083", "0.5138083", "0.51335746", "0.51334643", "0.51307684", "0.51270914", "0.5121204", "0.51139426", "0.5078355", "0.50741184", "0.5052905", "0.5051841", "0.504709", "0.5044091", "0.5043519", "0.50367945", "0.5030817", "0.50295335", "0.5024875", "0.50206566" ]
0.0
-1
GET /proyectominero2s GET /proyectominero2s.json
def index @proyectominero2s = Proyectominero2.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_proyectominero2\n @proyectominero2 = Proyectominero2.find(params[:id])\n end", "def index\n @bicepstriceps2s = Bicepstriceps2.all\n end", "def index\n if params[:propietario]\n @usuario = Usuario.find(params[:usuario_id])\n authorize! :show, @usuario\n @negocios_propios = Usuario.find(params[:usuario_id]).negocios_propios\n render json: @negocios_propios,\n root: 'negocios_propios',\n each_serializer: NegocioPropioSerializer\n else\n @negocios = Negocio.all\n render json: @negocios\n end\n end", "def stod2sport2\n Apis.client.get('/tv/stod2sport2')\n end", "def index\n @proyects = Proyect.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proyects }\n end\n end", "def update\n respond_to do |format|\n if @proyectominero2.update(proyectominero2_params)\n format.html { redirect_to @proyectominero2, notice: 'Proyectominero2 was successfully updated.' }\n format.json { render :show, status: :ok, location: @proyectominero2 }\n else\n format.html { render :edit }\n format.json { render json: @proyectominero2.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n if params[:product_id]\n @promotions = Product.find(params[:product_id]).promotions\n else\n @promotions = Promotion.all\n end\n\n render json: @promotions\n end", "def destroy\n @proyectominero2.destroy\n respond_to do |format|\n format.html { redirect_to proyectominero2s_url, notice: 'Proyectominero2 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def proyectominero2_params\n params.require(:proyectominero2).permit(:code, :name, :user_id)\n end", "def stod2bio\n Apis.client.get('/tv/stod2bio')\n end", "def index\n @bicepstricepshome2s = Bicepstricepshome2.all\n end", "def index\n @proverbes = Proverbe.all\n end", "def show\n render json: @prossumer\n end", "def stod2\n Apis.client.get('/tv/stod2')\n end", "def index\n @proyects = Proyect.all\n end", "def index\n @proyects = Proyect.all\n end", "def index\n @provedores = Provedor.all\n end", "def show\n @product2 = Product2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product2 }\n end\n end", "def index\n @obras_proyectos = ObraProyecto.all\n end", "def index\n @processos = Processo.all\n\n render json: @processos\n end", "def index\n if is_my_resource(params[:prossumer_id])\n @products = Product.where(prossumer_id: params[:prossumer_id]).as_json({\n cycle_id: params[:cycle_id],\n include: {\n prossumer: {\n except: [:encrypted_password, :salt, :confirm_hash]\n },\n product_category: {}\n }\n })\n render json: @products\n end\n end", "def show\n @round_robin_promo = RoundRobinPromo.find(params[:id])\n \n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @round_robin_promo }\n end\n end", "def show\n @produktion_site = ProduktionSite.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produktion_site }\n end\n end", "def index\n @proyectos = Proyecto.search.page params[:page]\n end", "def index\n @proyectos = Proyecto.all\n end", "def index\n @proyectos = Proyecto.all\n end", "def index\n @proyectos = Proyecto.all\n end", "def index\n @proyectos = Proyecto.all\n end", "def show\n @produccion = Produccion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produccion }\n end\n end", "def show\n @produccion = Produccion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produccion }\n end\n end", "def show\n @voprosy = Voprosy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @voprosy }\n end\n end", "def index\n @proteins = Protein.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proteins }\n end\n end", "def index\n @probandos = Probando.all\n end", "def show\n @promocion = Promocion.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n #format.json { render json: @promocion }\n end\n end", "def index\n @prospies = Prospie.all\n end", "def index\n @protectoras = Protectora.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @protectoras }\n end\n end", "def get_path2\n\t\tlist_required = params[:list_id]\n\t\tproducts_required = Shoppinglist.get_products_of_shopping_list(list_required)\n\n\t\tnodes_required = []\n\t\tproducts_not_found = []\n\t\tlocations = []\n\n\t\t\n\t\tnodes_required.push( Mapnode.get_id_entrance_point() )\n\t\tproducts_required.each do |product_id|\n\t\t\tresult = Productnode.get_node_of_product(product_id)\n\t\t\tif result != -1\n\t\t\t\tnodes_required.push( result )\n\n\t\t\t\tlocation=Productlocation.get_product_location(product_id)\n\t\t\t\tproduct_name = Product.get_name(product_id)\n\t\t\t\tlocations.push(\"point\" => Point.new(location[0]['X'],location[0]['Y']) , \"name\" => product_name )\n\t\t\telse\n\t\t\t\tproducts_not_found.push(product_id)\n\t\t\tend\n\t\t\t\n\t\tend\n\n\t\tpoints=Tsp.get_path3(nodes_required)\n\t\tresult = { 'path' => points , 'products_not_found' =>products_not_found , 'locations'=>locations }\n\n\t\trender :json => result \n\tend", "def index\n @status2s = Status2.all\n end", "def index\n @propuestas = Propuesta.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @propuestas }\n end\n end", "def show\n @payment2 = Payment2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @payment2 }\n end\n end", "def get_pokemon_JSON\n r = \n {\n :p1 => JSON.parse(self.pokeserver(self.p1)), \n :p2 => JSON.parse(self.pokeserver(self.p2)), \n :p3 => JSON.parse(self.pokeserver(self.p3)), \n :p4 => JSON.parse(self.pokeserver(self.p4)), \n :p5 => JSON.parse(self.pokeserver(self.p5)), \n :p6 => JSON.parse(self.pokeserver(self.p6)) \n }\n \n JSON.generate(r)\n end", "def index\n @promotions = Promotion.where(active: true)\n @all_promotions = Promotion.all\n respond_to do |format|\n format.html \n format.json { render json: @all_promotions }\n end\n end", "def index\n @parishes = Parish.all\n\n render json: @parishes\n end", "def show\n @proyect = Proyect.find(params[:id])\n if request.path != proyect_path(@proyect)\n redirect_to @proyect, status: :moved_permanently\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proyect }\n end\n end", "def show\n @pessoa = Pessoa.find(params[:id])\n\n respond_to do |format|\n # format.html # show.html.erb\n format.json { render json: @pessoa }\n end\n end", "def stod2sport\n Apis.client.get('/tv/stod2sport')\n end", "def show\n @pessoa = Pessoa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pessoa }\n end\n end", "def index\n @copropietarios = Copropietario.all\n end", "def index\n @user_proyectos = UserProyecto.all\n end", "def index\n @proovedors = Proovedor.all\n end", "def show\n \t\tif params[:usuario_pedido]\n \t\t\t@usuario = Usuario.find(params[:usuario_id])\n \t\t\trender json: @usuario.pedidos.find(@pedido.id)\n \t\telse\n \t\t\t@negocio = Negocio.find(params[:negocio_id])\n \t\t\trender json: @negocio.pedidos.find(@pedido.id)\n \t\tend\n \tend", "def index\n if current_user\n @user = User.find(current_user.id)\n end\n\n if current_user && @user.role == \"account_user\" #account_user - not currently used\n @venues = Venue.where(account_id: current_user.account_id)\n @promotions = Promotion.where(venue_id: @venues)\n elsif current_user && @user.role == \"admin\" #admin\n #get all promotions for all venues that the user is registered with\n @venues = Venue.where(account_id: current_user.account_id)\n @promotions = Promotion.where(venue_id: @venues)\n elsif current_user && @user.role == \"hypedrive_employee\"\n @promotions = Promotion.all\n else\n @promotions = Promotion.where('active=:isActive and (start_time >= :time_now or end_time >= :time_now)',\n :isActive => true,\n :time_now => Time.now)\n end\n render json: @promotions\n end", "def list_pengaduan_proses\n pengaduan = Pengaduan.all.where(status: 'proses').where(user_id: @user.id).order(created_at: :desc)\n render json: {status: true, total: pengaduan.count, data: pengaduan}\n end", "def show\n @profesore = Profesore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profesore }\n end\n end", "def get_prefectures\n server_response = handle_timeouts do\n get '/1/neighborhoods.json?locale=en'\n end\n server_response['response']\n end", "def show\n @propose = Propose.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @propose }\n end\n end", "def show\n @pologeno = Pologeno.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pologeno }\n end\n end", "def show\n @store2product = Store2product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @store2product }\n end\n end", "def index\n @equipos = Equipo.all\n render json: @equipos, status: :ok\n end", "def show\n @produto = Produto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produto }\n end\n end", "def index\n @v2_users = V2User.all\n end", "def index\n @title = t('admin.promotions.index.title')\n @promotions = ( @product ? @product.promotions : Promotion.all )\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @promotions }\n end\n end", "def taken_promos\n respond_to do |format|\n @promos = Promo.get_taken_promos_for_user current_user\n format.html { render \"promos/content\" }\n end\n end", "def index\n @proyectos_users = ProyectosUser.all\n end", "def index\n @usuario_proyectos = UsuarioProyecto.all\n end", "def get_products()\n\tputs \"Getting products\"\n\tresponse = request_get(\"/api/product\")\n\tputs response.body\nend", "def index\n if params[:usuario_producto]\n @usuario = Usuario.find(params[:usuario_id])\n render json: @usuario.productos\n else\n @productos = Producto.all\n render json: @productos\n end\n end", "def servers\n endpoint = 'https://pcs.baidu.com/rest/2.0/pcs/manage?method=listhost'\n @res = @api.request_json( endpoint )\n end", "def index\n @snps = Snp.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @snps }\n end\n end", "def index\n @proprietarios = Proprietario.all\n end", "def get_rooms \n json_rooms = IO.popen(\"curl -u #{@config['campfire_config']['API_KEY']}:X #{@config['campfire_config']['URL']}/presence.json\") \n parsed_rooms = JSON.parse(json_rooms.readlines.first)[\"rooms\"]\n rooms = parsed_rooms.collect {|room| [room[\"name\"],room[\"id\"]]} \nend", "def user_info\n user = User.find_by(id: params[:id])\n progresses = user.progresses.select {|p| p.habit.user.id == params[:id]} \n \n render json: progresses\n end", "def index\n @socios = Socio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @socios }\n end\n end", "def index\n @participante_videoconferencia = ParticipanteVideoconferencium.all\n render json: @participante_videoconferencia\n end", "def show\n @cryptocurrencies = Cryptocurrency.all\n require 'net/http'\n require 'json'\n @url = 'https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?start=1&limit=100&CMC_PRO_API_KEY=8e364003-38f2-410d-81af-9166deca3a6f'\n @uri = URI(@url)\n @response = Net::HTTP.get(@uri)\n @array1 = JSON.parse(@response).to_a\n @array2 = @array1[1].to_a\n @show_crypto = @array2[1].to_a\n end", "def index\n @prospective_users = ProspectiveUser.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @prospective_users }\n end\n end", "def show\n @topic2 = Topic2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @topic2 }\n end\n end", "def recebeLista\n\n file = File.read('secrets.json')\n @info = JSON.parse(file)\n palavraSecreta\n end", "def show\n @imagenes = @proyecto.proyecto_imagenes\n @participante_proyectos = @proyecto.participante_proyectos\n end", "def index\n @m2s = M2.all\n end", "def index\n @prod_servis = ProdServi.all\n end", "def index\n @breeding_pairs = current_user.breeding_pairs.all\n\n respond_to do |format|\n format.json { render json: @breeding_pairs }\n end\n end", "def fetch\n response = RestClient.get \"http://pokeapi.co/#{resource_uri}\"\n update(resource_data: JSON.parse(response))\n end", "def index\n @profanes = Profane.all\n end", "def show\n @pto = Pto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pto }\n end\n end", "def index\n @promotions = Promotion.all\n end", "def index\n @promotions = Promotion.all\n end", "def index\n @promotions = Promotion.all\n end", "def index\n @socio_irpjs = SocioIrpj.all\n end", "def index\n @orden_proyectos = OrdenProyecto.all\n end", "def show\n @odontologia1 = Odontologia1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @odontologia1 }\n end\n end", "def show\n @socio = Socio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @socio }\n end\n end", "def grab_professors\n professor_size = User.where(:professor => true).length\n current_offset = (params[:payload][:pagenumber] - 1)*10\n direction = params[:payload][:direction]\n\n respond_to do |format|\n format.json {\n\n if current_offset + direction < professor_size && current_offset + direction >= 0\n offset = current_offset + direction\n @professors = User.where(:professor => true).offset(offset).take(10)\n render :json => @professors\n else\n render :nothing => true, :status => 200, :content_type => 'text/html'\n end\n\n }\n end\n end", "def servers\n response = get \"server\"\n data = JSON.parse response.body\n data[\"servers\"][\"server\"]\n end", "def servers\n response = get \"server\"\n data = JSON.parse response.body\n data[\"servers\"][\"server\"]\n end", "def index\n @event2s = Event2.all\n end", "def search\n stuff = params[:q]\n ntee_id = params[:ntee_id]\n results = Typhoeus.get(\"https://projects.propublica.org/nonprofits/api/v1/search.json\", :params => {:q => stuff, 'ntee[id]' => ntee_id })\n @nonprofit_result = JSON.parse(results.body)\n end", "def index\n @cryptostables = Cryptostable.all\n\n require 'uri'\n require 'net/http'\n require 'openssl'\n\n @url = \"https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?CMC_PRO_API_KEY=#{ENV.fetch('CRYPTO')}&start=1&limit=500\"\n @uri = URI(@url)\n @response = Net::HTTP.get(@uri)\n @lookup_cryptos = JSON.parse(@response)\n @profit_loss = 0\n end", "def index\n @promotions = current_shop_owner.promotions.all\n end", "def show\n @partecipanti_gruppo = PartecipantiGruppo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @partecipanti_gruppo }\n end\n end" ]
[ "0.6182335", "0.5837226", "0.58189654", "0.5715098", "0.5710772", "0.5578785", "0.54372406", "0.5424648", "0.538353", "0.5379659", "0.5349621", "0.53452927", "0.5335853", "0.5324027", "0.5229179", "0.5229179", "0.5222237", "0.522137", "0.521966", "0.5218293", "0.52150816", "0.52064973", "0.52025247", "0.51873887", "0.51805776", "0.51805776", "0.51805776", "0.51805776", "0.516625", "0.516625", "0.51653343", "0.514517", "0.51442724", "0.5142983", "0.5139598", "0.5134653", "0.51300144", "0.5124761", "0.51093733", "0.51066643", "0.5104144", "0.5082624", "0.5077356", "0.50747514", "0.50731266", "0.5072599", "0.50700784", "0.5066989", "0.5063362", "0.50498265", "0.50435746", "0.5039965", "0.5032338", "0.50292647", "0.50287914", "0.50172013", "0.50154966", "0.50150174", "0.50149167", "0.5013561", "0.5006498", "0.49935055", "0.4986045", "0.4985913", "0.4982049", "0.49800134", "0.49772093", "0.49758202", "0.49706796", "0.49663472", "0.49620336", "0.49576616", "0.49573976", "0.49559408", "0.4953303", "0.49516174", "0.49309453", "0.4929127", "0.49275976", "0.49101543", "0.4909425", "0.49080947", "0.4905147", "0.48986515", "0.48969552", "0.48951775", "0.48951775", "0.48951775", "0.48906153", "0.48886377", "0.4886662", "0.4880823", "0.4874439", "0.48740232", "0.48740232", "0.48731652", "0.4870699", "0.48698524", "0.48664066", "0.48650157" ]
0.7297018
0
GET /proyectominero2s/1 GET /proyectominero2s/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @proyectominero2s = Proyectominero2.all\n end", "def set_proyectominero2\n @proyectominero2 = Proyectominero2.find(params[:id])\n end", "def show\n @product2 = Product2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product2 }\n end\n end", "def index\n if params[:propietario]\n @usuario = Usuario.find(params[:usuario_id])\n authorize! :show, @usuario\n @negocios_propios = Usuario.find(params[:usuario_id]).negocios_propios\n render json: @negocios_propios,\n root: 'negocios_propios',\n each_serializer: NegocioPropioSerializer\n else\n @negocios = Negocio.all\n render json: @negocios\n end\n end", "def show\n @payment2 = Payment2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @payment2 }\n end\n end", "def show\n @promocion = Promocion.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n #format.json { render json: @promocion }\n end\n end", "def update\n respond_to do |format|\n if @proyectominero2.update(proyectominero2_params)\n format.html { redirect_to @proyectominero2, notice: 'Proyectominero2 was successfully updated.' }\n format.json { render :show, status: :ok, location: @proyectominero2 }\n else\n format.html { render :edit }\n format.json { render json: @proyectominero2.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n render json: @prossumer\n end", "def show\n @round_robin_promo = RoundRobinPromo.find(params[:id])\n \n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @round_robin_promo }\n end\n end", "def show\n @pologeno = Pologeno.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pologeno }\n end\n end", "def index\n if params[:product_id]\n @promotions = Product.find(params[:product_id]).promotions\n else\n @promotions = Promotion.all\n end\n\n render json: @promotions\n end", "def index\n @proyects = Proyect.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proyects }\n end\n end", "def show\n @produccion = Produccion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produccion }\n end\n end", "def show\n @produccion = Produccion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produccion }\n end\n end", "def show\n @server1 = Server1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @server1 }\n end\n end", "def show\n @proyect = Proyect.find(params[:id])\n if request.path != proyect_path(@proyect)\n redirect_to @proyect, status: :moved_permanently\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proyect }\n end\n end", "def show\n @produktion_site = ProduktionSite.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produktion_site }\n end\n end", "def show\n @odontologia1 = Odontologia1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @odontologia1 }\n end\n end", "def show\n @voprosy = Voprosy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @voprosy }\n end\n end", "def show\n @produto = Produto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produto }\n end\n end", "def show\n @profesore = Profesore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profesore }\n end\n end", "def destroy\n @proyectominero2.destroy\n respond_to do |format|\n format.html { redirect_to proyectominero2s_url, notice: 'Proyectominero2 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def index\n if is_my_resource(params[:prossumer_id])\n @products = Product.where(prossumer_id: params[:prossumer_id]).as_json({\n cycle_id: params[:cycle_id],\n include: {\n prossumer: {\n except: [:encrypted_password, :salt, :confirm_hash]\n },\n product_category: {}\n }\n })\n render json: @products\n end\n end", "def show\n @propose = Propose.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @propose }\n end\n end", "def show\n @topic2 = Topic2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @topic2 }\n end\n end", "def show\n @store2product = Store2product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @store2product }\n end\n end", "def index\n @bicepstriceps2s = Bicepstriceps2.all\n end", "def show\n @pessoa = Pessoa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pessoa }\n end\n end", "def show\n @pessoa = Pessoa.find(params[:id])\n\n respond_to do |format|\n # format.html # show.html.erb\n format.json { render json: @pessoa }\n end\n end", "def show\n @step2 = Step2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @step2 }\n end\n end", "def stod2sport2\n Apis.client.get('/tv/stod2sport2')\n end", "def show\n \t\tif params[:usuario_pedido]\n \t\t\t@usuario = Usuario.find(params[:usuario_id])\n \t\t\trender json: @usuario.pedidos.find(@pedido.id)\n \t\telse\n \t\t\t@negocio = Negocio.find(params[:negocio_id])\n \t\t\trender json: @negocio.pedidos.find(@pedido.id)\n \t\tend\n \tend", "def show\n @pto = Pto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pto }\n end\n end", "def show\n @produkt = Produkt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produkt }\n end\n end", "def show\n @partecipanti_gruppo = PartecipantiGruppo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @partecipanti_gruppo }\n end\n end", "def index\n @proteins = Protein.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proteins }\n end\n end", "def index\n @processos = Processo.all\n\n render json: @processos\n end", "def show\n if params[:usuario_producto]\n @usuario = Usuario.find(params[:usuario_id])\n @producto = Producto.find(params[:id])\n render json: @usuario.productos.find(@producto.id)\n else\n \t @producto = Producto.find(params[:id])\n render json: @producto\n end\n end", "def show\n @po = Po.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @po }\n end\n end", "def show\n @premio = Premio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @premio }\n end\n end", "def show\n @puntaje = Puntaje.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @puntaje }\n end\n end", "def show\n @puntaje = Puntaje.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @puntaje }\n end\n end", "def show\n @post2 = Post2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post2 }\n end\n end", "def show\n @promo = Promo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @promo }\n end\n end", "def show\n @pessoa_receber = PessoaReceber.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @pessoa_receber }\n end\n end", "def show\n #@processo = Processo.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @processo }\n end\n end", "def show\n @commtent1 = Commtent1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @commtent1 }\n end\n end", "def user_info\n user = User.find_by(id: params[:id])\n progresses = user.progresses.select {|p| p.habit.user.id == params[:id]} \n \n render json: progresses\n end", "def show\n @repuesto = Repuesto.find(params[:id])\n respond_to do |format|\n format.html { render :show }\n format.json { render json: @repuesto.to_json }\n end\n end", "def show\n @propuesta = Propuesta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @propuesta }\n end\n end", "def show\n @productonegocio = Productonegocio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @productonegocio }\n end\n end", "def show\n @piping_system = PipingSystem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @piping_system }\n end\n end", "def get_proselint_json path\n json = `proselint \"#{path}\" --json`.strip\n if json[0] == \"{\" and json[-1] == \"}\"\n JSON.parse json\n else\n {}\n end\n end", "def index\n @proverbes = Proverbe.all\n end", "def show\n @promotersbind = Promotersbind.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @promotersbind }\n end\n end", "def InfoProducto\n \tid = params[:id]\n @productos = Producto.find_by_sql(\"select distinct productos.nombre as nombreProducto, productos.id as idProducto, productos.oferta, productos.compra, laboratorios.nombre as nombreLaboratorio, presentacions.descripcion, plan_pacientes.id, \n\t\tplan_pacientes.nombre as nombrePlanPaciente, plan_pacientes.id as idPlanPaciente,\n\t\tsustancia.descripcion as descripcionSustancia\n\t\t from productos, presentacions, plan_pacientes, laboratorios, sustancia where \n\t\tproductos.presentacion_id = presentacions.id and\n\t\tproductos.laboratorio_id = laboratorios.id and\n\t\tproductos.sustancium_id = sustancia.id and\n\t\tproductos.id = #{id} LIMIT 1\")\n render json: @productos\n end", "def fetch\n response = RestClient.get \"http://pokeapi.co/#{resource_uri}\"\n update(resource_data: JSON.parse(response))\n end", "def show\n @osoba = Osoba.find(params[:id])\n\n render json: @osoba\n end", "def get_default_profile \n get(\"/profiles.json/default\")\nend", "def index\n if params[:usuario_producto]\n @usuario = Usuario.find(params[:usuario_id])\n render json: @usuario.productos\n else\n @productos = Producto.all\n render json: @productos\n end\n end", "def show\n @proyecto_imagen = ProyectoImagen.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proyecto_imagen }\n end\n end", "def show\n @perfilnegocio = Perfilnegocio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @perfilnegocio }\n end\n end", "def index\n @propuestas = Propuesta.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @propuestas }\n end\n end", "def proyectominero2_params\n params.require(:proyectominero2).permit(:code, :name, :user_id)\n end", "def show\n @profesor_pertenece_asignatura = ProfesorPerteneceAsignatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profesor_pertenece_asignatura }\n end\n end", "def get_path2\n\t\tlist_required = params[:list_id]\n\t\tproducts_required = Shoppinglist.get_products_of_shopping_list(list_required)\n\n\t\tnodes_required = []\n\t\tproducts_not_found = []\n\t\tlocations = []\n\n\t\t\n\t\tnodes_required.push( Mapnode.get_id_entrance_point() )\n\t\tproducts_required.each do |product_id|\n\t\t\tresult = Productnode.get_node_of_product(product_id)\n\t\t\tif result != -1\n\t\t\t\tnodes_required.push( result )\n\n\t\t\t\tlocation=Productlocation.get_product_location(product_id)\n\t\t\t\tproduct_name = Product.get_name(product_id)\n\t\t\t\tlocations.push(\"point\" => Point.new(location[0]['X'],location[0]['Y']) , \"name\" => product_name )\n\t\t\telse\n\t\t\t\tproducts_not_found.push(product_id)\n\t\t\tend\n\t\t\t\n\t\tend\n\n\t\tpoints=Tsp.get_path3(nodes_required)\n\t\tresult = { 'path' => points , 'products_not_found' =>products_not_found , 'locations'=>locations }\n\n\t\trender :json => result \n\tend", "def show\n puts \"VIEW SHOW\"\n @new_pro = NewPro.find_by_phoneNumber(params[:id])\n puts @new_pro\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @new_pro }\n end\n end", "def client_choose(offset = 10, limit = 20)\n response = Net::HTTP.get(\n URI(\"https://pokeapi.co/api/v2/pokemon/?offset=#{offset}&limit=#{limit}\")\n )\n \n JSON.parse(response)\nend", "def show\n @mosttwo = Mosttwo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mosttwo }\n end\n end", "def show\n @przedmiot = current_user.przedmioty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @przedmiot }\n end\n end", "def show\n @contato_produto = ContatoProduto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contato_produto }\n end\n end", "def get_by_property\n @api_v1_reservation = current_api_v1_user.properties.find(params[:id]).reservations\n render template: '/api/v1/reservations/index', status: 200\n rescue Exception => errors\n render json: errors, status: :unprocessable_entity\n end", "def show\n @respuesta = Respuesta.find(params[:id])\n\n render json: @respuesta\n end", "def show\n @ativo_outro = AtivoOutro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ativo_outro }\n end\n end", "def index\n @promotions = Promotion.where(active: true)\n @all_promotions = Promotion.all\n respond_to do |format|\n format.html \n format.json { render json: @all_promotions }\n end\n end", "def index\n @api_v1_products = Product.all\n json_response(@api_v1_products)\n end", "def index\n @participante_videoconferencia = ParticipanteVideoconferencium.all\n render json: @participante_videoconferencia\n end", "def index\n @title = t('admin.promotions.index.title')\n @promotions = ( @product ? @product.promotions : Promotion.all )\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @promotions }\n end\n end", "def get_products()\n\tputs \"Getting products\"\n\tresponse = request_get(\"/api/product\")\n\tputs response.body\nend", "def get_pokemon_JSON\n r = \n {\n :p1 => JSON.parse(self.pokeserver(self.p1)), \n :p2 => JSON.parse(self.pokeserver(self.p2)), \n :p3 => JSON.parse(self.pokeserver(self.p3)), \n :p4 => JSON.parse(self.pokeserver(self.p4)), \n :p5 => JSON.parse(self.pokeserver(self.p5)), \n :p6 => JSON.parse(self.pokeserver(self.p6)) \n }\n \n JSON.generate(r)\n end", "def show\n pessoa = Pessoa.find(params[:id])\n render json: {status: 'SUCCESS', message:'Loaded pessoa', data:pessoa},status: :ok\n end", "def show\n @tipocliente = Tipocliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n #format.json { render json: @tipocliente }\n end\n end", "def show\n @promos = Promos.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @promos }\n end\n end", "def show\n render json: @processo\n end", "def new\n @proyect = Proyect.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @proyect }\n end\n end", "def show\n @peso = Peso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @peso }\n end\n end", "def show\n @concurso = Concurso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concurso }\n end\n end", "def new\n @product2 = Product2.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @product2 }\n end\n end", "def show\n @voivodship_committee = VoivodshipCommittee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @voivodship_committee }\n end\n end", "def index\n @parishes = Parish.all\n\n render json: @parishes\n end", "def show\n @tipo_pregunta = TipoPregunta.find(params[:id])\n\n render json: @tipo_pregunta\n end", "def show\n json_response(@api_v1_product)\n end", "def new\n @server1 = Server1.new\n\n @server_options = Server1.all.map{|u| [ u.server_name, u.id ] }\n @server_ips = Server1.all.map{|u| [ u.IP, u.id ] }\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @server1 }\n end\n end", "def show\n @prime = Prime.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @prime }\n end\n end", "def show\n @noto = Noto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @noto }\n end\n end", "def index\n @status2s = Status2.all\n end", "def show\n @order1 = Order1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order1 }\n end\n end", "def show\n @coligacao_partido = ColigacaoPartido.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coligacao_partido }\n end\n end", "def stod2\n Apis.client.get('/tv/stod2')\n end", "def index\n @bicepstricepshome2s = Bicepstricepshome2.all\n end", "def index\n @protectoras = Protectora.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @protectoras }\n end\n end" ]
[ "0.70163065", "0.64495873", "0.59255457", "0.59112656", "0.5757934", "0.57215905", "0.57202154", "0.571031", "0.56956255", "0.56920964", "0.568806", "0.5672757", "0.5658837", "0.5658837", "0.5652408", "0.563381", "0.56083584", "0.5566164", "0.55629784", "0.5561067", "0.5524039", "0.55114096", "0.55058175", "0.550362", "0.55014974", "0.5485996", "0.5451427", "0.54236996", "0.54218763", "0.5417465", "0.5392045", "0.5368521", "0.53611344", "0.53602844", "0.5353963", "0.534287", "0.5339692", "0.5337634", "0.5328905", "0.5324312", "0.532387", "0.532387", "0.5317187", "0.53117454", "0.53012437", "0.5286395", "0.52826655", "0.5280382", "0.5277932", "0.52725935", "0.5269934", "0.5266089", "0.5260912", "0.5255951", "0.52537864", "0.5243912", "0.5235435", "0.5232051", "0.5230272", "0.5226284", "0.5221656", "0.5218659", "0.5218164", "0.52155894", "0.5212047", "0.5211154", "0.5210853", "0.5207202", "0.5201441", "0.51974267", "0.5195558", "0.5194773", "0.51917297", "0.5188755", "0.51882213", "0.5178029", "0.5177688", "0.5173273", "0.51731485", "0.5171955", "0.5163485", "0.516129", "0.51594585", "0.51590973", "0.5155046", "0.5150576", "0.5145764", "0.5145065", "0.51383454", "0.51383114", "0.51379186", "0.5134505", "0.5134475", "0.5126825", "0.51214594", "0.5116276", "0.5115121", "0.51109403", "0.5109161", "0.5109152", "0.51083505" ]
0.0
-1
POST /proyectominero2s POST /proyectominero2s.json
def create @proyectominero2 = Proyectominero2.new(proyectominero2_params) @proyectominero2[:user_id] = @user_id puts @proyectominero2[:user_id] respond_to do |format| if @proyectominero2.save format.html { redirect_to @proyectominero2, notice: 'Proyectominero2 was successfully created.' } format.json { render :show, status: :created, location: @proyectominero2 } else format.html { render :new } format.json { render json: @proyectominero2.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def proyectominero2_params\n params.require(:proyectominero2).permit(:code, :name, :user_id)\n end", "def create\n @bicepstriceps2 = Bicepstriceps2.new(bicepstriceps2_params)\n\n respond_to do |format|\n if @bicepstriceps2.save\n format.html { redirect_to @bicepstriceps2, notice: 'Bicepstriceps2 was successfully created.' }\n format.json { render :show, status: :created, location: @bicepstriceps2 }\n else\n format.html { render :new }\n format.json { render json: @bicepstriceps2.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_proyectominero2\n @proyectominero2 = Proyectominero2.find(params[:id])\n end", "def index\n @proyectominero2s = Proyectominero2.all\n end", "def update\n respond_to do |format|\n if @proyectominero2.update(proyectominero2_params)\n format.html { redirect_to @proyectominero2, notice: 'Proyectominero2 was successfully updated.' }\n format.json { render :show, status: :ok, location: @proyectominero2 }\n else\n format.html { render :edit }\n format.json { render json: @proyectominero2.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bicepstricepshome2 = Bicepstricepshome2.new(bicepstricepshome2_params)\n\n respond_to do |format|\n if @bicepstricepshome2.save\n format.html { redirect_to @bicepstricepshome2, notice: 'Bicepstricepshome2 was successfully created.' }\n format.json { render :show, status: :created, location: @bicepstricepshome2 }\n else\n format.html { render :new }\n format.json { render json: @bicepstricepshome2.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if params[:propietario]\n @negocio_propio = Negocio.find(params[:negocio_id])\n @propietario = Usuario.find(params[:usuario_id])\n authorize! :update, @propietario\n if @propietario.negocios_propios << @negocio_propio\n render json: @propietario.negocios_propios, status: :created\n else\n render json: @propietario.negocios_propios.errors, status: :unprocessable_entity\n end\n else\n @negocio = Negocio.new(parametros_negocio)\n authorize! :create, Negocio\n if @negocio.save\n render json: @negocio, status: :created\n else\n render json: @negocio.errors, status: :unprocessable_entity\n end\n end\n end", "def create\n megam_rest.post_promos(to_hash) #WONT BE USED AS OF NOW\n end", "def create\n puts 'AQQQQQUUUUUUUIIIIII'\n json = ActiveSupport::JSON.decode(params[:pessoa])\n puts json\n @pessoa = Pessoa.new(json)\n # @address = Address.new(params[:address])\n\n # @client.addresses = @address\n\n respond_to do |format|\n if @pessoa.save\n format.html { redirect_to @pessoa, notice: 'Pessoa was successfully created.' }\n format.json { render json: @pessoa, status: :created, location: @pessoa }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pessoa.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @proyectominero2.destroy\n respond_to do |format|\n format.html { redirect_to proyectominero2s_url, notice: 'Proyectominero2 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def create\n @task2 = Task2.new(task2_params)\n\n respond_to do |format|\n if @task2.save\n format.html { redirect_to @task2, notice: 'Task2 was successfully created.' }\n format.json { render :show, status: :created, location: @task2 }\n else\n @task2s = Task2.all\n format.html { render :index }\n format.json { render json: @task2.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @payment2 = Payment2.new(params[:payment2])\n\n respond_to do |format|\n if @payment2.save\n format.html { redirect_to @payment2, notice: 'Payment2 was successfully created.' }\n format.json { render json: @payment2, status: :created, location: @payment2 }\n else\n format.html { render action: \"new\" }\n format.json { render json: @payment2.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @status2 = Status2.new(status2_params)\n\n respond_to do |format|\n if @status2.save\n format.html { redirect_to @status2, notice: 'Status2 was successfully created.' }\n format.json { render :show, status: :created, location: @status2 }\n else\n format.html { render :new }\n format.json { render json: @status2.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product2 = Product2.new(params[:product2])\n\n respond_to do |format|\n if @product2.save\n format.html { redirect_to @product2, notice: 'Product2 was successfully created.' }\n format.json { render json: @product2, status: :created, location: @product2 }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product2.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @proyect = Proyect.new(params[:proyect])\n\n respond_to do |format|\n if @proyect.save\n format.html { redirect_to @proyect, notice: 'Proyect was successfully created.' }\n format.json { render json: @proyect, status: :created, location: @proyect }\n else\n format.html { render action: \"new\" }\n format.json { render json: @proyect.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @proyectos_user = ProyectosUser.new(proyectos_user_params)\n\n respond_to do |format|\n if @proyectos_user.save\n format.html { redirect_to @proyectos_user, notice: 'Proyectos user was successfully created.' }\n format.json { render action: 'show', status: :created, location: @proyectos_user }\n else\n format.html { render action: 'new' }\n format.json { render json: @proyectos_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @store2product = Store2product.new(params[:store2product])\n\n respond_to do |format|\n if @store2product.save\n format.html { redirect_to @store2product, notice: 'Store2product was successfully created.' }\n format.json { render json: @store2product, status: :created, location: @store2product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @store2product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @probando = Probando.new(probando_params)\n\n respond_to do |format|\n if @probando.save\n format.html { redirect_to @probando, notice: 'Probando was successfully created.' }\n format.json { render :show, status: :created, location: @probando }\n else\n format.html { render :new }\n format.json { render json: @probando.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @proyect = Proyect.new(proyect_params)\n\n respond_to do |format|\n if @proyect.save\n format.html { redirect_to @proyect, notice: \"Proyect was successfully created.\" }\n format.json { render :show, status: :created, location: @proyect }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @proyect.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @proyect = Proyect.new(proyect_params)\n\n respond_to do |format|\n if @proyect.save\n format.html { redirect_to @proyect, notice: 'Proyect was successfully created.' }\n format.json { render :show, status: :created, location: @proyect }\n else\n format.html { render :new }\n format.json { render json: @proyect.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @vo2maximo = Vo2maximo.new(vo2maximo_params)\n\n respond_to do |format|\n if @vo2maximo.save\n format.html { redirect_to @vo2maximo, notice: 'Vo2maximo was successfully created.' }\n format.json { render action: 'show', status: :created, location: @vo2maximo }\n else\n format.html { render action: 'new' }\n format.json { render json: @vo2maximo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @copropietario = Copropietario.new(copropietario_params)\n\n respond_to do |format|\n if @copropietario.save\n format.html { redirect_to @copropietario, notice: 'Copropietario was successfully created.' }\n format.json { render :show, status: :created, location: @copropietario }\n else\n format.html { render :new }\n format.json { render json: @copropietario.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @anteproyecto_observacion = AnteproyectoObservacion.new(anteproyecto_observacion_params)\n\n respond_to do |format|\n if @anteproyecto_observacion.save\n format.html { redirect_to @anteproyecto_observacion, notice: 'Anteproyecto observacion was successfully created.' }\n format.json { render :show, status: :created, location: @anteproyecto_observacion }\n else\n format.html { render :new }\n format.json { render json: @anteproyecto_observacion.errors, status: :unprocessable_entity }\n end\n end\n end", "def criar_sobrevivente\n @suvivor = Sobrevivente.create(\n name: params[:name], genero: params[:genero], idade: params[:idade],\n lat: params[:lat], lon: params[:lon],\n agua: params[:agua], comida: params[:comida], medicamento: params[:medicamento],\n municao: params[:municao]\n )\n render json: @suvivor\n end", "def create\n @bicepstriceps1 = Bicepstriceps1.new(bicepstriceps1_params)\n\n respond_to do |format|\n if @bicepstriceps1.save\n format.html { redirect_to @bicepstriceps1, notice: 'Bicepstriceps1 was successfully created.' }\n format.json { render :show, status: :created, location: @bicepstriceps1 }\n else\n format.html { render :new }\n format.json { render json: @bicepstriceps1.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @round_robin_promo = RoundRobinPromo.new(params[:round_robin_promo])\n\n respond_to do |format|\n if @round_robin_promo.save\n format.html { redirect_to @round_robin_promo, notice: 'Round robin promo was successfully created.' }\n format.json { render json: @round_robin_promo, status: :created, location: @round_robin_promo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @round_robin_promo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profesor = Profesor.new(profesor_params)\n\n if @profesor.save\n render json: @profesor, status: :created, location: @profesor\n else\n render json: @profesor.errors, status: :unprocessable_entity\n end\n end", "def post_spoonacular\n # %encode ingredients to url\n encoded_ingr = URI.escape(@translated_recipe[:ingredients_list])\n # post call block :\n url = URI(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/parseIngredients?includeNutrition=true\")\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Post.new(url)\n request[\"content-type\"] = \"application/x-www-form-urlencoded\"\n request[\"x-rapidapi-key\"] = ENV[\"X_RAPIDAPI_KEY\"]\n request[\"x-rapidapi-host\"] = \"spoonacular-recipe-food-nutrition-v1.p.rapidapi.com\"\n # body of the call with ingredients and servings\n request.body = \"ingredientList=#{encoded_ingr}&#{@recipe_hash[:servings]}\"\n # response\n response = http.request(request)\n end", "def create\n @equipo_torneos = EquiposTorneos.new(equipos_torneos_params)\n \n if @equipo_torneos.save\n \n else\n render json: @equipo_torneos.errors, status: :unprocessable_entity\n end\n end", "def create\n @user = User.find(session[:user_id])\n @proyecto = Proyecto.new(proyecto_params)\n @user.proyectos << @proyecto\n @proyecto.update(empresa_id: @user.id)\n #it gets values from skill \n params[:proskill][:skill_ids] ||= []\n skills = params[:proskill][:skill_ids]\n skills.each do |skill|\n @proskill = Proskill.new(skill_id: skill, proyecto_id: @proyecto.id)\n @proskill.save\n end\n\n respond_to do |format|\n if @proyecto.save\n format.html { redirect_to @proyecto, notice: 'Proyecto was successfully created.' }\n format.json { render :show, status: :created, location: @proyecto }\n else\n format.html { render :new }\n format.json { render json: @proyecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @produccion = Produccion.new(params[:produccion])\n\n respond_to do |format|\n if @produccion.save\n format.html { redirect_to @produccion, notice: 'Produccion was successfully created.' }\n format.json { render json: @produccion, status: :created, location: @produccion }\n else\n format.html { render action: \"new\" }\n format.json { render json: @produccion.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @promocion = Promocion.new(promocion_params)\n\n respond_to do |format|\n if @promocion.save\n format.html { redirect_to @promocion, notice: 'Promocion ha sido creado.' }\n format.json { render :show, status: :created, location: @promocion }\n else\n format.html { render :new }\n format.json { render json: @promocion.errors, status: :unprocessable_entity }\n end\n end\n end", "def bicepstricepshome2_params\n params.require(:bicepstricepshome2).permit(:exercise, :reps, :sets)\n end", "def create\n @osoba = Osoba.new(params[:osoba])\n\n if @osoba.save\n render json: @osoba, status: :created, location: @osoba\n else\n render json: @osoba.errors, status: :unprocessable_entity\n end\n end", "def create\n @arriendo = Arriendo.new(arriendo_params)\n\n respond_to do |format|\n if @arriendo.save\n format.html { redirect_to @arriendo, notice: 'Arriendo was successfully created.' }\n format.json { render :show, status: :created, location: @arriendo }\n else\n format.html { render :new }\n format.json { render json: @arriendo.errors, status: :unprocessable_entity }\n end\n end\n\n (1..(@arriendo.cantidad-1)).each do |arriendo2|\n arriendo2 = Arriendo.new\n arriendo2.talla = @arriendo.talla\n arriendo2.talla_parka = @arriendo.talla_parka\n arriendo2.talla_pantalon = @arriendo.talla_pantalon\n arriendo2.altura = @arriendo.altura\n arriendo2.fecha = @arriendo.fecha\n arriendo2.peso = @arriendo.peso\n arriendo2.nombre = @arriendo.nombre\n arriendo2.apellidop = @arriendo.apellidop\n arriendo2.apellidom = @arriendo.apellidom\n arriendo2.nropedido = @arriendo.nropedido\n arriendo2.cantidad = @arriendo.cantidad\n arriendo2.user_id = @arriendo.user_id\n arriendo2.equipo_id = @arriendo.equipo_id\n arriendo2.email = @arriendo.email\n arriendo2.dias = @arriendo.dias\n arriendo2.experience = @arriendo.experience\n arriendo2.document = @arriendo.document\n arriendo2.save\n end\n\n end", "def create\n @event2 = Event2.new(event2_params)\n\n respond_to do |format|\n if @event2.save\n format.html { redirect_to @event2, notice: 'Event2 was successfully created.' }\n format.json { render :show, status: :created, location: @event2 }\n else\n format.html { render :new }\n format.json { render json: @event2.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @processo_seletivo = ProcessoSeletivo.new(processo_seletivo_params)\n\n respond_to do |format|\n if @processo_seletivo.save\n format.html { redirect_to @processo_seletivo, notice: 'Processo seletivo was successfully created.' }\n format.json { render :show, status: :created, location: @processo_seletivo }\n else\n format.html { render :new }\n format.json { render json: @processo_seletivo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @promocion = Promocion.new(params[:promocion])\n\n respond_to do |format|\n if @promocion.save\n format.html { redirect_to @promocion, :notice => 'Promocion was successfully created.' }\n format.json { render json: @promocion, status: :created, location: @promocion }\n else\n format.html { render :action => \"new\" }\n format.json { render json: @promocion.errors }\n end\n end\n end", "def create\n @voprosy = Voprosy.new(params[:voprosy])\n\n respond_to do |format|\n if @voprosy.save\n format.html { redirect_to @voprosy, notice: 'Voprosy was successfully created.' }\n format.json { render json: @voprosy, status: :created, location: @voprosy }\n else\n format.html { render action: \"new\" }\n format.json { render json: @voprosy.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @promos = Promos.new(params[:promos])\n\n respond_to do |format|\n if @promos.save\n flash[:notice] = 'Promos was successfully created.'\n format.html { redirect_to(@promos) }\n format.xml { render :xml => @promos, :status => :created, :location => @promos }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @promos.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @pasien2 = Pasien2.new(params[:pasien2])\n\n respond_to do |format|\n if @pasien2.save\n format.html { redirect_to @pasien2, notice: 'Data pasien berhasil di tambah.' }\n format.json { render json: @pasien2, status: :created, location: @pasien2 }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pasien2.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @produto = Produto.create(produto_params)\n respond_with @produto\n end", "def create\n\t\n\t@precio_boleto = PrecioBoleto.new(precio_boleto_params)\n\n\trespond_to do |format|\n\tif @precio_boleto.save\n\t\tformat.html { redirect_to @precio_boleto, notice: 'Nuevo Precio de boleto fue creado exitosamente.' }\n\t\tformat.json { render action: 'show', status: :created, location: @precio_boleto }\n\telse\n\t\tformat.html { render action: 'new' }\n\t\tformat.json { render json: @precio_boleto.errors, status: :unprocessable_entity }\n\tend\n\tend\nend", "def create\n @consorciot = Consorciot.new(consorciot_params)\n\n respond_to do |format|\n if @consorciot.save\n format.html { redirect_to @consorciot, notice: 'Consorciot was successfully created.' }\n format.json { render :show, status: :created, location: @consorciot }\n else\n format.html { render :new }\n format.json { render json: @consorciot.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\tauthorize! :create, Presupuesto\n @presupuesto = Presupuesto.new(presupuesto_params)\n\n respond_to do |format|\n if @presupuesto.save\n sesion = Sesion.find_by(usuario_id: current_usuario.id, fechaFin: nil)\n\n Transaccion.create!(descripcion: \"Creación del presupuesto del proyecto #{@presupuesto.proyecto.nombre}: #{@presupuesto.attributes}\",\n sesion_id: sesion.id, \n proyecto_id: @presupuesto.proyecto.id)\n\n\n# Transaccion.create!(\n# descripcion: 'Creacion del presupuesto del proyecto'[email protected],\n# ‪ sesion_id‬: sesion.id,\n# ‪ proyecto_id‬: @presupuesto.proyecto.id\n# )\n format.html { redirect_to gestionar_presupuesto_path(@presupuesto) }#, notice: 'El Presupuesto fue creado exitosamente.' }\n #format.json { render :show, status: :created, location: @presupuesto }\n else\n format.html { redirect_to proyectos_mis_proyectos_path }\n #render :new }\n #format.json { render json: @presupuesto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @socio_irpj = SocioIrpj.new(socio_irpj_params)\n\n respond_to do |format|\n if @socio_irpj.save\n format.html { redirect_to @socio_irpj, notice: 'Socio irpj was successfully created.' }\n format.json { render action: 'show', status: :created, location: @socio_irpj }\n else\n format.html { render action: 'new' }\n format.json { render json: @socio_irpj.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @prodottos_operazione = ProdottosOperazione.new(prodottos_operazione_params)\n\n respond_to do |format|\n if @prodottos_operazione.save\n format.html { redirect_to controller: 'prodottos', action: 'show', id: @prodottos_operazione.id_prodotto }\n format.json { render :show, status: :created, location: @prodottos_operazione }\n else\n format.html { render :new }\n format.json { render json: @prodottos_operazione.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n course = Course.includes(:professors).new(course_params)\n course.professor_ids=(params[:professors])\n\n if course.save\n render json: course.to_json(include: :professors)\n else\n render :json => { :errors => course.errors }, :status => 422\n end\n end", "def create\n sleep(2)\n @v2_user = V2User.new(v2_user_params)\n\n respond_to do |format|\n if @v2_user.save\n format.html { redirect_to @v2_user, notice: \"V2 user was successfully created.\" }\n format.json { render :show, status: :created, location: @v2_user }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @v2_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @socio = Socio.new(params[:socio])\n\n respond_to do |format|\n if @socio.save\n format.html { redirect_to @socio, :notice => 'Socio cadastrado com sucesso.' }\n format.json { render :json => @socio, :status => :created, :location => @socio }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @socio.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @step2 = Step2.new(params[:step2])\n\n respond_to do |format|\n if @step2.save\n format.html { redirect_to @step2, notice: 'Step2 was successfully created.' }\n format.json { render json: @step2, status: :created, location: @step2 }\n else\n format.html { render action: \"new\" }\n format.json { render json: @step2.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @prospecto = Prospecto.new(prospecto_params)\n\n respond_to do |format|\n if @prospecto.save\n format.html { redirect_to @prospecto, notice: 'Prospecto was successfully created.' }\n format.json { render :show, status: :created, location: @prospecto }\n else\n format.html { render :new }\n format.json { render json: @prospecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def bicepstriceps2_params\n params.require(:bicepstriceps2).permit(:exercise, :reps, :sets)\n end", "def create_jp2(**params)\n Jp2Creator.create(self, **params)\n end", "def proyect_params\n params.require(:proyect).permit(:name, :description, :start, :finish,:info)\n end", "def create\n @notification2 = Notification2.new(notification2_params)\n\n respond_to do |format|\n if @notification2.save\n format.html { redirect_to @notification2, notice: 'Notification2 was successfully created.' }\n format.json { render :show, status: :created, location: @notification2 }\n else\n format.html { render :new }\n format.json { render json: @notification2.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @postnew2 = Postnew2.new(postnew2_params)\n\n respond_to do |format|\n if @postnew2.save\n format.html { redirect_to @postnew2, notice: 'Postnew2 was successfully created.' }\n format.json { render :show, status: :created, location: @postnew2 }\n else\n format.html { render :new }\n format.json { render json: @postnew2.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @processo = Processo.new(processo_params)\n\n if @processo.save\n render json: @processo, status: :created, location: @processo\n else\n render json: @processo.errors, status: :unprocessable_entity\n end\n end", "def create\n @puesto = Puesto.new(puesto_params)\n\n respond_to do |format|\n if @puesto.save\n format.html { redirect_to @puesto, notice: 'Puesto Creado.' }\n format.json { render :show, status: :created, location: @puesto }\n else\n format.html { render :new }\n format.json { render json: @puesto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @prod_servi = ProdServi.new(prod_servi_params)\n\n respond_to do |format|\n if @prod_servi.save\n format.html { redirect_to @prod_servi, notice: 'Prod servi was successfully created.' }\n format.json { render :show, status: :created, location: @prod_servi }\n else\n format.html { render :new }\n format.json { render json: @prod_servi.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tiposervico = Tiposervico.new(tiposervico_params)\n\n respond_to do |format|\n if @tiposervico.save\n format.html { redirect_to @tiposervico, notice: 'Tiposervico was successfully created.' }\n format.json { render :show, status: :created, location: @tiposervico }\n else\n format.html { render :new }\n format.json { render json: @tiposervico.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @produccion = Produccion.new(params[:produccion])\n\n respond_to do |format|\n if @produccion.save\n format.html { redirect_to @produccion, notice: 'Se ha creado satisfactoriamente.' }\n format.json { render json: @produccion, status: :created, location: @produccion }\n else\n format.html { render action: \"new\" }\n format.json { render json: @produccion.errors, status: :unprocessable_entity }\n end\n end\n end", "def proyectos_user_params\n params.require(:proyectos_user).permit(:user_id, :proyectos_id)\n end", "def create\n @post2 = Post2.new(params[:post2])\n \n \n respond_to do |format|\n if @post2.save\n format.html { redirect_to @post2, notice: 'Post2 was successfully created.' }\n format.json { render json: @post2, status: :created, location: @post2 }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post2.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @prospie = Prospie.new (prospie_params)\n @prospie.user = current_user\n\n respond_to do |format|\n if @prospie.save\n format.html { redirect_to @prospie, notice: 'Prospie was successfully created.' }\n format.json { render :show, status: :created, location: @prospie }\n else\n format.html { render :new }\n format.json { render json: @prospie.errors, status: :unprocessable_entity }\n end\n end\n end", "def probando_params\n params.require(:probando).permit(:user_id, :post_id, :parragraph, :number)\n end", "def create\n @estadoproceso = Estadoproceso.new(estadoproceso_params)\n\n respond_to do |format|\n if @estadoproceso.save\n format.html { redirect_to @estadoproceso, notice: 'Estadoproceso was successfully created.' }\n format.json { render :show, status: :created, location: @estadoproceso }\n else\n format.html { render :new }\n format.json { render json: @estadoproceso.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @suceso_perro = SucesoPerro.new(suceso_perro_params)\n\n respond_to do |format|\n if @suceso_perro.save\n format.html { redirect_to @suceso_perro, notice: 'Suceso perro was successfully created.' }\n format.json { render :show, status: :created, location: @suceso_perro }\n else\n format.html { render :new }\n format.json { render json: @suceso_perro.errors, status: :unprocessable_entity }\n end\n end\n end", "def create2\n @person= Person.find_by_upid(params[:person_upid])\n @pet = Pet.new(params[:pet])\n\n respond_to do |format|\n if @pet.save\n @pp = @person.as_json(:include => :addresses)\n @pp[:pets] = Pet.joins(:caretakers).includes(:petphotos).where(\"caretakers.primary_role = 'Owner' and caretakers.person_id = ?\", @person.id).all.as_json(:include => :petphotos)\n\n if @person.status.eql? \"active mobile\"\n # add pet to related peeps (f&f, pet_pros)\n @person.person_connections.each do |fandf|\n famfrnd = Person.find(fandf.person_b_id)\n if fandf.category.eql? 'Spouse-Partner'\n prim_role = 'Owner'\n else # category in Family, Friend, Dog Walker\n prim_role = fandf.category\n end\n famfrnd.caretakers.build(:pet_id => @pet.id, :primary_role => prim_role, :status => 'active', :started_at => Time.now)\n famfrnd.save\n end\n end\n\n format.json { render json: @pp }\n else \n format.json { render json: @pet.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @pologeno = Pologeno.new(params[:pologeno])\n\n respond_to do |format|\n if @pologeno.save\n format.html { redirect_to @pologeno, notice: 'Pologeno was successfully created.' }\n format.json { render json: @pologeno, status: :created, location: @pologeno }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pologeno.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @quimicos_serigrafia_producto = QuimicosSerigrafiaProducto.new(quimicos_serigrafia_producto_params)\n\n respond_to do |format|\n if @quimicos_serigrafia_producto.save\n format.html { redirect_to @quimicos_serigrafia_producto, notice: 'Quimicos serigrafia producto was successfully created.' }\n format.json { render :show, status: :created, location: @quimicos_serigrafia_producto }\n else\n format.html { render :new }\n format.json { render json: @quimicos_serigrafia_producto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @topic2 = Topic2.new(params[:topic2])\n\n respond_to do |format|\n if @topic2.save\n format.html { redirect_to @topic2, notice: 'Topic2 was successfully created.' }\n format.json { render json: @topic2, status: :created, location: @topic2 }\n else\n format.html { render action: \"new\" }\n format.json { render json: @topic2.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @nossos_servico = NossosServico.new(params[:nossos_servico])\n\n respond_to do |format|\n if @nossos_servico.save\n format.html { redirect_to(@nossos_servico, :notice => 'Nossos servico was successfully created.') }\n format.xml { render :xml => @nossos_servico, :status => :created, :location => @nossos_servico }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @nossos_servico.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\r\n @sivic_pessoa = SivicPessoa.new(sivic_pessoa_params)\r\n\r\n respond_to do |format|\r\n if @sivic_pessoa.save\r\n format.html { redirect_to @sivic_pessoa, notice: 'Registro inserido com sucesso.' }\r\n format.json { render action: 'show', status: :created, location: @sivic_pessoa }\r\n else\r\n format.html { render action: 'new' }\r\n format.json { render json: @sivic_pessoa.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def create\r\n @sivic_profissao = SivicProfissao.new(sivic_profissao_params)\r\n\r\n respond_to do |format|\r\n if @sivic_profissao.save\r\n format.html { redirect_to @sivic_profissao, notice: 'Sivic profissao was successfully created.' }\r\n format.json { render action: 'show', status: :created, location: @sivic_profissao }\r\n else\r\n format.html { render action: 'new' }\r\n format.json { render json: @sivic_profissao.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def create\n @m2 = M2.new(m2_params)\n\n respond_to do |format|\n if @m2.save\n format.html { redirect_to @m2, notice: 'M2 was successfully created.' }\n format.json { render :show, status: :created, location: @m2 }\n else\n format.html { render :new }\n format.json { render json: @m2.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n id = current_user.uid\n @percorso = Percorso.find(params[:percorso])\n @partecipanti = Partecipanti.new(percorso: @percorso.id, utente: id)\n\n respond_to do |format|\n if @partecipanti.save\n conn = Bunny.new\n conn.start\n ch = conn.create_channel\n x = ch.topic(\"#{@percorso.id}\")\n queue = ch.queue(\"#{@percorso.id}#{id}\")\n queue.bind(x, :routing_key => \"all\")\n queue.bind(x, :routing_key => \"#{id}\")\n ch.close\n conn.close\n format.html { redirect_to percorso_path(percorso), notice: 'Adesso fai parte di questo percorso!.' }\n format.js {}\n format.json { render :show, status: :created, location: @partecipanti }\n else\n format.html { render :new }\n format.json { render json: @partecipanti.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @sinistro = Sinistro.new(sinistro_params)\n\n respond_to do |format|\n if @sinistro.save\n format.html { redirect_to @sinistro, notice: 'Sinistro was successfully created.' }\n format.json { render :show, status: :created, location: @sinistro }\n else\n format.html { render :new }\n format.json { render json: @sinistro.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @pessoacondominio = Pessoacondominio.new(pessoacondominio_params)\n\n respond_to do |format|\n if @pessoacondominio.save\n format.html { redirect_to @pessoacondominio, notice: 'Pessoa cadastrada com sucesso.' }\n format.json { render :show, status: :created, location: @pessoacondominio }\n else\n format.html { render :new }\n format.json { render json: @pessoacondominio.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @proverbe = Proverbe.new(proverbe_params)\n\n respond_to do |format|\n if @proverbe.save\n format.html { redirect_to @proverbe, notice: 'Proverbe was successfully created.' }\n format.json { render :show, status: :created, location: @proverbe }\n else\n format.html { render :new }\n format.json { render json: @proverbe.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @precio_boleto = PrecioBoleto.new(precio_boleto_params)\n\n respond_to do |format|\n if @precio_boleto.save\n format.html { redirect_to @precio_boleto, notice: 'Precio boleto was successfully created.' }\n format.json { render action: 'show', status: :created, location: @precio_boleto }\n else\n format.html { render action: 'new' }\n format.json { render json: @precio_boleto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @outlet2 = Outlet2.new(outlet2_params)\n\n respond_to do |format|\n if @outlet2.save\n format.html { redirect_to @outlet2, notice: 'Outlet2 was successfully created.' }\n format.json { render :show, status: :created, location: @outlet2 }\n else\n format.html { render :new }\n format.json { render json: @outlet2.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @produto = Produto.new(params[:produto])\n @produto.empresa = session[:usuario].empresa\n \n params[:produto][:preco_compra] = converte_valor_banco params[:produto][:preco_compra]\n params[:produto][:preco_venda] = converte_valor_banco params[:produto][:preco_venda]\n\n respond_to do |format|\n if @produto.save\n format.html { redirect_to @produto, notice: 'Produto was successfully created.' }\n format.json { render json: @produto, status: :created, location: @produto }\n else\n format.html { render action: \"new\" }\n format.json { render json: @produto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @poligono = Poligono.new(poligono_params)\n\n respond_to do |format|\n if @poligono.save\n format.html { redirect_to @poligono, notice: 'Poligono was successfully created.' }\n format.json { render action: 'show', status: :created, location: @poligono }\n else\n format.html { render action: 'new' }\n format.json { render json: @poligono.errors, status: :unprocessable_entity }\n end\n end\n end", "def comprar_producto\n response = ApiB2b.comprarProducto(params[:sku], params[:cantidad])\n render json: response\n end", "def create\n @prossumer = Prossumer.new(prossumer_params)\n\n if @prossumer.save\n ConfirmAccount.welcome(@prossumer).deliver_later\n\n render json: @prossumer, status: :created #, location: @prossumer\n else\n render json: @prossumer.errors, status: :unprocessable_entity\n end\n end", "def create\n @produto = ProdutoSimples.new(params[:produto_simples])\n respond_to do |format|\n if @produto.save\n flash[:notice] = \"Produto criado com sucesso.\"\n format.html { redirect_to(admin_produtos_path) }\n format.xml { render :xml => @produto, :status => :created, :location => @produto }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @produto.errors, :status => :unprocessable_entity }\n end\n end\n end", "def status2_params\n params.require(:status2).permit(:name, :content)\n end", "def create\n @produto = Produto.new(params[:produto])\n\n respond_to do |format|\n if @produto.save\n format.html { redirect_to @produto, notice: 'Produto was successfully created.' }\n format.json { render json: @produto, status: :created, location: @produto }\n else\n format.html { render action: \"new\" }\n format.json { render json: @produto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @parametro = Parametro.new(parametro_params)\n @parametro.observacion = @parametro.multiparametro('Ingresa 1', 'Ingresa 2', 'Ingresa 3')\n respond_to do |format|\n if @parametro.save\n format.html { redirect_to @parametro, notice: \"Parametro was successfully created.\" }\n format.json { render :show, status: :created, location: @parametro }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @parametro.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @foo2 = Foo2.new(foo2_params)\n\n respond_to do |format|\n if @foo2.save\n format.html { redirect_to @foo2, notice: \"Foo2 was successfully created.\" }\n format.json { render :show, status: :created, location: @foo2 }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @foo2.errors, status: :unprocessable_entity }\n end\n end\n end", "def submit_form_2122\n validate_json_schema\n\n power_of_attorney = ClaimsApi::PowerOfAttorney.find_using_identifier_and_source(header_md5: header_md5,\n source_name: source_name)\n unless power_of_attorney&.status&.in?(%w[submitted pending])\n power_of_attorney = ClaimsApi::PowerOfAttorney.create(\n status: ClaimsApi::PowerOfAttorney::PENDING,\n auth_headers: auth_headers,\n form_data: form_attributes,\n source_data: source_data,\n header_md5: header_md5\n )\n\n unless power_of_attorney.persisted?\n power_of_attorney = ClaimsApi::PowerOfAttorney.find_by(md5: power_of_attorney.md5)\n end\n\n power_of_attorney.save!\n end\n\n ClaimsApi::PoaUpdater.perform_async(power_of_attorney.id)\n\n render json: power_of_attorney, serializer: ClaimsApi::PowerOfAttorneySerializer\n end", "def create\n @primeminester = Primeminester.new(primeminester_params)\n\n respond_to do |format|\n if @primeminester.save\n format.html { redirect_to @primeminester, notice: 'Primeminester was successfully created.' }\n format.json { render :show, status: :created, location: @primeminester }\n else\n format.html { render :new }\n format.json { render json: @primeminester.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @precioproducto = Precioproducto.new(params[:precioproducto])\n\n respond_to do |format|\n if @precioproducto.save\n format.html { redirect_to @precioproducto, notice: 'Precioproducto was successfully created.' }\n format.json { render json: @precioproducto, status: :created, location: @precioproducto }\n else\n format.html { render action: \"new\" }\n format.json { render json: @precioproducto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @prospecto = Prospecto.new(prospecto_params)\n\n respond_to do |format|\n if @prospecto.save\n format.html { redirect_to @prospecto, notice: 'Prospecto creado' }\n format.json { render :show, status: :created, location: @prospecto }\n else\n format.html { render :new }\n format.json { render json: @prospecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @socio = Socio.new(socio_params)\n\n respond_to do |format|\n if @socio.save\n format.html { redirect_to @socio, notice: 'Socio criado com sucesso.' }\n format.json { render :show, status: :created, location: @socio }\n else\n format.html { render :new }\n format.json { render json: @socio.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @producto_seccion = ProductoSeccion.new(producto_seccion_params)\n\n respond_to do |format|\n if @producto_seccion.save\n format.html { redirect_to @producto_seccion, notice: 'Producto seccion was successfully created.' }\n format.json { render :show, status: :created, location: @producto_seccion }\n else\n format.html { render :new }\n format.json { render json: @producto_seccion.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @scoot = Scoot.new(scoot_params)\n \n respond_to do |format|\n if @scoot.save\n format.html { redirect_to root_url, notice: 'Scoot was successfully created.' }\n format.json { render :show, status: :created, location: @scoot }\n else\n format.html { render :new }\n format.json { render json: @scoot.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @produto = Produto.new(produto_params)\n\n respond_to do |format|\n if @produto.save\n format.html { redirect_to @produto, notice: 'Produto was successfully created.' }\n format.json { render :show, status: :created, location: @produto }\n else\n format.html { render :new }\n format.json { render json: @produto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @produto = Produto.new(produto_params)\n\n respond_to do |format|\n if @produto.save\n format.html { redirect_to @produto, notice: 'Produto was successfully created.' }\n format.json { render :show, status: :created, location: @produto }\n else\n format.html { render :new }\n format.json { render json: @produto.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.6424797", "0.61014795", "0.59394616", "0.58475316", "0.5747115", "0.5692867", "0.5637399", "0.5531607", "0.54350954", "0.54121846", "0.53946453", "0.5390338", "0.5381138", "0.53646827", "0.5340217", "0.53147244", "0.52734876", "0.5262098", "0.5231716", "0.52271336", "0.5220963", "0.521936", "0.5207887", "0.52053607", "0.5203005", "0.5191114", "0.5185616", "0.5181009", "0.5174471", "0.51705015", "0.51565504", "0.51506126", "0.51481074", "0.514106", "0.5135472", "0.51265985", "0.51261246", "0.51192325", "0.5116748", "0.5112045", "0.51067483", "0.50990236", "0.5097423", "0.50942665", "0.5084957", "0.5081895", "0.50816", "0.5076127", "0.50697744", "0.50584906", "0.50579447", "0.50568825", "0.50562507", "0.50526357", "0.50474703", "0.50316507", "0.5029327", "0.5028153", "0.5028094", "0.5026121", "0.5024886", "0.50228274", "0.50184345", "0.5011722", "0.50108546", "0.50028974", "0.5001776", "0.49963987", "0.4993737", "0.49804145", "0.4977744", "0.49776816", "0.49566793", "0.4954825", "0.49539968", "0.49528578", "0.4952197", "0.4949807", "0.49478665", "0.49445543", "0.49392056", "0.49293518", "0.49278283", "0.49234277", "0.49217466", "0.491577", "0.49149725", "0.49148378", "0.49115583", "0.49018255", "0.48880187", "0.48879927", "0.4878302", "0.48780668", "0.48761854", "0.4875815", "0.48757842", "0.48742315", "0.48726216", "0.48726216" ]
0.547164
8
PATCH/PUT /proyectominero2s/1 PATCH/PUT /proyectominero2s/1.json
def update respond_to do |format| if @proyectominero2.update(proyectominero2_params) format.html { redirect_to @proyectominero2, notice: 'Proyectominero2 was successfully updated.' } format.json { render :show, status: :ok, location: @proyectominero2 } else format.html { render :edit } format.json { render json: @proyectominero2.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_proyectominero2\n @proyectominero2 = Proyectominero2.find(params[:id])\n end", "def update\n @promocion = Promocion.find(params[:id])\n logger.debug \"-------------------------------------------------------\"\n logger.debug params[:promocion][:formadepago_ids]\n logger.debug \"-------------------------------------------------------\"\n if (params[:promocion][:comercializable_ids] == nil)\n params[:promocion][:comercializable_ids] = []\n end\n\n if (params[:promocion][:formadepago_ids] == nil)\n params[:promocion][:formadepago_ids] = []\n end\n\n respond_to do |format|\n if @promocion.update_attributes(params[:promocion])\n format.html { redirect_to @promocion, :notice => 'Promocion was successfully updated.' }\n format.json { render json: @promocion}\n else\n format.html { render :action => \"edit\" }\n format.json { render json: @promocion.errors }\n end\n end\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def update\n @promos = Promos.find(params[:id])\n\n respond_to do |format|\n if @promos.update_attributes(params[:promos])\n flash[:notice] = 'Promos was successfully updated.'\n format.html { redirect_to(@promos) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @promos.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @proyect = Proyect.find(params[:id])\n\n respond_to do |format|\n if @proyect.update_attributes(params[:proyect])\n format.html { redirect_to @proyect, notice: 'Proyect was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proyect.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bicepstriceps2.update(bicepstriceps2_params)\n format.html { redirect_to \"/bicepstriceps2s\"}\n format.json { render :show, status: :ok, location: @bicepstriceps2 }\n else\n format.html { render :edit }\n format.json { render json: @bicepstriceps2.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @prospecto.update(prospecto_params)\n format.html { redirect_to @prospecto, notice: 'Prospecto was successfully updated.' }\n format.json { render :show, status: :ok, location: @prospecto }\n else\n format.html { render :edit }\n format.json { render json: @prospecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @voprosy = Voprosy.find(params[:id])\n\n respond_to do |format|\n if @voprosy.update_attributes(params[:voprosy])\n format.html { redirect_to @voprosy, notice: 'Voprosy was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @voprosy.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @probando.update(probando_params)\n format.html { redirect_to @probando, notice: 'Probando was successfully updated.' }\n format.json { render :show, status: :ok, location: @probando }\n else\n format.html { render :edit }\n format.json { render json: @probando.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @poligono.update(poligono_params)\n format.html { redirect_to @poligono, notice: 'Poligono was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @poligono.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @propose = Propose.find(params[:id])\n\n respond_to do |format|\n if @propose.update_attributes(params[:propose])\n format.html { redirect_to @propose, notice: 'Propuesta actualizada' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @propose.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bicepstriceps1.update(bicepstriceps1_params)\n format.html { redirect_to \"/bicepstriceps1s\"}\n format.json { render :show, status: :ok, location: @bicepstriceps1 }\n else\n format.html { render :edit }\n format.json { render json: @bicepstriceps1.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @product2 = Product2.find(params[:id])\n\n respond_to do |format|\n if @product2.update_attributes(params[:product2])\n format.html { redirect_to @product2, notice: 'Product2 was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product2.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n #Finding the specific chore where the id matches the one we pass in with the body\n @v1_chore = Chore.where(id: params[:id]).first\n #Here we're checking if we have user_id in our body, and if we do, we'll change the selected chore's properties\n #with the parameters of the body, we go through the specific group to our specific chore with the path\n if v1_chore_params[:user_id]\n @v1_chore.user_id = params[:user_id]\n @v1_chore.assigned = true\n if @v1_chore.save\n render :show, status: :ok\n end\n else\n render json: @v1_chore.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @proyect.update(proyect_params)\n format.html { redirect_to @proyect, notice: \"Proyect was successfully updated.\" }\n format.json { render :show, status: :ok, location: @proyect }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @proyect.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @prospie.update(prospie_params)\n format.html { redirect_to @prospie, notice: 'Prospie was successfully updated.' }\n format.json { render :show, status: :ok, location: @prospie }\n else\n format.html { render :edit }\n format.json { render json: @prospie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @premio = Premio.find(params[:id])\n\n respond_to do |format|\n if @premio.update_attributes(params[:premio])\n format.html { redirect_to @premio, :notice => 'Premio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @premio.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to(@product, :notice => 'Product was successfully updated.') }\n format.xml { head :ok }\n format.json { head :ok }\n\n # RhoConnect server\n server = \"http://127.0.0.1:9292\"\n login = \"rhoadmin\"\n password = \"\"\n\n # Login to the RhoConnect server\n res = RestClient.post(\"#{server}/login\", { :login => login, :password => password }.to_json, :content_type => :json)\n\n # Get the token from the login response\n token = RestClient.post(\"#{server}/api/get_api_token\", '', { :cookies => res.cookies })\n\n # Send a ping message, which triggers a ping on the device\n ping_params = {\n :api_token => token,\n :user_id => [\"bhanu\"], # user_id that this message is for\n :sources => [\"Product\"], # sources we want to sync when this message is received\n :vibrate => \"2\",\n :message => \"#{params[:product][:name]} has been updated\",\n :sound => ''\n }\n\n RestClient.post(\"#{server}/api/ping\", ping_params.to_json, :content_type => :json)\n\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @product.errors, :status => :unprocessable_entity }\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @p1.update(p1_params)\n format.html { redirect_to @p1, notice: 'P1 was successfully updated.' }\n format.json { render :show, status: :ok, location: @p1 }\n else\n format.html { render :edit }\n format.json { render json: @p1.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @proyect.update(proyect_params)\n format.html { redirect_to @proyect, notice: 'Proyect was successfully updated.' }\n format.json { render :show, status: :ok, location: @proyect }\n else\n format.html { render :edit }\n format.json { render json: @proyect.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @produccion = Produccion.find(params[:id])\n\n respond_to do |format|\n if @produccion.update_attributes(params[:produccion])\n format.html { redirect_to @produccion, notice: 'Se ha modificado satisfactoriamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @produccion.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @produccion = Produccion.find(params[:id])\n\n respond_to do |format|\n if @produccion.update_attributes(params[:produccion])\n format.html { redirect_to @produccion, notice: 'Produccion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @produccion.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @new_pro = NewPro.find(params[:id])\n\n respond_to do |format|\n if @new_pro.update_attributes(params[:new_pro])\n format.html { redirect_to @new_pro, notice: 'New pro was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @new_pro.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @pessoa = Pessoa.find(params[:id])\n\n respond_to do |format|\n if @pessoa.update_attributes(params[:pessoa])\n format.html { redirect_to pessoas_path, notice: 'Pessoa atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pessoa.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @premio = Premio.find(params[:id])\n\n respond_to do |format|\n if @premio.update_attributes(params[:premio])\n format.html { redirect_to @premio, notice: 'Premio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @premio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @proverb.update(proverb_params)\n format.html { redirect_to @proverb, notice: \"Proverb was successfully updated.\" }\n format.json { render :show, status: :ok, location: @proverb }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @proverb.errors, status: :unprocessable_entity }\n end\n end\n end", "def edit_pro\n customer_id = params[\"customer_id\"]\n siret = params[\"siret\"]\n cip = params[\"cip\"]\n raison_sociale = params[\"raison_sociale\"]\n puts params\n puts \"----------------------------------------MAKES NO SENSE\"\n puts params[\"raison_sociale\"]\n puts customer_id\n puts cip\n puts siret\n puts raison_sociale\n puts \"I am in edit pro\"\n\n metafields = ShopifyAPI::Customer.find(customer_id).metafields\n puts metafields[0].key\n puts metafields[0].value\n puts metafields[1].key\n puts metafields[1].value\n puts metafields[2].key\n puts metafields[2].value\n\n metafields[0].value = siret\n metafields[1].value = cip\n metafields[2].value = raison_sociale\n\n puts metafields[0].key\n puts metafields[0].value\n puts metafields[1].key\n puts metafields[1].value\n puts metafields[2].key\n puts metafields[2].value\n\n p metafields[0].save\n p metafields[1].save\n p metafields[2].save\n\n p metafields[0].errors\n p metafields[1].errors\n p metafields[2].errors\n\n puts \"editing tag\"\n\n cus = ShopifyAPI::Customer.find(customer_id)\n p cus\n p cus.tags\n\n cus.tags = \"cip- #{metafields[1].value}, PRO\"\n\n p cus.save\n\n\n\n render json: { metafields: metafields }\n end", "def update\n respond_to do |format|\n if @proprietario.update(proprietario_params)\n format.html { redirect_to edit_imovel_path(@proprietario.imovel_id), notice: 'Proprietario was successfully updated.' }\n format.json { render :show, status: :ok, location: @proprietario }\n else\n format.html { render :edit }\n format.json { render json: @proprietario.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @processo = Processo.find(params[:id])\n\n if @processo.update(processo_params)\n head :no_content\n else\n render json: @processo.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @copropietario.update(copropietario_params)\n format.html { redirect_to @copropietario, notice: 'Copropietario was successfully updated.' }\n format.json { render :show, status: :ok, location: @copropietario }\n else\n format.html { render :edit }\n format.json { render json: @copropietario.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @plato = Plato.find(params[:id])\n\n if @plato.update(plato_params)\n head :no_content\n else\n render json: @plato.errors, status: :unprocessable_entity\n end\n end", "def update\n @pologeno = Pologeno.find(params[:id])\n\n respond_to do |format|\n if @pologeno.update_attributes(params[:pologeno])\n format.html { redirect_to @pologeno, notice: 'Pologeno was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pologeno.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @server1 = Server1.find(params[:id])\n\n respond_to do |format|\n if @server1.update_attributes(params[:server1])\n format.html { redirect_to @server1, notice: 'Server was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @server1.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @prospecto_meta_largo_plazo.update(prospecto_meta_largo_plazo_params)\n format.html { redirect_to @prospecto_meta_largo_plazo, notice: 'Prospecto meta largo plazo was successfully updated.' }\n format.json { render :show, status: :ok, location: @prospecto_meta_largo_plazo }\n else\n format.html { render :edit }\n format.json { render json: @prospecto_meta_largo_plazo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\r\n respond_to do |format|\r\n if @proyect.update(proyect_params)\r\n format.html { redirect_to @proyect, notice: 'Proyect was successfully updated.' }\r\n format.json { render :show, status: :ok, location: @proyect }\r\n else\r\n puts @proyect.errors.full_messages\r\n format.html { render :edit }\r\n format.json { render json: @proyect.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n respond_to do |format|\n if @api_v1_todo.update(api_v1_todo_params)\n format.json { render json: @api_v1_todo, status: :ok }\n else\n format.json { render json: @api_v1_todo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @precioproducto = Precioproducto.find(params[:id])\n\n respond_to do |format|\n if @precioproducto.update_attributes(params[:precioproducto])\n format.html { redirect_to @precioproducto, notice: 'Precioproducto was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @precioproducto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @product1.update(product1_params)\n format.html { redirect_to @product1, notice: \"Product1 was successfully updated.\" }\n format.json { render :show, status: :ok, location: @product1 }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @product1.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @profesor = Profesor.find(params[:id])\n\n if @profesor.update(profesor_params)\n head :no_content\n else\n render json: @profesor.errors, status: :unprocessable_entity\n end\n end", "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end", "def update\n respond_to do |format|\n if @prodottos_operazione.update(prodottos_operazione_params)\n format.html { redirect_to @prodottos_operazione, notice: 'Prodottos operazione was successfully updated.' }\n format.json { render :show, status: :ok, location: @prodottos_operazione }\n else\n format.html { render :edit }\n format.json { render json: @prodottos_operazione.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @empresa = Empresa.find(params[:empresa_id]) \n @producto = @empresa.productos.find(params[:producto_id])\n @preparar_mate = @producto.preparar_mates.find(params[:id])\n respond_to do |format|\n if @preparar_mate.update(preparar_mate_params)\n format.html { redirect_to empresa_producto_preparar_mates_path, notice: 'Preparar mate was successfully updated.' }\n format.json { render :show, status: :ok, location: @preparar_mate }\n else\n format.html { render :edit }\n format.json { render json: @preparar_mate.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @provin.update(provin_params)\n format.html { redirect_to @provin, notice: 'Provin was successfully updated.' }\n format.json { render :show, status: :ok, location: @provin }\n else\n format.html { render :edit }\n format.json { render json: @provin.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @proverbe.update(proverbe_params)\n format.html { redirect_to @proverbe, notice: 'Proverbe was successfully updated.' }\n format.json { render :show, status: :ok, location: @proverbe }\n else\n format.html { render :edit }\n format.json { render json: @proverbe.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @objeto.update(objeto_params)\n format.html { redirect_to @objeto, notice: 'Objeto was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @objeto.update(objeto_params)\n format.html { redirect_to @objeto, notice: 'Objeto was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @round_robin_promo = RoundRobinPromo.find(params[:id])\n\n respond_to do |format|\n if @round_robin_promo.update_attributes(params[:round_robin_promo])\n format.html { redirect_to @round_robin_promo, notice: 'Round robin promo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @round_robin_promo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @propperty.update(propperty_params)\n format.html { redirect_to @propperty, notice: 'Propperty was successfully updated.' }\n format.json { render :show, status: :ok, location: @propperty }\n else\n format.html { render :edit }\n format.json { render json: @propperty.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @noto = Noto.find(params[:id])\n\n respond_to do |format|\n if @noto.update_attributes(params[:noto])\n format.html { redirect_to @noto, :notice => 'Noto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @noto.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\r\n respond_to do |format|\r\n if @sivic_pessoa.update(sivic_pessoa_params)\r\n format.html { redirect_to @sivic_pessoa, notice: 'Registro alterado com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_pessoa.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n @po = Po.find(params[:id])\n\n respond_to do |format|\n if @po.update_attributes(params[:po])\n format.html { redirect_to @po, notice: 'Po was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @po.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @productonegocio = Productonegocio.find(params[:id])\n\n respond_to do |format|\n if @productonegocio.update_attributes(params[:productonegocio])\n format.html { redirect_to @productonegocio, notice: 'Productonegocio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @productonegocio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profissional.update(profissional_params)\n format.html { redirect_to @profissional, notice: 'Profissional was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @profissional.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @prospecto.update(prospecto_params)\n format.html { redirect_to @prospecto, notice: 'Prospecto actualizado' }\n format.json { render :show, status: :ok, location: @prospecto }\n else\n format.html { render :edit }\n format.json { render json: @prospecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\trespond_to do |format|\n\tif @precio_boleto.update(precio_boleto_params)\n\t\tformat.html { redirect_to @precio_boleto, notice: 'Precio boleto was successfully updated.' }\n\t\tformat.json { head :no_content }\n\telse\n\t\tformat.html { render action: 'edit' }\n\t\tformat.json { render json: @precio_boleto.errors, status: :unprocessable_entity }\n\tend\n\tend\nend", "def update\n @ventas_presupuesto = Ventas::Presupuesto.find(params[:id])\n\n respond_to do |format|\n if @ventas_presupuesto.update_attributes(params[:ventas_presupuesto])\n format.html { redirect_to @ventas_presupuesto, notice: 'Presupuesto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ventas_presupuesto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @peso = Peso.find(params[:id])\n\n respond_to do |format|\n if @peso.update_attributes(params[:peso])\n format.html { redirect_to @peso, notice: 'Peso was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @peso.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bicepstricepshome2.update(bicepstricepshome2_params)\n format.html { redirect_to \"/bicepstricepshome2s\"}\n format.json { render :show, status: :ok, location: @bicepstricepshome2 }\n else\n format.html { render :edit }\n format.json { render json: @bicepstricepshome2.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @proyectos_user.update(proyectos_user_params)\n format.html { redirect_to @proyectos_user, notice: 'Proyectos user was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @proyectos_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @robo.update(robo_params)\n format.html { redirect_to @robo, notice: 'Robo was successfully updated.' }\n format.json { render :show, status: :ok, location: @robo }\n else\n format.html { render :edit }\n format.json { render json: @robo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @produto.update(produto_params)\n respond_with @produto\n end", "def update\n @perfilnegocio = Perfilnegocio.find(params[:id])\n\n respond_to do |format|\n if @perfilnegocio.update_attributes(params[:perfilnegocio])\n format.html { redirect_to @perfilnegocio, notice: 'Perfilnegocio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @perfilnegocio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @opo.update(opo_params)\n format.html { redirect_to @opo, notice: 'Opo was successfully updated.' }\n format.json { render :show, status: :ok, location: @opo }\n else\n format.html { render :edit }\n format.json { render json: @opo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @resto.update(resto_params)\n format.html { redirect_to @resto, notice: 'Entry was successfully updated.' }\n format.json { render :show, status: :ok, location: @resto }\n else\n format.html { render :edit }\n format.json { render json: @resto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @empresa = Empresa.find(params[:empresa_id]) \n @producto = @empresa.productos.find(params[:producto_id])\n @item_producto = @producto.item_productos.find(params[:item_producto_id])\n @opinion = @item_producto.opinions.find(params[:id])\n respond_to do |format|\n if @opinion.update(opinion_params)\n format.html { redirect_to empresa_producto_item_producto_opinions_path, notice: 'Item producto was successfully updated.' }\n format.json { render :show, status: :ok, location: @opinion }\n else\n format.html { render :edit }\n format.json { render json: @opinion.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @provisor.update(provisor_params)\n format.html { redirect_to @provisor, notice: t('helpers.success-upd') }\n format.json { render :show, status: :ok, location: @provisor }\n else\n format.html { render :edit }\n format.json { render json: @provisor.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @pasien2 = Pasien2.find(params[:id])\n\n respond_to do |format|\n if @pasien2.update_attributes(params[:pasien2])\n format.html { redirect_to @pasien2, notice: 'Data pasien berhasil di update.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pasien2.errors, status: :unprocessable_entity }\n end\n end\n end", "def update # PATCH\n raise NotImplementedError\n end", "def update\n respond_to do |format|\n if @platoon.update(platoon_params)\n format.html { redirect_to @platoon, notice: 'Platoon was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @platoon.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @proceso = Proceso.find(params[:id])\n\n respond_to do |format|\n if @proceso.update_attributes(params[:proceso])\n format.html { redirect_to(@proceso, :notice => 'Proceso was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @proceso.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @socio_irpj.update(socio_irpj_params)\n format.html { redirect_to @socio_irpj, notice: 'Socio irpj was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @socio_irpj.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @promocion.update(promocion_params)\n format.html { redirect_to @promocion, notice: 'Promocion ha sido actualizado.' }\n format.json { render :show, status: :ok, location: @promocion }\n else\n format.html { render :edit }\n format.json { render json: @promocion.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @proposta.update(propostum_params)\n format.html { redirect_to @proposta, notice: 'Propostum was successfully updated.' }\n format.json { render :show, status: :ok, location: @proposta }\n else\n format.html { render :edit }\n format.json { render json: @proposta.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @pessoa.update(pessoa_params)\n format.html { redirect_to @pessoa, notice: 'Cadastro alterado com sucesso!.' }\n format.json { render :show, status: :ok, location: @pessoa }\n else\n format.html { render :edit }\n format.json { render json: @pessoa.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @poto.update(poto_params)\n format.html { redirect_to @poto, notice: 'Poto was successfully updated.' }\n format.json { render :show, status: :ok, location: @poto }\n else\n format.html { render :edit }\n format.json { render json: @poto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task2.update(task2_params)\n format.html { redirect_to @task2, notice: 'Task2 was successfully updated.' }\n format.json { render :show, status: :ok, location: @task2 }\n else\n format.html { render :edit }\n format.json { render json: @task2.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @repuesto.update(repuesto_params)\n format.html { redirect_to @repuesto, notice: 'Repuesto was successfully updated.' }\n format.json { render :show, status: :ok, location: @repuesto }\n else\n format.html { render :edit }\n format.json { render json: @repuesto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def update\n @request_for_change.set_manager(force: true)\n @request_for_change.set_security_officer(force: true)\n\n respond_to do |format|\n if @request_for_change.update(request_for_change_params)\n format.html { redirect_to edit_request_for_change_path(@request_for_change), notice: 'Request for change was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @request_for_change.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tiposervico.update(tiposervico_params)\n format.html { redirect_to @tiposervico, notice: 'Tiposervico was successfully updated.' }\n format.json { render :show, status: :ok, location: @tiposervico }\n else\n format.html { render :edit }\n format.json { render json: @tiposervico.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @provincium.update(provincium_params)\n format.html { redirect_to @provincium, notice: 'Provincium was successfully updated.' }\n format.json { render :show, status: :ok, location: @provincium }\n else\n format.html { render :edit }\n format.json { render json: @provincium.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n course = Course.includes(:professors).find(params[:id])\n course.update!(course_params)\n \n course.professor_ids=(params[:professors])\n\n render json: course.to_json(include: :professors)\n end", "def update\n @photo1 = Photo1.find(params[:id])\n\n respond_to do |format|\n if @photo1.update_attributes(params[:photo1])\n format.html { redirect_to @photo1, notice: 'Photo1 was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @photo1.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @tipo_negocio = TipoNegocio.find(params[:id])\n\n respond_to do |format|\n if @tipo_negocio.update_attributes(params[:tipo_negocio])\n format.html { redirect_to @tipo_negocio, notice: 'Tipo negocio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipo_negocio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @osoba = Osoba.find(params[:id])\n\n if @osoba.update(params[:osoba])\n head :no_content\n else\n render json: @osoba.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @processo.update(processo_params)\n format.html { redirect_to @processo, notice: 'Processo was successfully updated.' }\n format.json { render :show, status: :ok, location: @processo }\n else\n format.html { render :edit }\n format.json { render json: @processo.errors, status: :unprocessable_entity }\n end\n end\n end", "def activo_update\n respond_to do |format|\n activo = params[:producto][:activo]\n id = params[:id]\n Producto.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end", "def update\n respond_to do |format|\n if @foo2.update(foo2_params)\n format.html { redirect_to @foo2, notice: \"Foo2 was successfully updated.\" }\n format.json { render :show, status: :ok, location: @foo2 }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @foo2.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @consorciot.update(consorciot_params)\n format.html { redirect_to @consorciot, notice: 'Consorciot was successfully updated.' }\n format.json { render :show, status: :ok, location: @consorciot }\n else\n format.html { render :edit }\n format.json { render json: @consorciot.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @prod_coti.update(prod_coti_params)\n format.html { redirect_to @prod_coti, notice: 'Prod coti was successfully updated.' }\n format.json { render :show, status: :ok, location: @prod_coti }\n else\n format.html { render :edit }\n format.json { render json: @prod_coti.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @payment2 = Payment2.find(params[:id])\n\n respond_to do |format|\n if @payment2.update_attributes(params[:payment2])\n format.html { redirect_to @payment2, notice: 'Payment2 was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @payment2.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @fotosprofile.update(fotosprofile_params)\n format.html { redirect_to @fotosprofile, notice: 'Fotosprofile was successfully updated.' }\n format.json { render :show, status: :ok, location: @fotosprofile }\n else\n format.html { render :edit }\n format.json { render json: @fotosprofile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @proyect.update(proyect_params)\n format.html { redirect_to [@zone,@proyect], notice: 'El proyecto fue actualizado exitosamente' }\n format.json { render :show, status: :ok, location: @proyect }\n else\n format.html { render :edit }\n format.json { render json: @proyect.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @pocetna.update(pocetna_params)\n format.html { redirect_to @pocetna, notice: \"Pocetna was successfully updated.\" }\n format.json { render :show, status: :ok, location: @pocetna }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @pocetna.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if params[:commit] == 'Accept'\n params[:scoot][:state] = 'accepted'\n else\n params[:scoot][:state] = 'rejected'\n end\n respond_to do |format|\n if @scoot.update(scoot_params)\n format.html { redirect_to root_url, notice: 'Scoot was successfully updated.' }\n format.json { render :show, status: :ok, location: @scoot }\n else\n format.html { render :edit }\n format.json { render json: @scoot.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if not ( paziente_signed_in? or administrator_signed_in?)\n redirect_to root_path and return\n end\n respond_to do |format|\n if @profilopazienti.update(profilopazienti_params)\n format.html { redirect_to @profilopazienti, notice: \"Profilopazienti was successfully updated.\" }\n format.json { render :show, status: :ok, location: @profilopazienti }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @profilopazienti.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @promoter.update(promoter_params)\n format.html { redirect_to root_url, notice: 'Promoter was successfully updated.' }\n format.json { render :show, status: :ok, location: @promoter }\n else\n format.html { render :edit }\n format.json { render json: @promoter.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @prime = Prime.find(params[:id])\n\n respond_to do |format|\n if @prime.update_attributes(params[:prime])\n format.html { redirect_to @prime, notice: 'Prime was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @prime.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @promocao = Promocao.find(params[:id])\n\n respond_to do |format|\n if @promocao.update_attributes(params[:promocao])\n format.html { redirect_to(@promocao, :notice => 'Promoção aletrada com sucesso!') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @promocao.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @proef = Proef.find(params[:id])\n\n respond_to do |format|\n if @proef.update_attributes(params[:proef])\n format.html { redirect_to @proef, notice: 'Test werd succesvol gewijzigd.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proef.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.6090932", "0.6007985", "0.5998861", "0.5983099", "0.59798175", "0.59776366", "0.59641343", "0.59578866", "0.5955673", "0.59382", "0.59373164", "0.5936199", "0.5915847", "0.5909665", "0.58937526", "0.58917654", "0.58903193", "0.58865935", "0.588383", "0.5879216", "0.5875565", "0.5868525", "0.585401", "0.5843727", "0.5838377", "0.5835678", "0.5834451", "0.5822419", "0.5821171", "0.58162963", "0.5810439", "0.5804444", "0.5792852", "0.579263", "0.57722116", "0.5761289", "0.57608527", "0.57595176", "0.5759164", "0.57572967", "0.57554686", "0.5752573", "0.5750901", "0.57503533", "0.57494634", "0.57494634", "0.5743936", "0.5737767", "0.5729739", "0.57290965", "0.57281876", "0.5727393", "0.5725309", "0.57211643", "0.571813", "0.5711534", "0.5707565", "0.570096", "0.5698917", "0.569792", "0.5696597", "0.5693381", "0.56901383", "0.5681182", "0.56803936", "0.56800425", "0.5679344", "0.56729007", "0.5671709", "0.56689185", "0.5665758", "0.5664249", "0.56618446", "0.5660957", "0.56583637", "0.565627", "0.5654174", "0.5652488", "0.56497854", "0.564868", "0.5646179", "0.56457454", "0.56439173", "0.5643132", "0.5641837", "0.5641621", "0.56391585", "0.56386685", "0.56378883", "0.56370646", "0.5637017", "0.5634945", "0.56326336", "0.56302327", "0.5629299", "0.56266844", "0.5625384", "0.5624998", "0.5622581", "0.56177115" ]
0.7085922
0
DELETE /proyectominero2s/1 DELETE /proyectominero2s/1.json
def destroy @proyectominero2.destroy respond_to do |format| format.html { redirect_to proyectominero2s_url, notice: 'Proyectominero2 was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @server1 = Server1.find(params[:id])\n @server1.destroy\n\n respond_to do |format|\n format.html { redirect_to server1s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @odontologia1 = Odontologia1.find(params[:id])\n @odontologia1.destroy\n\n respond_to do |format|\n format.html { redirect_to odontologia1s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @proyect = Proyect.find(params[:id])\n @proyect.destroy\n\n respond_to do |format|\n format.html { redirect_to proyects_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @step2 = Proce.find(params[:id])\n @step2.destroy\n\n respond_to do |format|\n format.html { redirect_to(step2s_url) }\n format.xml { head :ok }\n format.json { render :text => '{status: \"success\"}'}\n end\n end", "def destroy\n @prod_cli.destroy\n respond_to do |format|\n format.html { redirect_to prod_clis_url, notice: 'produto excluido com sucesso.' }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end", "def destroy\n @produccion = Produccion.find(params[:id])\n @produccion.destroy\n\n respond_to do |format|\n format.html { redirect_to produccions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bicepstricepshome2.destroy\n respond_to do |format|\n format.html { redirect_to bicepstricepshome2s_url, notice: 'Bicepstricepshome2 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @promocion = Promocion.find(params[:id])\n @promocion.destroy\n\n respond_to do |format|\n format.html { redirect_to promocions_url }\n #format.json { head :ok }\n end\n end", "def destroy\n @produccion = Produccion.find(params[:id])\n @produccion.destroy\n\n respond_to do |format|\n format.html { redirect_to producciones_url }\n format.json { head :no_content }\n end\n end", "def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end", "def destroy\n @pologeno = Pologeno.find(params[:id])\n @pologeno.destroy\n\n respond_to do |format|\n format.html { redirect_to pologenos_url }\n format.json { head :no_content }\n end\n end", "def delete\r\n respond_to do |format|\r\n if @proyecto.destroy\r\n proyectos=Proyecto.where(:user_id=>@user_id)\r\n #response={msge:{type: 'success', msg:\"Proyecto eliminado satisfactoriamente\"},proyectos:proyectos}\r\n format.html { render :json => proyectos, meta: {msge:{type: 'success', msg:\"Proyecto eliminado satisfactoriamente\"}}}\r\n else\r\n response={msge:{type: 'warning', msg:\"Ocurrió un error en el servidor\"}}\r\n format.html { render json: response }\r\n end\r\n end\r\n end", "def destroy\n @p1.destroy\n respond_to do |format|\n format.html { redirect_to p1s_url, notice: 'P1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @photo1 = Photo1.find(params[:id])\n @photo1.destroy\n\n respond_to do |format|\n format.html { redirect_to photo1s_url }\n format.json { head :no_content }\n end\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def destroy\n @bicepstriceps1.destroy\n respond_to do |format|\n format.html { redirect_to bicepstriceps1s_url, notice: 'Bicepstriceps1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @round_robin_promo = RoundRobinPromo.find(params[:id])\n @round_robin_promo.destroy\n\n respond_to do |format|\n format.html { redirect_to round_robin_promos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @line_item1 = LineItem1.find(params[:id])\n @line_item1.destroy\n\n respond_to do |format|\n format.html { redirect_to line_item1s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @przedmiot = Przedmiot.find(params[:id])\n @przedmiot.destroy\n\n respond_to do |format|\n format.html { redirect_to przedmioty_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @healthpro.destroy\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @v1_chore = Chore.where(id: params[:id])\n if @v1_chore.destroy\n head(:ok)\n else\n head(:unprocessable_entity)\n end\n end", "def destroy\n @prueba_json.destroy\n respond_to do |format|\n format.html { redirect_to prueba_jsons_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @anteproyecto_observacion.destroy\n respond_to do |format|\n format.html { redirect_to anteproyecto_observaciones_url, notice: 'Anteproyecto observacion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @prospecto.destroy\n respond_to do |format|\n format.html { redirect_to prospectos_url, notice: 'Prospecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @order1 = Order1.find(params[:id])\n @order1.destroy\n\n respond_to do |format|\n format.html { redirect_to order1s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bicepstriceps2.destroy\n respond_to do |format|\n format.html { redirect_to bicepstriceps2s_url, notice: 'Bicepstriceps2 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @promos = Promos.find(params[:id])\n @promos.destroy\n\n respond_to do |format|\n format.html { redirect_to(promos_url) }\n format.xml { head :ok }\n end\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def destroy\n @step2 = Step2.find(params[:id])\n @step2.destroy\n\n respond_to do |format|\n format.html { redirect_to step2s_url }\n format.json { head :ok }\n end\n end", "def destroy\n @proyect.destroy\n respond_to do |format|\n format.html { redirect_to proyects_url, notice: \"Proyect was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @profilsekolah.destroy\n respond_to do |format|\n format.html { redirect_to profilsekolahs_url }\n format.json { head :no_content }\n end\n end", "def cmd_delete argv\n setup argv\n uuid = @hash['uuid']\n response = @api.delete(uuid)\n msg response\n return response\n end", "def destroy\n @promo = Promo.find(params[:id])\n @promo.destroy\n\n respond_to do |format|\n format.html { redirect_to promos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @promo = Promo.find(params[:id])\n @promo.destroy\n\n respond_to do |format|\n format.html { redirect_to promos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @deco1.destroy\n respond_to do |format|\n format.html { redirect_to deco1s_url, notice: 'Deco1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @proyect.destroy\n respond_to do |format|\n format.html { redirect_to proyects_url, notice: 'Proyect was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @commtent1 = Commtent1.find(params[:id])\n @commtent1.destroy\n\n respond_to do |format|\n format.html { redirect_to commtent1s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @curso.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @task2.destroy\n respond_to do |format|\n format.html { redirect_to task2s_path, notice: 'Task2 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @status2.destroy\n respond_to do |format|\n format.html { redirect_to status2s_url, notice: 'Status2 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @server = Server.find(params[:id])\n checkaccountobject(\"servers\",@server)\n @server.send_delete\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :ok }\n end\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def destroy\n @pro_far = ProFar.where([\"producto_id = ? and farmacium_id = ?\", params[:id], session[:farmacia_id]]).first\n @pro_far.destroy\n respond_to do |format|\n msg = { :status => \"ok\", :message => \"Eliminado!\" }\n format.json { render :json => msg }\n end\n end", "def destroy\n @api_v1_item.destroy\n render json: {message: 'deletado com sucesso'}\n end", "def destroy\n @proceso = Proceso.find(params[:id])\n @proceso.destroy\n\n respond_to do |format|\n format.html { redirect_to(procesos_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @shouldersbiceps1.destroy\n respond_to do |format|\n format.html { redirect_to shouldersbiceps1s_url, notice: 'Shouldersbiceps1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @prospecto.destroy\n respond_to do |format|\n format.html { redirect_to prospectos_url, notice: 'Prospecto eliminado' }\n format.json { head :no_content }\n end\n end", "def destroy\n @poligono.destroy\n respond_to do |format|\n format.html { redirect_to poligonos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @payment2 = Payment2.find(params[:id])\n @payment2.destroy\n\n respond_to do |format|\n format.html { redirect_to payment2s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @proyecto.destroy\n respond_to do |format|\n format.html { redirect_to proyectos_url, notice: 'Proyecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @proyecto.destroy\n respond_to do |format|\n format.html { redirect_to proyectos_url, notice: 'Proyecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @proyecto.destroy\n respond_to do |format|\n format.html { redirect_to proyectos_url, notice: 'Proyecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @proyecto.destroy\n respond_to do |format|\n format.html { redirect_to proyectos_url, notice: 'Proyecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @proyecto.destroy\n respond_to do |format|\n format.html { redirect_to proyectos_url, notice: \"Proyecto was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @produto = Produto.find(params[:id])\n @produto.destroy\n\n respond_to do |format|\n format.html { redirect_to produtos_url }\n format.json { head :ok }\n end\n end", "def destroy\n @product2 = Product2.find(params[:id])\n @product2.destroy\n\n respond_to do |format|\n format.html { redirect_to product2s_url }\n format.json { head :no_content }\n end\n end", "def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end", "def destroy\n @product1.destroy\n respond_to do |format|\n format.html { redirect_to product1s_url, notice: \"Product1 was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @seguidore = Seguidore.find(params[:id])\n @seguidore.destroy\n\n respond_to do |format|\n format.html { redirect_to seguidores_url }\n format.json { head :ok }\n end\n end", "def destroy\r\n @proyect.destroy\r\n respond_to do |format|\r\n format.html { redirect_to proyects_url, notice: 'Proyect was successfully destroyed.' }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @coconut1.destroy\n respond_to do |format|\n format.html { redirect_to coconut1s_url, notice: 'Coconut1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @proyect = Proyect.find(params[:id])\n @proyect.destroy\n\n respond_to do |format|\n format.html { redirect_to(proyects_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @ministerio = Ministerio.find(params[:id])\n @ministerio.destroy\n\n respond_to do |format|\n format.html { redirect_to ministerios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @test_obj2 = TestObj2.find(params[:id])\n @test_obj2.destroy\n\n respond_to do |format|\n format.html { redirect_to(test_obj2s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @tuhu_prodoct.destroy\n respond_to do |format|\n format.html { redirect_to tuhu_prodocts_url, notice: 'Prodoct was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @consorciot.destroy\n respond_to do |format|\n format.html { redirect_to consorciots_url, notice: 'Consorciot was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @probando.destroy\n respond_to do |format|\n format.html { redirect_to probandos_url, notice: 'Probando was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @prodottos_operazione.destroy\n respond_to do |format|\n format.html { redirect_to controller: 'prodottos', action: 'show', id: @prodottos_operazione.id_prodotto }\n format.json { head :no_content }\n end\n end", "def destroy\n @retroaspecto = Retroaspecto.find(params[:id])\n @retroaspecto.destroy\n\n respond_to do |format|\n format.html { redirect_to retroaspectos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trein_consul_comercial.destroy\n respond_to do |format|\n format.html { redirect_to trein_consul_comercials_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @precioproducto = Precioproducto.find(params[:id])\n @precioproducto.destroy\n\n respond_to do |format|\n format.html { redirect_to precioproductos_url }\n format.json { head :ok }\n end\n end", "def destroy\n @sub1_line_item.destroy\n respond_to do |format|\n format.html { redirect_to sub1_line_items_url, notice: 'Sub1 line item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @bicepstricepshome3.destroy\n respond_to do |format|\n format.html { redirect_to bicepstricepshome3s_url, notice: 'Bicepstricepshome3 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @persona_proyecto.destroy\n respond_to do |format|\n format.html { redirect_to personas_proyectos_url, notice: 'Persona proyecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @pessoa = Pessoa.find(params[:id])\n @pessoa.destroy\n\n respond_to do |format|\n format.html { redirect_to pessoas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @produccion.destroy\n respond_to do |format|\n format.html { redirect_to produccions_url, notice: 'Produccion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @colegio = Colegio.find(params[:id])\n @colegio.destroy\n\n respond_to do |format|\n format.html { redirect_to colegios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @proceso_examan.destroy\n respond_to do |format|\n format.html { redirect_to proceso_examen_url, notice: 'Proceso examan was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @encuesta1.destroy\n respond_to do |format|\n format.html { redirect_to encuesta1s_url, notice: 'Encuesta1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @proyectos_user.destroy\n respond_to do |format|\n format.html { redirect_to proyectos_users_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @notification2.destroy\n respond_to do |format|\n format.html { redirect_to notification2s_url, notice: 'Notification2 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @voprosy = Voprosy.find(params[:id])\n @voprosy.destroy\n\n respond_to do |format|\n format.html { redirect_to voprosies_url }\n format.json { head :ok }\n end\n end", "def destroy\n @orden_proyecto.destroy\n respond_to do |format|\n format.html { redirect_to orden_proyectos_url, notice: 'Orden proyecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @puntaje = Puntaje.find(params[:id])\n @puntaje.destroy\n\n respond_to do |format|\n format.html { redirect_to puntajes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @level2.destroy\n respond_to do |format|\n format.html { redirect_to level2s_url, notice: 'Level2 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @promocion.destroy\n respond_to do |format|\n format.html { redirect_to promocions_url, notice: 'Promocion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @sivic_ministerio.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_ministerios_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end", "def delete(path)\n repository = path.split(/\\//)[2]\n objectid = path.split(/\\//)[3]\n if storage_fetch(repository, objectid) && storage_delete(repository, objectid)\n ['200', {}, []]\n else\n ['404', {}, [\"Repository #{repository} or ObjectID #{objectid} not found: #{path}\"]]\n end\n end", "def destroy\n @archivo_proyecto.destroy\n respond_to do |format|\n format.html { redirect_to archivo_proyectos_url, notice: 'Archivo proyecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @secubat_client = SecubatClient.find(params[:id])\n @secubat_client.destroy\n\n respond_to do |format|\n format.html { redirect_to secubat_clients_url }\n format.json { head :ok }\n end\n end", "def destroy\n @premio = Premio.find(params[:id])\n @premio.destroy\n\n respond_to do |format|\n format.html { redirect_to premios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @premio = Premio.find(params[:id])\n @premio.destroy\n\n respond_to do |format|\n format.html { redirect_to premios_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.68049335", "0.67074704", "0.66802436", "0.66765225", "0.66579705", "0.66567826", "0.6610583", "0.6585789", "0.65806866", "0.6578983", "0.6578791", "0.6541785", "0.652494", "0.65248084", "0.65207726", "0.6515599", "0.64962053", "0.64959675", "0.64946645", "0.64871144", "0.64781356", "0.64781034", "0.6475981", "0.6467761", "0.6467363", "0.64610463", "0.64566594", "0.6454566", "0.6454108", "0.64514613", "0.64448154", "0.6437164", "0.6435649", "0.6434434", "0.6434275", "0.64323926", "0.64323926", "0.6431415", "0.64281625", "0.6424513", "0.64197147", "0.6412032", "0.64095014", "0.6406999", "0.640594", "0.640594", "0.640594", "0.640594", "0.6405634", "0.64001334", "0.6399144", "0.63983667", "0.6397171", "0.6394071", "0.63898444", "0.6385221", "0.6385221", "0.6385221", "0.6385221", "0.6383411", "0.63812095", "0.63748926", "0.6370379", "0.63697505", "0.6369306", "0.6365304", "0.6365189", "0.6364929", "0.6363484", "0.63582516", "0.6357616", "0.6356533", "0.634739", "0.63469195", "0.63451874", "0.634052", "0.63399464", "0.6337397", "0.6337367", "0.6334481", "0.6333728", "0.6332086", "0.6327732", "0.6321791", "0.63167626", "0.63166285", "0.6315924", "0.6315374", "0.6314956", "0.63145447", "0.6314439", "0.63115805", "0.63103694", "0.63102686", "0.6308884", "0.6307172", "0.63050896", "0.63027143", "0.6298326", "0.6298326" ]
0.73682797
0
Use callbacks to share common setup or constraints between actions.
def set_proyectominero2 @proyectominero2 = Proyectominero2.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def set_actions\n actions :all\n end", "def define_action_helpers?; end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def workflow\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def setup\n # override and do something appropriate\n end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def save_action; end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def setup(&blk)\n @setup_block = blk\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def callback_phase\n super\n end", "def advice\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def duas1(action)\n action.call\n action.call\nend", "def _handle_action_missing(*args); end" ]
[ "0.6164095", "0.6046031", "0.5945298", "0.59179014", "0.58890367", "0.58341795", "0.5776118", "0.5700777", "0.5700777", "0.5656277", "0.56218207", "0.5423995", "0.5411516", "0.5411516", "0.5411516", "0.5395004", "0.53783494", "0.53593004", "0.53412604", "0.534078", "0.5332865", "0.53135896", "0.52999926", "0.5297309", "0.5296569", "0.5261449", "0.5247048", "0.52376497", "0.52376497", "0.52376497", "0.52376497", "0.52376497", "0.52323204", "0.52310973", "0.523081", "0.5225785", "0.5219039", "0.52136266", "0.5208033", "0.520763", "0.5177365", "0.5175224", "0.5173357", "0.5166104", "0.5162502", "0.51573396", "0.5154547", "0.5153531", "0.51502854", "0.51436496", "0.5142863", "0.51330835", "0.5115634", "0.5115634", "0.511527", "0.5109693", "0.51076853", "0.5093146", "0.5090683", "0.50829846", "0.50819314", "0.50670373", "0.5055505", "0.5053398", "0.50504035", "0.50504035", "0.5037765", "0.5027292", "0.5024484", "0.50150335", "0.5014069", "0.50022113", "0.5001542", "0.49981874", "0.49915564", "0.49915564", "0.49880967", "0.4982312", "0.49787375", "0.49786067", "0.49687737", "0.49676532", "0.49602765", "0.49565676", "0.49550772", "0.495342", "0.49522525", "0.49463704", "0.49447197", "0.49362713", "0.49328062", "0.49280638", "0.49272856", "0.4927058", "0.49221697", "0.4919526", "0.49185994", "0.49184805", "0.49170163", "0.49168405", "0.49167764" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def proyectominero2_params params.require(:proyectominero2).permit(:code, :name, :user_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def valid_params_request?; end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def url_whitelist; end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def url_params\n params[:url].permit(:full)\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.6979893", "0.6781746", "0.6746611", "0.6742344", "0.6735229", "0.6592651", "0.65027124", "0.6498011", "0.648163", "0.647716", "0.64556813", "0.64386255", "0.63784456", "0.63756156", "0.636574", "0.6319542", "0.63004524", "0.6299559", "0.62925464", "0.62923217", "0.6289894", "0.6289475", "0.62831545", "0.6242381", "0.6240358", "0.6217451", "0.6214354", "0.62098235", "0.61918235", "0.6177287", "0.61755854", "0.61712915", "0.61620486", "0.6151379", "0.61510575", "0.6145169", "0.61207956", "0.6115647", "0.6107701", "0.61030304", "0.60909295", "0.60797", "0.60701567", "0.6062068", "0.60203075", "0.60167485", "0.60125494", "0.6009718", "0.6007027", "0.6007027", "0.6000283", "0.59990394", "0.5996995", "0.59915864", "0.59914654", "0.59912056", "0.5979621", "0.596686", "0.5959418", "0.59585625", "0.59583765", "0.5958032", "0.5952298", "0.5951678", "0.5941885", "0.59378815", "0.59376645", "0.59376645", "0.5933908", "0.59302104", "0.5924862", "0.5923981", "0.59165645", "0.5909916", "0.590986", "0.5908378", "0.5904956", "0.5897421", "0.58970135", "0.5894611", "0.5893914", "0.58927566", "0.5891277", "0.5885355", "0.58825094", "0.58783555", "0.58728755", "0.58686864", "0.5867015", "0.58660764", "0.58659357", "0.5864526", "0.58634263", "0.5861585", "0.5861255", "0.5858771", "0.58579147", "0.5854071", "0.5853147", "0.58498794", "0.58492327" ]
0.0
-1
only when no has_ancestry
def stop_delete if self.id && self.id < 11 raise ActiveRecord::Rollback end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sane_ancestry?\n ancestry.nil? || (ancestry.to_s =~ Ancestry::ANCESTRY_PATTERN && !ancestor_ids.include?(self.id)) \n end", "def check_if_has_children\n self.lookups.count == 0\n end", "def ignore_parent_exclusion?; end", "def depthfirst?\n false\n end", "def ignore_parent_exclusion; end", "def is_childless?\n return call_ancestry_method(:is_childless?) if use_ancestry?\n\n relationships.all?(&:is_childless?)\n end", "def is_only_child?\n return call_ancestry_method(:is_only_child?) if use_ancestry?\n\n relationships.all?(&:is_only_child?)\n end", "def preserve_children?\n false\n end", "def leaf?; false end", "def hierarchical?\n false\n end", "def test_sort_by_ancestry_no_parents_siblings\n AncestryTestDatabase.with_model do |model|\n _, _, n3, n4, _, _ = build_tree(model)\n\n records = model.sort_by_ancestry(model.all.ordered_by_ancestry_and(:id => :desc).offset(3).take(2))\n assert_equal [n4, n3].map(&:id), records.map(&:id)\n end\n end", "def restricted?\n ancestors.any?{|p| p.children_restricted?}\n end", "def test_apply_orphan_strategy_custom_unsupported\n AncestryTestDatabase.with_model skip_ancestry: true do |model|\n model.class_eval do\n # needs to be defined before calling has_ancestry\n def apply_orphan_strategy_abc\n apply_orphan_strategy_destroy\n end\n\n has_ancestry orphan_strategy: :abc, ancestry_column: AncestryTestDatabase.ancestry_column\n end\n root = model.create!\n 3.times { root.children.create! }\n model.create! # a node that is not affected\n assert_difference 'model.count', -4 do\n root.destroy\n end\n end\n end", "def ancestors?\n read_attribute(self.ancestry_base_class.ancestry_column).present?\n end", "def has_children?\n return call_ancestry_method(:has_children?) if use_ancestry?\n\n relationships.any?(&:has_children?)\n end", "def leaf?\n self.children.size == 0\n end", "def root_relation?; !parent end", "def has_parent?\n not history.empty?\n end", "def has_children?\n false\n end", "def full_ancestry\n return id.to_s unless ancestry\n path_ids.join('/')\n end", "def has_children?\n self.children.size > 0 \n end", "def has_children?\n self.children.size > 0 \n end", "def has_children?\n self.children.size > 0 \n end", "def has_children?\n self.children.size > 0 \n end", "def has_siblings?\n return call_ancestry_method(:has_siblings?) if use_ancestry?\n\n relationships.any?(&:has_siblings?)\n end", "def index\n @blogs = Blog.all\n @parents = Category.all.where(ancestry: nil)\n # binding.pry\n # @grandchilds = Category.where(ancestry: \"1/3\")\n # @grandchilds2 = Category.where(ancestry: \"2/4\")\n end", "def is_subtree(root)\n\nend", "def test_sort_by_ancestry_missing_parent_middle_of_tree\n AncestryTestDatabase.with_model do |model|\n n1, _, _, n4, n5, _ = build_tree(model)\n\n records = model.sort_by_ancestry([n5, n4, n1])\n if CORRECT\n assert_equal [n1, n4, n5].map(&:id), records.map(&:id)\n else\n assert_equal [n1, n5, n4].map(&:id), records.map(&:id)\n end\n end\n end", "def leaf?; @leaf; end", "def test_sort_by_ancestry_no_parents_same_level\n AncestryTestDatabase.with_model do |model|\n _, _, n3, n4, n5, _ = build_tree(model)\n\n records = [n5, n4, n3]\n # records = model.sort_by_ancestry(model.all.ordered_by_ancestry_and(:id => :desc).offset(3).take(3))\n assert_equal [n5, n4, n3].map(&:id), records.map(&:id)\n end\n end", "def valid_tree?\n false\n end", "def ignore_parent_exclusion=(_arg0); end", "def recursive => nil", "def restrict_when_referenced\n return false if nodes.count > 0\n end", "def leaf?\n self.variations.size == 0\n end", "def has_neo4j_ancestry(options)\n \n link_class_name = 'Neo4jAncestry::Link'\n \n # Links (direct relationships between objects) are stored\n # via ActiveRecord in the mysql database. (The neo4j database contains only \n # redundant information and is used for fast queries.)\n #\n has_many :links_as_parent, foreign_key: :parent_id, class_name: link_class_name\n has_many :links_as_child, foreign_key: :child_id, class_name: link_class_name\n \n parent_class_names = options[:parent_class_names] || []\n child_class_names = options[:child_class_names] || []\n \n # links_as_child for specific parent object classes and\n # links_as_parent for specific child object classes, e.g.\n # group.links_as_child_for_groups\n # group.links_as_parent_for_groups\n # group.links_as_parent_for_users\n #\n parent_class_names.each do |parent_class_name|\n has_many_for_rails_3_and_4(\n \"links_as_child_for_#{parent_class_name.underscore.pluralize}\".to_sym,\n { parent_type: parent_class_name },\n { as: :child, class_name: link_class_name } )\n end\n child_class_names.each do |child_class_name|\n has_many_for_rails_3_and_4( \n \"links_as_parent_for_#{child_class_name.underscore.pluralize}\".to_sym, \n { child_type: child_class_name },\n { as: :parent, class_name: link_class_name } )\n end\n \n # parent and child associations for specific object classes, e.g.\n # group.parent_groups\n # group.child_groups\n # group.child_users\n #\n parent_class_names.each do |parent_class_name|\n has_many( \n \"parent_#{parent_class_name.underscore.pluralize}\".to_sym, \n through: \"links_as_child_for_#{parent_class_name.underscore.pluralize}\".to_sym, \n as: :structureable, \n foreign_key: :parent_id, source: 'parent', \n source_type: parent_class_name )\n end\n child_class_names.each do |child_class_name|\n has_many( \n \"child_#{child_class_name.underscore.pluralize}\".to_sym, \n through: \"links_as_parent_for_#{child_class_name.underscore.pluralize}\".to_sym, \n as: :structureable, \n foreign_key: :child_id, source: 'child', \n source_type: child_class_name )\n end\n \n # ancestors and descendants for certain types of objects, e.g.\n # group.ancestor_groups\n # group.descendant_users\n #\n parent_class_names.each do |parent_class_name|\n define_method(\"ancestor_#{parent_class_name.underscore.pluralize}\") do |options = {}|\n ancestors(options.merge({ type: parent_class_name }))\n end\n end\n child_class_names.each do |child_class_name|\n define_method(\"descendant_#{child_class_name.underscore.pluralize}\") do |options = {}|\n descendants(options.merge({ type: child_class_name }))\n end\n end\n \n # Copy the name attribute to the neo4j nodes.\n # Other attributes can be copied as well by using the 'attributes_to_copy_to_neo4j', later.\n # \n attributes_to_copy_to_neo4j :name\n \n # Include the instance methods for interaction with the neo4j graph.\n #\n include Neo4jAncestry::NodeInstanceMethods\n \n # Callbacks to synchronize from ActiveRecord to Neo4j.\n after_save :create_or_update_neo_node\n before_destroy :destroy_neo_node_and_relations\n \n end", "def has_children?\n !self.children.empty?\n end", "def getParentCategory()\n self.level == 1 ? false : Category.find(self.parent_category_id)\nend", "def ancestors; end", "def ancestors; end", "def ancestors; end", "def ancestors; end", "def children_exist?\n\tend", "def has_parents?\n \n return ! @parents.empty?\n \n end", "def has_parents?\n \n return ! @parents.empty?\n \n end", "def test_sort_by_ancestry_with_block_no_parents_all_children\n AncestryTestDatabase.with_model :extra_columns => {:rank => :integer} do |model|\n _, _, n3, n4, n5, n6 = build_ranked_tree(model)\n\n records = model.sort_by_ancestry(model.all.ordered_by_ancestry_and(:rank).offset(2), &RANK_SORT)\n if CORRECT || records[0] == n5\n assert_equal [n5, n3, n4, n6].map(&:id), records.map(&:id)\n else\n assert_equal [n4, n6, n5, n3].map(&:id), records.map(&:id)\n end\n end\n end", "def allowed_children; end", "def has_children?\n !leaf?\n end", "def ancestors_affected\n ancestors\n end", "def has_parent?\n !root?\n end", "def include_root?\n min_depth == 0\n end", "def ancestors() end", "def non_relational?\n ancestors.include?(NonRelational)\n end", "def ignore_children!\n @ignoring_children += 1\n end", "def is_leaf\n true\n end", "def is_leaf\n true\n end", "def ancestry=(value)\n if value == \"\"\n write_attribute(:ancestry, nil)\n else\n write_attribute(:ancestry, value)\n end\n end", "def matching_ancestors; end", "def has_children?\n self.children.size > 0\n end", "def has_children?\n self.children.size > 0\n end", "def has_children?\n self.children.size > 0\n end", "def has_children?\n self.children.size > 0\n end", "def possible_branch_nodes\r\n max_depth = max_category_depth\r\n article_categories.select {|ac| ac.parent_id.nil? || (ac.depth < max_depth)}\r\n end", "def parent?\n !children.empty?\n end", "def compute_ancestry(node)\n\n\t\t# compute ancestry and ancestry links\n\t\tif node.nav_level > 0\n\t\t\n\t\t\tancestors = node.link.split(\"/\")\n\t\t\tancestors.pop\n\t\t\tancestors_links = []\n\t\n\t\n\t\t\talink = node.link.dup\n\t\t\twhile alink.index(\"/\")\n\t\t\t\tancestors_links << alink.dup\n\t\t\t\talink = alink[0..(alink.rindex(\"/\") - 1)]\n\t\t\tend\t\t\t \n\t\t\tancestors_links << alink.dup\n\t\n\t\t\tancestors_links.reverse!.pop\n\t\n\t\tend\n\t\n\t\tnode.ancestors = ancestors.uniq if ancestors\n\t\tnode.ancestors_links = ancestors_links.uniq if ancestors\n\t\n\t\treturn node\n\tend", "def replied_to?\n self.children.length > 0\n end", "def stronger\n ancestors\n end", "def self_and_siblings\n parent ? parent.children : Category.roots\n end", "def self_and_siblings\n parent ? parent.children : Category.roots\n end", "def roots\n self.find(:all, :conditions => \"(#{acts_as_nested_set_options[:scope]} AND #{acts_as_nested_set_options[:parent_column]} IS NULL)\", :order => \"#{acts_as_nested_set_options[:left_column]}\")\n end", "def descendants_affected\n descendants\n end", "def unknown?\n !root? && !child?\n end", "def unknown?\n !root? && !child?\n end", "def unknown?\n !root? && !child?\n end", "def test_depth_value_not_exist\n @tree.insert(\"c\")\n refute_equal 0, @tree.depth_of?(\"a\")\n end", "def root\n self.find(:first, :conditions => \"(#{acts_as_nested_set_options[:scope]} AND #{acts_as_nested_set_options[:parent_column]} IS NULL)\")\n end", "def leaf?\n children.empty?\n end", "def parentable?\n false\n end", "def branches\n if ancestor_ids.empty? then\n nil\n else\n read_attribute(self.base_class.ancestry_column).to_s.split(',')\n end\n end", "def test_return_method_falsey\n @tree.insert(\"b\")\n @tree.insert(\"a\")\n refute_equal true, @tree.includes?(\"c\")\n end", "def relevant?\n existing_subtree_players.size > 0\n end", "def if_ancestor_or_self\n local_page_id = self[:id].to_s\n ids = @global_page.ancestor_ids + [@global_page.id.to_s]\n ids.include?(local_page_id)\n end", "def leaf?\n true\n end", "def roots\n self.class.find(:all, :conditions => \"#{acts_as_nested_set_options[:scope]} AND (#{acts_as_nested_set_options[:parent_column]} IS NULL)\", :order => \"#{acts_as_nested_set_options[:left_column]}\")\n end", "def useless?\n content.nil? and children.empty?\n end", "def has_parent?\n !parent_context.nil?\n end", "def has_children?\n self.children.any?\n end", "def has_children?\n self.children.any?\n end", "def has_children?\n self.children.any?\n end", "def has_children?\n self.children.any?\n end", "def has_children?\n self.children.any?\n end", "def has_children?\n self.children.any?\n end", "def has_children?\n self.children.any?\n end", "def has_children?\n self.children.any?\n end", "def has_children?\n self.children.any?\n end", "def children?\n self.children.any?\n end", "def test_node_1_has_0_ancestors_after_building_ancestors_ids_attribute\n id=1\n assert_equal 0, find_node(id).ancestors.size\n assert find_node(id).update_ancestor_ids\n assert_equal 0, find_node(id).ancestors.size\n end", "def cache_ancestry\n self.names_depth_cache = path.map(&:name).join('/')\n end", "def children() []; end", "def all_children(special=nil)\n if special && special[:exclude]\n transaction do\n # exclude some items and all their children\n special[:exclude] = [special[:exclude]] if !special[:exclude].is_a?(Array)\n # get objects for ids\n special[:exclude].collect! {|s| s.is_a?(self.class) ? s : self.class.find(s)}\n # get all subtrees and flatten the list\n exclude_list = special[:exclude].map{|e| e.full_set.map{|ee| ee.id}}.flatten.uniq.join(',')\n if exclude_list.blank?\n self.class.find(:all, :conditions => \"#{acts_as_nested_set_options[:scope]} AND (#{acts_as_nested_set_options[:left_column]} > #{self[acts_as_nested_set_options[:left_column]]}) and (#{acts_as_nested_set_options[:right_column]} < #{self[acts_as_nested_set_options[:right_column]]})\", :order => acts_as_nested_set_options[:left_column])\n else\n self.class.find(:all, :conditions => \"#{acts_as_nested_set_options[:scope]} AND id NOT IN (#{exclude_list}) AND (#{acts_as_nested_set_options[:left_column]} > #{self[acts_as_nested_set_options[:left_column]]}) and (#{acts_as_nested_set_options[:right_column]} < #{self[acts_as_nested_set_options[:right_column]]})\", :order => acts_as_nested_set_options[:left_column])\n end\n end\n else\n self.class.find(:all, :conditions => \"#{acts_as_nested_set_options[:scope]} AND (#{acts_as_nested_set_options[:left_column]} > #{self[acts_as_nested_set_options[:left_column]]}) and (#{acts_as_nested_set_options[:right_column]} < #{self[acts_as_nested_set_options[:right_column]]})\", :order => acts_as_nested_set_options[:left_column])\n end\n end", "def parentage\n get_parents unless @already_fetched_parents\n @already_fetched_parents = true\n super\n end" ]
[ "0.72967345", "0.6931421", "0.6699044", "0.66153926", "0.65838563", "0.65785754", "0.64663476", "0.63657194", "0.63316566", "0.63075984", "0.63063943", "0.62869793", "0.6229176", "0.62248117", "0.6205661", "0.61984026", "0.6147501", "0.6141672", "0.6138268", "0.6112276", "0.6065978", "0.6065978", "0.6065978", "0.6065978", "0.6065899", "0.6064361", "0.60574716", "0.60395086", "0.60125196", "0.6012386", "0.59953016", "0.5993186", "0.59925514", "0.5991271", "0.59654963", "0.595056", "0.5946034", "0.5939364", "0.592777", "0.592777", "0.592777", "0.592777", "0.592603", "0.5924391", "0.5924391", "0.59223866", "0.59054387", "0.5902499", "0.58992916", "0.58984905", "0.58952415", "0.5890439", "0.58869433", "0.58740175", "0.5869888", "0.5869888", "0.5868056", "0.5859494", "0.58496636", "0.58496636", "0.58496636", "0.58496636", "0.5848614", "0.5847373", "0.5840974", "0.5837468", "0.58311635", "0.5828194", "0.5828194", "0.5824646", "0.5791692", "0.5769541", "0.5769541", "0.5769541", "0.57598263", "0.57562524", "0.5754816", "0.5753547", "0.57508534", "0.57444596", "0.5735511", "0.57325745", "0.57287526", "0.57270765", "0.57191074", "0.5714864", "0.57130855", "0.57130855", "0.57130855", "0.57130855", "0.57130855", "0.57130855", "0.57130855", "0.57130855", "0.57130855", "0.5708683", "0.5708045", "0.5707866", "0.57065004", "0.5705541", "0.5699988" ]
0.0
-1
Returns the current Redis connection. If none has been created, will create a new one.
def redis return @redis if @redis self.redis = 'localhost:6379' self.redis end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def redis\n parms =\n {\n :host => @host,\n :port => @port,\n :db => @database\n }\n\n $_redis_connection ||= Redis.new(parms)\n end", "def connect\n @redis ||= create\n end", "def connection\n RedisModel::Base.connection\n end", "def generate_redis_connection!\n redis_options ? Redis.new(**redis_options) : Redis.current\n end", "def redis\n @redis ||= Redis.connect\n end", "def redis_connection(name)\n name = name.to_s\n config = redis_config_by_name(name)\n ConnectionWrapper.new(self, name, config)\n end", "def redis_pool\n @redis ||= Redlics::Connection.create(config.to_h)\n end", "def redis\n return @redis if @redis\n self.redis = Redis.respond_to?(:connect) ? Redis.connect : \"localhost:6379\"\n end", "def redis\n @redis ||= Redis.new\n end", "def redis\n @redis ||= Redis.new\n end", "def redis\n @redis ||= Redis.new\n end", "def redis\n return @redis if @redis\n self.redis = Redis.respond_to?(:connect) ? Redis.connect : \"localhost:6379\"\n self.redis\n end", "def redis\n return @redis if @redis\n self.redis = Redis.respond_to?(:connect) ? Redis.connect : \"localhost:6379\"\n self.redis\n end", "def redis\n return @redis if @redis\n self.redis = Redis.respond_to?(:connect) ? Redis.connect : \"localhost:6379\"\n self.redis\n end", "def redis_connections\n @redis_connections ||= Stockpile::RedisConnectionsFactory.build_connections\n end", "def redis\n @@redis ||= Redis.new\n end", "def redis\n @redis ||= Redis.new url: LcEnv.redis_url\n end", "def redis\n @redis || init\n end", "def redis\n @myredis || ::Redis::Objects.redis\n end", "def get_instance\n @redis\n end", "def redis\n @redis ||= begin\n redis = Redis.new(config.redis)\n Redis::Namespace.new(REDIS_NAMESPACE, redis: redis)\n end\n end", "def connection\n if defined?(@active_connection_name) && (conn = active_connections[@active_connection_name])\n conn\n else\n # retrieve_connection sets the cache key.\n conn = retrieve_connection\n active_connections[@active_connection_name] = conn\n end\n end", "def redis_connection_pool\n @redis_connection_pool ||= Stockpile::RedisConnection.connection_pool\n end", "def client\n @redis\n end", "def redis\n Redis.current\nend", "def redis\n @redis ||= EM::Protocols::Redis.connect(@config)\n end", "def redis\n return @redis if @redis\n self.redis = config.redis.host('localhost:6379')\n self.redis\n end", "def redis\n @redis ||= begin\n redis = Redis.new(config.redis)\n Redis::Namespace.new(REDIS_NAMESPACE, redis: redis).tap do |client|\n begin\n client.ping\n rescue Redis::BaseError => e\n if Lita.test_mode?\n raise RedisError, I18n.t(\"lita.redis.test_mode_exception\", message: e.message)\n else\n Lita.logger.fatal I18n.t(\n \"lita.redis.exception\",\n message: e.message,\n backtrace: e.backtrace.join(\"\\n\")\n )\n abort\n end\n end\n end\n end\n end", "def redis\n @redis ||= begin\n redis = Redis.new(config.redis)\n Redis::Namespace.new(REDIS_NAMESPACE, redis: redis).tap do |client|\n begin\n client.ping\n rescue Redis::BaseError => e\n if Lita.test_mode?\n raise RedisError, I18n.t(\"lita.redis.test_mode_exception\", message: e.message)\n else\n logger.fatal I18n.t(\n \"lita.redis.exception\",\n message: e.message,\n backtrace: e.backtrace.join(\"\\n\")\n )\n abort\n end\n end\n end\n end\n end", "def connection #:nodoc:\n Thread.current['connection'] ||= retrieve_connection\n Thread.current['connection']\n end", "def client\n Exchange::GemLoader.new('redis').try_load unless defined?(::Redis)\n @client ||= ::Redis.new(:host => config.host, :port => config.port)\n end", "def redis\n @redis ||= Redis.new(\n url: Pantry.configuration.redis_uri,\n driver: :hiredis)\n end", "def connection_manager\n @manager ||= (connection_base? ? Redis::ConnectionManager.new(@connection_specification) : superclass.connection_manager)\n end", "def redis\n return @redis if @redis\n self.redis = ENV['RELATED_REDIS_URL'] || ENV['REDIS_URL'] || 'localhost:6379'\n self.redis\n end", "def connection\n @connection ||= make_connection\n end", "def redis\n @redis ||= if @redis_config.nil? || @redis_config.kind_of?(String)\n url = URI(@redis_config || \"redis://127.0.0.1:6379/0\")\n\n Updater.check_schema(Redis.new({\n :host => url.host,\n :port => url.port,\n :db => url.path[1..-1],\n :password => url.password\n }))\n else\n Updater.check_schema(@redis_config)\n end\n end", "def redis\n return @redis if @redis\n self.redis = self.configuration.redis\n self.redis\n end", "def connection\n # this is correctly done double-checked locking\n # (ThreadSafe::Cache's lookups have volatile semantics)\n @reserved_connections[current_connection_id] || synchronize do\n @reserved_connections[current_connection_id] ||= checkout\n end\n end", "def connection\n connection_id = current_connection_id\n unless conn = @reserved_connections.fetch(connection_id, nil)\n synchronize do\n conn = ( @reserved_connections[connection_id] ||= checkout )\n end\n end\n conn\n end", "def with &block\n @redis ||= ConnectionPool.new(POOL_CONF){ new_redis }\n @redis.with &block\n end", "def redis\n return @redis if @redis\n\n @redis = if @options[:redis]\n @options[:redis]\n elsif @options[:url]\n uri = URI.parse(@options[:url])\n Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)\n else\n Redis.new(:host => @options[:host], :port => @options[:port], :password => @options[:password])\n end\n end", "def redis(new: false)\n params = {}\n params.merge!(url: ENV['REDIS_URL']) if ENV.key?('REDIS_URL')\n params.merge!(path: ENV['REDIS_PATH']) if ENV.key?('REDIS_PATH')\n\n if new\n Redis.new(**params)\n else\n @redis ||= Redis.new(**params)\n end\n end", "def connection\n @connection = create_connection! unless connected?\n @connection\n end", "def redis\n self.class.redis\n end", "def redis\n self.class.redis\n end", "def connection\n @connection ||= build_connection\n end", "def connection\n @connection ||= Connection.new(nil)\n end", "def connect_redis()\n log.trace \"connect_redis - Create connection if non existant\"\n if !@redis\n begin\n @redis=Redis.new(host:@hostaddr,port:@port,connect_timeout:@connection_timeout,reconnect_attempts:@reconnect_attempts)\n log.debug \"Connected to Redis \"[email protected]?.to_s\n rescue Redis::BaseConnectionError, Redis::CannotConnectError => conn_err\n log.error \"Connection error - \", conn_err.message, \"\\n connection timeout=\", @connection_timeout, \"\\n connection attempts=\", @reconnect_attempts\n @redis = nil\n return nil\n rescue => err\n log.error \"Error connecting to redis - \", err.message, \"|\",err.class.to_s\n @redis = nil\n return nil\n end\n end\n end", "def pool\n pool_connection = ConnectionPool.new(size: 10, timeout: 5) do \n Redis.new :db=> redis_db_index, :password=> redis_instance.password, :host=> redis_instance.host, :port=> redis_instance.port\n end \n return pool_connection \n end", "def redis\n $redis\n end", "def connection\n raise ConnectionNotEstablished unless @@connection\n return @@connection\n end", "def redis\n Resque.redis\n end", "def connection\n @connection || Connection.new\n end", "def redis\n @redis ||= (self['redis'] || {}).symbolize_keys\n end", "def redis_pool\n @redis_pool ||= config_redis_pool\n end", "def conn\n\t\treturn @conn ||= self.connect\n\tend", "def connect_redis()\n log.trace \"connect_redis called\"\n if !@redis\n begin\n log.trace \"initialize redis \", @hostaddr,\":\",@port\n @redis=Redis.new(host:@hostaddr,port:@port,connect_timeout:5,reconnect_attempts:2)\n log.trace \"redis object initialized\"\n log.debug \"Connected to Redis \"[email protected]?.to_s\n rescue Redis::BaseConnectionError, Redis::CannotConnectError => conn_err\n log.error \"Connection error - \", conn_err.message, \"\\n connection timeout=\", @connection_timeout, \"\\n connection attempts=\", @reconnect_attempts\n @redis = nil\n rescue => err\n log.error \"Error connecting to redis - \", err.message, \"|\",err.class.to_s\n @redis = nil\n return nil\n end\n end\n end", "def ensure_redis_connection\n self.redis = Redis.new(:host => self.redis_host, :port => self.redis_port)\n ensure_cache_up_to_date\n rescue Errno::ECONNREFUSED\n raise RedisConnectionError.new(\"Unable to connect to redis\")\n end", "def with_redis_connection(default_rescue_value: nil)\n if redis_pool\n redis_pool.with do |redis|\n yield redis\n end\n else\n yield single_redis\n end\n rescue Errno::ECONNREFUSED, Redis::CannotConnectError => e\n on_redis_down.call(e) if on_redis_down\n default_rescue_value\n end", "def redis\n Resque.respond_to?(:redis) ? Resque.redis : Resque.backend.store\n end", "def connection\n retrieve_connection\n end", "def redis\n RedisRecord::Backend::redis_server\n end", "def redis_info\n @redis_info ||= redis.info\n end", "def connection(options={})\n raise NoToken if @token.to_s.empty?\n\n @connections ||= {}\n\n cached_connection? && !protocol_changed? ? cached_connection : new_connection\n end", "def discover\n redis = Redis.current\n redis.ping rescue start(redis)\n redis\n end", "def redis_pool\n Rails.redis_pool\n end", "def redis(r_pool = nil, &block)\n r_pool ||= defined?(redis_pool) ? redis_pool : r_pool\n if r_pool\n r_pool.with(&block)\n else\n Sidekiq.redis(&block)\n end\n end", "def connect\n @client = Redis.new(host: @host, port: @port)\n @logger.info(\"Connecting to database #{@host}:#{@port}\")\n end", "def retrieve\n session = session_from_redis\n return session if session.present?\n\n establish_chip_session\n end", "def connection\n if conn = @reserved_connections[current_connection_id]\n conn\n else\n @reserved_connections[current_connection_id] = checkout\n end\n end", "def redis_config\n @redis_config ||= begin\n config = ActiveRecord::Base.connection_config[:redis].with_indifferent_access\n config[:logger] = Rails.logger if config.delete(:debug)\n require 'redis/namespace' if config[:namespace]\n config\n end\n end", "def get_connection\n return @db_connection if @db_connection\n mongo_client = MongoClient.new(\"localhost\", 27017)\n @db_connection = mongo_client.db(\"robocoder2\")\n end", "def session_from_redis\n redis_handler.get\n end", "def initialize(redis_connection) \n @redis = redis_connection\n end", "def initialize\n @redis = Redis.new(host: 'redis', port: 6379)\n end", "def get_cache_object\n return @cache_obj unless @cache_obj == nil\n @cache_obj = ChaiIo::Cache::RedisCache.new\n @cache_obj\n end", "def conn\n #if @conn exists and is open\n if @conn and begin @conn.status rescue PGError false end then\n return @conn\n else\n return @conn = connect_to_database\n end\n end", "def conRed\n begin\n puts \"Connecting to Redis...\"\n @redis = Redis.new( host: @@opts[:redis_host].chomp, port: @@opts[:redis_port])\n @redis.ping\n rescue Errno::ECONNREFUSED => e\n puts \"Error: Redis server unavailable. Shutting down...\"\n e.message\n e.inspect\n exit 1\n end\n end", "def redis\n raise ArgumentError, 'requires a block' unless block_given?\n redis_pool.with do |conn|\n retryable = true\n begin\n yield conn\n rescue Redis::BaseError => e\n raise e unless config.silent\n rescue Redis::CommandError => ex\n (conn.disconnect!; retryable = false; retry) if retryable && ex.message =~ /READONLY/\n raise unless config.silent\n end\n end\n end", "def redis(uri=nil)\n if Integer === uri\n tmp = Familia.uri\n tmp.db = uri\n uri = tmp\n elsif String === uri\n uri &&= URI.parse uri\n end\n uri ||= Familia.uri\n connect(uri) unless @clients[uri.serverid] \n @clients[uri.serverid]\n end", "def connection\n #@pool ||= {}\n #@pool[Thread.current] ||= Mongoc::Client.new(host, port, :pool_size=>@pool_size)\n #Mongoc::Client.new(host, port, {})\n Thread.current[:_mongo] ||= Mongoc::Client.new(host, port, {})\n end", "def connection\n @connection ||= if authenticated?\n RestClient::Resource.new(api_uri.to_s, @username, @password)\n else\n RestClient::Resource.new(api_uri.to_s)\n end\n end", "def new_connection\n old_db_id = @db.nil? ? 0 : @db.object_id\n @db.disconnect! unless @db.nil?\n\n @db = ActiveRecord::Base.mysql2_connection(@db_config)\n\n new_db_id = @db.object_id\n logger.info(\"New cache db connection - old db id was: #{old_db_id} -- new db id is: #{new_db_id}\")\n\n return @db\n end", "def with_redis(&block)\n redis_pool.with(&block)\n end", "def connection\n return nil unless has_connection?\n ActiveRecord::Base.connection\n end", "def get\n self.class.client.get REDIS_KEY\n end", "def connect\n @connection_pool.get_connection\n end", "def initialize\r\n @redis = Redis.new(:host => REDIS_HOST, :port => REDIS_POST)\r\n @redis.select REDIS_DB_NUM\r\n end", "def connection\n @connection ||= Bunny.new RabidMQ::Config.load_config\n end", "def connection\n @reserved_connections[current_connection_id] ||= checkout\n end", "def cache\n $Redis\n end", "def redis_command\n if redis.empty?\n # Default to old method of connecting to redis\n # for users that haven't updated their configuration\n %W(env -i redis-cli)\n else\n redis['database'] ||= 0\n redis['host'] ||= '127.0.0.1'\n redis['port'] ||= '6379'\n if redis.has_key?(\"socket\")\n %W(#{redis['bin']} -s #{redis['socket']} -n #{redis['database']})\n else\n if redis.has_key?(\"pass\")\n %W(#{redis['bin']} -h #{redis['host']} -p #{redis['port']} -n #{redis['database']} -a #{redis['pass']})\n else\n %W(#{redis['bin']} -h #{redis['host']} -p #{redis['port']} -n #{redis['database']})\n end\n end\n end\n end", "def fake_redis!\n @@redis = Redis.new(host: ENV['REDIS_HOST'])\n end", "def channel\n return @channel if @channel && [email protected]?\n @channel = connect.create_channel\n rescue Bunny::ChannelAlreadyClosed => e\n reconnect\n end", "def client\n set_connection unless @client\n @client\n end", "def default_connection\r\n raise NotConnected unless connected?\r\n\t\t\t\t\treturn @connections.last\r\n\t\t\t\tend", "def conn\n @conn ||=\n begin\n if @@require_pg\n require 'pg'\n @@require_pg = false\n end\n initialize_copy nil\n c = PG.connect(arguments)\n @conn_owned = true if c\n c\n end\n end", "def connection\n @connection_pool\n end", "def with\n yield @redis\n end", "def connection\n @@connection\n end" ]
[ "0.79104745", "0.76783204", "0.7637821", "0.754402", "0.75320333", "0.73548406", "0.73410505", "0.7291144", "0.7287146", "0.7287146", "0.7287146", "0.7246972", "0.7246972", "0.7246972", "0.71933687", "0.7147105", "0.7142247", "0.70780224", "0.70723706", "0.7068234", "0.7038217", "0.6995123", "0.6982236", "0.69787663", "0.6925175", "0.69002783", "0.6892697", "0.6864545", "0.68617237", "0.6857605", "0.6843923", "0.6820602", "0.67807573", "0.67597544", "0.67346007", "0.6711883", "0.6689923", "0.66531605", "0.66394275", "0.6637134", "0.6634087", "0.6591444", "0.6552198", "0.6496092", "0.6496092", "0.6495507", "0.6483878", "0.6481485", "0.6472237", "0.646856", "0.64471257", "0.6443332", "0.63989687", "0.637054", "0.6369499", "0.63061625", "0.63007325", "0.62827814", "0.62530375", "0.6240288", "0.6226325", "0.6219934", "0.6211752", "0.6199946", "0.6198624", "0.61722463", "0.6167303", "0.61459804", "0.6130731", "0.6100711", "0.60933226", "0.6088312", "0.6085247", "0.6077621", "0.6052265", "0.6036038", "0.60157704", "0.59844416", "0.5975816", "0.5967505", "0.59522873", "0.59516156", "0.5947824", "0.5941699", "0.59375846", "0.5914291", "0.59122676", "0.58963555", "0.58756965", "0.5874583", "0.5866991", "0.58552086", "0.58470255", "0.5841666", "0.58301526", "0.5827889", "0.58273274", "0.5821298", "0.580799", "0.57944125" ]
0.69234115
25
O(n^2) which is quadratic time!
def okay_two_sum?(arr, target_sum) sorted = arr.sort sorted.each_with_index do |num, idx| target = target_sum - num return true if binary_search(sorted, target, num) end false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_dublicate(array)\n sum = 1000000*(1000000+1)/2 # (n*(n+1))/2\n array.each do |el| \n sum -= el\n end\n return sum\nend", "def solution(a)\r\n n=a.size\r\n i=1\r\n for k in a.sort do\r\n\tif k!=i \r\n\t then \r\n\t return 0\r\n\t break;\r\n\tend\r\n i+=1;\r\n end\t\r\n return 1 if a.inject(:+) ==n*(n+1)/2;\r\nend", "def my_min_2(list)\r\n min = 0 # O(1)\r\n \r\n list.each do |ele| # O(n) \r\n if ele < min # O(1)\r\n min = ele # O(1)\r\n end\r\n end\r\n min # O(1) \r\nend", "def largest_subsum(list)\n max = list[0] # O(1)\n current_sum = list[0] # O(1)\n\n (1...list.length).each do |i| # O(n)\n # debugger\n if current_sum < 0 # O(1)\n current_sum = 0 # O(1)\n end \n current_sum += list[i] # O(1)\n if current_sum > max # O(1)\n max = current_sum # O(1)\n end\n end\n\n max # O(1)\n\nend", "def sub_sum(list)\n sub_arr = []\n (0...list.length).each do |i| #O(n)\n (i...list.length).each do |j| #O(n)\n sub_arr << list[i..j] if i <= j\n end\n end\n largest_continuous_sub_sum1(sub_arr)\nend", "def my_min_2(array)#O(n)\n array.inject do |acc, ele|#O(n)\n if acc < ele\n acc\n else\n ele\n end\n end\nend", "def okay_two_sum?(arr, target)\n arr = arr.sort #n log n\n (0...arr.length).each do |i| #n\n search = bsearch(arr, target-arr[i]) # log n\n return true unless search.nil?\n end #n log n\n false\nend", "def solution(a)\n n = a.size\n return 0 unless n > 2\n a.sort!\n\n (2..n - 1).each do |i|\n return 1 if a[i - 2] + a[i - 1] > a[i]\n end\n\n return 0\nend", "def my_min(list) \n\n list.each_with_index do |ele, i| #O(n)\n compare_arr = list[0...i] + list[i+1..-1] # O(2n) \n return ele if compare_arr.all? { |ele2| ele < ele2 } #O(n)\n end\n\n #time complexity = O(n^2) + O(2n)\n\nend", "def solution(a)\n # In production environment this will be my solution:\n # a.uniq.size\n #\n # But since this is a coding challenge, my assumption\n # is that you're looking for a by-hand O(N*logN) solution\n\n return 0 if a.empty?\n\n n = a.size\n ary = a.sort\n uniques = 1\n (1...n).each do |i|\n uniques += 1 if ary[i] != ary[i - 1]\n end\n uniques\nend", "def findDiffSquares(n)\n sum = 0\n (1..n).each { |i|\n (1..n).each { |j|\n sum += i*j unless i == j\n }\n }\n sum\nend", "def solution(a)\n n = a.size\n a.sort!\n\n count = 0\n for i in 0...n-2 do\n k = i+2\n for j in i+1...n-1 do\n while k < n and a[i] + a[j] > a[k] do\n k += 1\n end\n count += k - j - 1\n end\n end\n count\nend", "def three_sum_fastest(arr)\n count = 0\n\n (0..arr.length - 2).each { |i|\n set = Set.new\n\n (i + 1..arr.length - 1).each { |j|\n if set.include?(-arr[i] - arr[j])\n count += 1\n end\n\n set.add(arr[j])\n }\n }\n count\nend", "def largest_contiguous_subsum_2(list)# [2, 3, -6, 7, -6, 7]\n largest_num = list[0]#2 O(1)\n running_sum = list[0]#2 - 5 after entering loop. O(1)\n\n (1...list.length).each do |i| #O(n) \n running_sum = 0 if running_sum < 0 #O(1)\n running_sum += list[i] #O(1)\n largest_num = running_sum if running_sum > largest_num #O(1)\n end\n return largest_num #O(1)\nend", "def solution(m, a)\n n = a.count\n result = 0\n front = 0\n numbers = Array.new(m + 1, false)\n n.times { |back|\n while front < n and not numbers[a[front] - 1]\n numbers[a[front] - 1] = true\n front += 1\n result += front - back\n return 1_000_000_000 if result >= 1_000_000_000\n end\n numbers[a[back] - 1] = false\n }\n result\nend", "def solution(a)\n n = a.size\n passing_cars = 0\n\n suffix_sums = Array.new(n + 1, 0)\n\n a.reverse.each_with_index do |elem, i|\n suffix_sums[i + 1] = suffix_sums[i] + elem\n end\n suffix_sums.reverse!\n\n a.each_with_index do |car, i|\n if car == 0\n passing_cars += suffix_sums[i]\n end\n end\n\n passing_cars > 1_000_000_000 ? -1 : passing_cars\nend", "def fds(n)\n\n # arr = []\n # (n + 1).times.each{|e| arr << e if e > 0}\n # arr.flat_map.reduce(:*)\n # arr.flat_map.reduce(:*).to_s.split(//).map(&:to_i).reduce(:+)\n (1..n).to_a.flat_map.reduce(:*).to_s.split(//).map(&:to_i).reduce(:+)\n\nend", "def sorted_squares(nums)\n # This takes O(n)\n nums.map! { |num| num**2 }\n # This can take Ο(n logn)\n bubble_sort(nums)\nend", "def find_amicables(n)\n pairs = []\n sum = 0\n for i in 0..n do \n next if pairs.include? i\n d = sum_proper_divisors(i)\n next if d == i\n p = sum_proper_divisors(d)\n if p == i \n pairs << d\n pairs << i\n sum += d + i\n end\n end\n return sum\nend", "def naive(array)\n max = -10000\n for i in (0..array.length - 1)\n for j in (i..array.length - 1)\n total = array[i..j].inject { |m,k| m + k }\n max = total if total > max\n end\n end\n max\nend", "def largest_contiguous_subsum(arr) #BigO of O(n)\n max = 0 \n current_sum = 0\n arr.each_with_index do |el,idx|\n if current_sum + el >= el \n current_sum += el \n else \n current_sum = el \n end \n max = current_sum if current_sum > max \n end \n max\nend", "def largest_contiguous_subsum2(list)\n # O(N) ==> Time\n # O(1) ==> Space\n largest = list.first\n curr = list.first\n\n len = list.length\n (1...len).each do |i|\n curr = 0 if curr < 0 \n curr += list[i]\n largest = curr if curr > largest\n end\n largest\nend", "def sub_sum(list)\n array = []\n (0...list.length).each do |idx1|\n (idx1...list.length).each do |idx2|\n array << list[idx1..idx2] #O(n)\n end\n end \n array.map {|sub| sub.length > 1 ? sub.sum : sub.first}.max\nend", "def seesaw?(arr)\n left_sum = 0\n arr.each_index do |i| #O(n)\n if i > 0\n left_sum = arr[0...i].reduce(:+) #O(n)\n end\n if i < arr.size-1\n right_sum = arr[i+1..-1].reduce(:+); #O(n)\n else\n right_sum = 0\n end\n if left_sum == right_sum\n return true\n end\n end\n return false\nend", "def solution(n)\n x = (n**0.5).floor\n (1..x).reduce(0) { |s, i| n % i == 0 ? s += (i * i == n ? 1 : 2) : s }\nend", "def solution(a)\n # write your code in Ruby 2.2\n n = a.length\n \n counter = Array.new(n+1, 0)\n \n a.each do |x|\n counter[x-1] += 1\n end\n \n return counter.index { |x| x == 0 } + 1\nend", "def solve( n = 10_000 )\n (1..n).select {|i| i.amicable?}.reduce( :+ )\n end", "def largest_cont_subsum_fast(list)\n # for constant size to be true, you cant create any variables\n # whose memory size depends on the size of the input\n curr_sum = list[0]\n largest_sum = list[0]\n\n # we know there are n^2 potential, so if we ever check all of them\n # it must be n^2\n\n # there must be a way to find the max without checking every subarray\n list[1..-1].each do |ele|\n # debugger\n if curr_sum > largest_sum\n largest_sum = curr_sum\n end\n\n if curr_sum < 0\n curr_sum = 0\n end\n\n curr_sum += ele\n\n end\n\n # debugger\n return [largest_sum, curr_sum].max\n\nend", "def largest_contiguous_subsum1(list)\n p Time.now\n sub_arrays = []\n list.each_index do |i|\n list.each_index do |j|\n next if j < i\n sub_arrays << list[i..j]\n end\n end\n sub_arrays.map{|numbers| numbers.inject(:+)}.max\n p Time.now\nend", "def my_min_2(arr)\n\n smallest_value = arr[0] # O(1)\n\n arr.each do |ele1| # [ 0, 3, 5, 4, -5, 10, 1, 90 ] O(n)\n smallest_value = ele1 if ele1 <= smallest_value #O(1)\n end\n\n smallest_value #O(1)\n\nend", "def solution(a)\n ((1..a.size + 1).to_a - a).first\nend", "def solution(a)\n return 1 if a.empty?\n a.sort!\n return 1 if a.first > 1\n return a.first + 1 if a.length <2\n (0..(a.length)).each do |index|\n return a[index] + 1 if a[index] + 1 != a[index + 1]\n end\n return a.last + 1\nend", "def find_it(seq)\n uniqueInts=seq.uniq\n\n uniqueInts.each do |value|\n k=0\n seq.each do |mainSeq|\n k+=1 if mainSeq==value\n end\n return value if k%2==1\n end\nend", "def find_duplicate(nums)\n if !nums or nums.size == 0\n return nil\n else\n fast = nums[ 0 ]\n slow = nums[ 0 ]\n while true\n fast = nums[ fast ]\n fast = nums[ fast ]\n slow = nums[ slow ]\n if fast == slow\n new_node = nums[ 0 ]\n while new_node != slow\n new_node = nums[ new_node ]\n slow = nums[ slow ]\n end\n return slow\n end\n end\n end\nend", "def solve( n = 100 )\n n.partition_sieve[-1] - 1\n end", "def amicable_numbers(n)\r\n numbers = Array.new\r\n 2.upto(n) do |x|\r\n y = d(x)\r\n if !numbers.include?(y)\r\n numbers.push(x,y) if d(y) == x && y != x\r\n end\r\n end\r\n return numbers\r\nend", "def f(n)\n # your code here\n result = []\n possibles = (2..n).flat_map{ |s| [*2..n].combination(s).map(&:join).to_a }\n p possibles\n possibles.each do |i|\n x = 0\n temp_arr = []\n temp = i.split('').map { |j| j.to_i }\n p temp\n while x < temp.length do \n if i[x + 1] != i[x] + 1 || i[x + 1] == nil\n temp_arr << i[x]\n end\n x += 1\n end\n result << temp_arr\n end\n result.length\nend", "def largest_contiguous_subsum2(list)\n result = list.first\n sum = list.first\n\n list.each_with_index do |n, i|\n next if i == 0\n\n sum = 0 if sum < 0\n\n sum += n\n\n result = sum if sum > result\n end\n\n result\nend", "def solution(a)\n len = a.size\n unique = {}\n i = 0\n while i < len\n item = a[i]\n if unique.has_key?(item)\n unique[item] += 1\n else\n unique[item] = 1\n end\n i += 1\n end\n pairs = 0\n unique.each do |key,count|\n (1...count).step {|n| pairs += n }\n end\n return pairs > 1_000_000_000 ? 1_000_000_000 : pairs\nend", "def solution(a)\n # write your code in Ruby 2.2\n sum = a.inject(:+)\n acc = 0\n\n min = 99999999\n a[0..-2].each do |n|\n sum -= n\n acc += n\n\n min = [(acc - sum).abs, min].min\n end\n min\nend", "def my_min1(arr)\n arr.each do |el1| #O(n)\n if arr.all? {|el2| el1 <= el2 } #O(n + 1)\n return el1\n end\n end \nend", "def okay_two_sum?(arr, target)\n sorted = arr.sort # n log n => quicksort => is nlogn DOMINANT\n sorted.each_with_index do |num, i| # => O(n)\n # return true if sorted[i] + sorted[-1 - i] == target\n return true if sorted[i + 1 .. - 1].bsearch {|number| target - num <=> number} # => O(log(n))\n # ASK TA ABOUT BSEARCH\n # bsearch {|ele| pivot <=> ele}\n end\n false\nend", "def stones(n, a, b)\n ar=[0]\n (n-1).times do |val|\n tmp=[]\n ar.each do |v|\n tmp << v+a if !tmp.include?(v+a)\n tmp << v+b if !tmp.include?(v+b)\n end\n ar=tmp\n end\n ar.sort\nend", "def largest_contiguous_subsum_1(list) \n subs = [] #O(1)\n (0...list.length).each do |start_num| #O(n)\n (start_num...list.length).each do |end_num| #O(n)\n subs << list[start_num..end_num] #O(n)\n end\n end\n subs_sum = [] #O(1)\n subs.each do |sub| #O(n**2)\n sub_sum = 0 #O(1)\n sub.each {|s| sub_sum += s} #O(n)\n subs_sum << sub_sum #O(1)\n end\n subs_sum.inject do |acc,el| #O(n)\n if acc > el #O(1)\n acc #O(1)\n else\n el #O(1)\n end\n end\n end", "def dp_possible_trees(n)\n array = Array.new(n+2) { Array.new(n+1) { 0 } }\n (0...n+2).to_a.each do |i|\n array[i][0] = 1\n end\n\n sum = 0\n (1...n+1).to_a.each do |i|\n sum = 0\n (1..i).to_a.each do |j|\n array[j][i] = array[n+1][i-j] * array[n+1][j-1]\n sum += array[j][i]\n end\n array[n+1][i] = sum\n end\n array[n+1].last\nend", "def largest_contiguous_subsum(list)\n new_arr = []\n\n (0...list.length).each do |idx1| #O(n)\n (0...list.length).each do |idx2| #O(n)\n if idx2 >= idx1 #O(1)\n new_arr << list[idx1..idx2].sum #O(1)\n end \n end \n \n end \n \n return new_arr.max #O(n)\nend", "def find_missing(array, n)\n i = 0\n\n (1..n).each { |number| i = i ^ number }\n array.each { |number| i = i ^ number }\n\n i\nend", "def two_sum?(array, target)\n #O(n)\n hash = Hash.new(0)\n i = 1\n array.each do |ele|\n hash[ele] = i \n i += 1\n end\n hash.each_key do |k|\n return true if hash.has_key?(target - k) && hash[k] != hash[target - k]\n end\n false \nend", "def canBeSum(n, array, cache)\n\ti = 0\n\twhile array[i] <= n / 2\n\t\tif cache[n-array[i]] # array.include?(n-array[i]) is OK, but very slow\n\t\t\treturn true\n\t\tend\n\n\t\ti += 1\n\tend\n\n\treturn false\nend", "def three_sum_fast(arr)\n arr = merge_sort(arr)\n count = 0\n\n (0..arr.length - 1).each { |i|\n (i + 1..arr.length - 1).each { |j|\n if bin_search(arr, -arr[i] - arr[j]) > j\n count += 1\n end\n }\n }\n count\nend", "def sub_sum_better(list)\n largest_sum = list.first\n\n #iterate over once.\n # as you iterate keep a tally of the sum.\n # indexing into an array is O(1)\n # [2, 3, -6, 7, -6, 7]\n\n sub_sum = 0\n list.each do |el|\n sub_sum += el\n largest_sum = sub_sum if sub_sum > largest_sum\n\n sub_sum = 0 if sub_sum < 0\n end\n\n largest_sum\nend", "def largest_contiguous_subsum_fast(list)\n start = Time.now\n max_sum = list[0]\n cur_sum = list[0]\n list[1..-1].each do |el|\n if el >= cur_sum && cur_sum < 0\n cur_sum = el\n else\n cur_sum += el\n end\n max_sum = cur_sum if cur_sum > max_sum\n end\n finish = Time.now\n puts \"Runtime: #{finish - start}\"\n return max_sum\nend", "def solution(a)\n left = 0\n right = a.sum\n a.each_with_index do |element, index|\n right -= element\n return index if left == right\n left += element\n end\n -1\nend", "def sturges\n len = array.length\n return 1.0 if len == 0\n\n # return (long)(ceil(Math.log2(n)) + 1);\n return Math.log2(len).ceil + 1\n end", "def largest_contiguous_subsum(list) # O(n^2)\n array = []\n list.each_with_index do |ele1, i1| # O(n^2)\n (i1...list.length).each do |i2|\n array << list[i1..i2]\n end\n end\n\n max_sum = array.first.sum\n array[1..-1].each do |subarr| # O(n^2)\n sum = subarr.sum\n if sum > max_sum\n max_sum = sum\n end\n end\n\n max_sum\n\nend", "def solution(a)\n # write your code in Ruby 2.2\n seen = {}\n\n a.each do |number|\n seen[number] = true\n end\n\n max = a.max\n\n for i in 1..(max + 1)\n return i unless seen[i]\n end\n\n 1\nend", "def find_duplicate_space(nums)\n # sort nums first (lgn), then check for dups by iterate over (n)\n last_seen = 0\n nums.sort!.each do |num|\n return num if last_seen == num\n last_seen = num\n end\nend", "def solution(a)\n s= a.sort\n 0.step(s.size - 1).inject(0) do |result, x|\n z= x+2\n (x+1).step(s.size - 1).inject(result) do |acc, y|\n z+=1 while z < s.size && s[x] + s[y] > s[z]\n acc += z-y-1\n end\n end\nend", "def removNb(n)\n results = []\n (2..n).each do |a|\n b = (n*(n+1)/2.0-a)/(a + 1)\n results << [a, b.to_i] if b % 1 == 0 && b < n && b > 2\n end\n results\nend", "def josephus_survivor(n,k)\n arr = (1..n).to_a\n\n while arr.length > 1\n idx = k % arr.length\n\n if arr.length > k\n arr = arr.drop(k) + arr.take(k - 1)\n elsif arr.length == k \n arr = arr[0...-1]\n else\n arr = arr.drop(idx) + arr.take(idx - 1)\n end\n end\n \n arr[0]\nend", "def euler29(n)\n terms = []\n 2.upto(n) do |i|\n 2.upto(n) do |j|\n if terms.include?(i ** j) == false\n terms << i ** j\n end\n end\n end\n \n terms.length\nend", "def linear_search(n)\n\t(1..100).to_a.shuffle.each do |x|\n\t\tif x == n\n\t\t\tbreak\n\t\tend\n\tend\nend", "def two_sum(arr) #o(ns)\n set = Set.new\n arr.each{|el| set << el}\n arr.select{|el| set.include?(-1 * el)}\nend", "def sum_to_n? arr, n\n #arr.product(arr).any? {|c| sum(c) == n && c[0] != c[1] } ----1.3\n arr = arr.sort\n low = 0\n high = arr.length - 1\n while low < high\n if arr[low] + arr[high] == n\n return true\n end\n arr[low] + arr[high] < n ? low += 1 : high -= 1 \n end\n return false\nend", "def largest_contiguous_subsum(list)\r\n sub_arr = []\r\n list.each_with_index do |ele1,idx1|\r\n list.each_with_index do |ele2,idx2|\r\n sub_arr<< list[idx1..idx2] if idx2>=idx1\r\n end\r\n end\r\n p sub_arr.size\r\n sub_arr.map{ |sub| sub.sum}.max\r\n #(O(n^2 + m)\r\nend", "def efficient_contiguous_subsum(list)\n current_sum = list[0] #0\n largest_sum = list[0] #5\n # debugger\n (1...list.length).each do |i| \n if current_sum + list[i] > 0 \n current_sum += list[i] \n largest_sum = current_sum if current_sum > largest_sum\n else \n current_sum = 0\n end \n end \n largest_sum\nend", "def sum_upon_sums(array)\n # Step 0: initialize variables => O(1)\n max = -1\n sum = 0\n\n # Step 1: Get Max and Sum => O(n)\n array.each do |num|\n max = num if num >= max\n sum += num\n end\n\n # Step 2: Get summation => O(1)\n summation = max * (max + 1) / 2\n\n # Step 3: Return Missing value by subtracting summation and sum => O(1)\n summation - sum\nend", "def solution(n, a)\n counters = Array.new(n, 0)\n max = 0\n a.each do |item|\n if item >= 1 && item <= n\n counters[item - 1] += 1\n max = counters[item - 1] if counters[item - 1] > max\n elsif item == n + 1\n counters = Array.new(n, max)\n end\n end\n\n counters\nend", "def solution(a)\n a.sort!\n a.each_with_index do |element, index|\n return 0 if element != index + 1\n end\n 1\nend", "def dbl_linear(n)\n result = [1] # base\n\n i = 0 # pointer for 2x + 1\n j = 0 # pointer for 3x + 1\n\n until result.size == n + 1 # because n is an index (size - 1)\n list1 = 2 * result[i] + 1\n list2 = 3 * result[j] + 1\n min = [list1, list2].min\n\n result << min\n\n i += 1 if min == list1\n j += 1 if min == list2\n end\n\n result.last\nend", "def sum_to_n? arr, n\n hash = Hash.new\n arr.each do |val|\n if hash.key? val\n return true\n else\n hash[n-val] = val\n end\n end\n return false\nend", "def solution(a)\n min_val = 10_000\n min_pos = 0\n \n sums = [0]\n for i in (0..a.count - 1) \n sums << sums.last + a[i] \n end\n for p in (0..a.count - 2)\n for q in (p + 1..[p + 2, a.count - 1].min)\n s = (sums[q + 1] - sums[p]).to_f / (q - p + 1)\n if s < min_val\n min_val = s\n min_pos = p\n end\n end\n end\n min_pos\nend", "def josephus_survivor(n,k)\n result = 1\n for i in 1...n + 1\n result = (result + k - 1) % i + 1\n end\n \n result\nend", "def two_sum?(arr, target_sum) # O(N)\n hash = Hash.new(0)\n count = Hash.new(0)\n\n arr.each do |num|\n hash[num] = target_sum - num\n count[num] += 1\n end\n\n hash.each do |key, value|\n if hash.has_key?(value) \n if key == value \n if count[value] > 1\n return true\n end\n else\n return true\n end\n end\n end\n\n false\nend", "def my_min_2(nums) # O(n)\n smallest = 0\n nums.each do |num|\n smallest = num if num < smallest\n end\n smallest\nend", "def solution(a)\n n = a.size\n starting = Array.new(n, 0)\n ending = Array.new(n, 0)\n\n (1..n - 2).each {|i| starting[i] = [starting[i - 1] + a[i], 0].max}\n (1..n - 2).reverse_each {|i| ending[i] = [ending[i + 1] + a[i], 0].max}\n\n sum = 0\n (1..n - 2).each {|i| sum = [sum, starting[i - 1] + ending[i + 1]].max}\n sum\nend", "def removNb(n)\n numbers = (1..n).to_a\n all_combinations = numbers.combination(2).to_a\n possible_pairs = []\n sum = numbers.reduce(:+)\n all_combinations.each do |pair|\n if (sum - pair.reduce(:+)) == pair.reduce(:*)\n possible_pairs << pair\n possible_pairs << pair.reverse\n end\n end\n possible_pairs\nend", "def solution(a)\n # write your code in Ruby 2.2\n num_of_elements=a.length\n num_of_zeros=0\n tot_num_car_pairs=0\n a.each do |element|\n if element == 0\n num_of_zeros+=1\n else\n tot_num_car_pairs+=num_of_zeros\n end\n end\n return tot_num_car_pairs>1_000_000_000?-1:tot_num_car_pairs\nend", "def fast_lcss(arr)\n i_arr = []\n biggest = 0\n max_sub_arr = []\n arr.length.times do |x|\n arr.map do |ele1|\n i_arr += [ele1]\n sum = i_arr.inject(0) do |a, b|\n a + b\n end\n max_sub_arr = i_arr if sum > biggest\n biggest = sum if sum > biggest \n end\n i_arr = []\n arr.shift\n end\n max_sub_arr\nend", "def hash_two_sum(arr,target_sum)\n #creates a new hash with each element that is satisfying the target_sum\n hash = Hash.new(0) #{|h,k| h[k] = []}\n (0...arr.length).each { |i| hash[i] = arr[i]} #O(n)\nend", "def solution(a)\n length = a.length\n sum = (length + 1) * (length + 1 + 1) / 2\n\n sum - a.inject(0) { |acc, e| acc += e }\nend", "def largest_contiguous_subsum_n(list2)\n large = 0\n \n list2.inject do |sum, n|\n if (sum + n) > sum\n sum += n \n large = sum if sum > large\n sum\n else\n sum = 0\n end\n end\n\n large\nend", "def largest_contiguous_subsum_2(list)\n largest_sum = 0\n current_sum = 0\n\n list.each do |el|\n largest_sum = current_sum \n current_sum += el \n if current_sum < el \n current_sum = el \n end \n largest_sum = current_sum if largest_sum < current_sum\n end\n\n largest_sum\nend", "def equal(arr)\n size = arr.size\n hash = Hash.new{|h,k| h[k] = []}\n (0...size).each do |i|\n (i + 1...size - 1).each do |j|\n sum = arr[i] + arr[j]\n if hash.has_key?(sum)\n values = hash[sum]\n values << i\n values << j\n return values\n else\n hash[sum] = [i, j]\n end\n end\n end\nend", "def my_min2 # O(n) time complexity\n smallest = self.first\n self.each do |num|\n sleep(1)\n smallest = num if num < smallest \n end\n smallest\n end", "def seesaw2?(arr)\n left_sum = 0\n right_sum = arr.size > 1 ? arr[1..-1].reduce(:+) : 0\n\n arr.each_index do |i| #O(n)\n return true if left_sum == right_sum\n left_sum += arr[i]\n i < arr.size-1 ? right_sum -= arr[i+1] : right_sum = 0\n end\n return false\nend", "def fibonacci(n)\n return fib_helper([0, 1], 2, n)\n # if you'd like to test what i THINK is an O(1) space complexity solution.....\n # i did run this through the tests and it SHOULD work:\n # return faster_fib_helper([0, 1], 2, n)\nend", "def sum_to_n? arr, n\n if arr.length > 1\n for i in arr do\n ndx = arr.find_index(i)\n x = arr.delete_at(ndx)\n if arr.include?(n - x)\n return true\n end\n arr.insert(ndx, x)\n end\n end\n return false\nend", "def largest_contiguous_subsum1(list)\n greatest_sum = -1.0/0.0\n (0...list.length).each do |i|\n (i...list.length).each do |j|\n greatest_sum = list[i..j].sum if greatest_sum < list[i..j].sum\n end\n end\n greatest_sum\nend", "def two_sum_v3?(arr, target) \n hash = Hash.new\n arr.each { |ele| hash[ele] = ele } #o(n)\n arr.each do |ele| #o(n)\n search_value = target - ele\n return true if !hash[search_value].nil? && hash[search_value] != ele\n end\n false\nend", "def solution(a)\n stack = []\n\n a.each_with_index do |n, i|\n if stack.empty?\n stack << [i, n]\n next\n end\n\n last_value = stack.last[1]\n\n if n == last_value\n stack << [i, n]\n else\n stack.pop\n end\n end\n\n return -1 if stack.empty?\n\n i, cd = stack.last\n\n count = a.inject(0) do |acc, n|\n cd == n ? acc + 1 : acc\n end\n\n count > a.length / 2 ? i : -1\nend", "def equil_idcs(a)\n left = 0\n sum = a.inject(:+)\n equils = []\n a.each_with_index do |num, idx|\n sum -= num\n equils << idx if left == sum\n left += num\n end\n equils.empty? ? -1 : equils\nend", "def largest_contiguous_subsum_1(list)\r\n subarrays = [] #1\r\n list.each_with_index do |ele1, i| #n\r\n list[i...list.length].each_with_index do |ele2,i2| #(n-1)\r\n subarrays << list[i..i2+i] #k \r\n end\r\n end # n^2\r\n subarrays.map { |subarray| subarray.sum}.max # n^x\r\nend", "def bad_two_sum?(arr, target)\n arr.each_with_index do |num1, idx1| #O(n)\n arr.each_with_index do |num2, idx2| #O(n)\n return true if idx2 > idx1 && num1 + num2 == target #O(1)\n end\n end\n false\nend", "def solution(n, a)\n max = 0\n counters = Array.new(n, max)\n a.each do |counter|\n if counter == n + 1\n counters.fill(max)\n else\n counters[counter - 1] += 1\n max = counters[counter - 1] if counters[counter - 1] > max\n end\n end\n counters\nend", "def solution(a)\n result = 0\n tmp_count = 0\n a.each_with_index do |val, idx|\n if val.zero?\n tmp_count += 1\n else\n result += tmp_count\n end\n end\n return result > 1000000000 ? -1 : result\nend", "def solution(a)\n counter = Hash.new(0)\n a.each do |elem|\n counter[elem] += 1\n end\n\n (1..a.size).each do |number|\n return 0 if counter[number] != 1\n end\n\n 1\nend", "def brute_force_two_sum(array, target)\n indexes = []\n array.each.with_index do |n1, index1|\n array.each.with_index do |n2, index2|\n indexes.push(index1) if target - n1 == n2 && index1 != index2\n end\n end\n indexes\nend", "def sorted_squared_array_n_nlogn(values)\n values.collect!{|val| val*val}\n merge_sort(values)\nend", "def pairSumSequence(n)\n sum = 0\n\n for i in 0..n\n # pairSum calls do not exist simultabeously on\n # the call stack, so you only need O(1) space\n sum += pairSum(i, i + 1)\n puts \"sum += (#{i + i + 1}) #{i} + #{i} + 1 \"\n end\n\n return sum\nend", "def problem_57\n ret,n,d = 0,1,1\n 1000.times do |i|\n n,d = (n+2*d),(n+d)\n ret += 1 if n.to_s.length > d.to_s.length\n end\n ret\nend" ]
[ "0.71262777", "0.68800735", "0.6508513", "0.6507173", "0.6491702", "0.64238715", "0.638691", "0.636333", "0.6323467", "0.6307346", "0.6297802", "0.6280894", "0.62475246", "0.6247299", "0.6232608", "0.6221362", "0.6216807", "0.62084085", "0.61740553", "0.61623377", "0.61540717", "0.61339235", "0.6112925", "0.60970783", "0.60818714", "0.60726905", "0.60639465", "0.6060264", "0.6058347", "0.6054939", "0.6046921", "0.6038437", "0.60352916", "0.6029095", "0.6020558", "0.60104686", "0.6008905", "0.6005959", "0.5998978", "0.5996704", "0.5992334", "0.599049", "0.5984943", "0.59834135", "0.5978613", "0.5969483", "0.5967822", "0.5965861", "0.5965843", "0.5962533", "0.5955027", "0.5953257", "0.59500533", "0.59467906", "0.5943949", "0.5941605", "0.5941133", "0.5933257", "0.5929176", "0.5925807", "0.5925606", "0.59194946", "0.59178627", "0.5916258", "0.5912123", "0.59080076", "0.59049153", "0.59021723", "0.58995104", "0.58953905", "0.58834326", "0.58757794", "0.58746856", "0.58746356", "0.5872745", "0.5870321", "0.58685076", "0.5865703", "0.5861127", "0.5855112", "0.5851459", "0.5851395", "0.58487165", "0.58403873", "0.5837644", "0.58347726", "0.5827914", "0.58273405", "0.5827137", "0.5825851", "0.58256495", "0.58215636", "0.5816634", "0.5814276", "0.58106697", "0.58103013", "0.58083516", "0.5807809", "0.5805235", "0.5801385", "0.579709" ]
0.0
-1
Places the robot on the board in position X,Y and facing NORTH, SOUTH, EAST or WEST
def place(x, y, direction) raise TypeError, 'Invalid coordinates' unless x.is_a? Integer and y.is_a? Integer raise TypeError, 'Invalid direction' unless DIRECTIONS.include?(direction) return false unless valid_position?(x, y) @position = { x: x, y: y } @direction = direction true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def place(robot, x:0, y:0)\n raise PlacementError.new \"Coordinates (#{x},#{y}) are not on this board\" if \n !width_range.include?(x) || !height_range.include?(y)\n # @playing_field[x][y] = robot\n @robots[robot] = {x: x, y: y}\n robot.place(self)\n end", "def move\n case @toy_direction\n when \"NORTH\"\n new_place = [@toy_place[0], @toy_place[1] + 1]\n when \"EAST\"\n new_place = [@toy_place[0] + 1, @toy_place[1]]\n when \"SOUTH\"\n new_place = [@toy_place[0], @toy_place[1] - 1]\n when \"WEST\"\n new_place = [@toy_place[0] - 1, @toy_place[1]]\n end\n place_robot(new_place, @toy_direction)\n end", "def place(x, y)\n self.robot_position = {\n x: x,\n y: y\n } if valid_coordinates?(x, y)\n end", "def move!\n if placed?\n case orientation.to_sym\n when :NORTH then @y += 1 if valid_coordinates?(x, y + 1)\n when :EAST then @x += 1 if valid_coordinates?(x + 1, y)\n when :SOUTH then @y -= 1 if valid_coordinates?(x, y - 1)\n when :WEST then @x -= 1 if valid_coordinates?(x - 1, y)\n end\n nil\n else\n raise RobotSimulation::NotPlacedError, \"Robot has not been placed yet.\"\n end\n end", "def place(rbot, x: nil, y: nil, direction: nil)\n rbot.at(x, y)\n rbot.orient(direction)\n end", "def move\n return unless placed?\n # We know place() will already ignore invalid placements, so just advance\n # the robot and let it fail silently if those positions are not on the board\n place(*next_position, direction)\n end", "def place_robot(x,y,name)\n if (0..max_length).include?(x) && (0..max_height).include?(y)\n self.robot_position[name] = [x,y]\n end\n end", "def test_can_move_north\n table_top = TableTop.new(5, 5)\n @robot.place(table_top, :TEST)\n\n assert_equal(:NORTH, @robot.direction)\n assert_equal(\"P\", @robot.get_path_value(0, 0))\n\n @robot.move\n assert_equal(0, @robot.x, \"X position should be 0 (not changed)\")\n assert_equal(1, @robot.y, \"Y position should be 1 (moved 1 north)\")\n assert_equal(:NORTH, @robot.direction, \"Direction should be :NORTH (not changed)\")\n assert_equal(\"M\", @robot.get_path_value(0, 1))\n end", "def move_east\n # Each time we move_east we move the Robot 1 space to the left\n @east += 1\n end", "def move!\n case @facing\n when Direction::NORTH\n @loc[:y] += 1 unless out_of_bounds? @loc[:x], @loc[:y] + 1\n when Direction::EAST\n @loc[:x] += 1 unless out_of_bounds? @loc[:x] + 1, @loc[:y]\n when Direction::SOUTH\n @loc[:y] -= 1 unless out_of_bounds? @loc[:x], @loc[:y] - 1\n when Direction::WEST\n @loc[:x] -= 1 unless out_of_bounds? @loc[:x] - 1, @loc[:y]\n else\n raise %q{Don't know which direction to move}\n end\n end", "def move\n check_placed\n new_position = case facing\n when :north then @position.inc_y\n when :south then @position.dec_y\n when :east then @position.inc_x\n when :west then @position.dec_y\n end\n check_position(new_position)\n @position = new_position\n end", "def move\n if @direction.north? then @y += 1\n elsif @direction.south? then @y -= 1\n elsif @direction.east? then @x += 1\n elsif @direction.west? then @x -= 1\n end\n return self\n end", "def place args\n \n @is_robot_availabe = true\n \n @pos_x,@pos_y,@direction = args\n\n if not (0..TABLE_X).include?(@pos_x) or not (0..TABLE_Y).include?(@pos_y)\n puts \"Warning: The position of Robot at (#{@pos_x}, #{@pos_y}) is outside the table (5,5).\"\n @is_robot_availabe = false\n return\n end\n\n if not DIRECTIONS.include?(@direction)\n puts \"Warning: #{@direction} is invaid. Robot can only move towards the four directions: \\n\"\\\n \"#{DIRECTIONS.inspect}.\"\n @is_robot_availabe = false\n return\n end\n\n # return \"PLACE\" #for test\n end", "def move_home_z\n @axis_z.move_home()\n @axis_z.disable_motor()\n end", "def test_can_not_move_north\n table_top = TableTop.new(5, 5)\n @robot.place(table_top, :TEST, 1, 5)\n\n assert_equal(:NORTH, @robot.direction)\n assert_equal(\"P\", @robot.get_path_value(1, 5))\n\n @robot.move\n assert_equal(1, @robot.x, \"X position should be 1 (not changed)\")\n assert_equal(5, @robot.y, \"Y position should be 5 (not changed)\")\n assert_equal(:NORTH, @robot.direction, \"Direction should be :NORTH (not changed)\")\n assert_equal(\"P\", @robot.get_path_value(1, 5))\n end", "def place(x, y, direction_to_face)\n # Check if we're working with a valid destination\n if @table.valid_destination x, y \n # Set our new position instance variable values\n @current_position[:x] = x\n @current_position[:y] = y\n @current_position[:direction] = direction_to_face\n\n puts \"Toy Robot placed at (#{@current_position[:x]}, #{@current_position[:y]}) facing #{@current_position[:direction]}\"\n\n return true\n else\n puts \"Invalid placement given, please specify a valid place within the range of the table in the format X, Y e.g. PLACE 1, 2\" \n return false\n end\n end", "def place(x, y, direction)\n # Set target position. Cancel processing the method if it's outside current surface\n target_position = NavigationEntities::Position.new(x, y)\n return cancel_action(\"Robot can't be placed outside\") unless surface.position_on_surface?(target_position)\n\n # Set direction of the robot. Store it in the placement object.\n target_direction = NavigationEntities::Direction.new(direction)\n self.target_placement = NavigationEntities::Placement.new(target_position, target_direction)\n\n # Update information about current location.\n update_placement(target_placement)\n end", "def test_can_not_move_south\n table_top = TableTop.new(5, 5)\n @robot.place(table_top, :SOUTH, 1, 0)\n\n assert_equal(:SOUTH, @robot.direction)\n assert_equal(\"P\", @robot.get_path_value(1, 0))\n\n @robot.move\n assert_equal(1, @robot.x, \"X position should be 1 (not changed)\")\n assert_equal(0, @robot.y, \"Y position should be 0 (not changed)\")\n assert_equal(:SOUTH, @robot.direction, \"Direction should be :SOUTH (not changed)\")\n assert_equal(\"P\", @robot.get_path_value(1, 0))\n end", "def execute\n if @robot.placed?\n new_position = @robot.current_position.go_to(@robot.current_position.direction)\n\n @robot.current_position = new_position if @table.position_is_valid?(new_position)\n end\n end", "def test_can_move_west\n table_top = TableTop.new(5, 5)\n @robot.place(table_top, :WEST, 5, 5)\n\n assert_equal(:WEST, @robot.direction)\n assert_equal(\"P\", @robot.get_path_value(5, 5))\n\n @robot.move\n assert_equal(4, @robot.x, \"X position should be 4 (moved 1 east)\")\n assert_equal(5, @robot.y, \"Y position should be 5 (not changed)\")\n assert_equal(:WEST, @robot.direction, \"Direction should be :WEST (not changed)\")\n assert_equal(\"M\", @robot.get_path_value(4, 5))\n end", "def test_can_move_east\n table_top = TableTop.new(5, 5)\n @robot.place(table_top, :EAST, 1, 2)\n\n assert_equal(:EAST, @robot.direction)\n assert_equal(\"P\", @robot.get_path_value(1, 2))\n\n @robot.move\n assert_equal(2, @robot.x, \"X position should be 2 (moved 1 east)\")\n assert_equal(2, @robot.y, \"Y position should be 2 (not changed)\")\n assert_equal(:EAST, @robot.direction, \"Direction should be :EAST (not changed)\")\n assert_equal(\"M\", @robot.get_path_value(2, 2))\n end", "def test_can_not_move_west\n table_top = TableTop.new(5, 5)\n @robot.place(table_top, :WEST, 0, 4)\n\n assert_equal(:WEST, @robot.direction)\n assert_equal(\"P\", @robot.get_path_value(0, 4))\n\n @robot.move\n assert_equal(0, @robot.x, \"X position should be 0 (not changed)\")\n assert_equal(4, @robot.y, \"Y position should be 4 (not changed)\")\n assert_equal(:WEST, @robot.direction, \"Direction should be :WEST (not changed)\")\n assert_equal(\"P\", @robot.get_path_value(0, 4))\n end", "def move\n case self.direction\n when 'NORTH'\n self.y += 1 unless self.y == @table.y\n when 'EAST'\n self.x += 1 unless self.x == @table.x\n when 'SOUTH'\n self.y -= 1 unless self.y == 0\n when 'WEST'\n self.x -= 1 unless self.x == 0\n end\n end", "def test_can_not_move_east\n table_top = TableTop.new(5, 5)\n @robot.place(table_top, :EAST, 5, 2)\n\n assert_equal(:EAST, @robot.direction)\n assert_equal(\"P\", @robot.get_path_value(5, 2))\n\n @robot.move\n assert_equal(5, @robot.x, \"X position should be 5 (not changed)\")\n assert_equal(2, @robot.y, \"Y position should be 2 (not changed)\")\n assert_equal(:EAST, @robot.direction, \"Direction should be :EAST (not changed)\")\n assert_equal(\"P\", @robot.get_path_value(5, 2))\n end", "def execute\n return unless @robot.placed?\n\n original_position = @robot.position\n new_position = original_position.dup\n new_position.move\n\n @robot.position = new_position if @table.position_valid?(new_position)\n end", "def execute\n return unless @robot.table\n x = @robot.coordinate.x\n y = @robot.coordinate.y\n direction = @robot.direction.to_s.upcase\n @out.puts(\"#{x},#{y},#{direction}\")\n end", "def test_can_move_south\n table_top = TableTop.new(5, 5)\n @robot.place(table_top, :SOUTH, 1, 2)\n\n assert_equal(:SOUTH, @robot.direction)\n assert_equal(\"P\", @robot.get_path_value(1, 2))\n\n @robot.move\n assert_equal(1, @robot.x, \"X position should be 1 (not changed)\")\n assert_equal(1, @robot.y, \"Y position should be 1 (moved 1 south)\")\n assert_equal(:SOUTH, @robot.direction, \"Direction should be :SOUTH (not changed)\")\n assert_equal(\"M\", @robot.get_path_value(1, 1))\n end", "def robot_move\n state_execute do |robot|\n robot.move\n end\n end", "def place_robot(args)\n x, y, direction = args.split(',')\n [x, y, direction].each do |arg|\n fail 'Missing argument' if arg.to_s.empty?\n end\n\n @toy_robot.place x.strip.to_i, y.strip.to_i,\n direction.strip.downcase.to_sym\n end", "def go_to(rows,cols,face=nil)\n \tface = 'north' if (rows == 0 && cols == 0)\n @position.change ({:x => rows, :y => cols, :face => face.to_sym}) if face\n end", "def place_robot(new_place, direction)\n if @table_top.move_robot(new_place)\n @toy_place = new_place\n @toy_direction = direction\n end\n end", "def move\n # Check that we have been placed\n if self.placed?\n # Create a new version to hold our new position for validation later\n new_position = @current_position.dup\n \n # Get our direction constant to establish whether we want to operate on the X or Y co-ordinate and whether to subtract or add based on direction\n direction_constant = self.get_direction_constant\n\n # Calculate our new position operating on the correct coordinate with the correct operation using the constants we have on the class\n new_position[direction_constant[:coordinate]] = new_position[direction_constant[:coordinate]] + direction_constant[:operation_value] \n # Check if the new position is valid move to this position\n if @table.valid_destination new_position[:x], new_position[:y]\n # Set our new valid position\n @current_position = new_position \n puts \"The Toy Robot has moved to (#{@current_position[:x]}, #{@current_position[:y]}) facing #{@current_position[:direction]}...\"\n else\n puts \"The Toy Robot cannot move any further, position unchanged, skipping command...\"\n return false\n end\n else\n puts \"The Toy Robot has not been placed, skipping command...\"\n return false\n end\n end", "def update_move\n self.x = screen_x\n self.y = screen_y\n update_move_arch if @type == Arched\n end", "def move\n @leading_x = coordinate_array[0]\n @leading_y = coordinate_array[1]\n end", "def move\n if @x + @x_vel < 0\n net_move = (-2 * @x) - @x_vel\n @x += net_move\n @truex += net_move\n @x_vel = -@x_vel\n elsif @x + @x_vel > (1280 - @w)\n net_move = (2 * (1280 - @w - @x)) - @x_vel \n @x += net_move\n @truex += net_move\n @x_vel = -@x_vel\n else\n @truex += @x_vel\n @x += @x_vel\n end\n\n if @y + @y_vel < 0\n net_move = (-2 * @y) - @y_vel\n @y += net_move\n @truey += net_move\n @y_vel = -@y_vel\n elsif @y + @y_vel > (720 - @h)\n net_move = (2 * (720 - @h - @y)) - @y_vel \n @y += net_move\n @truey += net_move\n @y_vel = -@y_vel\n else\n @truey += @y_vel\n @y += @y_vel\n end\n end", "def place_command_proceed\n @robot.place(@x_position.to_i, @y_position.to_i, @vector.to_s.strip)\n end", "def place_robot(robot, x, y, direction)\n return false unless position_valid?(x, y)\n\n robot.remove if robot.table\n\n robot.instance_variable_set(:@table, self)\n robot.instance_variable_set(:@x, x)\n robot.instance_variable_set(:@y, y)\n robot.instance_variable_set(:@direction, direction)\n\n @robots.push(robot) unless robots.include?(robot)\n\n true\n end", "def move_home_x\n @axis_x.move_home()\n @axis_x.disable_motor()\n end", "def update(x_position, y_position)\n @robot_x_position = x_position\n @robot_y_position = y_position\n end", "def move\n case @direction\n when \"NORTH\" then move_north\n when \"SOUTH\" then move_south\n when \"EAST\" then move_east\n when \"WEST\" then move_west\n end\n end", "def move\n case @current_rotation\n when ToyEnums::NORTH\n @position_y +=1\n when ToyEnums::SOUTH\n @position_y -=1\n when ToyEnums::EAST\n @position_x +=1\n when ToyEnums::WEST\n @position_x -=1\n else\n\n end\n end", "def move\n\n if @position != []\n if @position[2] == \"EAST\"\n @position[0] += 1\n elsif @position[2] == \"WEST\"\n @position[0] -= 1\n elsif @position[2] == \"NORTH\"\n @position[1] += 1\n elsif @position[2] == \"SOUTH\"\n @position[1] -= 1\n end\n check_position()\n else\n puts \"Invalid Command!!.\\nPlease execute command (place) to place the robot on the table.\"\n end\n @position\nend", "def move\n case @rover_facing\n when 'N'\n @coordinates[1] += 1\n when 'E'\n @coordinates[0] += 1\n when 'S'\n @coordinates[1] -= 1\n when 'W'\n @coordinates[0] -= 1\n end\n end", "def ai\n mx = window.level.mouse.x\n my = window.level.mouse.y\n if @x + 35.0 < mx\n move_right\n if @y >= my + 15.0\n up\n end\n elsif @x > mx + 35.0\n move_left\n if @y >= my + 15.0\n up\n end\n end\n end", "def move_east\n @x += 1\n end", "def move\n case @facing\n when \"north\"\n @posY += 1 if @posY+1 < @table.width\n when \"east\"\n @posX += 1 if @posX+1 < @table.height\n when \"south\"\n @posY -= 1 if @posY-1 >= 0\n when \"west\"\n @posX -= 1 if @posX-1 >= 0\n end\n end", "def reset_robot\n @commands_array = []\n @next_command_index = 0\n\n # Robot robot should not move before getting PLACEd.\n @is_placed = false\n\n # Start at origin, looking EAST.\n @face = FACES.keys[0]\n @location = {:x=>0, :y=>0}\n end", "def move_west\n @x -= 1\n end", "def move\n case @direction\n when \"N\"\n @y_coord += 1\n when \"S\"\n @y_coord -= 1\n when \"W\"\n @x_coord += 1\n when \"E\"\n @x_coord -= 1\n end\n end", "def define_axes!\n\t\tsouth_neighbor, east_neighbor = northwest_corner.all_possible_neighbors\n\n\t\teast_edge = northwest_corner.matching_edge east_neighbor\n\t\tnorthwest_corner.orient! :east, east_edge\n\t\teast_neighbor.orient! :west, east_edge.reverse\n\t\t@tile_layout[0][1] = east_neighbor\n\n\t\tsouth_neighbor.orient! :north, northwest_corner.south_edge.reverse\n\t\t@tile_layout[1][0] = south_neighbor\n\tend", "def move\n case @direction\n when \"N\" then @y += 1 unless @y + 1 > @plateau.y || @@rover_locations.values.include?([@x, @y + 1])\n when \"E\" then @x += 1 unless @x + 1 > @plateau.x || @@rover_locations.values.include?([@x + 1, @y])\n when \"S\" then @y -= 1 unless @y - 1 < 0 || @@rover_locations.values.include?([@x, @y -1])\n when \"W\" then @x -= 1 unless @x - 1 < 0 || @@rover_locations.values.include?([@x -1, @x])\n end\n @@rover_locations[@id.to_sym] = [@x, @y]\n end", "def move_home_y\n @axis_y.move_home()\n @axis_y.disable_motor()\n end", "def move\n\t\treturn \"INVALID COMMANDS, YOU CAN NOT MAKE THE ROBOT FALL OFF THE TABLE\" unless is_valid_move?\n\t\tcase @direction\n\t\twhen \"east\"\n\t\t\t@x_coordinate += 1\n\t\twhen \"west\"\n\t\t\t@x_coordinate -= 1\n\t\twhen \"south\"\n\t\t\t@y_coordinate -= 1\n\t\twhen \"north\"\n\t\t\t@y_coordinate += 1\n\t\telse\n\t\tend\n\t\ttrue\n\tend", "def place!(x, y, f)\n raise ArgumentError, 'invalid coordinate' unless @playground.valid_coordinate?(x, y)\n raise ArgumentError, 'invalid position' unless @robot.set_position(x, y, f)\n end", "def forward_move\n case @facing\n when 'NORTH'\n @y += 1\n when 'SOUTH'\n @y -= 1\n when 'EAST'\n @x += 1\n when 'WEST'\n @x -= 1\n end\n self\n end", "def move\n position_after_move = @position.new_coordinates_for_step_size(@direction.step_size_for_x_axis, @direction.step_size_for_y_axis)\n\n #ignore the command if robot is being out off tabletop\n if(@table_top.has_within_bounds?(position_after_move))\n @position = @position.new_coordinates_for(@direction.step_size_for_x_axis, @direction.step_size_for_y_axis)\n\n end\n end", "def position_for_next_harvest()\n turn_right()\n move()\n turn_right()\n end", "def moveto(x, y)\r\r\n @x = x % $game_map.width\r\r\n @y = y % $game_map.height\r\r\n @real_x = @x\r\r\n @real_y = @y\r\r\n @prelock_direction = 0\r\r\n straighten\r\r\n update_bush_depth\r\r\n end", "def move_forward\n case @orientation\n when :north\n @position.y_coordinate += 1\n when :east\n @position.x_coordinate += 1\n when :south\n @position.y_coordinate -= 1\n when :west\n @position.x_coordinate -= 1\n end\n end", "def move_south\n @y -= 1\n end", "def rotate_cordinate_space\n Location.new(9 - @row, 9 - @col)\n end", "def place(x, y, heading_symbol)\n heading = Heading.create(heading_symbol)\n valid_location = @board.safe_location(x, y)\n if valid_location && heading\n @state.unshift(Robot.new(x,y,heading))\n else\n puts \"Invalid heading: #{heading}\" if heading.nil?\n puts \"Invalid location: (#{x}, #{y}). Must be between (0, 0) and (#{@width}, #{@height})\" unless valid_location\n end\n self\n end", "def move\n if me\n turn_left if window.button_down? Gosu::KbLeft\n turn_right if window.button_down? Gosu::KbRight\n run if window.button_down? Gosu::KbUp\n run_with_ball\n end\n end", "def place(x, y, facing)\n return false if falls_off?(x, y)\n self.x = x\n self.y = y\n self.facing = facing\n true\n end", "def move\n origin = @table.find(self)\n\n # Check if the robot can move without falling off the table\n case @direction\n when Direction::NORTH\n movement = Coordinate.new(0, 1)\n when Direction::EAST\n movement = Coordinate.new(1, 0)\n when Direction::SOUTH\n movement = Coordinate.new(0, -1)\n when Direction::WEST\n movement = Coordinate.new(-1, 0)\n end\n destination = origin + movement\n return unless @table.contain? destination\n\n # Safe to move\n @table.place origin, nil\n @table.place destination, self\n end", "def moveto(x, y)\r\n @x = x % $game_map.width\r\n @y = y % $game_map.height\r\n @real_x = @x\r\n @real_y = @y\r\n @prelock_direction = 0\r\n straighten\r\n update_bush_depth\r\n end", "def projected_move\n\t\t\t\traise NotYetPlaced if been_placed.nil?\n\n\t\t\t\t_x = x\n\t\t\t\t_y = y\n\t\t\t\tcase face\n\t\t\t\twhen 'NORTH'\n\t\t\t\t\t_y += 1\n\t\t\t\twhen 'EAST'\n\t\t\t\t\t_x += 1\t\t\t\t\t\n\t\t\t\twhen 'SOUTH'\n\t\t\t\t\t_y -= 1\n\t\t\t\twhen 'WEST'\n\t\t\t\t\t_x -= 1\t\t\t\t\t\n\t\t\t\tend\n\t\t\t\t[_x, _y]\n\t\t\tend", "def castle!(x,y)\n if castle_kingside?(x,y)\n castle_rook_kingside.update_attributes(x_position: 5, y_position: y_position)\n end\n if castle_queenside?(x,y)\n castle_rook_queenside.update_attributes(x_position:3, y_position: y_position)\n end\n update_attributes(x_position: x, y_position: y)\n end", "def move\n\t\tif valid_move?\n\t\t\tputs \"\"\n\t\t\tif OS.mac?\n\t\t\t\tcmd = ('say \"roger-roger\"')\n\t\t\t\tsystem cmd\n\t\t\tend\n\t\t\tputs \"Roger, roger I\\'m moving forward one field!\"\n\t\t\tcase @robot_direction\n\t\t\twhen \"EAST\" then @x += 1\n\t\t\twhen \"WEST\" then @x -= 1\n\t\t\twhen \"NORTH\" then @y += 1\n\t\t\twhen \"SOUTH\" then @y -= 1\n\t\t\tend\n\t\telse\n puts \"This is the end of this world and I can't go further in this direction, please change direction\"\n\t\tend\n\tend", "def place_at(x, y, direction)\n @position = [x.to_i, y.to_i]\n @front = case direction.downcase \n when \"north\" then :north\n when \"south\" then :east\n when \"east\" then :south\n when \"west\" then :west\n end\n puts \"position is: #{@position} direction is #{@front}\"\n end", "def move(direction, map)\n x = @x_location\n y = @y_location\n \n case direction\n when :north then y -= 1\n when :south then y += 1 \n when :west then x -= 1\n when :east then x += 1 \n end\n \n unless map[y][x].is_a_wall?\n @x_location = x\n @y_location = y\n end \n end", "def moveto(x, y)\n #@ox = x; @oy = y\n @x = x % $game_map.width\n @y = y % $game_map.height\n #kk20\n @real_x = @x * 128 + 64\n @real_y = @y * 128 + 64\n end", "def move_home_all\n Status.current.info_target_x = 0\n Status.current.info_target_y = 0\n Status.current.info_target_z = 0\n @ramps_arduino.execute_command('G28', true, false)\n end", "def move\r\n @x += @x_direction\r\n @y += @y_direction\r\n # Preventing the Alien moving out of the screen\r\n if @x > (SCREEN_WIDTH - GAME_PRESET[\"alien_reach\"]) || @x < 0\r\n @x_direction= -@x_direction\r\n elsif @y > (SCREEN_HEIGHT * @height_limit)\r\n @y_direction = 0\r\n end\r\n end", "def north\n return nil if @y == 0\n Textcell.new(@x, @y-1,@parent)\n end", "def turnLeft\n case @currentDir\n when :north\n @currentDir = :west\n when :south\n @currentDir = :east\n when :east\n @currentDir = :north\n when :west\n @currentDir = :south\n end\n end", "def place_object\n @board.place_object *next_position\n end", "def go!\n send_position_to_engine\n move_piece(bestmove)\n end", "def place\n next_move = {x: command.arguments[:x], y: command.arguments[:y]}\n if inside_table?(next_move_x_y(next_move, false))\n update_position!(next_move_x_y(next_move, false))\n update_direction!\n else\n almost_die\n end\n end", "def right position\n # if currently facing north\n if position[2] == \"north\"\n # right will make it face east\n position[2] = \"east\"\n # if currently facing south\n elsif position[2] == \"south\"\n # right will make it face west\n position[2] = \"west\"\n # if currently facing east\n elsif position[2] == \"east\"\n # right will make it face south\n position[2] = \"south\"\n # if currently facing west\n elsif position[2] == \"west\"\n # right will make it face north\n position[2] = \"north\"\n end\n position\nend", "def update_location\n self.x = screen_x unless self.disposed?\n self.y = screen_y unless self.disposed?\n end", "def setup_board\r\n place_pawns\r\n place_bishops\r\n place_rooks\r\n place_knights\r\n place_queens\r\n place_kings\r\n end", "def move_home_all\n @target_x = 0\n @target_y = 0\n @target_z = 0\n start_command('G28', true, false)\n end", "def place?(robot, direction_sym)\n true\n end", "def initialize(x_coord, y_coord, direction)\n\n @compass = [\"N\", \"E\", \"S\", \"W\"]\n @count = 0\n @x = x_coord\n @y = y_coord\n @d = direction\n @current_direction = @compass.index(@d)\n puts \"\\nThe initial position of the robot is #{@x}, #{@y}. It is facing the #{@d} direction.\"\n end", "def move_robot(position)\n # check if point valid\n if position[0].between?(0, @dimension - 1) && position[1].between?(0, @dimension - 1)\n @robot_position = position\n return true\n else\n return false\n end\n end", "def move(robot_name,robot_direction)\n case robot_direction\n when \"NORTH\"\n self.robot_position[robot_name][1] +=1 if robot_position[robot_name][1] < max_height\n when \"SOUTH\"\n self.robot_position[robot_name][1] -=1 if robot_position[robot_name][1] > 0\n when \"WEST\"\n self.robot_position[robot_name][0] -=1 if robot_position[robot_name][0] > 0\n when \"EAST\"\n self.robot_position[robot_name][0] +=1 if robot_position[robot_name][0] < max_length\n else\n nil\n end\n end", "def move\n\t\t# move 5px to the left\n\t @x = @x - 5\n\t # move up or down based on the Y velocity\n\t @y = @y + @vy\n\tend", "def place!(x, y, facing = nil)\n raise 'x or y coordinate out of bounds' if out_of_bounds? x, y\n\n @facing = facing if facing\n @loc = {x: x, y: y}\n end", "def set_current_position!\n matrix[\n position[:y]\n ][\n position[:x]\n ] = DIRECTION_ARROWS[direction]\n end", "def move_home_set_direction()\n\n if (invert_axis ^ reverse_home) == false\n set_direction_low()\n else\n set_direction_high()\n end\n\n end", "def move\n\t\tif @direction == \"N\"\n\t\t\t@y += 1\n\t\telsif @direction == \"W\"\n\t\t\t@x -= 1\n\t\telsif @direction == \"E\"\n\t\t\t@x += 1\n\t\telsif @direction == \"S\"\n\t\t\t@y -= 1\n\t\tend\n\tend", "def move\n case @direction\n when \"n\"\n @y_axis += 1\n when \"e\"\n @x_axis += 1\n when \"s\"\n @y_axis -= 1\n when \"w\"\n @x_axis -= 1\n end\n end", "def move_rover()\n puts \"DEBUG: moving: #{@orientation}\" if DEBUG\n case @orientation\n when DIRECTION_EAST\n @position[:x] += 1 if @position[:x] < @map.width\n when DIRECTION_WEST\n @position[:x] -= 1 if @position[:x] > 0\n when DIRECTION_NORTH\n @position[:y] += 1 if @position[:y] < @map.height\n when DIRECTION_SOUTH\n @position[:y] -= 1 if @position[:y] > 0\n end\n puts \"DEBUG: position after move: #{@position}\" if DEBUG\n end", "def valid_move?(robot)\n x_pos = robot.x_position\n y_pos = robot.y_position\n dir = robot.direction\n invalid_east_move = (x_pos == @dimension) && (dir == 'EAST')\n invalid_west_move = x_pos.zero? && (dir == 'WEST')\n invalid_north_move = (y_pos == @dimension) && (dir == 'NORTH')\n invalid_south_move = y_pos.zero? && (dir == 'SOUTH')\n !(invalid_east_move || invalid_west_move || invalid_north_move || invalid_south_move)\n end", "def configure_cells\n\t\teach_cell do |cell|\n\t\t\trow, col = cell.row, cell.column\n\n\t\t\tcell.north = self[row - 1, col]\n\t\t\tcell.south = self[row + 1, col]\n\t\t\tcell.east = self[row, col + 1]\n\t\t\tcell.west = self[row, col - 1]\n\t\tend\n\tend", "def place x, y, f\n if @board.can_place?(x, y) and valid_direction?(f)\n @x = x\n @y = y\n @f = DIRECTIONS.index(f.to_s.downcase)\n end\n report\n end", "def left\n if @position != []\n if @position[2] == \"EAST\"\n @position[2] = \"NORTH\"\n elsif @position[2] == \"WEST\"\n @position[2] = \"SOUTH\"\n elsif @position[2] == \"NORTH\"\n @position[2] = \"WEST\"\n elsif @position[2] == \"SOUTH\"\n @position[2] = \"EAST\"\n end\n else\n puts \"Invalid Command!!.\\nPlease execute command (place) to place the robot on the table.\"\n end\n return @position\nend", "def right\n if @position != []\n if @position[2] == \"EAST\"\n @position[2] = \"SOUTH\"\n elsif @position[2] == \"WEST\"\n @position[2] = \"NORTH\"\n elsif @position[2] == \"NORTH\"\n @position[2] = \"EAST\"\n elsif @position[2] == \"SOUTH\"\n @position[2] = \"WEST\"\n end\n else\n puts \"Invalid Command!!.\\nPlease execute command (place) to place the robot on the table.\"\n end\n return @position\nend", "def move\n return unless placed?\n # no need to use a loop since the length is only 2\n new_x = @pos_x + @direction[:x]\n new_y = @pos_y + @direction[:y]\n\n return unless valid_position?(new_x, new_y)\n set_position(new_x, new_y)\n end", "def moveto(x, y, z=self.z)\n @x, @y, @z = x, y, z\n refresh_bodies_pos\n end" ]
[ "0.7014113", "0.6885764", "0.6792347", "0.66941637", "0.66223013", "0.65164053", "0.64042723", "0.6393004", "0.63708675", "0.63499534", "0.6347441", "0.6291623", "0.6255879", "0.6247514", "0.6232943", "0.6209512", "0.62019527", "0.6184982", "0.616402", "0.61450106", "0.6142101", "0.61403435", "0.6129742", "0.6112805", "0.60890913", "0.60867995", "0.60850555", "0.60678905", "0.6066763", "0.6043564", "0.60428923", "0.6042141", "0.60392064", "0.60348356", "0.6020204", "0.60162485", "0.60119265", "0.60103935", "0.6003701", "0.59918344", "0.59711945", "0.5949415", "0.59476286", "0.5945792", "0.5945497", "0.59397054", "0.59377295", "0.5936579", "0.5928769", "0.59285814", "0.5925509", "0.5924677", "0.59141576", "0.59069353", "0.5896341", "0.58869374", "0.5884295", "0.5882569", "0.58789384", "0.5877925", "0.58737636", "0.5870799", "0.5869223", "0.5866152", "0.58656585", "0.58567595", "0.58511907", "0.5842512", "0.58367395", "0.5817852", "0.58174914", "0.5817297", "0.58104926", "0.58094907", "0.5803979", "0.58022183", "0.57964134", "0.57935447", "0.57731515", "0.5769663", "0.5760804", "0.5755829", "0.57420015", "0.5730723", "0.57187855", "0.57181054", "0.5717423", "0.5711011", "0.5704835", "0.57030153", "0.5700936", "0.56930864", "0.5690249", "0.5689986", "0.5678613", "0.5672162", "0.56707793", "0.5662427", "0.56609195", "0.56584275", "0.5653273" ]
0.0
-1
Moves the robot one unit forward in the direction it is currently facing
def move return false if @position.nil? movements = { north: { x: 0, y: 1 }, east: { x: 1, y: 0 }, south: { x: 0, y: -1 }, west: { x: -1, y: 0 } } position, movement = @position, movements[@direction] return false unless valid_position?(position[:x] + movement[:x], position[:y] + movement[:y]) @position = { x: position[:x] + movement[:x], y: position[:y] + movement[:y] } true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_forward\n new_location = @location + facing_direction.coordinate_component\n \n if !surface.within_bounds?(new_location)\n raise OutOfBoundaryError, \"The movement has put the robot out of boundaries\"\n end\n \n @location = new_location\n self\n end", "def forward_move\n case @facing\n when 'NORTH'\n @y += 1\n when 'SOUTH'\n @y -= 1\n when 'EAST'\n @x += 1\n when 'WEST'\n @x -= 1\n end\n self\n end", "def move_forward\n self.velocity_x = Gosu::offset_x(self.angle, 0.5)*self.max_velocity_x\n self.velocity_y = Gosu::offset_y(self.angle, 0.5)*self.max_velocity_y\n end", "def move_forward\n case @orientation\n when :north\n @position.y_coordinate += 1\n when :east\n @position.x_coordinate += 1\n when :south\n @position.y_coordinate -= 1\n when :west\n @position.x_coordinate -= 1\n end\n end", "def move_forward\n\t\tnew_position = forward_position\n\t\t@x = new_position[0]\n\t\t@y = new_position[1]\n\tend", "def forward(steps)\n move(steps)\n end", "def move_forward\n case @direction\n when 2\n move_down(false)\n when 4\n move_left(false)\n when 6\n move_right(false)\n when 8\n move_up(false)\n end\n end", "def forward\n direction(:forward)\n end", "def move_forward\r\r\n @move_poll+= [[@direction, true]] * (32.0 / CXJ::FREE_MOVEMENT::PIXELS_PER_STEP).ceil\r\r\n end", "def move(direction)\n \n end", "def forward\n\n\t\t#Could use case statement here\n\t\t# case (@angle.abs % 360)\n\t\t# \twhen 0 then x = @x + 1\n\t\t# \tetc...\n\t\t# end\n\n\t\t#Get new x\n\t\tx = @x + Math.cos(@angle * (Math::PI / 180)).round\n\n\t\t#Get new y\n\t\ty = @y + Math.sin(@angle * (Math::PI / 180)).round\n\n\t\t# This should perhaps be tested in the command method after each command\n\t\tif !isLostPoint(x, y) and !isLost(x, y) then\n\t\t\t@x = x\n\t\t\t@y = y\n\t\tend\n\n\tend", "def accelForward\n @vel_y -= @VELOCITY\n end", "def move_forward\n raise 'Это последняя станция' if @stations[@index + 1].nil?\n\n @stations[@index].departure(self)\n @index += 1\n @current_station = @stations[@index]\n @stations[@index].arrival(self)\n end", "def move_robot(command, unit)\n if /#{FORWARD}/.match?(command)\n case $current_direction \n when 0\n $y += unit\n when 1\n $x += unit\n when 2\n $y -= unit\n else\n $x -= unit\n end\n elsif /#{BACKWARD}/.match?(command)\n case $current_direction \n when 0\n $y -= unit\n when 1\n $x -= unit\n when 2\n $y += unit\n else\n $x += unit\n end \n end \nend", "def moveForward\n case @currentDir\n when :north\n incrementY\n when :south\n decrementY\n when :east\n incrementX\n when :west\n decrementX\n end\n\n #if new current position has obstacle, move back and report it\n if @grid.obstacles.include?(@currentPos)\n puts \"Cannot move forward. Obstacle present ahead at (#{@currentPos.x}, #{@currentPos.y})\"\n moveBackward\n return false\n end\n\n true\n end", "def change_direction\n @move_x = -@move_x\n @speed = -@speed\n end", "def move_forward(count)\n old_position = position\n\n if facing > 0 and facing < 180\n @x += count\n elsif facing > 180\n @x -= count\n end\n\n if facing > 90 and facing < 270\n @y += count\n elsif facing > 270 or facing < 90\n @y -= count\n end\n draw_line(old_position, position)\n end", "def turn_left\n if @@compass.index(@direction) == 0\n @direction = @@compass[-1]\n else\n current_index = @@compass.index(@direction)\n @direction = @@compass[current_index - 1]\n end\n end", "def move(forward)\n moves = [0, forward ? 1 : -1]\n moves.reverse! if @hor\n new_coord = @coord.add(moves + moves)\n set!(new_coord[0], new_coord[1], @hor)\n end", "def move_forward\n position.depart_train(self)\n @current_station += 1 if @route.stations[@current_station] != @route.stations.last\n position.add_train(self)\n end", "def turn_robot(name, direction)\n\t\ttarget_robot = find_robot_by_name(name)\n\t\t#switch in case we want different directions in the future, like turn around \n\t\tif target_robot != nil\n\t\t\ti = @facings.find_index(target_robot.facing)\n\t\t\tcase direction\n\t\t\twhen \"LEFT\"\n\t\t\t\ti -= 1\n\t\t\twhen \"RIGHT\"\n\t\t\t\ti += 1\n\t\t\telse\n\t\t\t\tputs \"invalid command: invalid direction\"\n\t\t\tend\n\t\t\tnew_facing = @facings[(i) % @facings.length]\n\t\t\ttarget_robot.facing = new_facing\t\n\t\tend\n\tend", "def move(direction)\n @x += @velocity if direction == :right\n @x -= @velocity if direction == :left\n end", "def move( turn, forward)\n\t\tif forward < 0 \n\t\t raise 'Robot cant move backwards ' + forward.to_s \n\t\tend\n\t\t# turn, and add randomness to the turning command\n\t\t# puts 'o:'+(@orientation/PI).to_s\n\t\t@orientation = @orientation + turn.to_f + random_gauss(0.0, @turn_noise)\n\t\t \n\t\t\n\t\t@orientation = @orientation % ( 2 *PI )\n\t\t# puts 'o:'+(@orientation/PI).to_s\n\t\t# move, and add randomness to the motion command\n\t\tdist = forward.to_f + random_gauss(0.0, @forward_noise)\n\t\t@x = @x + (cos(@orientation) * dist)\n\t\t@y = @y + (sin(@orientation) * dist)\n\t\t@x = @x % world_size # cyclic truncate\n\t\t@y = @y % world_size\n\t \n\t\t# set particle\n\t\tres = Robot.new()\n\t\tres.set(@x, @y, @orientation)\n\t\tres.set_noise(@forward_noise, @turn_noise, @sense_noise)\n\t\treturn res\n\tend", "def move( turn, forward)\n\t\tif forward < 0 \n\t\t raise 'Robot cant move backwards ' + forward.to_s \n\t\tend\n\t\t# turn, and add randomness to the turning command\n\t\t# puts 'o:'+(@orientation/PI).to_s\n\t\t@orientation = @orientation + turn.to_f + random_gauss(0.0, @turn_noise)\n\t\t \n\t\t\n\t\t@orientation = @orientation % ( 2 *PI )\n\t\t# puts 'o:'+(@orientation/PI).to_s\n\t\t# move, and add randomness to the motion command\n\t\tdist = forward.to_f + random_gauss(0.0, @forward_noise)\n\t\t@x = @x + (cos(@orientation) * dist)\n\t\t@y = @y + (sin(@orientation) * dist)\n\t\t@x = @x % world_size # cyclic truncate\n\t\t@y = @y % world_size\n\t \n\t\t# set particle\n\t\tres = Robot.new()\n\t\tres.set(@x, @y, @orientation)\n\t\tres.set_noise(@forward_noise, @turn_noise, @sense_noise)\n\t\treturn res\n\tend", "def move\n\t\tif valid_move?\n\t\t\tputs \"\"\n\t\t\tif OS.mac?\n\t\t\t\tcmd = ('say \"roger-roger\"')\n\t\t\t\tsystem cmd\n\t\t\tend\n\t\t\tputs \"Roger, roger I\\'m moving forward one field!\"\n\t\t\tcase @robot_direction\n\t\t\twhen \"EAST\" then @x += 1\n\t\t\twhen \"WEST\" then @x -= 1\n\t\t\twhen \"NORTH\" then @y += 1\n\t\t\twhen \"SOUTH\" then @y -= 1\n\t\t\tend\n\t\telse\n puts \"This is the end of this world and I can't go further in this direction, please change direction\"\n\t\tend\n\tend", "def move!\n case @facing\n when Direction::NORTH\n @loc[:y] += 1 unless out_of_bounds? @loc[:x], @loc[:y] + 1\n when Direction::EAST\n @loc[:x] += 1 unless out_of_bounds? @loc[:x] + 1, @loc[:y]\n when Direction::SOUTH\n @loc[:y] -= 1 unless out_of_bounds? @loc[:x], @loc[:y] - 1\n when Direction::WEST\n @loc[:x] -= 1 unless out_of_bounds? @loc[:x] - 1, @loc[:y]\n else\n raise %q{Don't know which direction to move}\n end\n end", "def move\n\t\t@x += 0\n\t\t@y += @vel\n\tend", "def move(direction)\n @position += direction\n end", "def move(direction)\n @old = @pos\n @pos += direction\n end", "def move\n @x += @vel_x\n @y += @vel_y\n @spin += @vel_spin\n end", "def move!\n\t\tbounce! until !will_bounce? #TODO add surroundedness checking\n\t\t@x += @@target_coords[@direction][:dx]\n\t\t@y += @@target_coords[@direction][:dy]\n\tend", "def forwardDeg!(point)\r\n point.x *= Proj4::DEG_TO_RAD\r\n point.y *= Proj4::DEG_TO_RAD\r\n forward!(point)\r\n end", "def forward(steps)\n must_be_number(steps, 'distance')\n angle = heading * DEG\n x, y = xy\n self.xy = [x + steps * sin(angle), y + steps * cos(angle)]\n track.last << xy if pen_down?\n end", "def next_position\n\n # change the direction when the number of a half spin\n # has been walked. Also increase the number of steps\n # in the next turn accordingly.\n if @steps_of_half_spin == 0\n @max_steps_in_dir += 1\n @steps_of_half_spin = 2 * @max_steps_in_dir\n @move_right_or_up = !@move_right_or_up\n @steps = 0\n end\n @steps_of_half_spin -= 1\n\n if @move_right_or_up\n if @steps < @max_steps_in_dir\n @x += 1\n @steps += 1\n else\n # up\n @y += 1\n end\n Pos2.new(@x, @y)\n else\n if @steps < @max_steps_in_dir\n # left\n @x -= 1\n @steps += 1\n else\n # down\n @y -= 1\n end\n Pos2.new(@x, @y)\n end\n end", "def move(forward,rotx,rotz)\n \n return if not (forward!=0 or rotx!=0 or rotz!=0)\n \n if CONFIG[:log][:camera]\n puts \"move: forward=#{forward} rotx=#{rotx} rotz=#{rotz}\"\n puts \"cam: pos=#{@pos} rot=#{@rot}\" \n end\n\n #@pos = @[email protected] if forward != 0\n @rot.x -= rotx\n @rot.z -= rotz\n\n end", "def accelBackward\n @vel_y += @VELOCITY\n end", "def move_toward_beeper()\n if front_is_clear?()\n move()\n else\n turn_left()\n end\n end", "def move\n if @direction.north? then @y += 1\n elsif @direction.south? then @y -= 1\n elsif @direction.east? then @x += 1\n elsif @direction.west? then @x -= 1\n end\n return self\n end", "def move\n\t\t# move 5px to the left\n\t @x = @x - 5\n\t # move up or down based on the Y velocity\n\t @y = @y + @vy\n\tend", "def moving!\n end", "def move\n case @current_rotation\n when ToyEnums::NORTH\n @position_y +=1\n when ToyEnums::SOUTH\n @position_y -=1\n when ToyEnums::EAST\n @position_x +=1\n when ToyEnums::WEST\n @position_x -=1\n else\n\n end\n end", "def move(*_)\n dir = direction_compass.to_direction(direction)\n new_value = direction_compass.direction[dir.to_sym]\n\n place(x + new_value[:x], y + new_value[:y])\n end", "def move_robot_forward details\r\n\tif(details.f == 1 and details.y<5)\r\n\t\tdetails.y += 1\r\n\telsif(details.f == 2 and details.x<5)\r\n\t\tdetails.x += 1\r\n\telsif(details.f == 3 and details.y>0)\r\n\t\tdetails.y -= 1\r\n\telsif(details.f == 4 and details.x>0)\r\n\t\tdetails.x -= 1\r\n\telse\r\n\t\tprint(\"\\nRobot will fall off the table. Aborting movement.\")\r\n\tend\r\n\tdetails\r\nend", "def turn dir\n self.a = (a + dir).degrees if dir\n end", "def advance_position\n case @direction\n when :up\n new_position = [@position[0], @position[1] - 1]\n determine_heading(new_position)\n @position = new_position\n when :down\n new_position = [@position[0], @position[1] + 1]\n determine_heading(new_position)\n @position = new_position\n when :left\n new_position = [@position[0] - 1, @position[1]]\n determine_heading(new_position)\n @position = new_position\n when :right\n new_position = [@position[0] + 1, @position[1]]\n determine_heading(new_position)\n @position = new_position\n end\n @position\n end", "def walk\n if @headed_left\n move_left\n else\n move_right\n end\n end", "def truck(view, time)\n direction = view.camera.direction * Z_AXIS\n direction.reverse! if( (@keys & LEFT_ARROW) != 0 )\n self.move(view, time, direction, @speedx)\nend", "def move\n\t\tcase @car.orientation\n\t\t\twhen 0 \n\t\t\t\[email protected] += 1\n\t\t\twhen 2\n\t\t\t\[email protected] -= 1\n\t\t\twhen 1\n\t\t\t\[email protected] += 1\n\t\t\twhen 3\n\t\t\t\[email protected] -= 1\n\t\tend\n\tend", "def turnLeft\n case @currentDir\n when :north\n @currentDir = :west\n when :south\n @currentDir = :east\n when :east\n @currentDir = :north\n when :west\n @currentDir = :south\n end\n end", "def move\n check_placed\n new_position = case facing\n when :north then @position.inc_y\n when :south then @position.dec_y\n when :east then @position.inc_x\n when :west then @position.dec_y\n end\n check_position(new_position)\n @position = new_position\n end", "def change_direction\n if @movement_direction == @directions.fetch(\"forward\")\n @movement_direction = @directions.fetch(\"backward\")\n else\n @movement_direction = @directions.fetch(\"forward\")\n end\n end", "def forward(steps)\n raise ArgumentError unless steps.is_a?(Numeric)\n @xy = [@xy.first + sin(@heading * DEG) * steps, @xy.last + cos(@heading * DEG) * steps]\n @track.last << @xy if @pen_is_down\n end", "def move_up\n\t\t@y_speed -= @speed_inc_step\n\t\tif @y_speed < -@max_speed\n\t\t\t@y_speed = -@max_speed\n\t\tend\n\n\t\tupdate_y(@y_speed)\n\t\t\n\t\trotation = (face_left?) ? @rotation_speed : -@rotation_speed\n\t\tif (face_left? && @angle >= 270 - @rotation_speed) ||\n\t\t\t(!face_left? && @angle <= 270 + @rotation_speed)\n\t\t\t\n\t\t\tupdate_angle(270)\n\t\telse\n\t\t\tupdate_angle(calculate_angle(rotation))\n\t\tend\n\n\t\t@has_moved = @player_moved = @moved_y_axis = true\n\tend", "def turn_right\n if @@compass.index(@direction) == @@compass.length - 1\n @direction = @@compass[0]\n else\n current_index = @@compass.index(@direction)\n @direction = @@compass[current_index + 1]\n end\n end", "def move_home_z\n @axis_z.move_home()\n @axis_z.disable_motor()\n end", "def move\n move_by get_incremental_position_for_velocity if (any_velocity?)\n decrease_velocity\n @has_increased_velocity_for = {\n x: false,\n y: false\n }\n @velocity_deltatime.update\n end", "def move\n\t\tif @direction == \"N\"\n\t\t\t@y += 1\n\t\telsif @direction == \"W\"\n\t\t\t@x -= 1\n\t\telsif @direction == \"E\"\n\t\t\t@x += 1\n\t\telsif @direction == \"S\"\n\t\t\t@y -= 1\n\t\tend\n\tend", "def turn\n @delta.x = [email protected]\n @delta.y = [email protected]\n end", "def drive(cmd)\n if @steer.include?(cmd)\n @orientation = @gps.turn(cmd)\n else\n move\n end\n end", "def turn(this_much)\n @angle += this_much\n calculate_heading\n end", "def turn(by: 90)\n next_direction_index = DIRECTIONS.find_index(@facing) + (by / 90).to_i\n @facing = DIRECTIONS[next_direction_index % 4]\n end", "def walk\n @speed = @speed + (0.2 * @legs)\n end", "def move(direction)\n turn direction unless @dir_fixed\n return(stop) if scene_collision?\n \n @moving = true\n animate\n case direction\n when :up\n @y -= @speed\n when :left\n @x -= @speed\n when :down\n @y += @speed\n when :right\n @x += @speed\n end\n end", "def update\n accelerate(0, 1) if should_fall?\n move\n end", "def move_upper_left\n unless @direction_fix\n @direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)\n end\n if (passable?(@x, @y, 8) && passable?(@x, @y - 1, 4)) ||\n (passable?(@x, @y, 4) && passable?(@x - 1, @y, 8))\n move_follower_to_character\n @x -= 1\n @y -= 1\n if @follower && $game_variables[Yuki::Var::FM_Sel_Foll] == 0\n @memorized_move = :move_upper_left\n @follower.direction = @direction\n end\n movement_process_end(true)\n increase_steps\n end\n end", "def move\n @route.stations[@index_current_station].recieve_train(self)\n @route.stations[@index_current_station - 1].send_train(self)\n end", "def rotate_robot(command, unit)\n if /#{RIGHT}/.match?(command)\n case unit\n when 1\n $current_direction += 1\n when 2\n $current_direction += 2\n when 3\n $current_direction += 3\n else\n $current_direction += 0\n end\n elsif /#{LEFT}/.match?(command)\n case unit\n when 1\n $current_direction += 3\n when 2\n $current_direction += 2\n when 3\n $current_direction += 1\n else\n $current_direction += 0\n end\n end\n $current_direction %= 4\nend", "def move_position\n @x += @velocity_x\n @y += @velocity_y\n end", "def interpret_move(command)\n ensure_placed\n @robot.move_forward\n end", "def walk\n case @direction\n when 'N'\n @y += 1\n when 'W'\n @x += 1\n when 'S'\n @y -= 1\n when 'E'\n @x -= 1\n end\n end", "def move\n case @direction\n when \"NORTH\" then move_north\n when \"SOUTH\" then move_south\n when \"EAST\" then move_east\n when \"WEST\" then move_west\n end\n end", "def move\r\n @x += @x_direction\r\n @y += @y_direction\r\n # Preventing the Alien moving out of the screen\r\n if @x > (SCREEN_WIDTH - GAME_PRESET[\"alien_reach\"]) || @x < 0\r\n @x_direction= -@x_direction\r\n elsif @y > (SCREEN_HEIGHT * @height_limit)\r\n @y_direction = 0\r\n end\r\n end", "def robot_move\n state_execute do |robot|\n robot.move\n end\n end", "def move\n \n end", "def move\n \n end", "def forward\n top, left = move_forward(@top), move_forward(@left)\n Cube.new(top, left)\n end", "def move(args)\n return if !@is_robot_availabe\n case @direction\n when \"NORTH\"\n if @pos_y + STEP <= TABLE_Y\n @pos_y += STEP\n return\n end\n \n when \"EAST\"\n if @pos_x + STEP <= TABLE_X\n @pos_x += STEP\n return\n end\n \n when \"SOUTH\"\n if @pos_y - STEP >= 0\n @pos_y -= STEP\n return\n end\n \n when \"WEST\"\n if @pos_x - STEP >= 0\n @pos_x -= STEP\n return\n end\n \n end\n puts \"Warning: Robot cannot move towards #{@direction} anymore. \"\n # return \"MOVE\" #for test\n end", "def move(view, time, direction, speed)\n # compute how far to move\n distance = @distance_to_target * time / 5.0\n distance *= speed\n \n vec = direction\n return if( vec.length == 0.0 )\n vec.length = distance\n \n # now move the camera\n camera = view.camera\n eye = camera.eye\n target = camera.target\n up = camera.up\n \n eye.offset! vec\n target.offset! vec\n\n camera.set(eye, target, up)\nend", "def advance\n case bearing\n when :north\n coordinates[1] += 1\n when :east\n coordinates[0] += 1\n when :south\n coordinates[1] -= 1\n when :west\n coordinates[0] -= 1\n end\n end", "def new_direction(dir)\n @direction = dir unless @turned\n @turned = true\n end", "def move_to!(x, y, z)\n #f = front\n #re = rear\n #t = top\n #b = bottom\n #l = left\n #r = right\n\n ## since the (ftl) front top left facing side's vertex is always\n ## the origin with my implementation, I am able to simply\n ## define the new origin and I am able to move the whole\n ## object with just two lines of code\n\n self.origin[0], self.origin[1], self.origin[2] = x, y, z\n self\n\n end", "def turn(command)\n @direction = ALLOWED_TURNS[ next_position_index(command) ]\n end", "def turn_left\n index = DIRECTIONS.index(@facing)-1\n @facing = DIRECTIONS[index]\n end", "def move(forward)\n if @direction == \"N\"\n if @y + 1 < @@ymax\n @y += 1\n else\n puts \"Nice try sucker\"\n end\n elsif @direction == \"S\"\n if @y - 1 > @@ymin\n @y -= 1\n else\n puts \"Nice try sucker\"\n end\n elsif @direction ==\"E\"\n if @x + 1 < @@xmax\n @x += 1\n else\n puts \"Nice try sucker\"\n end\n elsif @direction == \"W\"\n if @x - 1 > @@xmin\n @x -= 1\n else\n puts \"Nice try sucker\"\n end\n else\n puts \"Where in the world are you?\"\n end\nend", "def move_left\n\t\t@x_speed -= @speed_inc_step\n\t\tif @x_speed < -@max_speed\n\t\t\t@x_speed = -@max_speed\n\t\tend\n\n\t\tupdate_x(@x_speed)\n\n\t\tif !face_left?\n\t\t\tupdate_angle(calculate_angle(180))\n\t\tend\n\n\t\t@has_moved = @player_moved = true\n\tend", "def accelerate\r\n @velx += Gosu.offset_x(@angle,ACCELERATION)\r\n @vely += Gosu.offset_y(@angle,ACCELERATION)\r\n end", "def move\n if me\n turn_left if window.button_down? Gosu::KbLeft\n turn_right if window.button_down? Gosu::KbRight\n run if window.button_down? Gosu::KbUp\n run_with_ball\n end\n end", "def update_direction!\n direction.place!(command.arguments[:direction])\n end", "def turning_move_style\n # spin\n @angle[0] -= @axial if $program.holding?(:turn_left)\n @angle[0] += @axial if $program.holding?(:turn_right)\n # momentum\n if $program.holding?(:move_backward)\n @x += @speed * Math::cos(@angle[0] * Math::PI / 180.0)\n @z += @speed * Math::sin(@angle[0] * Math::PI / 180.0)\n elsif $program.holding?(:move_forword)\n @x -= @speed * Math::cos(@angle[0] * Math::PI / 180.0)\n @z -= @speed * Math::sin(@angle[0] * Math::PI / 180.0)\n end\n # camera position updates\n @tx = @x - Math::cos(@angle[0] * Math::PI / 180.0)\n @ty = @y \n @tz = @z - Math::sin(@angle[0] * Math::PI / 180.0) \n end", "def fast_forward()\n @ole.FastForward()\n end", "def move\n @position.shift unless @growing\n case @direction\n when 'down'\n @position.push(new_coords(head[0], head[1] + 1))\n when 'up'\n @position.push(new_coords(head[0], head[1] - 1))\n when 'left'\n @position.push(new_coords(head[0] - 1, head[1]))\n when 'right'\n @position.push(new_coords(head[0] + 1, head[1]))\n end\n @growing = @turned = false\n end", "def start_moving\n return if marked_floors.empty?\n init_direction\n move\n end", "def move(number)\n @position += number\n if @position < 32\n puts \"You moved #{number} steps forward\"\n end\n sleep(1)\n landed_on_which_panel(@position)\n end", "def move_backward\r\r\n last_direction_fix = @direction_fix\r\r\n @direction_fix = true\r\r\n @move_poll+= [[reverse_dir(@direction), false]] * (32.0 / CXJ::FREE_MOVEMENT::PIXELS_PER_STEP).ceil\r\r\n @direction_fix = last_direction_fix\r\r\n end", "def moveUpAndDown(dis)\n vector = getCurrentDirection\n vector.length = dis\n moveTransformation = Geom::Transformation.translation(vector)\n @@componentInstance.transform! moveTransformation\n updateAvatarLocation\n updateTransformation\n updateViewPort\n\n \n\n end", "def motion (direction)\n unit = (direction == :forward) ? 1 : -1;\n new_x, new_y = @x, @y\n case @heading\n when 'N'\n new_y = bound_y(@y + unit)\n when 'E'\n new_x = bound_x(@x + unit)\n when 'S'\n new_y = bound_y(@y - unit)\n when 'W'\n new_x = bound_x(@x - unit)\n end\n if @world.obstacle?(new_x, new_y)\n raise \"Obstacle found at x:#{new_x} y:#{new_y}\"\n else\n @x, @y = new_x, new_y\n end\n end", "def move\n case @rover_facing\n when 'N'\n @coordinates[1] += 1\n when 'E'\n @coordinates[0] += 1\n when 'S'\n @coordinates[1] -= 1\n when 'W'\n @coordinates[0] -= 1\n end\n end", "def move_left\n\t\tmove([-1,0])\n\tend", "def walk\n @speed = 2\n end", "def move \n self.send(@orientation.current.to_sym)\n end", "def move(x, y)\n (x < 0 ? backward(-x) : (x > 0 ? forward(x) : '')) +\n (y < 0 ? down(-y) : (y > 0 ? up(y) : ''))\n end" ]
[ "0.8134495", "0.78324604", "0.7665074", "0.7433086", "0.7414301", "0.73746246", "0.73363715", "0.69001186", "0.6851061", "0.68235445", "0.6796847", "0.6786047", "0.6763337", "0.67607224", "0.6692402", "0.66691494", "0.6644748", "0.66328764", "0.6612352", "0.6538308", "0.6530232", "0.65265805", "0.6518907", "0.6518907", "0.6509875", "0.6485446", "0.6435614", "0.64219934", "0.6418405", "0.6368591", "0.6351764", "0.6328586", "0.6322887", "0.62702686", "0.62436503", "0.62220865", "0.6219504", "0.6219324", "0.6215358", "0.6192185", "0.6175443", "0.6162171", "0.6142285", "0.6133751", "0.6129106", "0.6128494", "0.6123359", "0.6119763", "0.61194706", "0.61137223", "0.6103158", "0.60951585", "0.60934764", "0.6084677", "0.60563266", "0.6054564", "0.6054528", "0.605076", "0.60498077", "0.60329044", "0.6026525", "0.6018838", "0.60178363", "0.601525", "0.5995617", "0.5989921", "0.5978015", "0.59703165", "0.5966218", "0.5961742", "0.5957796", "0.59573144", "0.59559464", "0.59519386", "0.59519386", "0.5951576", "0.59513617", "0.59502333", "0.594985", "0.594861", "0.5942643", "0.5926681", "0.5917105", "0.5914265", "0.59138906", "0.591146", "0.5898331", "0.5895337", "0.5888656", "0.58865803", "0.5885066", "0.58757323", "0.58730906", "0.58644104", "0.586006", "0.5857968", "0.58486605", "0.58370626", "0.583245", "0.58282876", "0.58220345" ]
0.0
-1
Returns the X,Y and Direction of the robot
def report return "Not on board" if @position.nil? or @direction.nil? "#{@position[:x]},#{@position[:y]},#{@direction.to_s.upcase}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def position\n puts \"X: #{@x_coord}\"\n puts \"Y: #{@y_coord}\"\n puts \"Direction: #{@direction}\"\n end", "def near_xy direction\n nx = @x\n ny = @y\n delta = [\"ny -= 1\", \"nx += 1\", \"ny += 1\", \"nx -= 1\"]\n @angle.times{delta.push delta.shift}\n direction_index = ['f','r','b','l'].index(direction)\n eval(delta[direction_index])\n nangle = @angle + direction_index\n return ny, nx, nangle\n end", "def get_direction\n return (@dir || @character.direction)\n end", "def getDirection(x, y)\n if(@grid != nil && @grid.getCell(x,y).getState == :bridge)\n return @grid.getCell(x,y).getDirection\n end\n return nil\n end", "def get_move_coordinates\n {x: position_x + DIRECTION[direction.to_sym][:x], y: position_y + DIRECTION[direction.to_sym][:y]}\n end", "def position \n\t\treturn @y,@x\n\tend", "def location\n [@posX, @posY, @facing]\n end", "def command direction\n ny, nx, nangle = near_xy(direction)\n if @labirint[ny][nx] == 0 || @labirint[ny][nx] == 2\n @x = nx\n @y = ny\n print\n @angle = nangle % 4\n end\n end", "def position\n\t\t[ @x, @y ]\n\tend", "def execute\n return unless @robot.table\n x = @robot.coordinate.x\n y = @robot.coordinate.y\n direction = @robot.direction.to_s.upcase\n @out.puts(\"#{x},#{y},#{direction}\")\n end", "def position\n return [@x, @y, @heading]\n end", "def direction\n return nil if x_vel.zero? && y_vel.zero?\n vector_to_angle(*drop_diagonal)\n end", "def get_head_coords\n {\n x: position.first[:x],\n y: position.first[:y],\n direction: get_current_direction\n }\n end", "def position\n [ @x, @y, COMPASS[@orientation].to_s ]\n end", "def directions\n DIRECTIONS\n end", "def direction\n\t\tpoint_x = end_junction.position.x - start_junction.position.x\n\t\tpoint_y = end_junction.position.y - start_junction.position.y\n\t\t[point_x / @length, point_y / @length]\n\tend", "def neighbor_coords\r\n coordinates = [\r\n up,\r\n down,\r\n right, \r\n left,\r\n # Diagonals\r\n # Move.new(up).right,\r\n # Move.new(up).left,\r\n # Move.new(down).right,\r\n # Move.new(down).left\r\n up_right,\r\n up_left,\r\n down_right,\r\n down_left\r\n ]\r\n\r\n coordinates.compact\r\n end", "def pos\n [posx, posy]\n end", "def output\n \"#{@x_axis},#{@y_axis},#{@facing_direction.direction}\"\n end", "def report_robot_details details\r\n\tprint(\"\\nCurrent position details\")\r\n\tprintf(\"\\nFORMAT : (X,Y) - Face Direction => (%d,%d) - %s\", details.x, details.y, DIRECTIONS[details.f])\r\nend", "def next_move\n case Direction::DIRECTIONS[direction.current]\n when Direction::DIRECTIONS[0] # NORTH\n {x: 0, y: 1}\n when Direction::DIRECTIONS[1] # EAST\n {x: 1, y: 0}\n when Direction::DIRECTIONS[2] # SOUTH\n {x: 0, y: -1}\n when Direction::DIRECTIONS[3] # WEST\n {x: -1, y: 0}\n end\n end", "def get_current_position\n [@current_X_pos, @current_Y_pos]\n end", "def direction\n return @direction\n end", "def direction(x_diff, y_diff)\n Math.atan2(0, -1) - Math.atan2(x_diff, y_diff)\n end", "def initialize(x_coord, y_coord, direction)\n\n @compass = [\"N\", \"E\", \"S\", \"W\"]\n @count = 0\n @x = x_coord\n @y = y_coord\n @d = direction\n @current_direction = @compass.index(@d)\n puts \"\\nThe initial position of the robot is #{@x}, #{@y}. It is facing the #{@d} direction.\"\n end", "def position\n\t\treturn \"#{@x} #{@y} #{PlanetModel::ORIENTATIONS.invert[@angle.abs % 360].to_s}#{if @lost == true then ' LOST' end}\"\t\n\tend", "def report\n\t\tputs \"My current location is (#{@x}, #{@y}) facing #{@robot_direction}.\"\n\tend", "def move (x,y,direction)\n if direction ==\"EAST\"\n if validate(x+1) then return x+1,y end\n elsif direction ==\"WEST\"\n if validate(x-1) then return x-1,y end\n elsif direction ==\"NORTH\"\n if validate(y+1) then return x,y+1 end\n elsif direction ==\"SOUTH\"\n if validate(y-1) then return x,y-1 end\n end\n return x,y\n end", "def location\n \"#{@position} #{DIRECTIONS[@orientation]}\"\n end", "def get_next_coords(direction)\n x, y = get_head_coords[:x], get_head_coords[:y]\n case direction\n when 'S'\n y += 1\n when 'N'\n y -= 1\n when 'E'\n x += 1\n when 'W'\n x -= 1\n end\n return x, y\n end", "def position\n [@x, @y]\n end", "def direction\n @direction ||= Vector.new(p2.x - p1.x, p2.y - p1.y)\n end", "def coordinates\n [@y_location, @x_location]\n end", "def direction(fx, fy, tx, ty)\n\t\treturn @@E if fx < tx \n\t\treturn @@W if fx > tx\n\t\treturn @@S if fy < ty\n\t\treturn @@N if fy > ty\n\tend", "def find_bot_position\n position_coordinates('m')\n end", "def position(robot, robot_positions)\n r_pos = robot_positions.find { |p| p[:robot] == robot }\n r_pos[:position]\n end", "def location(x, y, w, h)\n return x - w/2, y + 20\n end", "def to_s\n\t\t\"#{@x}, #{@y}, #{@direction}\"\n\tend", "def dir_sym\n if grid.include?(self.direction_vector.direction.leap)\n self.direction_vector.direction.leap\n elsif grid.include?(self.direction_vector.direction.normal)\n self.direction_vector.direction.normal\n else\n nil\n end\n end", "def get_command\n\t\ttext = read.chomp\n\t\tcommand = {}\n\t\tif text =~ /PASS/i\n\t\t\tcommand[:pass] = true\n\t\telsif text =~ /(\\d+),\\W+(\\d+)/i\n\t\t\tcommand[:x] = $1.to_i\n\t\t\tcommand[:y] = $2.to_i\n\t\telsif text =~ /\\A([NSEW]|[NS][EW])\\z/i\n\t\t\tdirection = $1.to_sym\n\t\t\tcommand[:x] = @x + @@target_coords[direction][:dx]\n\t\t\tcommand[:y] = @y + @@target_coords[direction][:dy]\n\t\tend\n\t\tcommand\n\tend", "def directions\n vectors.map {|v| v.direction }\n end", "def output\n puts \"#{@coord_x} #{@coord_y} #{@direction}\"\nend", "def position\n [x, y]\n end", "def dir_from_points(x1, y1, x2, y2)\n VECTOR_DIRECTIONS[[x2-x1, y2-y1]].first\n end", "def dir(v)\n if @x == v.x\n return 8 if v.y > @y # down\n return 2 # up\n elsif @y == v.y\n return 6 if v.x > @x # right\n return 4 # left\n end\n end", "def directions\n STRAIGHT + DIAGONAL\n end", "def report\n return {\n x: @position[0],\n y: @position[1],\n direction: @direction\n }\n end", "def theta\n (@x == 0)? ((@y > 0)? @@pio2 : -@@pio2) : Math.atan2(@y,@x)\n end", "def location\n return @peer.getXLocationStyle.to_s, @peer.getYLocationStyle.to_s\n end", "def right\n @robot.right\n end", "def get_direction()\n\n floor_difference = @elevator.current_floor - @floor\n if floor_difference > 0\n @direction = \"down\"\n else\n @direction = \"up\"\n end\n end", "def coords\n Vector[@ob.x, @ob.y, @ob.z]\n end", "def get_move\n\t\tif(row_winning_move)\n\t\t\treturn row_winning_move\n\t\tend\n\t\tif(column_winning_move)\n\t\t\treturn column_winning_move\n\t\tend\n\t\tif(left_diag_winning_move)\n\t\t\treturn left_diag_winning_move\n\t\tend\n\t\tif(right_diag_winning_move)\n\t\t\treturn right_diag_winning_move\n\t\tend\n\n\t\t[rand(3), rand(3)]\n\tend", "def get_command_coords_and_direction(command_segments, index)\n if command_segments[index+1].include? \",\"\n \n # Get our x coord from the first param\n params = command_segments[index+1].split(\",\")\n\n if self.is_numeric? params[0]\n # Set our x coord from the first split element\n x_coord = params[0].to_i\n else\n # If no y coord was found, return an error\n puts \"Invalid X co-ordinate given to the PLACE command, skipping command...\"\n return false\n end\n \n\n # Check if the second paramater is numberic and if so use that as our y coord\n if !params[1].nil? \n # Strip comma\n y_coord = params[1].to_i \n elsif self.is_numeric? command_segments[index+2].tr!(\",\", \"\")\n # If we found the y coord in the next command segment use this\n y_coord = command_segments[index+2].to_i\n else\n # If no y coord was found, return an error\n puts \"Invalid Y co-ordinate given to the PLACE command, skipping command...\"\n return false\n end\n\n # Check if we have a direction to face as well\n if !params[2].nil?\n direction = params[2].tr(\" \", \"\")\n return {x: x_coord, y: y_coord, direction: direction}\n elsif command_segments[index+3] == \"NORTH\" || command_segments[index+3] == \"EAST\" || command_segments[index+3] == \"SOUTH\" || command_segments[index+3] == \"WEST\"\n direction = command_segments[index+3]\n return {x: x_coord, y: y_coord, direction: direction}\n else\n puts \"Invalid direction given to the PLACE command, skipping command\"\n return false\n end\n else\n puts \"Invalid PLACE command, skipping command...\"\n return false\n end\n end", "def move_direction(x, y)\n x_next = x\n y_next = y\n case @dp\n when :right\n x_next = x + 1\n when :down\n y_next = y + 1\n when :left\n x_next = x - 1\n when :up\n y_next = y - 1\n end\n\n [x_next, y_next]\n end", "def dir(direction)\n if direction == \"f\"\n return \"left\"\n elsif direction == \"g\"\n return \"center\"\n elsif direction == \"h\"\n return \"right\"\n elsif direction == \"c\"\n return \"away\"\n else\n return \"invalid\"\n end\n end", "def get_directionPont\n return @directionPont\n end", "def report\n return unless placed?\n [@pos_x, @pos_y, @direction[:value]]\n end", "def move\r\n case direction\r\n when DIRECTIONS[:north]\r\n self.longitude += 1\r\n when DIRECTIONS[:south]\r\n self.longitude -= 1\r\n when DIRECTIONS[:east]\r\n self.latitude += 1\r\n when DIRECTIONS[:west]\r\n self.latitude -= 1\r\n end\r\n\r\n return [latitude, longitude]\r\n end", "def direction(dest_x,dest_y,start_x,start_y)\n \n if @battler.is_a?(Game_Actor)\n if @move_speed == 10\n return (Math.atan2((start_y - dest_y), (start_x - dest_x))+360) % 360\n else\n return (Math.atan2((dest_y - start_y), (dest_x - start_x))+360) % 360\n end\n else\n if @move_speed == 20\n return (Math.atan2((start_y - dest_y), (start_x - dest_x))+360) % 360\n else\n return (Math.atan2((dest_y - start_y), (dest_x - start_x))+360) % 360\n end\n end\n \n end", "def coords; {:x => @x, :y => @y} end", "def compass_direction\n angle = Sketchup.active_model.shadow_info[\"NorthAngle\"].degrees\n rotation = Geom::Transformation.rotation(ORIGIN, Z_AXIS, -angle)\n\n Y_AXIS.transform(rotation)\n end", "def coords\n [x, y]\n end", "def next_position\n return unless placed?\n axis = case direction\n when 'east', 'west'; :x\n when 'north', 'south'; :y\n end\n amount = case direction\n when 'north', 'east'; +1\n when 'south', 'west'; -1\n end\n [@x + (axis == :x ? amount : 0), @y + (axis == :y ? amount : 0)]\n end", "def move(robot_name,robot_direction)\n case robot_direction\n when \"NORTH\"\n self.robot_position[robot_name][1] +=1 if robot_position[robot_name][1] < max_height\n when \"SOUTH\"\n self.robot_position[robot_name][1] -=1 if robot_position[robot_name][1] > 0\n when \"WEST\"\n self.robot_position[robot_name][0] -=1 if robot_position[robot_name][0] > 0\n when \"EAST\"\n self.robot_position[robot_name][0] +=1 if robot_position[robot_name][0] < max_length\n else\n nil\n end\n end", "def mouse_position\n mouse_state.position\n end", "def direction(p0, p1, p2)\n return (p0.x-p1.x)*(p2.y-p1.y) - (p2.x-p1.x)*(p0.y-p1.y)\n end", "def calculate_heading()\n @heading[:x], @heading[:y] = Params::directional_vector @angle\n end", "def forward_position\n\t\tcase @orientations.key(@orientation.to_i)\n\t\twhen 'N'\n\t\t\treturn [@x.to_i, @y.to_i + 1]\n\t\twhen 'E'\n\t\t\treturn [@x.to_i + 1,@y.to_i]\n\t\twhen 'S'\n\t\t\treturn [@x.to_i,@y.to_i - 1]\n\t\twhen 'W'\n\t\t\treturn [@x.to_i - 1,@y.to_i]\n\t\telse\n\t\t\treturn 'There was a problem'\n\t\tend\n\tend", "def direction\n self.vector.normalize\n end", "def initialize\n @current_direction\n end", "def motion (direction)\n unit = (direction == :forward) ? 1 : -1;\n new_x, new_y = @x, @y\n case @heading\n when 'N'\n new_y = bound_y(@y + unit)\n when 'E'\n new_x = bound_x(@x + unit)\n when 'S'\n new_y = bound_y(@y - unit)\n when 'W'\n new_x = bound_x(@x - unit)\n end\n if @world.obstacle?(new_x, new_y)\n raise \"Obstacle found at x:#{new_x} y:#{new_y}\"\n else\n @x, @y = new_x, new_y\n end\n end", "def direction\n @x1 != @x2 ? AvoidRoads::DIRECTION_RIGHT : AvoidRoads::DIRECTION_UP\n end", "def move\n if @direction.north? then @y += 1\n elsif @direction.south? then @y -= 1\n elsif @direction.east? then @x += 1\n elsif @direction.west? then @x -= 1\n end\n return self\n end", "def get_direction_constant\n # Use const_get to get the classes direction constants based on the direction string (NORTH, EAST, SOUTH and WEST)\n return DIRECTION_INFORMATION[@current_position[:direction].upcase.to_sym]\n end", "def get_position(x, y)\r\n\t\treturn maze[y][x]\r\n\tend", "def next_position\n\n # change the direction when the number of a half spin\n # has been walked. Also increase the number of steps\n # in the next turn accordingly.\n if @steps_of_half_spin == 0\n @max_steps_in_dir += 1\n @steps_of_half_spin = 2 * @max_steps_in_dir\n @move_right_or_up = !@move_right_or_up\n @steps = 0\n end\n @steps_of_half_spin -= 1\n\n if @move_right_or_up\n if @steps < @max_steps_in_dir\n @x += 1\n @steps += 1\n else\n # up\n @y += 1\n end\n Pos2.new(@x, @y)\n else\n if @steps < @max_steps_in_dir\n # left\n @x -= 1\n @steps += 1\n else\n # down\n @y -= 1\n end\n Pos2.new(@x, @y)\n end\n end", "def position\n V[x, y]\n end", "def location\n x_pointer = FFI::MemoryPointer.new :int, 1\n y_pointer = FFI::MemoryPointer.new :int, 1\n XDo::FFILib.xdo_get_window_location @_xdo_pointer, @_window, x_pointer,\n y_pointer, nil\n [x_pointer.read_int, y_pointer.read_int]\n end", "def position\n Vector2.new x, y\n end", "def y\n @location.y\n end", "def current_pos\n\t\treturn arr = [pos_x, pos_y]\n\tend", "def movements\n @movements ||= {\n \"s\" => -> (x, y, z) { [x, y - 1, z + 1] },\n \"n\" => -> (x, y, z) { [x, y + 1, z - 1] },\n \"ne\" => -> (x, y, z) { [x + 1, y, z - 1] },\n \"se\" => -> (x, y, z) { [x + 1, y - 1, z] },\n \"nw\" => -> (x, y, z) { [x - 1, y + 1, z] },\n \"sw\" => -> (x, y, z) { [x - 1, y, z + 1] },\n }\n end", "def to_s\n puts \"Your Mars rover is at #{@x_axis}, #{@y_axis}, #{@direction}\"\n end", "def robot_right\n state_execute do |robot|\n robot.right\n end\n end", "def screen_position\n position\n end", "def lon\n @position[1]\n end", "def mouse_coords\n # For some reason, Gosu's mouse_x/mouse_y return Floats, so round it off\n [\n (mouse_x.round + @camera_x) * PIXEL_WIDTH,\n (mouse_y.round + @camera_y) * PIXEL_WIDTH\n ]\n end", "def robot_move\n state_execute do |robot|\n robot.move\n end\n end", "def get_direction start_pos, end_pos\n difference = [end_pos[0] - start_pos[0], end_pos[1] - start_pos[1]]\n difference.map { |value| value <=> 0 }\n end", "def right position\n # if currently facing north\n if position[2] == \"north\"\n # right will make it face east\n position[2] = \"east\"\n # if currently facing south\n elsif position[2] == \"south\"\n # right will make it face west\n position[2] = \"west\"\n # if currently facing east\n elsif position[2] == \"east\"\n # right will make it face south\n position[2] = \"south\"\n # if currently facing west\n elsif position[2] == \"west\"\n # right will make it face north\n position[2] = \"north\"\n end\n position\nend", "def direction; end", "def direction; end", "def get_coords_from_node(node)\n\t\t[node.x,node.y]\n\tend", "def neighbor direction\n\t\tdirection=direction.to_s.upcase.to_sym # canonical: :N, :E, :S, :W\n\n\t\tcase direction\n\t\twhen :N\n\t\t\trow, col = @ai.normalize @row-1, @col\n\t\twhen :E\n\t\t\trow, col = @ai.normalize @row, @col+1\n\t\twhen :S\n\t\t\trow, col = @ai.normalize @row+1, @col\n\t\twhen :W\n\t\t\trow, col = @ai.normalize @row, @col-1\n\t\telse\n\t\t\traise 'incorrect direction'\n\t\tend\n\n\t\treturn @ai.map[row][col]\n\tend", "def neighbor direction\n\t\tdirection=direction.to_s.upcase.to_sym # canonical: :N, :E, :S, :W\n\n\t\tcase direction\n\t\twhen :N\n\t\t\trow, col = @ai.normalize @row-1, @col\n\t\twhen :E\n\t\t\trow, col = @ai.normalize @row, @col+1\n\t\twhen :S\n\t\t\trow, col = @ai.normalize @row+1, @col\n\t\twhen :W\n\t\t\trow, col = @ai.normalize @row, @col-1\n\t\telse\n\t\t\traise 'incorrect direction'\n\t\tend\n\n\t\treturn @ai.map[row][col]\n\tend", "def orientation \n @position - @prev_position\n end", "def compass_position\n return @compass_position if @state == ORIENT_STATE\n\n @input_point.position\n end", "def cal_pos\n x, y = map_location(@grid_x, @grid_y)\n x += @tile_size/2\n y += @tile_size/2\n [x,y]\n end" ]
[ "0.6960154", "0.66306275", "0.65223086", "0.65220875", "0.6433028", "0.6346873", "0.63243526", "0.6262036", "0.62360185", "0.6227738", "0.6204321", "0.6193288", "0.6170154", "0.6150194", "0.6134255", "0.61071503", "0.6086386", "0.6074544", "0.60576725", "0.60527176", "0.60456586", "0.60197014", "0.6010587", "0.5989299", "0.5960344", "0.59412074", "0.5919885", "0.5912077", "0.5898359", "0.58860105", "0.5885807", "0.58831763", "0.5865814", "0.5845411", "0.58345336", "0.58301705", "0.58178574", "0.58124244", "0.5803515", "0.579818", "0.5795259", "0.5794802", "0.5774774", "0.57695943", "0.5767412", "0.5745357", "0.5704598", "0.5698628", "0.5685665", "0.56827", "0.56658477", "0.5660241", "0.5652916", "0.56527", "0.56402063", "0.56390256", "0.56365114", "0.56330204", "0.5631059", "0.56287664", "0.5621714", "0.5612035", "0.5598353", "0.55961007", "0.5585957", "0.55814487", "0.55757385", "0.5549989", "0.55390036", "0.55212337", "0.5512814", "0.55068165", "0.54998326", "0.5499376", "0.5495189", "0.54948026", "0.5489816", "0.5475636", "0.54709625", "0.54615057", "0.54433864", "0.5439027", "0.5436329", "0.54359674", "0.54315245", "0.54117304", "0.5409211", "0.5397903", "0.5390168", "0.5389713", "0.53839445", "0.5373713", "0.5373713", "0.5372475", "0.5369052", "0.5369052", "0.536459", "0.5362992", "0.53603595" ]
0.5568673
68
Evals and executes a string command.
def eval(input) return if input.strip.empty? args = input.split(/\s+/) command = args.first.to_s.downcase.to_sym arguments = args.last raise ArgumentError, 'Invalid command' unless COMMANDS.include?(command) case command when :place raise ArgumentError, 'Invalid command' if arguments.nil? tokens = arguments.split(/,/) raise ArgumentError, 'Invalid command' unless tokens.count > 2 x = tokens[0].to_i y = tokens[1].to_i direction = tokens[2].downcase.to_sym place(x, y, direction) when :move move when :left rotate_left when :right rotate_right when :report report else raise ArgumentError, 'Invalid command' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_command(str)\n Shellissimo.with_error_handling do\n command = @input_parser.parse_command(str)\n puts format instance_eval(&command.block)\n end\n end", "def execute(command_string)\n Runner.instance.cross_call command_string\n end", "def execute(input_string)\n input = Input.new(input_string)\n\n send \"#{input.command.downcase}_command\".to_sym, input.args\n end", "def execute(command_str)\n # get_params: gets the command to be executed. It formats in a hash like {command: 'method_name', options: {} }\n command_hash = @command_recognizer.get_params(command_str)\n command = command_hash[:command]\n options = command_hash[:options]\n\n if options.nil?\n send(command)\n else\n send(command, options)\n end\n end", "def issue_command(str)\n puts str\nend", "def execute_command(string = nil)\n say_command = generate_command\n say = IO.popen(say_command, 'w+')\n say.write(string) if string\n say.close\n\n [say_command, $CHILD_STATUS.exitstatus]\n end", "def execute_command command_text\r\n #TODO: really, what is point of this \"convenience\" method!?\r\n create_command( command_text ).execute\r\n end", "def execute\n parse_command\n run_command(command)\n end", "def exec_cmd(cmd, str)\n return cmd.execute(@pl, str.split(\" \"))\nend", "def exec_command(command_string)\n io = IO.popen(command_string)\n raise Indy::Source::Invalid, \"No data returned from command string execution\" if io.eof?\n io\n end", "def cmd(string)\n @commands << string\n end", "def command(command_text)\n @command_text = command_text\n end", "def execute_command(command)\n end", "def execute_command(command)\n end", "def execute_command(command)\n %x{#{command}}\n end", "def execute(command)\n end", "def execute_command(command)\n raw(*command)\n end", "def send_command(string_to_execute)\n command! <<~VIML\n call histadd(\":\", #{VimlValue.dump(string_to_execute)})\n VIML\n\n history_updated = with_ignore_cache do\n became_truthy_within?(5.seconds) do\n echo(func('histget', ':', -1)) == string_to_execute\n end\n end\n raise unless history_updated\n\n command('let &undolevels=&undolevels')\n press! \":#{string_to_execute}\"\n send_keys :enter\n end", "def command command_string\n connection.command self.id, nil, command_string\n end", "def run(command_string)\n\n command, param1, param2, param3 = command_string.strip().gsub(' ', ',').squeeze(',').upcase().split(',')\n\n\n # raise exception if 'PLACE' command has not been called earlier\n raise \"'PLACE' command has not been called earlier\" unless @placed or command == 'PLACE'\n\n\n # blank or invalid command\n raise 'Invalid command' unless COMMAND.key?(command)\n\n if command == 'PLACE'\n # PLACE command should have three parameters attached\n raise 'Missing parameter' unless (param1 and param2 and param3)\n\n place(Coordinates.new(param1, param2), Direction.new(param3))\n\n else\n self.public_send(COMMAND[command])\n end\n end", "def execute(cmd)\n res = eval(@multiline_cmd << \"\\n\" << cmd, @pure_binding)\n $last_res = res\n eval(\"_ = $last_res\", @pure_binding)\n @multiline_cmd = ''\n print_result res\n rescue SyntaxError => e\n unless e.message.include? 'unexpected end-of-input'\n @multiline_cmd = ''\n puts \"Exception #{e.class} -> #{e.message}\"\n end\n # Else it should be multiline command.\n rescue Rush::Exception => e\n puts \"Exception #{e.class} -> #{e.message}\"\n @multiline_cmd = ''\n rescue ::Exception => e\n puts \"Exception #{e.class} -> #{e.message}\"\n e.backtrace.each { |t| puts \"\\t#{::File.expand_path(t)}\" }\n @multiline_cmd = ''\n end", "def run_command(val)\n commands.process_line(\n val,\n eval_string: @eval_string,\n target: current_binding,\n pry_instance: self,\n output: output\n )\n Pry::Command::VOID_VALUE\n end", "def execute(value)\n unless value.kind_of?(String)\n raise ParseError.new(\"#{name}: #{value.inspect} must be kind of String\")\n end\n Executor.new(self, value).result\n end", "def call(*command); end", "def execute(command)\r\n system \"#{command}\"\r\nend", "def call command_str, options={}, &block\n Sunshine.logger.info @host, \"Running: #{command_str}\" do\n execute build_remote_cmd(command_str, options), &block\n end\n end", "def execute(cmd)\n send(*cmd)\n end", "def exec(cmd, *rest) end", "def execute_string(param_string)\n tmp = Tempfile.new('tmp')\n command_string = option_string() + \"#{param_string} \" + \" 2> \" + tmp.path\n success = system(command_string)\n if success\n begin\n while (line = tmp.readline)\n line.chomp\n selected_string = line\n end\n rescue EOFError\n tmp.close\n end\n return selected_string\n else\n tmp.close!\n return success\n end\n end", "def command(string)\n @request_id = rand(1000)\n @string1 = string\n @string2 = TRAILER\n @command_type = COMMAND_EXEC\n\n @packet_size = build_packet.length\n\n return self\n end", "def send_string(str, command)\n when_not_awaiting_continuation do\n begin\n send_line_buffered str\n rescue => e\n command.fail e\n end\n end\n end", "def run_cmd(input); end", "def try_and_execute_command(command)\n command_array = command.split(' ')\n method_name = command_array.shift\n args = \"\"\n command_array.each{|k| args << \"'#{k}',\"}\n args.chomp!(',')\n output = eval(\"#{method_name.downcase}(#{args})\")\n puts output if output\n end", "def execute(command)\n if valid_command?(command)\n apply_command(command)\n else\n return 'Invalid command.'\n end\n end", "def execute(command)\n system \"#{command}\" # rubocop:disable UnneededInterpolation\nend", "def run\n raise \"`#{ real_command }' failed\" unless Kernel.system( real_command )\n end", "def run(command_string, *args)\n complete_string = \"#{command_string} #{args.join(\" \")}\".rstrip\n command_set.process_line(complete_string, context)\n end", "def run_command(command)\n `#{command}`\nend", "def process_commands(val, eval_string, target)\n def val.clear() replace(\"\") end\n def eval_string.clear() replace(\"\") end\n\n if system_command?(val)\n execute_system_command(val, target)\n return\n end\n\n # no command was matched, so return to caller\n return if !pry_command?(val)\n\n val.replace interpolate_string(val, target)\n command, args_string = command_matched(val)\n\n args = args_string ? Shellwords.shellwords(args_string) : []\n\n options = {\n :val => val,\n :eval_string => eval_string,\n :nesting => nesting,\n :commands => commands.commands\n }\n\n execute_command(target, command.name, options, *args)\n end", "def execute(command)\n invoke_command(command, nil)\n end", "def exec_on!(command_str,current_path_str)\n exec!(\"cd #{current_path_str};\" + command_str)\n end", "def execute(command)\n system \"#{command}\"\nend", "def execute(command)\n system \"#{command}\"\nend", "def exec(cmd)\n puts cmd\n `#{cmd}`\nend", "def execute(cmd_string, complete_target = true, target = nil, sel = nil)\n #DebugTools.log_outbound_command(self.command, cmd_string, complete_target, target)\n\n @unit.send_raw(cmd_string.token!, cmd_string)\n return true \n end", "def execute\n command = lines.map(&:to_s).join(\"\\n\")\n\n reset!\n\n clear\n\n Vedeu.trigger(:_command_, command)\n\n command\n end", "def execute(command)\n @command = command\n self\n end", "def cmd(command)\n\t\tbegin\n\t\t\t`#{command}`\n\t\trescue Exception => e\n\t\t\te.to_s\n\t\tend\n\tend", "def run(cmd_str)\n\tcmd_str.chars[$last_run_idx..-1].join('').match(/([RL]*)(A+)/)\nend", "def run_cmd(cmd)\n\tend", "def execute(cmd_string, complete_target = true, target = nil, sel = nil)\n #DebugTools.log_outbound_command(self.command, cmd_string, complete_target, target)\n \n c = @unit.world.selchannel || @unit\n\n if cmd_string.empty?\n @unit.print_both(c, :error_reply, self.help)\n return true\n end\n\n begin\n result = eval(cmd_string).inspect\n rescue SyntaxError => e \n @unit.send_text(c, :privmsg, \"syntax error >> #{cmd_string}\")\n rescue Exception => e\n @unit.send_text(c, :privmsg, \"exception #{e} >> #{cmd_string}\")\n else\n @unit.send_text(c, :privmsg, \"=> #{result}\")\n end\n \n return true \n end", "def subexec(str)\n\tsubprocess { exec(*str.split(' ')) }\nend", "def execute(command) # rubocop:disable Lint/UnusedMethodArgument\n end", "def cmd(cmd)\n puts cmd\n system cmd\n end", "def ex(cmd)\n puts cmd\n puts `#{cmd}`\nend", "def exec(command, &block); end", "def execute(cmd)\n Util.execute(cmd)\n end", "def cmd(command, val)\n @emq.push( raw_cmd command, val )\n end", "def execute_command(command)\n system(command)\n end", "def parse_command_string(command_string)\n # Split our command into segments to be further parsed\n command_segments = command_string.split(\" \")\n\n # Iterate over each command segment with the current index (i)\n command_segments.each_with_index do |command_segment, i|\n # Skip any command parameters, checks if segment contains a delimiter (,)\n next if command_segment.include? \",\"\n\n # Check which commdand we want to execute and execute the appropriate method\n case command_segment.upcase.to_sym\n when :MOVE\n self.move\n when :PLACE\n # Get our X, Y and direction information from the command params\n place_params = self.get_command_coords_and_direction(command_segments, i)\n\n # Pass the X and Y co-ordinates to the place method\n if place_params != false\n self.place place_params[:x], place_params[:y], place_params[:direction]\n end\n when :LEFT\n self.rotate :left\n when :RIGHT\n self.rotate :right\n when :REPORT\n self.report\n end\n end\n end", "def execute(cmd)\n eval(EXECUTE, binding, __FILE__, EXECUTE_LINE)\n nil\nend", "def execute(command)\n system(command)\n end", "def doCmd(cmd)\n puts cmd;\n puts `#{cmd}`;\nend", "def cmd(command, *arguments) Command.send(command.to_sym, *arguments) end", "def run\n\t\traise RuntimeError, \"Command line not parsed; call parse!().\" unless @command\n\t\t$log.debug(\"#{self.class}.#{__method__}() - Performing #{@command}...\")\n\t\treturn self.send(@command)\n\tend", "def execute(cmd)\n @log.info(\"Executing command '#{cmd}'...\")\n Kernel.system(cmd)\n end", "def read_and_execute(inp)\n args = inp.split(' ') # Split the input by space\n cmd_name = args[0] # First argument of the command name\n cmd_args = args[1..inp.length] # Second argument is the argument of the commands\n @commands_available[cmd_name].execute(cmd_args)\n end", "def execute(str)\n @parser.parse(str) do |to_call|\n if @dispatch.trace\n puts to_call\n c = ImmediateRead.new.getch\n throw :reset unless c == \"\\n\"\n puts\n end\n @dispatch.dispatch(to_call)\n end\n end", "def simple_execute(chain, event)\n return nil if chain.empty?\n\n args = chain.split(' ')\n execute_command(args[0].to_sym, event, args[1..])\n end", "def execute(cmd_string, complete_target = true, target = nil, sel = nil)\n #DebugTools.log_outbound_command(self.command, cmd_string, complete_target, target)\n\n interval = cmd_string.token!\n if interval =~ /^\\d+$/\n @unit.add_timed_command( [interval.to_i, sel, cmd_string] )\n else\n @unit.print_both(@unit, :error_reply, self.help) \n end\n return true\n \n end", "def process_commands(val, eval_string, target)\n\n command, captures, pos = command_matched(val, target)\n\n # no command was matched, so return to caller\n return Result.new(false) if !command\n\n arg_string = val[pos..-1]\n\n # remove the one leading space if it exists\n arg_string.slice!(0) if arg_string.start_with?(\" \")\n\n args = arg_string ? Shellwords.shellwords(arg_string) : []\n\n options = {\n :val => val,\n :arg_string => arg_string,\n :eval_string => eval_string,\n :commands => commands.commands,\n :captures => captures\n }\n\n ret = execute_command(target, command.name, options, *(captures + args))\n\n Result.new(true, command.options[:keep_retval], ret)\n end", "def execute(command_line)\n #the first part of command_line is stored in command and the second is is rest\n command, rest = command_line.split(/ /, 2)\n case command\n when 'show' #display tasks by projects and all the properties of each task\n show\n when 'add' #add a new task or project, btw..A project can contain many tasks\n add rest\n when 'check' #mark the task entered as checked\n check rest\n when 'uncheck' #mark the task entered as unchecked\n uncheck rest\n when 'help' #check the existing commands and there format\n help\n when 'deadline' # adding the ability to precise a deadline for a task already existing, syntax: deadline id_task date_deadline\n deadline rest\n when 'today' # adding the ability to display all tasks which deadline is today\n today\n when 'delete' #adding the ability to delete a task, syntax: delete id_task\n delete rest\n when 'view' #displays tasks by date or deadline or project depending on input, syntax: view by date||view by deadline||view by project\n view rest\n else\n error command\n end\n end", "def `(cmd) #`\n\t\tRAILS_DEFAULT_LOGGER.debug(\"Running #{cmd}\")\n\t\tKernel.`(cmd) #`\n\tend", "def run_as_system(command)\n Strainer.ui.debug 'Using %x'\n %x{#{command}}\n end", "def exec(string)\n response = AGIResponse.new\n command_str = \"EXEC #{string}\"\n begin\n response.native = execute(command_str)\n rescue AGITimeoutError, AGICommandError, AGIHangupError\n raise\n end\n if response.native == -2 then\n raise AGICommandError.new(@last_response, \"Application Not Found in (#{command_str})\")\n elsif response.native == -1 then\n raise AGIChannelError.new(@last_response, \"Channel Failure in (#{command_str})\")\n else\n response.success = true\n response.data = parse_response\n response.data ||= response.native\n end\n return response\n end", "def exec(cmd)\n puts g(cmd)\n\n Process.exec(cmd)\n end", "def execute\n puts HEADER\n\n loop do\n cmd = gets.chomp\n\n if valid_command?(cmd)\n execute_command(cmd)\n else\n puts 'Not valid command'\n end\n end\n end", "def execute_command!(*argv)\n execute_command(argv)\n raise Error.new(\"Command failed!\") unless $?.success?\n end", "def execute(cmd_string, complete_target = true, target = nil, sel = nil)\n #DebugTools.log_outbound_command(self.command, cmd_string, complete_target, target)\n\n target = get_target(cmd_string, sel) # note... this method will mutate cmd_string\n\n params = cmd_string.split(/ +/)\n return true if params.empty? # TODO output help text\n\n mode_command_string = @privilege_modifier + (@mode_command * params.size) + ' ' + cmd_string \n @unit.send(:mode, target, mode_command_string)\n return true \n end", "def execute(*command)\n UI.say \"=> #{command.join(' ')}\".color(:green)\n success = system(*command)\n unless success\n UI.error(command.join(' '))\n exit 1\n end\n end", "def exec\n binding.pry\n # command.run(*service.exec(args.command))\n end", "def run_with_redirects(command_string, to_redact = \"\")\n common = Common.new\n command_to_echo = command_string.clone\n if to_redact\n command_to_echo.sub! to_redact, \"*\" * to_redact.length\n end\n common.put_command(command_to_echo)\n unless system(command_string)\n raise(\"Error running: \" + command_to_echo)\n end\nend", "def run_with_redirects(command_string, to_redact = \"\")\n common = Common.new\n command_to_echo = command_string.clone\n if to_redact\n command_to_echo.sub! to_redact, \"*\" * to_redact.length\n end\n common.put_command(command_to_echo)\n unless system(command_string)\n raise(\"Error running: \" + command_to_echo)\n end\nend", "def execute_system_command(val, target)\n SYSTEM_COMMAND_REGEX =~ val\n cmd = interpolate_string($1, target)\n\n if cmd =~ /^cd\\s+(.+)/i\n begin\n @@cd_history ||= []\n if $1 == \"-\"\n dest = @@cd_history.pop || Dir.pwd\n else\n dest = File.expand_path($1)\n end\n\n @@cd_history << Dir.pwd\n Dir.chdir(dest)\n rescue Errno::ENOENT\n output.puts \"No such directory: #{dest}\"\n end\n else\n if !system(cmd)\n output.puts \"Error: there was a problem executing system command: #{cmd}\"\n end\n end\n\n # Tick, tock, im getting rid of this shit soon.\n val.replace(\"\")\n end", "def execute(cmd)\n res = eval(cmd, @pure_binding)\n $last_res = res\n eval(\"_ = $last_res\", @pure_binding)\n print_result res\n rescue Rush::Exception => e\n puts \"Exception #{e.class} -> #{e.message}\"\n rescue ::Exception => e\n puts \"Exception #{e.class} -> #{e.message}\"\n e.backtrace.each do |t|\n puts \" #{::File.expand_path(t)}\"\n end\n end", "def run\n raise Error, \"Unknown command `#{command_name}`\"\n end", "def exec_command(cmd)\n exec(cmd)\n # windows? ? exec(cmd) : fake_exec(cmd)\n end", "def exec(command)\n @commands << %{write text \"#{command}\"}\n end", "def execute_command(parsed_command)\n execution_method = \"execute_#{parsed_command[:command]}\".to_sym\n if self.respond_to? execution_method, true\n self.send execution_method, parsed_command[:params]\n else\n raise \"Command '#{parsed_command[:command]}' not supported\"\n end\n end", "def execute command\n log command\n system(command) unless @options[:test]\n end", "def esx_cmd(command)\n cmd = \"#{BIN_LOCATION}/tty_expect -u #{@user} -p #{@pass} #{command}\"\nend", "def execute_command(cmd, user, room)\n cmd = cmd.split # split the array\n args = cmd.last(cmd.length - 1) # get the args (everything that's not the first entry)\n cmd = cmd.first.reverse.chop.reverse.downcase # remove the dot from the command\n \n # if this command is actually a command..\n if COMMANDS.keys.any?{|p| p == cmd }\n method = self.method(cmd) # get the method assoicated with the command\n opts = COMMANDS[cmd] # get the options\n opts = opts.to_s.to_a if not opts.is_a? Array\n\n # ensure we have the proper amount of options to pass to the method\n if method.arity == opts.length\n inputs = []\n opts.each do |opt| # build the params list\n inputs << case opt.to_sym\n when :room then room\n when :args then args\n when :user then user\n end\n end\n # execute it\n puts \"#{@num_processed += 1}@[#{Time.now}] Command processed: #{cmd}\"\n send(cmd, *inputs)\n else\n room.speak(\"Fatal error - configuration error\")\n quit\n raise \"fatal error - wrong number of inputs in COMMANDS hash. Had #{opts.length} needed #{method.arity}\"\n end\n else\n room.speak(\"Unknown command: #{cmd}\")\n end\n end", "def get_command_from_string(command_string)\n #Split the command based on the equal '=' sign.\n remove = \"\"\n keyword=\"\"\n value=\"\"\n\n if (command_string != \"\")\n #Get command and u-value\n if ( command_string.match(/(^\\s*(\\\".*?\\\")\\s*\\=\\s*(\\S+)\\s*)/) )\n @commandName=$3.strip\n @utype = $2.strip\n remove = Regexp.escape($1)\n\n else\n # if no u-value, get just the command.\n command_string.match(/(^\\s*(\\S*)\\s)/ )\n remove = Regexp.escape($1)\n @commandName=$2.strip\n end\n #Remove command from string.\n\n command_string.sub!(/#{remove}/,\"\")\n command_string.strip!\n\n\n #Loop throught the keyword values.\n while ( command_string.length > 0 )\n #DOEMaterial, or SCHEDULES\n if ( command_string.match(/(^\\s*(MATERIAL|DAY-SCHEDULES|WEEK-SCHEDULES)\\s*(\\=?)\\s*(.*)\\s*)/))\n #puts \"Bracket\"\n keyword = $2.strip\n value = $4.strip\n remove = Regexp.escape($1)\n #Stars\n elsif ( command_string.match(/(^\\s*(\\S*)\\s*(\\=?)\\s*(\\*.*?\\*)\\s*)/))\n #puts \"Bracket\"\n keyword = $2.strip\n value = $4.strip\n remove = Regexp.escape($1)\n\n #Brackets\n elsif ( command_string.match(/(^\\s*(\\S*)\\s*(\\=?)\\s*(\\(.*?\\))\\s*)/))\n #puts \"Bracket\"\n keyword = $2.strip\n value = $4.strip\n remove = Regexp.escape($1)\n #Quotes\n elsif ( command_string.match(/(^\\s*(\\S*)\\s*(\\=?)\\s*(\".*?\")\\s*)/) )\n #puts \"Quotes\"\n keyword = $2\n value = $4.strip\n remove = Regexp.escape($1)\n #single command\n elsif command_string.match(/(^\\s*(\\S*)\\s*(\\=?)\\s*(\\S+)\\s*)/)\n #puts \"Other\"\n keyword = $2\n value = $4.strip\n remove = Regexp.escape($1)\n end\n #puts \"DOE22::DOECommand: #{command_string}\"\n #puts \"K = #{keyword} V = #{value}\\n\"\n if (keyword != \"\")\n set_keyword_value(keyword,value)\n end\n command_string.sub!(/#{remove}/,\"\")\n end\n #puts \"Keyword\"\n #puts keywordPairs\n end\n end", "def method_missing(command, *args)\n execute(command.to_s, *args)\n end", "def method_missing(command, *args)\n execute(command.to_s, *args)\n end", "def execute_command(command, input)\n command.new(self, input).process\n end", "def eval(input)\n return if input.strip.empty?\n\n args = input.split(/\\s+/)\n command = args.first.to_s.downcase.to_sym\n arguments = args.last\n\n raise ArgumentError, 'Invalid command' unless Constant::COMMANDS.include?(command)\n\n case command\n when :place\n raise ArgumentError, 'Invalid command' if arguments.nil?\n\n tokens = arguments.split(/,/)\n\n raise ArgumentError, 'Invalid command' unless tokens.count > 2\n\n x = tokens[0].to_i\n y = tokens[1].to_i\n direction = tokens[2].downcase.to_sym\n\n place(x, y, direction)\n when :move\n move\n when :left\n rotate_left\n when :right\n rotate_right\n when :report\n report\n else\n raise ArgumentError, 'Invalid command'\n end\n end", "def run_command(*args)\n %x(#{args.join(\" \")})\n rescue IOError, SystemCallError\n nil\n end", "def command(cmd)\n \"do_#{cmd}\".intern\n end", "def call_command\n verb = match.captures[match.names.index('command')]\n verb = normalize_command_string(verb)\n public_send(verb)\n end", "def execute(str, args = [])\n normalise_array_of_hashes(Que.execute(str, args))\n end" ]
[ "0.7226228", "0.6979381", "0.6978896", "0.6842509", "0.6841425", "0.6824786", "0.67988217", "0.67216617", "0.6682211", "0.6627952", "0.66056275", "0.65997386", "0.65315396", "0.65315396", "0.65315324", "0.6523913", "0.6523123", "0.6520865", "0.64750385", "0.6471476", "0.64564157", "0.6415342", "0.63770026", "0.6358082", "0.6357538", "0.6356282", "0.63504773", "0.634386", "0.6333524", "0.6302481", "0.6301624", "0.62988204", "0.62933636", "0.6287929", "0.6277125", "0.62193817", "0.62133807", "0.6207312", "0.6197747", "0.61959845", "0.6194308", "0.6188589", "0.6188589", "0.6158027", "0.61565953", "0.6149888", "0.6147449", "0.61473733", "0.61356926", "0.61344516", "0.61301345", "0.6129224", "0.6126302", "0.6117529", "0.61108434", "0.6097897", "0.609414", "0.60828453", "0.6069209", "0.60608304", "0.6059299", "0.6058377", "0.6057629", "0.6047729", "0.6020961", "0.60143197", "0.6013067", "0.6001608", "0.59905565", "0.5972883", "0.59609294", "0.5959079", "0.5957712", "0.59411573", "0.58922905", "0.5891719", "0.5886291", "0.5881672", "0.5880472", "0.5871494", "0.58704436", "0.5861214", "0.5861214", "0.5858498", "0.5853187", "0.5851772", "0.5830377", "0.58292973", "0.5828246", "0.5828158", "0.58277124", "0.5817059", "0.579614", "0.5793281", "0.5793281", "0.5791821", "0.5789376", "0.57824266", "0.5775", "0.57673407", "0.5766774" ]
0.0
-1
Compare if two strings have less then 3 chars equals
def test_less_than_3_equal_chars assert_equal(false,compare('1234','1325')) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def third_ana(str1, str2)\n sorted1 = str1.chars.sort\n sorted2 = str2.chars.sort\n sorted1 == sorted2\nend", "def string_scramble(str1, str2)\r\n str2.chars.all? { |x| str1.count(x) >= str2.count(x) }\r\nend", "def third_anagram?(string1, string2)\n chars1 = string1.chars.sort\n chars2 = string2.chars.sort\n\n chars1 == chars2\nend", "def third_anagram?(str1, str2)\n letters1 = str1.chars\n letters1.sort!\n letters2 = str2.chars\n letters2.sort!\n \n letters1 == letters2\nend", "def third_anagram?(str_1, str_2)\n sorted_str_1 = str_1.chars.sort.join\n sorted_str_2 = str_2.chars.sort.join\n sorted_str_1 == sorted_str_2\nend", "def compare_string_length(str1, str2)\n\treturn str1.length() === str2.length() ? true : false\nend", "def common_substrings(string1, string2)\n string2.downcase.chars.each do |char|\n return false if string2.count(char) > string1.downcase.count(char)\n end\n true\nend", "def third_anagram?(str1, str2)\n s1 = str1.split('').sort\n s2 = str2.split('').sort\n\n s1 == s2\nend", "def scramble(str1, str2)\n str1_chars = str1.chars\n str2_chars = str2.chars\n\n str2_chars.all? do |char|\n str1_chars.count(char) >= str2_chars.count(char)\n end\nend", "def is_one_away_same_length(str1, str2)\n result = nil\n change_count = 0\n\n str1.split('').each_with_index do |chr, idx|\n change_count += 1 if str1[idx] != str2[idx]\n return false if change_count > 1\n end\n\n true\nend", "def compare_strings(string1, string2)\n\n\tcount = 0\n\tstring1.chars.each_index do |i|\n\t\tcount += 1 if string1[i] != string2[i]\n\tend\n\n\treturn count == 1\n\nend", "def ana3(string1, string2)\n\n string1.split(\"\").sort == string2.split(\"\").sort\n\nend", "def one_away?(str1, str2)\n if (str1.length - str2.length).between?(0,1)\n str1_index = 0\n str2_index = 0\n errors = 0\n\n count_errors = lambda do |str1, str2|\n if str1[str1_index] == str2[str2_index]\n str1_index += 1\n str2_index += 1\n else\n if errors.zero?\n errors += 1\n else\n return false\n end\n\n if str1.length > str2.length\n str1_index += 1\n elsif str2.length > str1.length\n str2_index += 1\n else\n str1_index += 1\n str2_index += 1\n end\n end\n end\n\n [str1.length, str2.length].max.times do |k|\n return false if !count_errors.call(str1, str2)\n end\n else\n false\n end\n\n return true\nend", "def scramble(str1, str2)\n str2.chars.all? do |char|\n str1.count(char) >= str2.count(char)\n end\nend", "def third_anagram?(str1, str2)\n str1.chars.sort == str2.chars.sort\nend", "def third_anagram?(str_1, str_2)\n str_1.chars.sort.join == str_2.chars.sort.join\nend", "def third_anagram?(str1, str2)\n str1.chars.sort == str2.chars.sort\nend", "def third_anagram?(str1, str2)\n str1.chars.sort == str2.chars.sort\nend", "def third_anagram?(str1, str2)\n str1.chars.sort == str2.chars.sort\nend", "def third_anagram?(str1, str2)\n str1.chars.sort == str2.chars.sort\nend", "def third_anagram?(str1, str2)\n str1.chars.sort == str2.chars.sort\nend", "def third_anagram?(str1, str2)\n str1.chars.sort == str2.chars.sort\nend", "def third_anagram?(str1, str2)\n str1.chars.sort! == str2.chars.sort!\nend", "def third_anagram?(first_str, second_str)\n first_sorted = first_str.chars.sort # n + nlogn\n second_sorted = second_str.chars.sort # m + mlogm\n first_sorted == second_sorted\nend", "def third_anagram?(str1,str2)\r\n str1.chars.sort == str2.chars.sort\r\nend", "def mutation?(string_1, string_2)\n \n string_2.each_char do |char|\n if string_1.count(char) < string_2.count(char)\n return false\n break\n else\n return true\n break\n end \n end \nend", "def third_anagram?(second_string)\n self.chars.sort == second_string.chars.sort\n end", "def third_anagram?(s1, s2)\n return s1.chars.sort == s2.chars.sort\nend", "def third_anagram?(string1, string2)\n string1.chars.sort == string2.chars.sort\nend", "def third_anagram?(string1, string2)\n string1.chars.sort == string2.chars.sort\nend", "def third_anagram?(str1, str2)\n str1sorted = str1.split(\"\").sort.join\n str2sorted = str2.split(\"\").sort.join\n\n return str1sorted == str2sorted\nend", "def prints_comparison(string1,string2)\r\n\r\n\tstring_length = string1.length\r\n\tdigitcntr=0\r\n\tfor i in (0 .. string_length-1) do\r\n\t\tif string1[i] != string2[i]\r\n\t\t\tdigitcntr = digitcntr + 1\r\n\t\tend \r\n\tend\r\n\r\n\tif digitcntr == 1 then\r\n\t\treturn true # strings off by one\r\n\telse\r\n\t\treturn false # strings same or off by more than one\r\n\tend\r\n\r\nend", "def third_anagram?(str1,str2)\n str1.chars.sort == str2.chars.sort\nend", "def third_anagram?(s1, s2)\r\n s1.chars.sort == s2.chars.sort\r\nend", "def third_anagram?(string1, string2)\n string1.chars.sort == string2.chars.sort\n \nend", "def third_anagram?(string1,string2)\n string1.chars.sort == string2.chars.sort\nend", "def common_prefix_length str1, str2\n l = 0\n s1 = str1.size\n s2 = str2.size\n for i in (0...min(min(s1,s2),4)) do\n if str1[i].eql?(str2[i])\n l += 1\n else\n break\n end\n end\n l\n end", "def third_anagram?(str,str2)\n str.chars.sort == str2.chars.sort\nend", "def third_anagram?(str1,str2) #O(nlogn)\n str1_a = str1.split('').sort\n str2_a = str2.split('').sort\n\n str1_a == str2_a \nend", "def third_anagram?(s1, s2)\n s1.chars.sort.join == s2.chars.sort.join\nend", "def third_anagram?(str1, str2)\r\n str1.split('').sort == str2.split('').sort\r\nend", "def third_anagram?(str1, str2) # O(n log n) linearithimic\n str1.chars.sort == str2.chars.sort\nend", "def third_anagram?(str1, str2)\r\n str1.split(\"\").sort == str2.split(\"\").sort\r\nend", "def third_anagram?(string1, string2)\n arr1 = string1.chars.sort\n arr2 = string2.chars.sort\n\n arr1 == arr2\nend", "def third_anagram?(word1, word2)\n split1= word1.chars.sort\n split2 = word2.chars.sort\n split1 == split2\nend", "def third_anagram?(str1, str2)\n str1.split(\"\").sort == str2.split(\"\").sort\nend", "def third_anagram?(str1, str2)\n sorted1 = str1.split(\"\").sort.join #O(n + nlogn + n) => O(nlogn)\n sorted2 = str2.split(\"\").sort.join #O(n + nlogn + n) => O(nlogn)\n\n sorted1 == sorted2 #O(1)\nend", "def third_anagram?(str1, str2)\n str1.split(\"\").sort.join(\"\") == str2.split(\"\").sort.join(\"\")\nend", "def third_anagram?(str1,str2) #O(n^2) ~ O(nlogn)\n str1.split('').sort == str2.split('').sort\nend", "def third_anagram?(str1, str2)\n\n str1.chars.sort == str2.chars.sort\n #sort1 #sort2\nend", "def same_letters?\n (@first.downcase.gsub(/[^a-z0-9\\s]/i, '').split(\"\") - @second.downcase.gsub(/[^a-z0-9\\s]/i, '').split(\"\")).empty?\n end", "def third_anagram?(first_word, second_word)\n first_word = first_word.chars.sort\n second_word = second_word.chars.sort\n\n first_word == second_word\nend", "def all_in_one_away(string1, string2)\n return false if (string1.length - string2.length).abs > 1\n\n s1 = string1.length < string2.length ? string1 : string2\n s2 = string1.length < string2.length ? string2 : string1\n\n index1 = 0\n index2 = 0\n found_difference = false\n\n while index1 < s1.length and index2 < s2.length\n if s1[index1] != s2[index2]\n return false if found_difference\n found_difference = true\n\n if s1.length == s2.length\n index1 += 1\n end\n else\n index1 += 1\n end\n index2 += 1\n end\n\n true\nend", "def backspace_compare(s1,s2)\n\tget_filtered_str(s1) == get_filtered_str(s2)\nend", "def one_away(str1, str2)\n if str1.length > str2.length\n longer = str1.length\n else\n longer = str2.length\n end\n\n different_counter = 0\n i = 0\n while i < longer\n if !str1[i]\n str1[i] = \" \"\n end\n\n if !str2[i]\n str2[i] = \" \"\n end\n\n if str1[0] != str2[0]\n different_counter += 1\n if different_counter > 1\n return false\n end\n end\n i += 1\n end\n\n true\nend", "def third_anagram?(str_1, str_2)\n str_1.split('').sort == str_2.split('').sort\nend", "def third_anagram?(string1, string2) #O(n log(n))\r\n string1.chars.sort == string2.chars.sort \r\nend", "def one_away(str1, str2)\n return true if str1 == str2\n return false if (str1.length - str2.length).abs > 1\n\n difference = 0\n\n if str1.length == str2.length\n (0...str1.length).each do |i|\n difference += 1 if str1[i] != str2[i]\n return false if difference > 1\n end\n else\n shorter = str1.length < str2.length ? str1 : str2\n longer = str1.length > str2.length ? str1 : str2\n idx1 = 0\n idx2 = 0\n while idx1 < longer.length && idx2 < shorter.length\n if longer[idx1] != shorter[idx2]\n return false if idx1 != idx2\n else\n idx2 += 1\n end\n\n idx1 += 1\n end\n end\n\n true\nend", "def third_anagram?(str_1, str_2)\n str_1.split(\"\").sort == str_2.split(\"\").sort\nend", "def third_anagram?(str_1, str_2)\n str_1.split(\"\").sort == str_2.split(\"\").sort\nend", "def third_anagram?(str1, str2) # O(2 * n log n)\n str1.chars.sort == str2.chars.sort\nend", "def third_anagram?(word1, word2)\n first = word1.chars.sort.join(\"\")\n second = word2.chars.sort.join(\"\")\n\n p first == second \nend", "def third_anagram?(str1, str2)\n str1.split(\"\").sort == str2.split(\"\").sort\nend", "def third_anagram?(str1, str2)\n str1.split(\"\").sort == str2.split(\"\").sort\nend", "def third_anagram?(str1, str2)\n str1.split(\"\").sort == str2.split(\"\").sort\nend", "def third_anagram?(str1, str2)\n str1.sort == str2.sort\nend", "def third_anagram?(str_1,str_2)\n str_1.sort == str_2.sort\nend", "def scramble(str1, str2)\n str2.chars.uniq.each do |char|\n if str1.include?(char)\n return false if str2.count(char) > str1.count(char)\n else \n return false\n end\n end\n\n true\nend", "def third_anagram?(string1, string2)\n string1.split(\"\").sort == string2.split(\"\").sort \nend", "def third_anagram?(str_1,str_2)\n str_1.split(\"\").sort == str_2.split(\"\").sort\nend", "def third_anagram?(str1, str2)\n\n str1.split(\"\").sort == str2.split(\"\").sort\n\nend", "def ana3(str1, str2)\n sorted1 = str1.split('').sort\n sorted2 = str2.split('').sort\n sorted1 == sorted2 #however ruby does .sort (input dependent, but qs?)\nend", "def fourth_anagramv2?(str1, str2)\n hash_1 = Hash.new(0)\n\n str1.chars.each { |char| hash_1[char] += 1 }\n str2.chars.each { |char| hash_1[char] -= 1 }\n\n hash_1.values.all?{ |count| count == 0}\nend", "def anagram_3?(str1,str2)\n str1.chars.sort == str2.chars.sort\nend", "def scramble(st1, st2)\n st1_arr = st1.chars\n st2_arr = st2.chars\n st2_arr.all? { |char| st1_arr.count(char) >= st2.count(char) }\nend", "def third_anagram?(word_1, word_2)\n word_1.chars.sort == word_2.chars.sort\nend", "def third_anagram(str1, str2)\n str1.chars.sort == str2.chars.sort\nend", "def third_anagram?(first_word, second_word)\n first_word.chars.sort == second_word.chars.sort\nend", "def third_anagram?(str1, str2)\n sorted_strings = [str1, str2].map do |str|\n str.split('').sort.join\n end\n\n sorted_strings.first == sorted_strings.last\nend", "def third_anagram?(word1, word2)\n word1_chars = word1.split(\"\").sort\n word2_chars = word2.split(\"\").sort\n word1_chars == word2_chars\n\nend", "def third_anagram?(string1, string2) #0(log n)\n string1.sort == string2.sort\nend", "def count_comparison_errors(valid_to_compare_to)\n errors = 0\n\n valid_to_compare_to.split('').each_with_index do |char,index|\n errors += 1 unless char == string.split('')[index]\n end\n\n errors\n end", "def third_anagram(str1, str2) \n sorted_str1 = str1.split(\"\").sort\n sorted_str2 = str2.split(\"\").sort\n\n sorted_str1 == sorted_str2\nend", "def third_anagram?(str1,str2)\n str1.split(\"\").sort == str2.split(\"\").sort # nlogn\nend", "def third_anagrams?(str1,str2)\n str1.split(\"\").sort.join(\"\") == str2.split(\"\").sort.join(\"\")\nend", "def third_anagram?(string1, string2) # Ruby uses quicksort. Time: o(n*log(n)) space = o(n)\n string1.split(\"\").sort == string2.split(\"\").sort\nend", "def third_anagram?(string, strong)\n string.chars.sort == strong.chars.sort\nend", "def ana4(str1, str2)\n return false unless str1.length == str2.length\n letters = Hash.new(0)\n i = 0\n while i < str1.length\n letters[str1[i]] += 1\n letters[str2[i]] -= 1\n i += 1\n end\n letters.values.all? { |value| value == 0 }\nend", "def can_complete(str1, str2)\n arr1 = str1.chars\n arr2 = str2.chars\n\n if arr1.all? {|char| arr2.include?(char)}\n missing_spaces = []\n arr2.each do |char|\n if char == arr1[0]\n missing_spaces << arr1.shift\n else\n missing_spaces << nil\n end\n end\n\n return false if !arr1.empty?\n\n missing_spaces.each_with_index do |char, index|\n if char == nil\n missing_spaces[index] = arr2[index]\n end\n end\n return true if missing_spaces == arr2\n end\n false\nend", "def fourth_anagram?(string1, string2)\n chars_hash = Hash.new(0)\n string1.chars.each do |chr|\n chars_hash[chr] += 1\n end\n\n string2.chars.each do |chr|\n chars_hash[chr] -= 1\n end\n\n chars_hash.values.all? {|count| count == 0}\nend", "def stringnum_comparison(str1, str2)\n extract_digits(str1) <=> extract_digits(str2)\n end", "def short_long_short(string1, string2)\n if string1.length < string2.length\n puts string1 + string2 + string1\n elsif string2.length < string1.length\n puts string2 + string1 + string2\n else\n puts \"The two strings are equal.\"\n end\nend", "def fourth_anagram?(str_1, str_2)\n letters = Hash.new(0)\n str_1.each_char do |letter|\n letters[letter] += 1\n end\n str_2.each_char do |letter|\n if !letters.include?(letter) || letters[letter] <= 0\n return false\n end\n letters[letter] -= 1\n end\n letters.all? { |k,v| v == 0 }\nend", "def is_permutation3(str1, str2)\n return false if str1.length != str2.length\n\n count = Hash.new(0)\n (0...str1.length).each do |idx|\n count[str1[idx]] += 1\n count[str2[idx]] -= 1\n end\n\n count.all? { |_, v| v == 0 }\nend", "def third_anagram?(str, target)\n str.chars.sort == target.chars.sort\nend", "def is_one_away(str1, str2)\n if str1.length - str2.length >= 2 || str2.length - str1.length >= 2\n return false\n elsif str1.length == str2.length\n return is_one_away_same_length(str1, str2)\n elsif str1.length > str2.length\n return is_one_away_diff_lengths(str1, str2)\n else\n return is_one_away_diff_lengths(str2, str1)\n end\nend", "def one_away(str1, str2)\n if str1 == str2\n return true\n elsif (str1.length - str2.length).abs > 1\n return false\n end\n\n num_edits =\n index_1 = 0\n index_2 = 0\n\n while index_1 < str1.length\n if str1[index_1] != str2[index_2]\n num_edits += 1\n index_2 += 1 if str1.length == str2.length\n else\n index_2 += 1\n end\n index_1 += 1\n\n \n p num_edits\n return false if num_edits > 1\n end\n\n true\nend", "def fourth_anagram?(str1, str2)\n char_count = Hash.new(0)\n str1.each_char do |el|\n char_count[el] += 1\n end\n str2.each_char do |el|\n if char_count[el] == 0\n return false\n else\n char_count[el] -= 1\n end\n end\n str1.length == str2.length\nend", "def ABCheck(str)\n letter_a_index = str.rindex('a')\n letter_b_index = str.rindex('b')\n number_places = letter_a_index - letter_b_index\n if number_places.abs >= 3\n puts 'true'\n else\n puts 'false'\n end\nend", "def fourth_anagram?(string_1, string_2)\n characters_1 = Hash.new(0)\n characters_2 = Hash.new(0)\n string_1.chars.each { |ch| characters_1[ch] += 1 }\n string_2.chars.each { |ch| characters_2[ch] += 1 }\n characters_1 == characters_2\nend" ]
[ "0.75032854", "0.7042264", "0.6976425", "0.6952992", "0.69413394", "0.6905814", "0.68864846", "0.6810362", "0.6801974", "0.6771305", "0.674886", "0.6744827", "0.6743547", "0.6738902", "0.6719764", "0.67191803", "0.6717567", "0.6717567", "0.6717567", "0.6717567", "0.6717567", "0.6717567", "0.67174655", "0.67174363", "0.67132646", "0.6711429", "0.6694403", "0.66932243", "0.66889703", "0.66889703", "0.6675422", "0.6675247", "0.6671365", "0.6660945", "0.6659275", "0.6651884", "0.6644749", "0.66371083", "0.66276664", "0.6620827", "0.66207457", "0.6600914", "0.659695", "0.6581241", "0.65790313", "0.657791", "0.6568449", "0.65583694", "0.6555306", "0.653622", "0.6536", "0.6533863", "0.6530352", "0.6524969", "0.65179884", "0.651019", "0.650323", "0.64987516", "0.64987326", "0.64987326", "0.6497902", "0.6496883", "0.64925313", "0.64925313", "0.6486009", "0.6479304", "0.64748734", "0.6470203", "0.64671886", "0.64657456", "0.64635783", "0.64597684", "0.64470816", "0.64293975", "0.64191544", "0.6409265", "0.64034444", "0.6402859", "0.63975334", "0.63974833", "0.6396526", "0.63856924", "0.6383868", "0.6383675", "0.6374242", "0.6365295", "0.6363111", "0.6360743", "0.63495576", "0.6348187", "0.63473856", "0.6342624", "0.63357145", "0.6323535", "0.63210815", "0.63179094", "0.6314305", "0.63081515", "0.63018686", "0.6294682" ]
0.7623301
0
Instance Methods Grabs all contacts associated with this account and the rest of the contacts in the scope. Logic: If +portal_case_scope__c+ is +SCOPE[:this_account]+, grab just the contacts associated with this account. If +portal_case_scope__c+ is +SCOPE[:children_accounts]+, grab this this account's contacts plus the contacts of its child accounts. If +portal_case_scope__c+ is empty and there is a parent, defer to the parent of this account. If +portal_case_scope__c+ is empty and there is NOT a parent, then grab just its associated contacts. If +portal_case_scope__c+ is empty and the root account's +portal_case_scope__c+ is also empty, then grab just those contacts directly associated with this account (and NOT those with the ancestor accounts).
def associated_contacts(accounts_path = []) if portal_case_scope__c == SCOPES[:this_account] contacts elsif portal_case_scope__c == SCOPES[:children_accounts] self.contacts + sibling_contacts elsif portal_case_scope__c.nil? and parent parent.associated_contacts(accounts_path << self) else # portal_case_scope__c is nil and this is root if accounts_path.empty? contacts else accounts_path.first.contacts end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contacts\n Contact.where(account_ids: self._id)\n end", "def contacts(params = {})\n # contacts in this group\n @contacts ||= get_contacts({\"group\" => self.id}.merge(params))\n end", "def case\n @account = @case.account\n # find the account we are grabing contacts from. this is used in the pulldown selection menu.\n if id = params[:from_account]\n @selected_account = Sfaccount.find(id)\n end\n # super users can only add themselves.\n if current_contact.portal_privilege == AppConstants::PRIVILEGE[:super_user]\n @instruction_text = \"Your current access level is \\\"Super User\\\" and you can only subscribe 1 contact: yourself.\"\n @contacts = [current_contact]\n else\n @contacts = (@selected_account || @account).contacts\n if current_contact.portal_privilege == AppConstants::PRIVILEGE[:user_manager]\n @instruction_text = \"Your current access level is \\\"User Manager\\\" and you can subscribe other contacts from your company.\"\n end\n end\n @subscribers = @case.watcher ? @case.watcher.contacts : []\n # set siblings if (a) this account can view child accounts and (b) it has sibling accounts\n @siblings = (@account.portal_case_scope__c == Sfaccount::SCOPES[:children_accounts] and @account.sibling_accounts) ? @account.sibling_accounts.reject { |a| a.contacts(true).empty? } : []\n end", "def account\n # find the account we are grabing contacts from\n if id = params[:from_account]\n @selected_account = Sfaccount.find(id)\n end\n # super users can only add themselves.\n if current_contact.portal_privilege == AppConstants::PRIVILEGE[:super_user]\n @instruction_text = \"Your current access level is \\\"Super User\\\" and you can only subscribe 1 contact: yourself.\"\n @contacts = [current_contact]\n else\n @contacts = (@selected_account || @account).contacts\n if current_contact.portal_privilege == AppConstants::PRIVILEGE[:user_manager]\n @instruction_text = \"Your current access level is \\\"User Manager\\\" and you can subscribe other contacts from your company.\"\n end\n end\n # the current subscribers\n @subscribers = @account.watcher ? @account.watcher.contacts : []\n # set siblings if (a) this account can view child accounts and (b) it has sibling accounts\n @siblings = ((@account.portal_case_scope__c == Sfaccount::SCOPES[:children_accounts] and @account.sibling_accounts) ? @account.sibling_accounts.reject { |a| a.contacts(true).empty? } : [])\n \n end", "def contacts\n\t\t@user = current_user\n\t\tcheck_if_myself\n\t\t@contacts = @user.contacts\n\tend", "def contacts(params = {})\n # contacts in this group\n @contacts = nil\n contacts!\n end", "def contacts(id, limit:, offset: 0, account: nil)\n path = \"filter/#{id}/contacts\"\n get account, path, limit: limit, offset: offset\n end", "def contacts\n @contacts ||= CreditorContactProxy.new(self)\n end", "def contacts()\n return MicrosoftGraph::Contacts::ContactsRequestBuilder.new(@path_parameters, @request_adapter)\n end", "def contacts\n collection = CapsuleCRM::ContactCollection.new(self,CapsuleCRM::Contact, [])\n collection.concat emails\n collection.concat phone_numbers\n collection.concat websites\n collection.concat addresses\n collection\n end", "def contacts!(params = {})\n @contacts ||= get_contacts({\"group\" => self.id}.merge(params))\n end", "def contacts\n @contacts ||= DebtorContactProxy.new(self)\n end", "def crowd\n case options['to']\n when :all\n TownCrier::Contact.all\n when nil\n TownCrier::Contact.interested_in(self)\n else # array of contact ids\n TownCrier::Contact.where(id: options['to'])\n end\n end", "def contacts!(params = {})\n # contacts in this group\n @contacts = nil\n contacts\n end", "def contacts(options={})\n order_option = [group_by_sort_order, options[:order]].reject {|s| s.blank?}.join(',')\n order_option = nil if order_option.blank?\n\n # joins = (order_option && order_option.include?('authors')) ? \"LEFT OUTER JOIN users authors ON authors.id = #{Contact.table_name}.author_id\" : nil\n\n joins = []\n if order_option\n if order_option.include?('authors')\n joins << \"LEFT OUTER JOIN users authors ON authors.id = #{Contact.table_name}.author_id\"\n end\n order_option.scan(/cf_\\d+/).uniq.each do |name|\n column = available_columns.detect {|c| c.name.to_s == name}\n join = column && column.custom_field.join_for_order_statement\n if join\n joins << join\n end\n end\n end\n joins = joins.any? ? joins.join(' ') : nil\n\n\n scope = Contact.scoped({})\n\n options[:search].split(' ').collect{ |search_string| scope = scope.live_search(search_string) } unless options[:search].blank?\n options[:include] << :assigned_to if (order_option && order_option.include?('users'))\n scope.visible.scoped(:conditions => options[:conditions]).find :all, :include => ([:projects, :address] + (options[:include] || [])).uniq,\n :conditions => statement,\n :order => order_option,\n :joins => joins,\n :limit => options[:limit],\n :offset => options[:offset]\n rescue ::ActiveRecord::StatementInvalid => e\n raise StatementInvalid.new(e.message)\n end", "def contacts(consent)\n process_consent(consent)\n contacts_xml = access_live_contacts_api()\n contacts_list = WindowsLive.parse_xml(contacts_xml)\n end", "def get_contacts_for_roles(achived,sort_order)\n return all_contacts(achived,sort_order) unless roles_in_contact_types?\n\n unless county_and_country_coordinators?\n return county_and_country_contacts(achived,sort_order)\n end\n\n return user_role_contacts(achived,sort_order)\n end", "def contacts\n fail NotPersisted if id.nil?\n\n @contacts ||=\n begin\n links = Amorail::ContactLink.find_by_leads(id)\n links.empty? ? [] : Amorail::Contact.find_all(links.map(&:contact_id))\n end\n end", "def common_account_chain(in_root_account)\n rid = in_root_account.id\n accts = self.associated_accounts.where(\"accounts.id = ? OR accounts.root_account_id = ?\", rid, rid)\n return [] if accts.blank?\n children = accts.inject({}) do |hash,acct|\n pid = acct.parent_account_id\n if pid.present?\n hash[pid] ||= []\n hash[pid] << acct\n end\n hash\n end\n\n enrollment_account_ids = in_root_account.\n all_enrollments.\n current_and_concluded.\n where(user_id: self).\n joins(:course).\n distinct.\n pluck(:account_id)\n\n longest_chain = [in_root_account]\n while true\n break if enrollment_account_ids.include?(longest_chain.last.id)\n\n next_children = children[longest_chain.last.id]\n break unless next_children.present? && next_children.count == 1\n longest_chain << next_children.first\n end\n longest_chain\n end", "def scrape_contacts \n unless auth_cookie = agent.cookies.find{|c| c.name =~ /^Auth/}\n raise( Blackbook::BadCredentialsError, \"Must be authenticated to access contacts.\" )\n end\n \n # jump through the hoops of formulating a request to get printable contacts\n uri = agent.current_page.uri.dup\n inputs = agent.current_page.search(\"//input\")\n user = inputs.detect{|i| i['type'] == 'hidden' && i['name'] == 'user'}\n utoken = user['value']\n\n path = uri.path.split('/')\n path.pop\n path << 'addresslist-print.aspx'\n uri.path = path.join('/')\n uri.query = \"command=all&sort=FirstLastNick&sortDir=Ascending&nameFormat=FirstLastNick&user=#{utoken}\"\n page = agent.get uri.to_s\n\n # Grab all the contacts\n rows = page.search(\"table tr\")\n name, email = nil, nil\n \n results = []\n rows.each do |row|\n new_name = row.search(\"span[@class='fullName']\").inner_text.strip\n if name.blank? || !new_name.blank?\n name = new_name\n end\n next if name.blank?\n \n email = row.search(\"td[@class='sectionContent'] span:last\").inner_text.strip\n next if email.blank?\n \n results << {:name => name, :email => email}\n name, email = nil, nil\n end\n results\n end", "def get_accounts_info(customer_id=nil, only_parent_accounts=false)\n\t\t\tresponse = call(:get_accounts_info, \n\t\t\t\t{customer_id: customer_id || self.client_proxy.customer_id, \n\t\t\t\tonly_parent_accounts: only_parent_accounts.to_s})\n\t\t\tresponse_hash = get_response_hash(response, __method__)\n\t\t\taccounts = response_hash[:accounts_info][:account_info].map do |account_hash|\n\t\t\t\tBingAdsApi::AccountInfo.new(account_hash)\n\t\t\tend\n\t\t\treturn accounts\n\t\tend", "def contacts\n @contacts ||= Harvest::API::Contacts.new(credentials)\n end", "def contacts\n @contacts ||= @ab.people.map {|abperson| Macabee::Contact.new(abperson, :macabee => self)}\n end", "def get_contacts(params={})\n @obj.get('get-contacts', @auth.merge(params))\n end", "def contacts\n contact_client.contacts\n end", "def contacts\n @contacts ||= User.any_in(:_id => facilities.map(&:consumer_ids).flatten.uniq)\n end", "def scrape_contacts\n unless agent.cookies.find{|c| c.name == 'MSPPre' && c.value == options[:username]}\n raise( Blackbook::BadCredentialsError, \"Must be authenticated to access contacts.\" )\n end\n\n page = agent.get('PrintShell.aspx?type=contact')\n rows = page.search(\"//div[@class='ContactsPrintPane cPrintContact BorderTop']\")\n rows.collect do |row|\n vals = {}\n row.search(\"table/tr\").each do |pair|\n key = pair.search(\"td[@class='TextAlignRight Label']\").first.inner_text.strip rescue nil\n next if key.nil?\n val = pair.search(\"td[@class='Value']\").first.inner_text.strip\n vals[key.to_sym] = val\n end\n vals[:name] = vals['Name:'.to_sym] rescue ''\n vals[:email] = (vals['Personal e-mail:'.to_sym] || vals['Work e-mail:'.to_sym] || vals['Windows Live ID:'.to_sym]).split(' ').first rescue ''\n vals\n end\n end", "def common\n #if Contact.where(:organization_id => current_user.organization.id).any?\n # #@users = current_user.organization.contacts.group_by{|u| u.first_name[0]}\n # @users = Contact.where(:organization_id => current_user.organization.id).order(\"name,first_name\")\n #end\n # Contact.all.each do |contact|\n # contact.update_column :created_by, current_user.id\n # end\n begin\n lastcontact = current_user.activities.where(\"activity_status=? and activity_type in (?)\", \"Create\", [\"IndividualContact\", \"CompanyContact\"]).last\n unless lastcontact.present?\n lastcontact = current_user.organization.activities.where(\"activity_status=? and activity_type in (?)\", \"Create\", [\"IndividualContact\", \"CompanyContact\"]).last\n\n end\n if lastcontact.present?\n if lastcontact && lastcontact.activity_type == \"IndividualContact\"\n @contact = IndividualContact.find(lastcontact.activity_id)\n get_contact_attrs\n elsif lastcontact && lastcontact.activity_type == \"CompanyContact\"\n @contact = CompanyContact.find(lastcontact.activity_id)\n get_contact_attrs\n end\n else\n contacts=current_user.organization.individual_contacts\n @contact = contacts.last\n get_contact_attrs\n end\n rescue ActiveRecord::RecordNotFound\n flash[:bowarning]=\"It seems you don't have sufficient privilege to access this item or something went wrong with your account permissions. Please contact Admin to get this fixed.\"\n #redirect_to contacts_path\n end\n\n end", "def contacts\n @contacts = Employee.by_company_id(params[:company_id]).by_search(params[:search]).by_contacts(current_user).paginate :page => params[:page]\n @active_employers = current_user.employers.active_employers.all\n end", "def get_children_accounts\n if(current_user.role == \"Parent\")\n current_user.find_children.map{ |c| [c.get_accounts(c)[0], c.get_accounts(c)[1]]}.flatten\n end\n end", "def build_accounts_by_tree(root_category)\n accounts = root_category.accounts.to_a\n if root_category.has_children?\n root_category.children.each {|category|\n accounts.concat(build_accounts_by_tree(category))\n }\n end\n accounts\n end", "def my_contacts(opts = {})\n client.get_my_contacts(opts)\n end", "def all_contacts\n Contact.all\n end", "def get_contacts(opts = {})\n data, _status_code, _headers = get_contacts_with_http_info(opts)\n data\n end", "def all_contacts\n ret = []\n chunk_size = 200\n offset = 0\n \n while (chunk = contacts(:limit => chunk_size, :offset => offset)).size != 0\n ret.push(*chunk)\n offset += chunk_size\n break if chunk.size < chunk_size\n end\n ret\n end", "def contacts\n @contacts ||= get_attr(:contacts).collect { |c| OpenStruct.new(c) }\n end", "def index\n # only show contacts for current login user\n @user = User.find_by_id(current_user.id)\n if ([email protected]?)\n @contacts = @user.contacts\n end\n end", "def contacts\n @contacts = @seller.get_contacts\n end", "def sub_accounts(conditions = {})\n client.accounts.list(conditions)\n end", "def get_all_contacts_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ContactsAndContactListsApi.get_all_contacts ...'\n end\n # resource path\n local_var_path = '/v3/contacts'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n return_type = opts[:return_type] \n\n auth_names = opts[:auth_names] || []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type)\n\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ContactsAndContactListsApi#get_all_contacts\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_projected_accounts\n\t\t #@projected_accounts_info = Hash[ACCOUNT_INFO.dup.find_all{|k,v| v[:discretionary]}]\n\t\t #@projected_accounts_info = accounts_with_projections(@projected_accounts_info)\n\t\t #@projected_accounts_info = @accounts.find_all{|acc| info = ACCOUNT_INFO[acc.name] and info[:discretionary]} \n projected_accounts = @accounts.find_all{|acc| acc.info and acc.info[:discretionary]}\n @projected_accounts_info = accounts_with_projections(projected_accounts)\n\tend", "def getaddressesbyaccount(account)\n coind.getaddressesbyaccount account\n end", "def account_list\n return [] unless company\n [company] + company.sibling_accounts\n end", "def all_accounts\n with_exclusive_scope { self.all }\n end", "def get_sub_accounts_of_account(account_id,opts={})\n query_param_keys = [\n :recursive\n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"account_id is required\" if account_id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :account_id => account_id\n )\n\n # resource path\n path = path_replace(\"/v1/accounts/{account_id}/sub_accounts\",\n :account_id => account_id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n response.map {|response|Account.new(response)}\n end", "def parents\n Contact.find(:all, :conditions => [\"merged_to_form_contact_id = ?\", self.id])\n end", "def get_all_contacts(opts = {})\n get_all_contacts_with_http_info(opts)\n nil\n end", "def contacts\n return [] unless persisted?\n results = connection.get(\"#{self.class.path}/#{@attributes[\"Id\"]}\")\n @attributes['ContactIds'] = results.first['ContactIds']\n end", "def all_in_tree\n accounts = Array.new\n accounts += ancestors\n accounts += sibling_accounts\n accounts += children\n accounts << self\n return accounts\n end", "def list_group_categories_for_context_accounts(account_id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"account_id is required\" if account_id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :account_id => account_id\n )\n\n # resource path\n path = path_replace(\"/v1/accounts/{account_id}/group_categories\",\n :account_id => account_id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n response.map {|response|GroupCategory.new(response)}\n end", "def accounts\n return [] if self.id.nil?\n @accounts ||= \n OrgSync::Base.request(\"#{self.class.endpoint}/#{self.id}/accounts\", {}, @api_key).map { |json| \n OrgSync::Account.new(json, @api_key) \n }\n end", "def account_condition\n\t\tcondition = \"\"\n\t\tif account.present?\n\t\t\tcondition = \"accounts_contacts.account_id = #{account.id}\"\n\t\tend\n\t\tcondition\n\tend", "def find_scoped_accounts(account_id)\n account_id = BSON::ObjectId(account_id) if account_id.is_a?(String)\n if superuser? || self.account_ids.include?(account_id)\n Account.find(account_id)\n else\n raise Mongoid::Errors::DocumentNotFound.new(Account, account_id)\n end\n end", "def find_by_names_and_company(card)\n conditions = find_by_names_and_company_conditions(card)\n if conditions[:organization]\n return nil unless organization = Organization.find_by_name(conditions.delete(:organization))\n find_base = organization.contacts\n else\n find_base = self\n end\n \n if conditions[:given_name] || conditions[:family_name]\n find_base.find(:first, :conditions => sanitize_sql_for_conditions(conditions))\n else\n organization\n end\n end", "def contacts(reload = false)\n self.cache(CostAgent::Contact, :all, reload) do\n (self.api(\"contacts\")/\"contact\").collect do |contact|\n projects = self.projects(:all, reload).select { |p| p.contact_id == (contact/\"id\").first.inner_text.to_i }\n Contact.new(\n :id => (contact/\"id\").first.inner_text.to_i,\n :organisation_name => (contact/\"organisation-name\").first.inner_text,\n :first_name => (contact/\"first-name\").first.inner_text,\n :last_name => (contact/\"last-name\").first.inner_text,\n :address1 => (contact/\"address1\").first.inner_text,\n :address2 => (contact/\"address2\").first.inner_text,\n :address3 => (contact/\"address3\").first.inner_text,\n :town => (contact/\"town\").first.inner_text,\n :region => (contact/\"region\").first.inner_text,\n :country => (contact/\"country\").first.inner_text,\n :postcode => (contact/\"postcode\").first.inner_text,\n :phone_number => (contact/\"phone-number\").first.inner_text,\n :email => (contact/\"email\").first.inner_text,\n :billing_email => (contact/\"billing-email\").first.inner_text,\n :contact_name_on_invoices => (contact/\"contact-name-on-invoices\").first.inner_text == \"true\",\n :sales_tax_registration_number => (contact/\"sales-tax-registration-number\").first.inner_text,\n :uses_contact_invoice_sequence => (contact/\"uses-contact-invoice-sequence\").first.inner_text == \"true\",\n :account_balance => (contact/\"account-balance\").first.inner_text.to_f,\n :projects => projects)\n end\n end\n end", "def accounts\n\n if params[:cost_ctr]\n # looks like something may have changed\n @cc = params[:cost_ctr]\n session[:cc] = params[:cost_ctr]\n end\n @cod_accounts = CodAccount.where(cost_ctr: session[:cc]).where(logistics_completed: true).where.not(accounting_completed: true)\n end", "def contacts_for_unit(unit)\n c = contacts.find(:all, :conditions => {:organization_contact_units => {:unit_id => unit.id}})\n return c.empty? ? contacts : c\n end", "def get_other_contacts(matter)\n client_contacts = matter.client_contacts\n client_contacts << matter.primary_matter_contact\n client_contacts.compact\n end", "def fetch_more_contacts\n page_limit = params[:page_no].to_i * params[:per_page].to_i\n @contact = eval(params[:contact_type]).find(params[:c_id].to_i)\n if params[:contact_type] == \"IndividualContact\"\n @individual_contacts = @current_organization.individual_contacts.where('id NOT IN (?)',params[:c_id]).order(\"id desc\").limit(page_limit)\n @company_contacts = @current_organization.company_contacts.order(\"id desc\").limit(page_limit)\n else\n @individual_contacts = @current_organization.individual_contacts.order(\"id desc\").limit(page_limit)\n @company_contacts = @current_organization.company_contacts.where('id NOT IN (?)',params[:c_id]).order(\"id desc\").limit(page_limit)\n end\n @contacts = @individual_contacts + @company_contacts\n render partial: \"list_contacts_in_contact_details\"\n end", "def contacts(uid, params={})\n response = @client.get \"#{@path}/#{uid}/contacts\", params\n PaginateResource.new \"#{@path}\", @client, response, Textmagic::REST::Contact\n end", "def contacts\n self.connections.map do |connection|\n connection.contact\n end\n end", "def get_user_contacts username_for, options = {}\n do_request 'get_user_contacts', options.merge(username_for: username_for)\n end", "def find_all_components_for_account(account = _get_nil_account, authorizer)\n debug \"central find_all_components_for_account: #{account.inspect} #{account.kind_of? Hash} #{account[:urn]}\"\n raise 'Method not implemented because the Central Manager just need to pass the same requisition to the other' \\\n ' brokers and create the concatenated results'\n end", "def accounts_from_current_user\n\t\taccounts = []\n\t\tcurrent_user.RelatedAccounts.each do |relatedaccount|\n\t\t\tAccount.find_all_by_Canal__c(relatedaccount.canal_id).each do |account|\n\t\t\t\taccounts << account\n\t\t\tend\n\t\tend\n\n\t\treturn accounts\n\tend", "def contacts\n Easybill::Api::Contacts\n end", "def get_contacts(user_or_identifier)\n identifier = identifier_param(user_or_identifier)\n json = parse_response(get(\"/api/#{API_VERSION}/get_contacts\",\n :apiKey => @api_key,\n :identifier => identifier))\n ContactList.new(json)\n end", "def list_customer_accounts_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: AccountsApi.list_customer_accounts ...\"\n end\n # resource path\n local_var_path = \"/raas/v2/accounts\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['basicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<AccountView>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AccountsApi#list_customer_accounts\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_contacts(options = {})\n request_params = {}\n\n if !options[:updated_after].nil?\n warn '[warning] :updated_after is depracated in XeroGateway#get_contacts. Use :modified_since'\n options[:modified_since] = options.delete(:updated_after)\n end\n\n request_params[:ContactID] = options[:contact_id] if options[:contact_id]\n request_params[:ContactNumber] = options[:contact_number] if options[:contact_number]\n request_params[:order] = options[:order] if options[:order]\n request_params[:ModifiedAfter] = options[:modified_since] if options[:modified_since]\n request_params[:where] = options[:where] if options[:where]\n request_params[:page] = options[:page] if options[:page]\n\n response_xml = http_get(@client, \"#{@xero_url}/Contacts\", request_params)\n\n parse_response(response_xml, {:request_params => request_params}, {:request_signature => 'GET/contacts'})\n end", "def find_contacts_advanced\n show_params(params)\n\n @person_query = params[:search][:person]\n @org_query = params[:search][:organisation]\n\n @role_ids = params[:search][:role_id_ids].select {|r| r != \"\"}.compact\n \n # Get country and region if they were chosen\n @country_id = @region_id = \"\"\n if params[:search][:country_id] and params[:search][:country_id] != \"\"\n @country_id = params[:search][:country_id]\n end\n if params[:search][:region_id] and params[:search][:region_id] != \"\"\n @region_id = params[:search][:region_id] \n end\n\n @valid_email = params[:search][:valid_email]\n @keywords_query = params[:search][:keywords]\n @modified_since = params[:search][:modified_since]\n \n @subcategory_filters = params[:category_filter].select {|v| !v.blank? }\n \n #This populates @contacts \n @found_contacts = search_by_name_and_organisation(@person_query, @org_query, @keywords_query)\n\n # Filter by subcategory\n if @subcategory_filters.length != 0\n @found_contacts = @found_contacts.select do |c|\n !@subcategory_filters.select do |f|\n c.marketing_subcategories.collect{|ms| ms.marketing_subcategory_id}.include?(f.to_i)\n end.empty?\n end\n end\n\n # Filter by role if a role is selected\n # FIXME: question for client: this returns all organisations that have\n # someone with the given role, if organisations are searched for. Is that\n # desired behaviour?\n if @role_ids.length != 0\n @found_contacts = @found_contacts.select do |c|\n c.roles.select {|r| @role_ids.include?(r.role_type_id.to_s) }.length > 0\n end\n end\n\n # Filter by country/region\n if @country_id != \"\" or @region_id != \"\"\n @found_contacts = @found_contacts.select do |c|\n if @region_id != \"\"\n c.regions.collect{|r| r.region_id }.include?(@region_id.to_i)\n elsif @country_id != \"\"\n c.countries.collect{|c| c.country_id }.include?(@country_id.to_i)\n else\n true\n end\n end\n end\n\n # Only show results with a valid e-mail address\n if @valid_email.to_i > 0\n @found_contacts = @found_contacts.select {|c| c.valid_email? }\n end\n\n # Only show contacts modified since the specified date\n if !@modified_since.blank?\n modified_since_time = Time.parse @modified_since\n @found_contacts = @found_contacts.select {|c| !c.updated_at.blank? and modified_since_time < c.updated_at }\n end\n\n session[:contacts_from_search] = @found_contacts\n \n render :layout => false\n \n end", "def get_all_contacts\n\t\t#@contacts = Contact.find_with_deleted(:all, :conditions=>[\"company_id=?\", get_company_id], :order=>\"coalesce(last_name,'')||''||first_name||''||coalesce(middle_name,'') asc\")\n #Bug 11593 Deleted contacts are displayed in Drop down.\n @contacts = Contact.find(:all, :conditions=>[\"company_id=?\", get_company_id], :order=>\"coalesce(last_name,'')||''||first_name||''||coalesce(middle_name,'') asc\")\n end", "def all_descendant_customers\n Customer.where(\"accounts.path <@ ?\", path)\n .where.not(path: path)\n end", "def contacts\n respond_with_entity(api.get('/api/v1/profile/contacts'),\n NexaasID::Entities::Profile::Contacts)\n end", "def getContacts\n @contact_list.each_with_index do |c, i|\n #puts \"#{i +1}) #{c}\"\n puts \"#{i +1}) #{c[:first_name]} #{c[:last_name]} #{c[:email]}\"\n end\n end", "def descendants\n model_base_class.scoped(:conditions => descendant_conditions)\n end", "def contacts\n ensure_cache_up_to_date\n contacts = self.redis.keys(\"bluster:objects:contact:*\")\n contacts.map! { |r| r.split(\":\")[3] }\n contacts.uniq\n end", "def index\n account = @user.account\n @contact_groups = account.client_groups\n \n end", "def primary_contacts_for_unit(unit)\n c = contacts.find(:all, :conditions => {:organization_contact_units => {:unit_id => unit.id, :primary_contact => true}})\n return c.empty? ? contacts_for_unit(unit) : c\n end", "def lactic_contacts(id,lactic_contacts)\n # PostgresUser.lactic_contacts(uid,lactic_contacts)\n lactic_pg_contacts(id,lactic_contacts)\n end", "def get_contact\n if self.contact_id\n return self.contact\n end\n end", "def consents_for_activity(activity, survey, contact_link)\n return [] unless activity.consent_activity?\n participant = activity.participant\n # find those consent records that are associated with a response_set\n # this is done to handle consents prior to change to using a Survey for consent\n survey_consents = participant.participant_consents.select{ |pc| !pc.response_set.nil? }\n # then match the consent to the current survey and event\n events_during_contact = Event.joins(:contact_links).where(\n \"contact_links.contact_id in (?)\", contact_link.contact_id)\n consents = survey_consents.select do |pc|\n pc.response_set.survey.title == survey.title &&\n events_during_contact.include?(pc.consent_event)\n end\n # and filter by activity_type\n if activity.reconsent?\n consents = consents.select { |c| c.reconsent? }\n elsif activity.withdrawal?\n consents = consents.select { |c| c.withdrawal? }\n elsif activity.child_consent_birth_to_6_months?\n consents = consents.select { |c| c.child_consent_birth_to_six_months? }\n elsif activity.child_consent_6_months_to_age_of_majority?\n consents = consents.select { |c| c.child_consent_six_month_to_age_of_majority? }\n else\n consents = consents.select { |c| !c.reconsent? && !c.withdrawal? }\n end\n consents\n end", "def contacts\n contacts = []\n contacts.concat(registrant_contact.is_a?(Array) ? registrant_contact : [registrant_contact]) if property_supported?(:registrant_contact)\n contacts.concat(admin_contact.is_a?(Array) ? admin_contact : [admin_contact]) if property_supported?(:admin_contact)\n contacts.concat(technical_contact.is_a?(Array) ? technical_contact : [technical_contact]) if property_supported?(:technical_contact)\n contacts.compact\n end", "def portable_contacts\n PortableContacts.new(self)\n end", "def contact\n @contact ||= get_contact(@data_object.user_contact)\n end", "def get_contacts_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ContactsApi.get_contacts ...'\n end\n if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100\n fail ArgumentError, 'invalid value for \"opts[:\"per_page\"]\" when calling ContactsApi.get_contacts, must be smaller than or equal to 100.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"per_page\"]\" when calling ContactsApi.get_contacts, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/contacts'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'filter[speeddial]'] = opts[:'filter_speeddial'] if !opts[:'filter_speeddial'].nil?\n query_params[:'filter[first_name]'] = opts[:'filter_first_name'] if !opts[:'filter_first_name'].nil?\n query_params[:'filter[last_name]'] = opts[:'filter_last_name'] if !opts[:'filter_last_name'].nil?\n query_params[:'filter[company]'] = opts[:'filter_company'] if !opts[:'filter_company'].nil?\n query_params[:'filter[email]'] = opts[:'filter_email'] if !opts[:'filter_email'].nil?\n query_params[:'filter[email_work]'] = opts[:'filter_email_work'] if !opts[:'filter_email_work'].nil?\n query_params[:'filter[phone_work]'] = opts[:'filter_phone_work'] if !opts[:'filter_phone_work'].nil?\n query_params[:'filter[mobile_work]'] = opts[:'filter_mobile_work'] if !opts[:'filter_mobile_work'].nil?\n query_params[:'filter[phone]'] = opts[:'filter_phone'] if !opts[:'filter_phone'].nil?\n query_params[:'filter[mobile]'] = opts[:'filter_mobile'] if !opts[:'filter_mobile'].nil?\n query_params[:'filter[blocked]'] = opts[:'filter_blocked'] if !opts[:'filter_blocked'].nil?\n query_params[:'search[number]'] = opts[:'search_number'] if !opts[:'search_number'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<Contact>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Bearer']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ContactsApi#get_contacts\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def contacts(options = {})\n params = { :limit => 200 }.update(options)\n response = get(PATH['contacts_full'], params)\n parse_contacts response_body(response)\n end", "def index\n params_hash = contact_params unless params[:contact].nil?\n\n pars = get_filter_params params_hash\n\n params[:page] ||= 1\n params[:limit] ||= Contact::DEFAULT_PER_PAGE\n params[:limit] = Contact::RESULTS_PER_PAGE.max unless params[:limit].to_i <= Contact::RESULTS_PER_PAGE.max\n\n contact_ids = Rails.cache.fetch(\"#{contacts_url}?q=#{Digest::SHA1.hexdigest(pars.inspect)}\",\n :tag => [\"contacts-filter-#{current_user.id}\"]) do\n\n Contact.where('$and' => pars).pluck(:_id)\n end\n\n @contacts = Contact.includes(:contact_groups).where(:_id => { '$in' => contact_ids })\n .asc('contact_profile.last_name').asc('contact_profile.first_name')\n .page(params[:page]).per(params[:limit])\n\n if @contacts.size < (params[:page].to_i*params[:limit].to_i - params[:limit].to_i)\n params[:page] = @contacts.num_pages\n redirect_to host: contacts_url, params: params and return\n end\n\n @metadata = current_user.metadata\n @groups = ContactGroup.where(uid: current_user.id).asc('label')\n @filters_form_action = '/contacts'\n\n respond_to do |format|\n format.html { render :index }\n format.json { render json: { metadata: @metadata, contacts: @contacts, groups: @groups } }\n end\n end", "def org_contact\n wizard_step(STEPS) { { next_step: :org_contact_next_step } }\n end", "def show_contacts(filters: {}, orders: {}, **params)\n params[:filters] = filters if filters.any?\n params[:orders] = orders if orders.any?\n\n get('contacts', params)\n end", "def search_contacts(opts = {})\n data, _status_code, _headers = search_contacts_with_http_info(opts)\n data\n end", "def rip_accounts()\n if @version >= IOS_VERSION_9\n @database.execute(\"SELECT ZICCLOUDSYNCINGOBJECT.Z_PK \" +\n \"FROM ZICCLOUDSYNCINGOBJECT \" + \n \"WHERE ZICCLOUDSYNCINGOBJECT.ZNAME IS NOT NULL\") do |row|\n rip_account(row[\"Z_PK\"])\n end \n end\n\n if @version == IOS_LEGACY_VERSION\n @database.execute(\"SELECT ZACCOUNT.Z_PK FROM ZACCOUNT\") do |row|\n rip_account(row[\"Z_PK\"])\n end\n end\n end", "def index\n @contacts = Contact\n\n if params[:project_id]\n # https://stackoverflow.com/q/680141/6594668\n @contacts = Contact.where(contactable_type: 'Project')\n .joins('INNER JOIN projects ON contacts.contactable_id = projects.id')\n .where(projects: { identifier: params[:project_id] }).all\n end\n\n @contacts = @contacts.where(id: params[:id]) if params[:id]\n\n @contacts = @contacts.all\n end", "def search\n manage_filter_state\n letter = params[:letter]\n if !session[:organization]\n init_oco\n end\n\n @search = CorpContact.search do\n fulltext params[:search]\n if session[:organization] != '0'\n with :organization_id, session[:organization]\n end\n if !letter.blank? && letter != \"%\"\n with(:last_name).starting_with(letter)\n end\n order_by :last_name, :asc\n order_by :first_name, :asc\n paginate :page => params[:page] || 1, :per_page => per_page\n end\n @corp_contacts = @search.results\n\n respond_to do |format|\n format.html # search.html.erb\n format.json { render json: @corp_contacts }\n format.js\n end\n end", "def matter_contact_records\n get_comp_id = get_company_id\n @contacts = Contact.get_contact_records(current_company,get_comp_id) \n @matters = Matter.get_matter_records(get_comp_id, get_employee_user_id)\n end", "def contact(options={})\n if self.padma_contact.nil? || options[:force_service_call]\n self.padma_contact = PadmaContact.find(contact_id, {select: :all, account_name: self.account_name})\n end\n ret = padma_contact\n if options[:decorated] && padma_contact\n ret = PadmaContactDecorator.decorate(padma_contact)\n end\n ret\n end", "def ancestors\n records = self_and_ancestors - [self]\n\n scope = self_and_ancestors.where(arel[:id].not_eq(id))\n scope.records(records)\n end", "def org_contact_next_step\n return accounts_registration_rep_address_path if AccountType.other_organisation?(@account.account_type)\n\n accounts_registration_taxes_path\n end", "def current_account_contact_ids\n current_account.added_contact_ids + current_account.mutual_contact_ids\n end", "def get_contacts\n\n #@company = Benefits.find.params[:company_id]\n #@contacts = @company.contacts\n\n Rails.logger.warn \"#{:areabenefit_id} jajaxxx\"\n @contacts = Benefit.where(areabenefit_id: params[:areabenefit_id], asistencia: '1')\n end", "def projects_charge_accounts(_projects)\n _array = []\n _ret = nil\n\n # Adding charge accounts belonging to current projects\n _ret = ChargeAccount.expenditures.where(project_id: _projects)\n ret_array(_array, _ret, 'id')\n # _projects.each do |i|\n # _ret = ChargeAccount.expenditures.where(project_id: i.id)\n # ret_array(_array, _ret, 'id')\n # end\n\n # Adding global charge accounts belonging to projects organizations\n _sort_projects_by_organization = _projects.sort { |a,b| a.organization_id <=> b.organization_id }\n _previous_organization = _sort_projects_by_organization.first.organization_id\n _sort_projects_by_organization.each do |i|\n if _previous_organization != i.organization_id\n # when organization changes, process previous\n _ret = ChargeAccount.expenditures.where('(project_id IS NULL AND charge_accounts.organization_id = ?)', _previous_organization)\n ret_array(_array, _ret, 'id')\n _previous_organization = i.organization_id\n end\n end\n # last organization, process previous\n _ret = ChargeAccount.expenditures.where('(project_id IS NULL AND charge_accounts.organization_id = ?)', _previous_organization)\n ret_array(_array, _ret, 'id')\n\n # Returning founded charge accounts\n _ret = ChargeAccount.where(id: _array).order(:account_code)\n end", "def projects_charge_accounts(_projects)\n _array = []\n _ret = nil\n\n # Adding charge accounts belonging to current projects\n _ret = ChargeAccount.expenditures.where(project_id: _projects)\n ret_array(_array, _ret, 'id')\n # _projects.each do |i|\n # _ret = ChargeAccount.expenditures.where(project_id: i.id)\n # ret_array(_array, _ret, 'id')\n # end\n\n # Adding global charge accounts belonging to projects organizations\n _sort_projects_by_organization = _projects.sort { |a,b| a.organization_id <=> b.organization_id }\n _previous_organization = _sort_projects_by_organization.first.organization_id\n _sort_projects_by_organization.each do |i|\n if _previous_organization != i.organization_id\n # when organization changes, process previous\n _ret = ChargeAccount.expenditures.where('(project_id IS NULL AND charge_accounts.organization_id = ?)', _previous_organization)\n ret_array(_array, _ret, 'id')\n _previous_organization = i.organization_id\n end\n end\n # last organization, process previous\n _ret = ChargeAccount.expenditures.where('(project_id IS NULL AND charge_accounts.organization_id = ?)', _previous_organization)\n ret_array(_array, _ret, 'id')\n\n # Returning founded charge accounts\n _ret = ChargeAccount.where(id: _array).order(:account_code)\n end" ]
[ "0.5875162", "0.55810314", "0.55255574", "0.54758084", "0.5382904", "0.5361437", "0.52924657", "0.52800417", "0.52296174", "0.5164685", "0.5159281", "0.5060566", "0.5020907", "0.5003781", "0.49790698", "0.49642307", "0.4950846", "0.49462676", "0.48950413", "0.48916897", "0.48513514", "0.48474526", "0.48282203", "0.47827774", "0.4742933", "0.46963638", "0.46806133", "0.46659818", "0.46598053", "0.46472827", "0.46316952", "0.46245527", "0.461876", "0.46067", "0.45980105", "0.45881012", "0.45825553", "0.45645267", "0.45438403", "0.45354998", "0.45341825", "0.45340985", "0.45247504", "0.4517478", "0.45073918", "0.45051607", "0.4501181", "0.44955194", "0.4494091", "0.44913018", "0.44785815", "0.44765043", "0.4457854", "0.44578004", "0.44489077", "0.44454738", "0.44381636", "0.44176772", "0.4412331", "0.44116363", "0.4395769", "0.43948796", "0.4392895", "0.43842107", "0.43770456", "0.4371156", "0.43710274", "0.4368816", "0.43678972", "0.43652257", "0.43516362", "0.4348576", "0.43284822", "0.43249586", "0.43159503", "0.43103918", "0.43016252", "0.4299858", "0.4298645", "0.42981467", "0.42854524", "0.4282412", "0.4270715", "0.42661688", "0.42558274", "0.4250965", "0.424109", "0.42409042", "0.42324197", "0.42267528", "0.42226985", "0.422246", "0.4220847", "0.42188588", "0.4200216", "0.41910025", "0.41904318", "0.41898054", "0.4183768", "0.4183768" ]
0.7968411
0
Query doesn't work in ASF for siblings.
def sibling_accounts Sfaccount.find(:all, :conditions => ["parent_id = ?",id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def siblings\n teachable.media.where(sort: sort)\n end", "def left_sibling\n siblings.where(arel_table[snumv_column_name].eq(numv)).\n where(arel_table[sdenv_column_name].eq(denv)).first\n end", "def self_and_siblings\n dataset.nested.filter(self.class.qualified_parent_column => self.parent_id)\n end", "def siblings\n self_and_siblings.where(arel[:id].not_eq(id))\n end", "def siblings\n self_and_siblings.where( table[tree.columns.id].not_eq(id) )\n end", "def sibling; end", "def siblings(*args)\n self.class.send(:with_scope, :find=>{:conditions=>['parent_node_id=? OR child_node_id=?', self.parent_node_id, self.child_node_id]}) do\n self.class.find(:all, *args) - [self]\n end\n end", "def siblings\n tree_search_class.where({\n :_id => { \"$ne\" => self._id },\n tree_parent_id_field => self[tree_parent_id_field]\n }).sort(self.class.tree_sort_order()).all\n end", "def siblings\n model_base_class.where(sibling_conditions)\n end", "def siblings field=:position\n klass = if embedded_one?\n _parent.send(metadata.key).class\n elsif embedded_many?\n _parent.send(metadata.key)\n else \n self.class\n end\n klass.where(field.exists => true).ne(id: id)\n end", "def next_siblings(scope = {})\n self.class.find_in_nested_set(:all, \n { :conditions => [\"#{scope_condition} AND #{sibling_condition} AND #{self.class.table_name}.id != ? AND #{prefixed_left_col_name} > ?\", self.id, self[right_col_name]], :order => \"#{prefixed_left_col_name} ASC\"}, scope)\n end", "def right_sibling\n siblings.where(arel_table[numv_column_name].eq(snumv)).\n where(arel_table[denv_column_name].eq(sdenv)).first\n end", "def find_my_siblings\n \tBrlevel.where(level: self.level, locale: I18n.locale).where.not(id: self.id).select(:id, :level) \n end", "def inelastic_siblings\n siblings\n end", "def siblings\n model_base_class.scoped(:conditions => sibling_conditions)\n end", "def self_and_siblings\n if self[acts_as_nested_set_options[:parent_column]].nil? || self[acts_as_nested_set_options[:parent_column]].zero?\n [self]\n else\n self.class.find(:all, :conditions => \"#{acts_as_nested_set_options[:scope]} and #{acts_as_nested_set_options[:parent_column]} = #{self[acts_as_nested_set_options[:parent_column]]}\", :order => acts_as_nested_set_options[:left_column])\n end\n end", "def self_and_siblings\n tree_search_class.where({\n tree_parent_id_field => self[tree_parent_id_field]\n }).sort(self.class.tree_sort_order()).all\n end", "def self_and_siblings\n ordered_tree_scope.where(parent_column => self[parent_column])\n end", "def self_and_siblings\n if self[parent_col_name].nil? || self[parent_col_name].zero?\n [self]\n else\n base_set_class.find(:all, :conditions => \"#{scope_condition} AND #{parent_col_name} = #{self[parent_col_name]}\", :order => left_col_name)\n end\n end", "def immediate_subqueries\n my_nodes_tagged(:subquery)\n end", "def immediate_subqueries\n my_nodes_tagged(:subquery)\n end", "def siblings\n #user = User.find_by_id(:user_id)\n \t#user = absence.user\n user.absences.where('id != ?', id || -1)\n end", "def self_and_siblings\n #parent ? parent.children : self.class.roots\n self.class.find(:all, :conditions => {:parent_id => self.parent_id})\n end", "def self_and_siblings(scope = {})\n if self[parent_col_name].nil? || self[parent_col_name].zero?\n [self]\n else\n self.class.find_in_nested_set(:all, { :conditions => \"#{scope_condition} AND #{sibling_condition}\", :order => \"#{prefixed_left_col_name}\" }, scope)\n end\n end", "def self_and_siblings\n base_class.all scoped(parent_column_name => _parent_id)\n end", "def previous_siblings(scope = {})\n self.class.find_in_nested_set(:all, \n { :conditions => [\"#{scope_condition} AND #{sibling_condition} AND #{self.class.table_name}.id != ? AND #{prefixed_right_col_name} < ?\", self.id, self[left_col_name]], :order => \"#{prefixed_left_col_name} DESC\" }, scope)\n end", "def siblings\n if self.parent.nil?\n self.class.where('forestify_level = 0').where('id != ?', self.id)\n else\n self.parent.children.where('forestify_level = ?', self.forestify_level).where('id != ?', self.id)\n end\n end", "def siblings\n parent&.children || []\n end", "def test_siblings\n setup_test_tree\n\n # Lets first collect the siblings in an array.\n siblings = []\n @child1.siblings { |sibling| siblings << sibling}\n\n assert_equal(2, siblings.length, \"Should have two siblings\")\n assert(siblings.include?(@child2), \"Should have 2nd child as sibling\")\n assert(siblings.include?(@child3), \"Should have 3rd child as sibling\")\n\n siblings.clear\n siblings = @child1.siblings\n assert_equal(2, siblings.length, \"Should have two siblings\")\n\n siblings.clear\n @child4.siblings {|sibling| siblings << sibling}\n assert(siblings.empty?, \"Should not have any siblings\")\n\n siblings.clear\n siblings = @root.siblings\n assert_equal(0, siblings.length, \"Root should not have any siblings\")\n end", "def self_and_siblings\n ltree_scope.where(\n \"SUBPATH(?, 0, NLEVEL(?) - 1) @> #{self.class.table_name}.#{ltree_path_column} AND nlevel(#{self.class.table_name}.#{ltree_path_column}) = NLEVEL(?)\",\n ltree_path, ltree_path, ltree_path\n )\n end", "def siblings\n without_self self_and_siblings\n end", "def ppl_many_siblings\n raise NotImplementedError\n end", "def siblings\n if top_level?\n Category.top_level\n else\n Category.joins(:parent_links)\n .where(category_hierarchies: {\n category1_id: parents\n })\n end\n end", "def siblings\n without_self self_and_siblings\n end", "def have_sibling(...)\n Matchers::HaveSibling.new(...)\n end", "def siblings\n if not @sibs\n raise \"Prev not set for %s\" % self.line unless self.prev\n @sibs = StorylineLinks.where('from_id = ?', self.prev).select { |n| n.to_id != self.id }\n @sibs_num = @sibs.size\n end\n @sibs\n end", "def get_siblings\n self.root? ? [] : self.siblings.select { |d| d.id != self.id }\n end", "def self_and_siblings\n scope.where( tree.columns.parent => parent_id ).preorder\n end", "def self_and_siblings\n nested_set_scope.children_of parent_id\n end", "def siblings\n others = user ? user.servers : Server.where(email: email, user_id: nil)\n others.where.not(id: id).to_a\n end", "def left_siblings\n siblings.where( table[tree.columns.position].lteq(position) )\n end", "def next_sibling_by_date\n siblings_by_date.where(\"starts_at >= ?\", starts_at)&.first\n end", "def sibling(name)\n parent && parent.find(name)\n end", "def left_sibling\n siblings.filter(self.class.qualified_left_column < left).order(self.class.qualified_left_column.desc).first\n end", "def first_sibling_in_list\n self.class.asc(:position).first\n end", "def first_sibling(scope = {})\n self_and_siblings(scope.merge(:limit => 1, :order => \"#{prefixed_left_col_name} ASC\")).first\n end", "def previous_sibling_by_date\n siblings_by_date.where(\"starts_at < ?\", starts_at)&.last\n end", "def left_sibling\n base_class.first scoped(parent_column_name => _parent_id, left_column_name => { '$lt' => left }, :order => \"#{left_column_name} DESC\")\n end", "def inherit_from_siblings this_list\n return #disabled\n siblings = this_list.items(:order => \"updated_at DESC\", :limit => 1)\n if this_sibling = siblings[0] # last one modified\n inherit_by_example this_sibling\n end\n end", "def calculated_siblings_position\n self.self_and_siblings.where('position < ?', self.position).count\n end", "def parent_child_where\n a,b = query_string.split(/\\s+/, 2)\n return table[:id].eq(-1) if a.nil? || b.nil?\n table[:name].matches(\"#{a}%\").and(parent[:name].matches(\"#{b}%\"))\n end", "def query \n first_element('query')\n end", "def self_and_siblings\n return [self] if self[nested_set_parent].nil? || self[nested_set_parent].zero?\n nested_set_class.find_with_nested_set_scope(:all, :conditions => \"#{nested_set_parent} = #{self[nested_set_parent]}\", :order => nested_set_left)\n end", "def next_sibling\n if siblings.where(project_id: project_id).any?\n sibs = self_and_siblings.order(:cached).pluck(:id)\n s = sibs.index(id)\n TaxonName.find(sibs[ s + 1] ) if s < sibs.length - 1\n else\n nil\n end\n end", "def right_siblings\n siblings.where( table[tree.columns.position].gteq(position) )\n end", "def query\n resource_id = @params.fetch(:resourceId)\n all_children_ids = db[:archival_object]\n .filter(:root_record_id => resource_id)\n .select(:id)\n db[:instance]\n .inner_join(:sub_container, :instance_id => :instance__id)\n .inner_join(:top_container_link_rlshp, :sub_container_id => :sub_container__id)\n .inner_join(:top_container, :id => :top_container_link_rlshp__top_container_id)\n .left_outer_join(:top_container_profile_rlshp, :top_container_id => :top_container__id)\n .left_outer_join(:container_profile, :id => :top_container_profile_rlshp__container_profile_id)\n .filter {\n Sequel.|({:instance__resource_id => resource_id},\n :instance__archival_object_id => all_children_ids)\n }\n .select(Sequel.as(Sequel.lit(\"CONCAT(COALESCE(container_profile.name, ''), ' ', top_container.indicator)\"), :container),\n Sequel.as(Sequel.lit(\"GetEnumValueUF(sub_container.type_2_id)\"), :container2Type),\n Sequel.as(:sub_container__indicator_2, :container2Indicator),\n Sequel.as(Sequel.lit(\"GetEnumValueUF(sub_container.type_3_id)\"), :container3Type),\n Sequel.as(:sub_container__indicator_3, :container3Indicator))\n .distinct\n end", "def self_and_siblings_through(other, scope = {})\n if self[parent_col_name].nil? || self[parent_col_name].zero?\n [self]\n else\n first, last = [self, other].sort\n self.class.find_in_nested_set(:all, { :conditions => \"#{scope_condition} AND #{sibling_condition} AND (#{prefixed_left_col_name} BETWEEN #{first[left_col_name]} AND #{last[right_col_name]})\", :order => \"#{prefixed_left_col_name}\" }, scope)\n end\n end", "def left_sibling\n siblings.\n where( arel[position_column].lt(self[position_column]) ).\n reorder( arel[position_column].desc ).\n first\n end", "def siblings\n without_self(self_and_siblings)\n end", "def higher_siblings\n self.class.where(:position.lt => self.position)\n end", "def self_and_descendants\n # using _left_ for both sides here lets us benefit from an index on that column if one exists\n nested_set_scope.where(\n arel_table[primary_column_name].eq(self.primary_id).or(arel_table[total_order_column_name].gteq(total_order)).\n and(arel_table[total_order_column_name].lt(snumv/denv)))\n end", "def siblings\n pages = (p = parent and p.children)\n return Set.new unless pages\n return Set.new unless pages.include?(self)\n Set.new(pages)\n end", "def previous_sibling\n if siblings.where(project_id: project_id).any?\n sibs = self_and_siblings.order(:cached).pluck(:id)\n\n s = sibs.index(id)\n TaxonName.find(sibs[s - 1]) if s != 0\n else\n nil\n end\n end", "def sibling_condition\n self[parent_col_name] ? \"#{prefixed_parent_col_name} = #{self[parent_col_name]}\" : \"(#{prefixed_parent_col_name} IS NULL OR #{prefixed_parent_col_name} = 0)\"\n end", "def siblings(options = {})\n self.siblings_and_self(options).excludes(id: self.id)\n end", "def pending_siblings_for(user)\n structural_parent.structural_children\n end", "def alias_node_query\n Category.left_outer_joins(:articles)\n .join_recursive do |query|\n query\n .connect_by(id: :parent_id)\n end\n end", "def lower_siblings\n self.class.where(:position.gt => self.position)\n end", "def siblings\n self_and_siblings - [self]\n end", "def siblings\n self_and_siblings - [self]\n end", "def siblings\n self_and_siblings - [self]\n end", "def children\n base_set_class.find(:all, :conditions => \"#{scope_condition} AND #{parent_col_name} = #{self.id}\", :order => left_col_name)\n end", "def self_and_siblings\n parent ? parent.children : Category.roots\n end", "def self_and_siblings\n parent ? parent.children : Category.roots\n end", "def next(name = nil)\n elements = self.class.all_siblings(self)\n elements = elements.where(:name => name) if name\n elements.where(\"position > ?\", self.position).order(\"position ASC\").limit(1)\n end", "def direct_children_by_id(*args)\n scope = args.last.is_a?(Hash) ? args.pop : {}\n ids = args.flatten.compact.uniq\n self.class.find_in_nested_set(:all, { \n :conditions => [\"#{scope_condition} AND #{prefixed_parent_col_name} = #{self.id} AND #{self.class.table_name}.#{self.class.primary_key} IN (?)\", ids]\n }, scope) \n end", "def rdfs_sub_property_of\n end", "def right_sibling\n siblings.\n where( arel[position_column].gt(self[position_column]) ).\n reorder( arel[position_column].asc ).\n first\n end", "def siblings\n self.drill.exercises.sort\n end", "def self_and_siblings\n parent ? parent.children : self.class.roots\n end", "def self_and_siblings\n parent ? parent.children : self.class.roots\n end", "def siblings\n self_and_siblings - [self]\n end", "def has_siblings?\n tree_search_class.where(:_id => { \"$ne\" => self._id }) \\\n .where(tree_parent_id_field => self[tree_parent_id_field]) \\\n .sort(self.class.tree_sort_order()).count\n end", "def left_sibling\n list.reverse.first(:position.lt => position)\n end", "def sibling_rels(*args)\n options = args.extract_options!\n rels = relationships.flat_map(&:siblings).uniq\n Relationship.filter_by_resource_type(rels, options)\n end", "def self_and_siblings_ids\n parent ? parent.children_ids : self.class.roots.map {|x| x.id}\n end", "def siblings\n parent && (parent.children - [self])\n end", "def chain_select_child\n self.chain_select_child\n end", "def children()\n #Ressource.filter(:parent_id => self.id, :parent_service_id => self.service_id).all\n end", "def collection_siblings\n return nil unless collection_member?\n @collection_siblings ||= CollectionMembers.new(\n Blacklight.solr.select(\n :params => {\n :fq => \"#{blacklight_config.collection_member_identifying_field}:\\\"#{self[blacklight_config.collection_member_identifying_field].first}\\\"\",\n :rows => blacklight_config.collection_member_grid_items.to_s\n }\n )\n )\n end", "def sibling_responses\n # self.question.responses.where(\"responses.id != ?\", self.id)\n self.question.responses.where.not(id: self.id)\n end", "def get_sibling(vector)\n conditions = get_siblings_conditions(vector)\n\n self.class.position_scope(scope_value)\n .where(conditions.first)\n .order(conditions.last)\n .limit(1).first\n end", "def siblings\n self_and_siblings - [self]\n end", "def siblings\n self_and_siblings - [self]\n end", "def ppl_siblings_in_file\n raise NotImplementedError\n end", "def right_sibling\n list.first(:position.gt => position)\n end", "def last_sibling_in_list\n self.class.asc(:position).last\n end", "def children\n Feature.find(:all, :conditions => [ 'parent_id=?', self.id] )\n end", "def siblings\n council.wards - [self]\n end", "def find_siblings(person)\n parent = find_parent(person)\n find_children(parent)\n .map(&:child)\n .map(&:name)\n .reject { |child| child == person }\n end" ]
[ "0.6565665", "0.6427067", "0.6412354", "0.63855445", "0.634301", "0.6324875", "0.63032067", "0.62764543", "0.62691164", "0.62453485", "0.62339234", "0.6167544", "0.6129583", "0.61256933", "0.61033237", "0.60631585", "0.6047185", "0.6043797", "0.6027462", "0.59774053", "0.59774053", "0.5947839", "0.594035", "0.5916041", "0.5896408", "0.5866966", "0.58632946", "0.5859729", "0.58270407", "0.58166337", "0.58008695", "0.57969385", "0.57925165", "0.5778139", "0.57535136", "0.5753051", "0.5745487", "0.5740806", "0.5708849", "0.5700815", "0.5697985", "0.56452954", "0.56420445", "0.5641156", "0.563559", "0.5623369", "0.5617393", "0.56157684", "0.55836356", "0.5578121", "0.5573371", "0.5569298", "0.55466187", "0.5528409", "0.5518841", "0.5516904", "0.5506344", "0.5499633", "0.54983455", "0.5493806", "0.54914254", "0.54768485", "0.5452439", "0.54346204", "0.54204416", "0.54088235", "0.5381677", "0.5377401", "0.53663903", "0.53663903", "0.53663903", "0.5360134", "0.53500134", "0.53500134", "0.5349062", "0.53481865", "0.5341221", "0.5340731", "0.5335588", "0.53207225", "0.53207225", "0.5288649", "0.5281251", "0.52734315", "0.5267482", "0.5244738", "0.52418405", "0.5240915", "0.52304065", "0.5225513", "0.52103525", "0.519298", "0.5180152", "0.5180152", "0.51797754", "0.5171462", "0.5170384", "0.5159812", "0.5159178", "0.5149268" ]
0.5521122
54
Returns ancestors, siblings, children, and this account.
def all_in_tree accounts = Array.new accounts += ancestors accounts += sibling_accounts accounts += children accounts << self return accounts end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_children_accounts\n if(current_user.role == \"Parent\")\n current_user.find_children.map{ |c| [c.get_accounts(c)[0], c.get_accounts(c)[1]]}.flatten\n end\n end", "def self_and_ancestors\n \t\tres = [self] + self.ancestors\n \t\treturn res.uniq\n \tend", "def account_list\n return [] unless company\n [company] + company.sibling_accounts\n end", "def self_and_siblings\n nested_set_scope.children_of parent_id\n end", "def ancestors() end", "def sibling_accounts\n Sfaccount.find(:all, :conditions => [\"parent_id = ?\",id])\n end", "def ancestors\n node, nodes = self, []\n nodes << node = node.parent while node.parent\n nodes\n end", "def descendants_and_self\r\n result = [self]\r\n children.each { |child| result << child.descendants_and_self }\r\n result.flatten!\r\n return result\r\n end", "def ancestors; end", "def ancestors; end", "def ancestors; end", "def ancestors; end", "def self_and_ancestors\n ancestors + [self]\n end", "def ancestors\n TreeNode.find(:all,\n :from => \"cms_treenode_ancestors(#{self.id}, #{AuthenticationModel.current_user}) tree_nodes\") rescue []\n end", "def ancestors\n node, nodes = self, []\n nodes << node = node.parent while node.parent\n nodes\n end", "def ancestors\n node, nodes = self, []\n nodes << node = node.parent while node.parent\n nodes\n end", "def self_and_siblings\n parent ? parent.children : self.class.roots\n end", "def self_and_siblings\n parent ? parent.children : self.class.roots\n end", "def self_and_siblings\n #parent ? parent.children : self.class.roots\n self.class.find(:all, :conditions => {:parent_id => self.parent_id})\n end", "def self_and_siblings\n parent ? parent.children : self.class.roots\n end", "def ancestors\n []\n end", "def ancestors\n node, nodes = self, []\n nodes << node = node.parent while node.parent\n nodes\n end", "def ancestors\n node, nodes = self, []\n nodes << node = node.parent while node.parent\n nodes\n end", "def self_and_ancestors\n ancestors + [self]\n end", "def self_and_siblings\n base_class.all scoped(parent_column_name => _parent_id)\n end", "def ancestors\n without_self self_and_ancestors\n end", "def ancestors\n self_and_ancestors - [self]\n end", "def self_and_descendants\n [self] + self.descendants\n end", "def ancestors\n @cache[:ancestors]\n end", "def ancestors\n []\n end", "def ancestors\n end", "def parents_and_self\n ret = []\n if self.parent\n ret.concat(self.parent.parents_and_self)\n end\n ret << self\n ret\n end", "def parents_and_self\n ret = []\n if self.parent\n ret.concat(self.parent.parents_and_self)\n end\n ret << self\n ret\n end", "def self_and_ancestor_user_ids\n Account.where(id: self_and_ancestors.unscope(where: :type)).includes(:user_roles).collect do |account|\n account.user_roles.collect(&:user_id)\n end.flatten\n end", "def ancestors\n without_self(self_and_ancestors)\n end", "def parents_and_self\n ret = []\n ret.concat(parent.parents_and_self) if parent\n ret << self\n ret\n end", "def self_and_siblings\n tree_search_class.where({\n tree_parent_id_field => self[tree_parent_id_field]\n }).sort(self.class.tree_sort_order()).all\n end", "def ancestors\n ancestors = []\n current_ancestor = self\n \n while !current_ancestor.nil?\n \n if current_ancestor.respond_to?(:parent)\n ancestors << current_ancestor\n current_ancestor = current_ancestor.parent\n else\n current_ancestor = nil\n end\n \n end\n \n ancestors\n end", "def accounts\n\t\treturn @accounts\n\tend", "def ancestors\n itr = self\n res = []\n until itr.top_level?\n itr = itr.parents.first\n res << itr\n end\n res\n end", "def ancestors\n node_ancestors.map(&:ancestor)\n end", "def ancestors\n self.root? ? [] : self.parent.ancestors_and_self\n end", "def descendants\n self.class.hierarchy_descendants(self)\n end", "def ancestors\n self.class.ancestors_of(self)\n end", "def self_and_descendants\n res = [self] + self.descendants\n return res.uniq\n end", "def ancestors\n parents + parents.map(&:ancestors).flatten\n end", "def accounts\n period.accounts\n end", "def self_and_descendants_from_active_record\n [self]\n end", "def ancestors\n @ancestors ||= [self] + (self.parent.try(:ancestors) || [])\n end", "def self_and_siblings\n return [self] if self[nested_set_parent].nil? || self[nested_set_parent].zero?\n nested_set_class.find_with_nested_set_scope(:all, :conditions => \"#{nested_set_parent} = #{self[nested_set_parent]}\", :order => nested_set_left)\n end", "def self_and_ancestors\n # 1. recursively load ancestors\n nodes = []\n node = self\n\n while node\n nodes << node\n node = node.parent\n end\n\n # 2. first ancestor is a root\n nodes.reverse!\n\n # 3. create fake scope\n ActsAsOrderedTree::Relation::Preloaded.new(self.class).\n where(:id => nodes.map(&:id).compact).\n extending(Arrangeable).\n records(nodes)\n end", "def ancestors\n return [] if root?\n tree_search_class.find(self[tree_path_field])\n end", "def self_and_descendants_from_active_record\n [self]\n end", "def common_account_chain(in_root_account)\n rid = in_root_account.id\n accts = self.associated_accounts.where(\"accounts.id = ? OR accounts.root_account_id = ?\", rid, rid)\n return [] if accts.blank?\n children = accts.inject({}) do |hash,acct|\n pid = acct.parent_account_id\n if pid.present?\n hash[pid] ||= []\n hash[pid] << acct\n end\n hash\n end\n\n enrollment_account_ids = in_root_account.\n all_enrollments.\n current_and_concluded.\n where(user_id: self).\n joins(:course).\n distinct.\n pluck(:account_id)\n\n longest_chain = [in_root_account]\n while true\n break if enrollment_account_ids.include?(longest_chain.last.id)\n\n next_children = children[longest_chain.last.id]\n break unless next_children.present? && next_children.count == 1\n longest_chain << next_children.first\n end\n longest_chain\n end", "def self_and_all_children\n [self] + all_children\n end", "def descendants\n self.class.descendants_of(self)\n end", "def accounts\n Management::Account.all(self)\n end", "def self_and_siblings\n if self[acts_as_nested_set_options[:parent_column]].nil? || self[acts_as_nested_set_options[:parent_column]].zero?\n [self]\n else\n self.class.find(:all, :conditions => \"#{acts_as_nested_set_options[:scope]} and #{acts_as_nested_set_options[:parent_column]} = #{self[acts_as_nested_set_options[:parent_column]]}\", :order => acts_as_nested_set_options[:left_column])\n end\n end", "def self_and_siblings\n ordered_tree_scope.where(parent_column => self[parent_column])\n end", "def ancestors\n records = self_and_ancestors - [self]\n\n scope = self_and_ancestors.where(arel[:id].not_eq(id))\n scope.records(records)\n end", "def descendants\n \t descendants = []\n \t self.children.each { |child|\n \t descendants += [child] if child.permitted?\n \t descendants += child.descendants\n \t } unless self.children.empty?\n \t descendants \n \tend", "def tree_transactions\n Transaction.where(admpart_tag_id: self_and_descendants.map(&:id))\n end", "def ancestors \n \t\tres=parents\n \t\tparents.each {|c| res += c.ancestors}\n \t\treturn res.uniq\n \tend", "def ancestors(scope = {})\n self_and_ancestors(scope) - [self]\n end", "def ancestors\n self.class.find(:all, :conditions => \"#{acts_as_nested_set_options[:scope]} AND (#{acts_as_nested_set_options[:left_column]} < #{self[acts_as_nested_set_options[:left_column]]} and #{acts_as_nested_set_options[:right_column]} > #{self[acts_as_nested_set_options[:right_column]]})\", :order => acts_as_nested_set_options[:left_column] )\n end", "def ancestors\n parents = []\n\n this_parent = self.parent\n\n while this_parent != nil\n parents << this_parent\n this_parent = this_parent.parent\n end\n parents\n end", "def ancestors\n @space.ancestors\n end", "def self_and_ancestors\n nested_set_scope.where(\"#{self.class.table_name}.lft <= ? AND #{self.class.table_name}.rgt >= ?\", lft, rgt)\n end", "def ancestors_r(*args)\n # fetch all parents\n pending = [self]\n ans = []\n while !pending.empty?\n e = pending.pop\n e.parents(*args).each do |p|\n if !ans.include?(p)\n ans << p\n pending.push(p)\n end\n end\n end\n ans\n end", "def sub_accounts(conditions = {})\n client.accounts.list(conditions)\n end", "def accounts\n @accounts_manager\n end", "def self_and_siblings_ids\n parent ? parent.children_ids : self.class.roots.map {|x| x.id}\n end", "def siblings\n if self.parent.nil?\n self.class.where('forestify_level = 0').where('id != ?', self.id)\n else\n self.parent.children.where('forestify_level = ?', self.forestify_level).where('id != ?', self.id)\n end\n end", "def siblings\n tree_search_class.where({\n :_id => { \"$ne\" => self._id },\n tree_parent_id_field => self[tree_parent_id_field]\n }).sort(self.class.tree_sort_order()).all\n end", "def ancestors\n model_base_class.scoped(:conditions => ancestor_conditions, :order => :ancestry_string)\n end", "def descendants\n node, nodes = self, []\n node.children.each { |child|\n # Check for circular dependenciess\n if !nodes.include?(child)\n nodes += [child]\n nodes += child.descendants\n end\n } unless node.children.empty?\n nodes\n end", "def descendants\n children + children.map(&:children).flatten\n end", "def descendents\n respond_to?(:values) ? values.map { |d| d.branch }.flatten : []\n end", "def ancestors\n @ancestors ||= parent ? parent.ancestors + [parent] : []\n end", "def get_siblings\n self.root? ? [] : self.siblings.select { |d| d.id != self.id }\n end", "def get_self_and_children_ids\n ids = [self.id]\n ids += get_children_ids_recursive\n return ids\n\t\tend", "def descendants\n node, nodes = self, []\n node.children.each { |child|\n # Check for circular dependencies\n if !nodes.include?(child)\n nodes += [child]\n nodes += child.descendants\n end\n } unless node.children.empty?\n nodes\n end", "def accounts\n return [] if self.id.nil?\n @accounts ||= \n OrgSync::Base.request(\"#{self.class.endpoint}/#{self.id}/accounts\", {}, @api_key).map { |json| \n OrgSync::Account.new(json, @api_key) \n }\n end", "def children\n self.class.find(:all, :conditions => \"#{acts_as_nested_set_options[:scope]} AND #{acts_as_nested_set_options[:parent_column]} = #{self.id}\", :order => acts_as_nested_set_options[:left_column])\n end", "def ancestors\n nested_set_class.find_with_nested_set_scope(:all, :conditions => \"(#{nested_set_left} < #{self[nested_set_left]} and #{nested_set_right} > #{self[nested_set_right]})\", :order => nested_set_left )\n end", "def self_and_ancestors\n ancestors << self\n end", "def accounts\n @transactions.collect(&:account).uniq\n end", "def accounts\n return @accounts if @accounts\n @accounts = [ brokerage_account, bank_account ].compact\n end", "def self_and_siblings\n parent ? parent.children : Category.roots\n end", "def self_and_siblings\n parent ? parent.children : Category.roots\n end", "def self_and_siblings\n dataset.nested.filter(self.class.qualified_parent_column => self.parent_id)\n end", "def self_and_descendents\n [self] + descendents\n end", "def taxons_with_ancestors\n taxons.flat_map(&:breadcrumb_trail)\n end", "def self_and_descendants\n nested_set_scope.where(\"#{self.class.table_name}.lft >= ? AND #{self.class.table_name}.rgt <= ?\", lft, rgt)\n end", "def siblings\n parent&.children || []\n end", "def grand_children\n []\n end", "def descendants\n @descendants\n end", "def ancestors_ids\n node, nodes = self, []\n while node.parent\n node = node.parent\n nodes << node.id\n end\n nodes\n end", "def accounts\n return @accounts if @accounts\n\n # find the bricklet articles, which contains the balance data\n @accounts = account_table_rows.map do |row|\n data = row.xpath(\".//td\").map(&:text)\n number = data.shift\n name = data.shift\n balance = data.pop.scan(NUMERIC_REGEXP).join\n available = data.pop.scan(NUMERIC_REGEXP).join\n available = balance if available.empty?\n Account.new(:bank, name, number, balance, available)\n end\n end", "def get_parent_id()\n self.account_id\n end" ]
[ "0.7272906", "0.6777231", "0.66082484", "0.66066164", "0.6581132", "0.65596396", "0.6503975", "0.64935976", "0.64854294", "0.64854294", "0.64854294", "0.64854294", "0.64535314", "0.64439255", "0.64401037", "0.64401037", "0.64294475", "0.64294475", "0.64206636", "0.64200544", "0.641525", "0.6414544", "0.6414544", "0.6408328", "0.64076555", "0.64034015", "0.64026266", "0.6395663", "0.6368964", "0.63552344", "0.63515705", "0.63233346", "0.6322387", "0.6274107", "0.6258297", "0.6246215", "0.6237333", "0.62309253", "0.62221", "0.62009144", "0.61990184", "0.61821204", "0.6176269", "0.6175521", "0.61451054", "0.61187166", "0.60903364", "0.60559547", "0.6055637", "0.6043642", "0.6027065", "0.60158086", "0.601203", "0.6010394", "0.6009408", "0.60080636", "0.5995311", "0.5993407", "0.5982681", "0.59728557", "0.59569246", "0.5956755", "0.59546226", "0.59475046", "0.5939206", "0.59237844", "0.59057635", "0.5863213", "0.5852631", "0.5849293", "0.58394617", "0.58373827", "0.5827984", "0.5823795", "0.5817185", "0.5815649", "0.5809661", "0.5809271", "0.57997876", "0.57948774", "0.57905436", "0.5782422", "0.5779188", "0.5775792", "0.5772029", "0.5766938", "0.57667166", "0.576308", "0.57494783", "0.57494783", "0.5748493", "0.57327837", "0.5731178", "0.57260877", "0.5724223", "0.5721282", "0.57193446", "0.5711731", "0.57108444", "0.57021254" ]
0.7909146
0
Initialize a model and build via a block
def initialize(*) super yield self if block_given? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(model, &block)\n @model = model\n @associations = {}\n @fields = []\n @attributes = []\n @conditions = []\n @groupings = []\n @options = {}\n @delta_object = nil\n \n initialize_from_builder(&block) if block_given?\n end", "def initialize(model_class, block)\n @model_class, @block = model_class, block\n\n @scopes = {}\n @allowed_fields = {}\n @validators = {}\n @fixtures = {}\n end", "def initialize_model\n # let's create our new empty model\n @model = OpenStudio::Model::Model.new if @model.nil?\n end", "def initialize(model, storage_id = nil, &block)\n super(model, storage_id)\n instance_eval(&block) if block_given?\n end", "def initialize_model\n end", "def build_model\n self.model = nil # set up the model\n end", "def build(&block)\n instance_eval(&block)\n end", "def new\n\t\t@block = Block.new\n\tend", "def initialize(model)\n @model = model\n end", "def parsed_model(&block)\n parsed_model_class.class_eval(&block)\n end", "def build(&block)\n if block\n @build = block\n else\n @build\n end\n end", "def initialize(model)\n @model = model\n end", "def initialize(model)\n @model = model\n end", "def initialize(model)\n @model = model\n end", "def initialize(model)\n @model = model\n\n instance_eval(&self.class.setup_model_blk) if model\n \n @templates = if model\n self.class.generated_files.models\n else\n self.class.generated_files.global\n end\n end", "def load(model, options = {}, &block)\n end", "def initialize_model\n { :def_class => BaseDefinition,\n :processes => [],\n :process_class => nil, :process_class_name => nil,\n :controller_class => nil, :controller_class_name => nil }\n end", "def build(attributes = {}, &block)\n attributes = defaults.merge!(attributes)\n\n model = new(attributes)\n\n if block_given?\n model.deputy(attributes[:client]).instance_eval(&block)\n end\n\n model\n end", "def initialize_block\n unless latest_block\n block = Bitcoin.chain_params.genesis_block\n genesis = ChainEntry.new(block.header, 0)\n db.save_entry(genesis)\n end\n end", "def initialize(make, model)\n @make = make\n @model = model\n end", "def new(&block)\n assign_attributes if params[model_identifier]\n respond_with(entry, &block)\n end", "def initialize(&block)\n instance_eval(&block) if block_given?\n end", "def init(model, rec, pckg, baseName); @model = model; @rec = rec; @pckg = pckg; @baseName = baseName; self end", "def h_set_single_model(&block)\n Backup::SpecLive.load_models = false\n Backup::Utilities.send(:reset!)\n Backup::Logger.clear!\n Backup::Model.all.clear\n Backup::Config.load_config!\n block.call\n model = Backup::Model.all.first\n model\n end", "def initialize_from_builder(&block)\n builder = Class.new(Builder)\n builder.setup\n \n builder.instance_eval &block\n \n unless @model.descends_from_active_record?\n stored_class = @model.store_full_sti_class ? @model.name : @model.name.demodulize\n builder.where(\"#{@model.quoted_table_name}.#{quote_column(@model.inheritance_column)} = '#{stored_class}'\")\n end\n\n @fields = builder.fields\n @attributes = builder.attributes\n @conditions = builder.conditions\n @groupings = builder.groupings\n @delta_object = ThinkingSphinx::Deltas.parse self, builder.properties\n @options = builder.properties\n \n # We want to make sure that if the database doesn't exist, then Thinking\n # Sphinx doesn't mind when running non-TS tasks (like db:create, db:drop\n # and db:migrate). It's a bit hacky, but I can't think of a better way.\n rescue StandardError => err\n case err.class.name\n when \"Mysql::Error\", \"ActiveRecord::StatementInvalid\"\n return\n else\n raise err\n end\n end", "def initialize(model = T.unsafe(nil)); end", "def create(attributes={}, &block) # TODO: testme\n model = self.new(attributes)\n yield(model) if block_given?\n model.save\n model\n end", "def initialize(&block)\n instance_eval(&block) if block_given?\n end", "def set_model\n\n # check credentials and handle OpenStack Keystone\n # TODO: check expiration dates on Keystone tokens\n raise \"You are not authorized to use this endpoint!\" unless check_authn\n\n #\n model = get('/-/')\n @model = Occi::Model.new(model)\n\n @mixins = {\n :os_tpl => [],\n :resource_tpl => []\n }\n\n #\n get_os_templates.each do |os_tpl|\n unless os_tpl.nil? || os_tpl.type_identifier.nil?\n tid = os_tpl.type_identifier.strip\n @mixins[:os_tpl] << tid unless tid.empty?\n end\n end\n\n #\n get_resource_templates.each do |res_tpl|\n unless res_tpl.nil? || res_tpl.type_identifier.nil?\n tid = res_tpl.type_identifier.strip\n @mixins[:resource_tpl] << tid unless tid.empty?\n end\n end\n\n model\n end", "def build(&block)\n Util.instance_eval_or_call(dsl, &block)\n self\n end", "def build(&block)\n Util.instance_eval_or_call(dsl, &block)\n self\n end", "def initialize(row_model, input = $stdin, **options, &block)\n @row_model, @input, @options = row_model, input, options.dup\n\n if block_given?\n case block.arity\n when 1 then block.call(self)\n else self.instance_eval(&block)\n end\n end\n end", "def initialize(scope, user, params, &block)\n @scope = scope\n @params = params.dup\n @user = user\n\n instance_eval(block) if block_given?\n\n build\n end", "def init (&block)\n @init_block = block\n end", "def build(model_name, attributes = {}) # rubocop:disable AbcSize, MethodLength\n hash = begin\n path = fixtures_path + '/' + model_name.to_s.pluralize + '.yml'\n line = YAML.load(ERB.new(File.read(path)).result)['DEFAULTS'] # rubocop:disable YAMLLoad\n instance_eval(ERB.new(line.to_s.gsub('$LABEL', 'sample')).result)\n end\n\n attributes.each { |key, value| hash[key] = value }\n\n if model_name == :account\n hash[:password] = APP::DEFAULT_PASSWORD\n hash[:password_confirmation] = APP::DEFAULT_PASSWORD\n end\n\n ##\n\n correction = lambda do |ref|\n if hash[ref].present?\n hash[\"#{ref}_id\"] = accounts(hash[ref].to_sym).id if ref == 'account'\n hash[\"#{ref}_id\"] = users(hash[ref].to_sym).id if ref == 'user'\n hash[\"#{ref}_id\"] = targets(hash[ref].to_sym).id if ref == 'target'\n\n hash.delete(ref)\n end\n end\n\n correction.call('account')\n correction.call('user')\n correction.call('target')\n\n ##\n\n model_name.to_s\n .classify\n .constantize.new(hash)\nend", "def populate &block\n instance_eval(&block)\n self\n end", "def initialize(type, &block)\n @state = OpenStruct.new(type: type)\n\n self.instance_eval(&block) if block_given?\n end", "def initialize(&block)\n yield self\n end", "def initialize(&block)\n load_defaults!\n\n instance_eval(&block)\n end", "def initialize(model, &block)\n super(model)\n\n @only_collections ||= Array.new\n @additional_options ||= Array.new\n @ipv6 ||= false\n @lock ||= false\n\n instance_eval(&block) if block_given?\n\n @mongodump_utility ||= utility(:mongodump)\n @mongo_utility ||= utility(:mongo)\n end", "def create_model(name, &block)\n name = name.to_s.tableize\n raise \"Model name '#{name}' is not unique\" if site.model_types.key?(name)\n \n # create a new instance of model\n child = self.class.new(site)\n child.name = name.camelcase.singularize\n child.parent = self\n \n # inherited fields\n fields.each do |name, field|\n child.set(name, get(name)) if field.inherited?\n end\n \n # insert the model in to the site models list\n class_name = name.classify\n site.model_types[name] = child.id\n site.model_plural_names[class_name] = name\n site.save\n \n # append the model to ancestor descendant lists (these are used in queries to\n # restrict the type of records returned, e.g pages.all => _model: ['Page', ...]\n child.tap do |child|\n child.add_descendant(child)\n child.instance_exec(child, &block) if block_given?\n child.save\n end\n end", "def new(&block)\n Builder.new(&block).to_client\n end", "def prepare\n model.tap do |p|\n p.name = name\n p.identifier = set_identifiers\n p.meta = set_meta\n end\n end", "def prepare\n model.tap do |p|\n p.name = name\n p.identifier = set_identifiers\n p.meta = set_meta\n end\n end", "def initialize(*args)\n # Call the ArsModels::Base initializer and delegate to the build or generate method\n super(*args)\n end", "def initialize(*args)\n # Call the ArsModels::Base initializer and delegate to the build or generate method\n super(*args)\n end", "def make_and_model; end", "def new(*args)\n Model.new(*args).tap { |model| yield model if block_given? }\n end", "def initialize(&block)\n load_defaults!\n\n instance_eval(&block) if block_given?\n\n set_defaults!\n end", "def create(model_name,options={})\n # @TODO: this is another path that parallels the ModelFactory\n model_class = Metro::Models.find(model_name)\n mc = model_class.new options\n mc.scene = scene\n mc.window = window\n mc\n end", "def initialize(model)\n\t\t\t@name = model.to_s\n\t\t\t@ar_model = ARModel.new(model)\n\t\t\t\n\n\n @api_model = APIModel.new(model, Hash[@ar_model.schema])\n\t\t\t@field_relationships = generate_field_relationships(@ar_model.schema)\n\t\t\tputs @field_relationships\n\t\tend", "def new_model\n unless @model\n @model = create_model\n attach_model\n end\n @model\n end", "def first_or_initialize(attributes={}, &block)\n result = first\n unless result\n attributes = @options[:hash].merge(attributes) if @options[:hash]\n result = @model_class.new(attributes, &block)\n end\n result\n end", "def build(&block)\n # provide access to 'this' in configuration block\n self.instance_exec(&block)\n end", "def initialize(model_wrapper)\n @model_wrapper = model_wrapper\n end", "def initialize(model_wrapper)\n @model_wrapper = model_wrapper\n end", "def build(base=nil, &block)\n struct = base || SparkleStruct.new\n struct.instance_exec(&block)\n @_struct = struct\n end", "def new_model(name = :foo, &block)\n table_name = \"#{name}_#{rand(1000000)}\"\n @table_names ||= []\n @table_names << table_name\n\n model = Class.new do\n (class << self; self; end).class_eval do\n define_method(:name) { \"MongoidTest::#{name.to_s.capitalize}\" }\n define_method(:to_s) { self.name }\n end\n end\n\n model.class_eval do\n include Mongoid::Document\n store_in collection: table_name\n\n field :state, :type => String\n end\n model.class_eval(&block) if block_given?\n model\n end", "def initialize(&block)\n @block = block\n end", "def initialize() # no file name if want to build model manually\n @reRefs = Hash.new(*[]) # references to the entity, hash keyed by entity\n @enums={}; @records = {}\n @ver = nil\n end", "def model(name, &block)\n @model_registry.model name, &block\n end", "def initialize(model, storage_id = nil, &block)\n super(model, storage_id)\n\n @servicenet ||= false\n @path ||= 'backups'\n\n instance_eval(&block) if block_given?\n end", "def build(&ruby_block)\n # Use local variable for accessing the attribute since they will\n # be hidden when opening the sytem.\n states = @states\n namespace = @namespace\n this = self\n mk_ev = @mk_ev\n mk_rst = @mk_rst\n type = @type\n dual = @dual\n sequential = @sequential\n extra_syncs = @extra_syncs\n extra_asyncs = @extra_asyncs\n default_codes = @default_codes\n\n return_value = nil\n\n # Enters the current system\n HDLRuby::High.cur_system.open do\n # sub do\n HDLRuby::High.space_push(namespace)\n # Execute the instantiation block\n # return_value = HDLRuby::High.top_user.instance_exec(&ruby_block)\n return_value = HDLRuby::High.top_user.instance_exec(&ruby_block) if ruby_block\n\n # Expands the extra state processing so that al all the\n # parts of the state machine are in par (clear synthesis).\n [extra_syncs,extra_asyncs].each do |extras|\n # Set the values of the extra states from their name.\n extras.each do |extra|\n st = states.find {|st| st.name == extra.name }\n unless st then\n raise \"Unknown state name: #{extra.name}\"\n end\n extra.value = st.value\n end\n # Fills the holes in the extra syncs and asyncs.\n if extras.any? then\n # Sort by value in a new array using counter sort.\n results = [ nil ] * states.size\n extras.each {|st| results[st.value] = st }\n # Fill the whole with empty states.\n results.map!.with_index do |st,i| \n unless st then\n st = State.new\n st.value = i\n st.code = proc {}\n end\n st\n end\n # Replace the content of extras\n extras.clear\n results.each {|st| extras << st }\n end\n end\n\n # Create the state register.\n name = HDLRuby.uniq_name\n # Declare the state register.\n this.cur_state_sig = [states.size.width].inner(name)\n # Declare the next state wire.\n name = HDLRuby.uniq_name\n this.next_state_sig = [states.size.width].inner(name)\n\n # Create the fsm code\n\n # Control part: update of the state.\n # par(mk_ev.call) do\n fsm_block(mk_ev.call) do\n hif(mk_rst.call) do\n # Reset: current state is to put to 0.\n this.cur_state_sig <= 0\n end\n helse do\n # No reset: current state is updated with\n # next state value.\n this.cur_state_sig <= this.next_state_sig\n end\n end\n\n # Operative main-part: one case per state.\n # (clock-dependent if synchronous mode).\n if type == :sync then\n # Synchronous case.\n event = mk_ev.call\n event = event.invert if dual\n else\n # Asynchronous case: no event required.\n event = []\n end\n # The process\n # par(*event) do\n fsm_block(*event) do\n # The operative code.\n oper_code = proc do\n # The default code.\n default_codes.each(&:call)\n # Depending on the state.\n if (type == :sync) then\n hcase(this.next_state_sig)\n else\n hcase(this.cur_state_sig)\n end\n states.each do |st|\n # Register the working state (for the gotos)\n this.work_state = st\n hwhen(st.value) do\n # Generate the content of the state.\n st.code.call\n end\n end\n end\n # Is there reset code?\n if type == :sync and this.reset_sync then\n # Yes in case of synchronous fsm,\n # use it before the operative code.\n hif(mk_rst.call) do\n this.reset_sync.call\n end\n helse(&oper_code)\n elsif type == :async and this.reset_async then\n # Yes in case of asynchronous fsm,\n # use it before the operative code.\n hif(mk_rst.call) do\n this.reset_async.call\n end\n helse(&oper_code)\n else\n # Use only the operative code.\n oper_code.call\n end\n end\n\n # Control part: computation of the next state.\n # (clock-independent)\n hcase(this.cur_state_sig)\n states.each do |st|\n hwhen(st.value) do\n if st.gotos.any? then\n # Gotos were present, use them.\n st.gotos.each(&:call)\n else\n # No gotos, by default the next step is\n if sequential then\n this.next_state_sig <= this.cur_state_sig + 1\n end\n end\n end\n end\n # By default set the next state to 0.\n helse do\n # hprint(\"Unknow state case: \",this.cur_state_sig,\"\\n\")\n this.next_state_sig <= 0\n end\n\n # Operative additional parts.\n # Extra synchronous operative part.\n if extra_syncs.any? then\n event = mk_ev.call\n event = event.invert if @dual\n # The extra code.\n # par(*event) do\n fsm_block(*event) do\n # Build the extra synchronous part.\n sync_code = proc do\n hcase(this.cur_state_sig)\n extra_syncs.each do |st|\n hwhen(st.value) do\n # Generate the content of the state.\n st.code.call\n end\n end\n end\n # Place it.\n if this.reset_sync then\n # There some synchronous reset code, use\n # it.\n hif(mk_rst.call) do\n this.reset_sync.call\n end\n helse(&sync_code)\n else\n # No syncrhonous code, place the extra\n # synchronous states as is.\n sync_code.call\n end\n end\n end\n\n # Extra asynchronous operative part.\n if extra_asyncs.any? then\n # par do\n fsm_block do\n # Build the extra synchronous part.\n async_code = proc do\n hcase(this.cur_state_sig)\n extra_asyncs.each do |st|\n hwhen(st.value) do\n # Generate the content of the state.\n st.code.call\n end\n end\n end\n # Place it with possible reset.\n if this.reset_async then\n # There some synchronous reset code, use\n # it.\n hif(mk_rst.call) do\n this.reset_async.call\n end\n helse(&sync_code)\n else\n # No syncrhonous code, place the extra\n # synchronous states as is.\n sync_code.call\n end\n end\n end\n\n HDLRuby::High.space_pop\n # end\n end\n\n return return_value\n end", "def build(base=nil, &block)\n if(base || block.nil?)\n struct = base || SparkleStruct.new\n struct.instance_exec(&block)\n struct\n else\n block\n end\n end", "def initialize model, logical_join, binding, from_record = nil, path = nil, reflection = nil, &blk\n @model = model\n @from = from_record\n @logical_join = logical_join\n @conditions = []\n @condition_blocks = []\n @reflection = reflection\n @path = [ path, reflection ].compact.flatten\n @binding = binding\n @order = []\n @negative = false\n @paginator = false\n @block = blk\n \n existing_methods = self.class.instance_methods(false)\n (model.column_names - existing_methods).each do |col|\n (class << self; self; end).class_eval do\n define_method(col.to_s.intern) do\n column(col)\n end\n end\n end\n (model.reflections.keys - existing_methods).each do |assn|\n (class << self; self; end).class_eval do\n define_method(assn.to_s.intern) do\n association(assn)\n end\n end\n end\n \n execute_block\n end", "def build(*arguments, &block)\n build_class(*arguments, &block).new(*arguments, &block)\n end", "def attach_model\n model.each_member do |name, field|\n case field\n when OpenStructModel\n @members[name] ||= create_subfield(name)\n end\n end\n\n # Trigger updating the structure whenever the state model is\n # changed\n model.on_change(nil, false) do |name, value|\n if value.kind_of?(OpenStructModel)\n @members[name] ||= create_subfield(name)\n end\n end\n end", "def initialize(block, json)\n @block = block\n @elements = []\n self.data = json\n end", "def initialize(make, model, classification, owner)\n @make = make\n @model = model\n @classification = classification\n @owner = owner\n @@all << self\n end", "def initialize(params ={}, &block)\n super\n instance_eval &block\n end", "def build\n yield self\n self\n end", "def construct( &block )\n self.instance_eval(&block)\n @options\n end", "def initialize(&block)\n instance_exec(&block) if block_given?\n end", "def model=(_arg0); end", "def model=(_arg0); end", "def model=(_arg0); end", "def model=(_arg0); end", "def initialize(model, name, owner)\n @model = model\n self.name = name\n self.owner = owner\n self.passengers = []\n self.cargo = []\n end", "def init(&block)\n @inits << block\n end", "def init(&block)\n @inits << block\n end", "def initialize(&block)\n @block = block\n end", "def initialize(&block)\n @block = block\n end", "def build(*args)\n model = generate(*args)\n model.save\n model\n end", "def with_model\n with_element do |model_name, _model_attributes|\n model = MODELS[model_name]\n if model.nil?\n raise OSM::APIBadUserInput, \"Unexpected element type #{model_name}, \" \\\n \"expected node, way or relation.\"\n end\n # new in libxml-ruby >= 2, expand returns an element not associated\n # with a document. this means that there's no encoding parameter,\n # which means basically nothing works.\n expanded = @reader.expand\n\n # create a new, empty document to hold this expanded node\n new_node = @doc.import(expanded)\n @doc.root << new_node\n\n yield model, new_node\n @reader.next\n\n # remove element from doc - it will be garbage collected and the\n # rest of the document is re-used in the next iteration.\n @doc.root.child.remove!\n end\n end", "def initialize(model, request)\n @model = model\n @request = request\n end", "def initialize(model_class)\n @model_class = model_class\n @models_to_embed = []\n end", "def block(block)\n @components[:__base__] = self.class.build(&block)\n @load_order << :__base__\n true\n end", "def execute(block)\n model = @wrapper.object\n block.call model\n end", "def initialize(model, year) #metodo constructor permite definir como se contruiran los objetos\n @model = model #guarda lo que sea que tenga en la variable \"model\"\n @year = year\n end", "def build(attributes)\n Model.new(resource_gateway, attributes)\n end", "def initialize (&block)\n instance_exec(&block)\n end", "def initialize_models\n @models = {}\n @models[:required] = parse_models(@spec.files) if @spec.files\n end", "def initialize(state, &block)\n if nil == state\n raise \"Passed nil to initialize. Generally disallowed.\"\n end\n @state = state\n @fields = {}\n # @context = context\n # @vars = Hashie::Mash.new(vars)\n\n instance_eval &block\n end", "def initialize(model, make, colour)\r\n @model = model\r\n @make = make\r\n @colour = colour\r\n end", "def initialize b\n @build = b\n end", "def build(attrs = {}, &block)\n create_document(:new, attrs, &block)\n end", "def initialize(options={}, &block)\n super(options)\n\n block.call(self) # Allow for population of data with a block during initialization.\n end", "def init_body(&block)\n if block_given?\n @body = to_node(yield)\n else\n @body = Null\n end\n end", "def initialize(attribs={})\n @new_record = true \n \n initialize_internals\n initialize_attributes\n update_attributes(attribs)\n yield self if block_given?\n end", "def initialize(&block)\n load_defaults!\n\n @only_collections ||= Array.new\n @additional_options ||= Array.new\n @ipv6 ||= false\n @lock ||= false\n\n instance_eval(&block)\n prepare!\n end", "def create(attributes = {}, &block)\n new(attributes, &block).tap { |record| record.save }\n end" ]
[ "0.75944704", "0.7004971", "0.6791078", "0.673156", "0.64625245", "0.6453866", "0.64320344", "0.63829386", "0.63524806", "0.6288333", "0.6277883", "0.62624705", "0.62624705", "0.62624705", "0.620875", "0.6204275", "0.62000376", "0.6172755", "0.61627465", "0.6159772", "0.6065822", "0.60307884", "0.60272837", "0.59948385", "0.5974612", "0.5932636", "0.59219015", "0.58987916", "0.58973074", "0.58887786", "0.58887786", "0.58867663", "0.5883381", "0.586903", "0.5866934", "0.58582246", "0.58403295", "0.5838465", "0.5832954", "0.5820335", "0.5808703", "0.5772216", "0.57595414", "0.57595414", "0.57572454", "0.57572454", "0.57430106", "0.57266366", "0.57245994", "0.57164174", "0.57112706", "0.5709304", "0.56956077", "0.5689679", "0.56880885", "0.56880885", "0.5676378", "0.56636184", "0.56570584", "0.5649243", "0.56337655", "0.56334805", "0.56307507", "0.5609158", "0.5606606", "0.56053704", "0.5597051", "0.5589835", "0.55818254", "0.55789727", "0.55723643", "0.5569964", "0.55649877", "0.55638546", "0.55638546", "0.55638546", "0.55638546", "0.5563848", "0.5556811", "0.5556811", "0.5555085", "0.5555085", "0.55538225", "0.55460477", "0.5533176", "0.55113804", "0.5508438", "0.55066353", "0.5505775", "0.55030864", "0.5503043", "0.550272", "0.5497573", "0.5497066", "0.5496711", "0.54950994", "0.5495035", "0.54810214", "0.547633", "0.54760677", "0.5469092" ]
0.0
-1
i = 1 every_other = [] 50.times do every_other << i i = i + 2 end p every_other end every_other
def every_other i = 1 numbers = [] 50.times do numbers << i i+= 2 end return numbers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_next_statement\n i = 0\n result = []\n while i < 10\n i += 1\n next if (i % 2) == 0\n result << i\n end\n assert_equal (1..10).step(2).to_a, result\n end", "def multiples(i)\n ms = []\n (1..10).each do |j|\n ms << i * j\n end\n ms\nend", "def sequence(integer1, integer2)\n sequence_array = []\n current_value = integer2\n integer1.times do\n sequence_array << current_value\n current_value += integer2\n end\n sequence_array\nend", "def iter\n f1,f2,k = 1,1,2\n f1,f2,k = f2,f1+f2,k+1 while f2.to_s.size < 1000\n puts k\nend", "def loop_with_next\n numbers = []\n counter = 0\n\n while counter < 20\n counter += 1\n next if counter.even?\n numbers << counter\n end\n\n numbers\nend", "def aliquot_sequence(a,b)\n arr = [a]\n j = 0\n (b-1).times do\n sum = 0\n i = 1\n while i < arr[j]\n if arr[j] % i == 0\n sum += i\n end\n i += 1\n end\n j += 1\n arr << sum\n end\n print arr\nend", "def sequence(count, first)\n sequence = []\n number = first\n\n count.times do\n sequence << number\n number += first\n end\n sequence\nend", "def sequence(n1, n2)\n\n arr = []\n counter = 1\n \n while n1 >0\n loop do \n arr << n2 * counter\n counter +=1\n break if counter > n1\n end\n break\n end\narr\nend", "def climb_stairs_2(n)\n a = b = 1\n n.times { a, b = b, a + b }\n a\nend", "def sequence(count, num)\n arr = []\n count.times{ |i| arr << (i+1) * num }\n arr\nend", "def sequence(count,num)\narr = []\ntotal = 0\ncount.times {arr << total += num}\np arr\nend", "def sequence(count, num)\n multiples = []\n count.times { |i| multiples.push(num * (i + 1)) }\n multiples\n # (1..count).map { |idx| idx * num }\nend", "def sequence(count, first_num)\n result = []\n multiple = 1\n\n count.times do \n result << first_num * multiple\n multiple += 1\n end\n result\nend", "def series_up(n)\n new_list=[] # to push into a new list\n (n + 1).times do |index| #You need the nested loop index.times to run at least once. Since Index starts at 0, you need to add 1 so that it runs at least once\n index.times do |value| # this runs the loop each time until it reaches the number needed\n new_list.push(value + 1) #Same as the loop above. Since the value starts at 0, you need to start at 1 bc that's what the challenge wants you to do. the .push pushes it into the new list \n end \n end \n return new_list # this makes the function print the newly created list\nend", "def series_up(n)\n list = []\n (n+1).times do |a|\n a.times do |b|\n list.push(b+1)\n end \n end\n return list\nend", "def sequence(count, integer)\n new_arr = []\n times = 1\n count.times do \n new_arr << integer * times\n times += 1\n end\n p new_arr\nend", "def sequence(count, first_nb)\n result = []\n count.times { |loop| result << (first_nb * (loop + 1)) }\n result\nend", "def seriesup(n)\n list = [] \n (n+1).times do |b| # added the +1 because this code needs to run 1 more time than the input\n b.times do |a|\n list.push(a+1) #changed the variable from b to a because it doesn't need to use the first variable, you have to use the second one to make it repeat from 1. Also, I had a space between the list.push and the (), so the push didnt even work with this space.\n end\n end\n return list\nend", "def amicables(limit)\n numbers = Array.new(limit, 0)\n (1...limit).each do |i|\n ((i * 2)...limit).step(i) do |j|\n numbers[j] += i\n end\n end\n result = []\n numbers.each_with_index do |j, i|\n if j < limit && i == numbers[j] && i != j\n result << i\n end\n end\n result\nend", "def magicalWell(a, b, n)\n (1..n).sum {\n money = a*b \n a += 1\n b += 1\n money\n }\nend", "def two(a, b)\n for i in a..b\n puts i if a.even?\n a += 1\n end\nend", "def looping_by_multi_2( num )\n\n result = 1\n\n while( result < num )\n result *= 2\n puts( result )\n end\n\nend", "def n_times(n)\r\n#+++solution+++\r\n n.times do yield() end\r\n#---solution---\r\nend", "def multiplication(x, y)\n # number = y\n nums = []\n # x.times do\n # nums << number\n # number += y \n # end\n i = 1\n x.times do\n nums << y * i\n i += 1\n end\n return nums\nend", "def multiples_of(number, upTo)\n result = Array.new\n (0..upTo).step(number) do |n|\n result << n\n end\n puts result.inspect\n result\nend", "def team(p, num)\n z = []\n num.times {z << []}\n i = 0\n while i < p.count\n z[ i%num ] << p[i]\n i+=1\n end\n puts z.inspect\nend", "def cracklepop3\n (1..100).zip(Array.new 100, nil).map do |i,x|\n [i%3, i%5].map.with_index do |y, j| \n x = x.to_s + ['crackle','pop'][j] if y==0\n end\n x ? x : i\n end\nend", "def sequence2(count, num)\n (1..count).to_a.map { |c| c * num }\nend", "def every_other_number\n number = 0\n while number < 100\n if number % 2 != 0\n puts number\n end \n number += 1\n end\nend", "def sequence(count, first_num)\n multiples = []\n count.times {|index| multiples[index] = first_num * (index +1) }\n multiples\nend", "def sequence(count, num)\n result = 0\n Array.new(count).map {|_| result += num }\nend", "def fibo_print_all_upto(num)\n a = 1\n b = 1\n c = a+b\n ar = [a,b,c]\n num.times do\n a = b\n b = c\n c = a+b\n ar << c\n end\n print \"The first #{num} in the Fibonacci series are #{ar}\"\n print \"\\n\"\nend", "def step_one_to_n_to_one(n)\n e = Enumerator.new do |y|\n (1..n).step(2).each { |i| y << i}\n (n - 2).downto(1).each { |i| y << i if i.odd?}\n end\nend", "def times(n)\n i = 0\n while i < n\n yield(i)\n i += 1\n end\nend", "def pTimes2(statement,num)\n num.times do\n puts statement\n end\nend", "def compute(n)\n a = []\n a.push(1)\n a.push(1)\n n -=1\n first = 1\n second = 1\n n.times do\n third = first + second\n first = second\n second = third\n a.push(third)\n end\n #first\n a\nend", "def multply(number)\n result = 2\n\n for i in 1..number\n result *= rand(2..999)\n end\nend", "def run_block_with_next\n numbers = []\n\n (1..20).each do |number|\n next if number.odd?\n numbers << number\n end\n\n numbers\nend", "def solution\n (1..40).inject(:*) / (1..20).inject(:*)**2\nend", "def element_times_index(numbers)\n i = 0\n count = 0\n while i < numbers.length\n numbers[i] = numbers[i] * count\n count += 1\n i += 1\n end\n return numbers\nend", "def doubler(numbers)\n new_numbers = []\n # numbers.each { |num| new_numbers << num * 2 }\n numbers.each { |num| new_numbers.push(num * 2) }\n new_numbers\nend", "def times_table(rows)\n 1.upto(rows) do |y|\n puts\n 1.upto(rows) { |x| print \"#{x * y} \"}\n end\nend", "def pattern(n)\n # take an array from 1 to n and print each element\n # the amount of times of the value of that element\n # join the output elements with newline characters\n (1..n).map { |num| num.to_s * num }.join(\"\\n\")\nend", "def loop(limit, step)\n i = 0\n numbers = []\n\n while i < limit\n puts \"At the top i is #{i}\"\n numbers.push(i)\n\n i += step\n puts \"Numbers now: \", numbers\n puts \"At the bottom i is #{i}\"\n\n puts \"The numbers: \"\n numbers.each {|num| puts num }\n end\nend", "def doubler(arr)\n new = []\n arr.each do |i|\n new << i*2\n end\n return new\nend", "def multi(x,y)\n (1..y).each do |i|\n a = []\n a << i if i % x == 0\n puts a\n end \nend", "def p_times2(statement,num)\n num.times do\n puts statement\n end\nend", "def problem(nth = 6,i = 13)\n while nth < 10001\n i += 2\n nth += 1 if i.prime?\n end\n i\n end", "def array_times_two!(arr)\n\n i = 0\n while i < arr.length\n arr[i] = arr[i] * 2\n i += 1\n end\n\n arr\n\nend", "def rings\n my_list = [6, 5, 3, 1]\n 3.times do\n index = 0\n my_list.length.times do\n print my_list[index].to_s + \" \"\n index += 1\n end\n end\nend", "def lists_problems(num1, num2)\n\n i1 = num1.to_i\n i2 = num2.to_i\n\n if i1 < i2\n range = (i1..i2)\n else \n range = (i2..i1)\n end\n orig1 = i1\n orig2 = i2\n prob_array = []\n\n range.each do |i|\n i2 = orig2\n until i2 <= orig1 \n second_integer = (i2 -= 1) + 1\n prob_array << \"#{i} * #{second_integer}\"\n end\n i += 1\n end\n prob_array\nend", "def oddities(arr)\n every_other_value = []\n\n counter = 0\n while counter < arr.size\n every_other_value << arr[counter]\n counter += 2\n end\n every_other_value\nend", "def n_times\n yield\n yield\nend", "def element_times_index(numbers)\n \n i = 0 # i represents to the index current index always\n \n new_array = []\n \n while i < numbers.length # We cant do less than or equal to here\n \n new_array << numbers[i] * i # You can shovel directly into a new array\n i += 1\n end\n return new_array\nend", "def element_times_index(numbers)\n new_nums = []\n \n i = 0\n while i < numbers.length\n new_nums << numbers[i] * i\n \n i += 1\n end\n \n return new_nums\n end", "def series_up(n) # given n, return a list that goes [1,1,2,1,2,3... n]\n n_list = []\n (n+1).times do |m|\n m.times do |val|\n n_list.push(val+1)\n end\n end\n return n_list\nend", "def sequence(num1, num2)\n (1..num1).map { |i| i * num2 }\nend", "def fourth_puzzle\n rng = Random.new\n ret = []\n 10.times { ret.push(rng.rand(55..100)) }\n return ret\nend", "def looper(stop_point)\n numbers = []\n # i = 0\n (0 ... stop_point).each do |i|\n puts \"at the top of i is #{i}\"\n numbers << i\n\n # i+= incrementer\n\n puts \"numbers is now: \", numbers\n puts \" at the bottom i is now #{i}\"\n end\n\n puts \"The numbers in the array: #{numbers} \"\n\n numbers.each do |num|\n puts \"in and .each #{num}\"\n end\n\nend", "def element_times_index(numbers)\n\tfor i in 0..numbers.length-1\n numbers[i] *= i\n end\n return numbers\nend", "def calculate_products_of_all_other_elements(nums)\n product_of_other_elements = Array.new(nums.count, 1)\n\n nums.count.times do |i|\n nums.count.times do |j|\n next if i == j\n\n product_of_other_elements[i] = product_of_other_elements[i] * nums[j]\n end\n end\n\n product_of_other_elements\nend", "def sequence(int, int1)\n arr = []\n int.times {|i| arr << int1 + (int1 * i) }\n arr\nend", "def random\n (0...20).each do |i|\n randoms = Array.new\n randoms << rand(100)\n puts randoms\n end\nend", "def sequence(num1, num2)\n (1..num1).map { |value| value * num2 }\nend", "def buy_fruit(fruits)\n result = []\n fruits.each do |pair|\n pair.last.times { |i| result << pair.first}\n end\n result\nend", "def element_times_index(numbers)\n multiplied_numbers = []\n \n i = 0\n while i < numbers.length\n multiplied_numbers << numbers[i] * i\n \n i += 1\n end\n \n return multiplied_numbers\nend", "def sequence(count, first)\n (1..count).map { |value| value * first }\nend", "def series_up(num)\n series = 0\n list = [] #starts as empty\n #puts \"running code\"\n num.times do |pattern|\n n = 0#original num\n num.times do |num|\n list[n + series] = n + 1\n n += 1\n end \n series += pattern + 1 \n #makes it grow exponentially\n end\n return list \nend", "def duplin(list, n)\n list.map { |i| [i] * n }.flatten\nend", "def multiples(n, max)\n i = 1\n add = []\n loop do\n add << i * n\n i += 1\n add.last >= max && add.pop && break\n end\n p add\nend", "def sequence(num)\n result = []\n num.times{|i| result << i + 1}\n result\nend", "def my_times\n\t\tfor i in 1..self\n\t\t\tyield\n\t\tend\n\tend", "def iterativeMap(list)\n list.each do |i|\n list[i-1] = list[i-1] * 2\n end\n return list\nend", "def step_test\n 3.upto(6) do |x|\n puts \" \"\n x.upto(x + 2) do |i|\n print \"#{i}\\t\"\n end\n end\nend", "def number_spirals(size)\n # declare all starting variables\n start = 1\n sum = start\n step = 2\n while start < size**2\n 4.times { sum += start += step }\n step +=2\n end\n puts sum\nend", "def element_times_index(numbers)\n new_arry = []\n i = 0\n while i < numbers.length\n new_arry << numbers[i] * i\n i += 1\n end\n return new_arry\n\nend", "def fibonacci(total_iterations)\n first, last = [1, 1]\n\n 3.upto(total_iterations) do\n first, last = [last, first + last]\n end\n \n last\nend", "def generateLoop2\n for i in 1...10 do #do optional\n puts i\n end\n end", "def fib\n first, second, i = 1, 1, 2\n while second.to_s.size < 1000\n first, second = second, first + second\n i = i + 1\n end \n puts \"#{i}\"\nend", "def doubler(numbers)\n i = 0\n while i < numbers.length\n puts numbers[i] * 2\n i += 1\n end\nend", "def consecutives(size)\n Enumerator.new do |enum|\n ps = Prime.lazy\n a = Prime.take(size)\n size.times{ps.next}\n loop do \n enum << a.dup\n ( a << ps.next ).shift\n end\n end\nend", "def multiply_by x,y,n\n (1..n).map {|i| x * y**i}\nend", "def series_up(num)\n seq = 0\n list = []\n # list[(num * (num + 1) / 2) - 1] = num wasn't doing anything for me\n num.times do |pat| # I swtiched to num.times because I couldn't do list.each because list is blank\n t = 0\n num.times do |numb|\n list[t + seq] = t + 1 # How it knows where to put what number\n t += 1\n end\n seq += pat + 1 # grows exponentially to make it add a new space every time\n end\n return list\nend", "def aleatorios(n)\n list = []\n (1..n).each do\n num = (rand*100000+1).to_i\n list.push(num)\n end\n list\nend", "def sequence(quantity, number)\n sequence = []\n counter = 1\n quantity.times do \n sequence << number * counter\n counter += 1\n end\n sequence\nend", "def print_odds()\n\t(1..255).step(2) { |i| print i, \" \" }\nend", "def element_times_index(numbers)\n\tmulti = []\n \n\ti = 0\n\twhile i < numbers.length\n\t\titem = numbers[i]*i\n\t\tmulti << item\n\t\ti += 1\n end\n\n\treturn multi\nend", "def sequence(count, first)\n (1..count).map { |idx| idx * first }\nend", "def repeat(input)\n # while i < 6\n i = 0\n numbers = [ ]\n for i in (1 .. input)\n puts \"At the top i is #{i}\"\n numbers.push(i)\n\n puts \"Numbers now: \", numbers\n puts \"At the bottom i is #{i}\"\n end\n\n puts \"The number: \"\n numbers.each {|num| puts num }\nend", "def sequence(num)\r\n new_arr = []\r\n (1..num).step(1) { |n| new_arr << n }\r\n new_arr\r\nend", "def element_times_index(numbers)\n\tnumber_multiplied = []\n\ti = 0\n\n\twhile i < numbers.length\n\t\tnumber = numbers[i] * i\n\t\tnumber_multiplied << number\n\n\t\ti += \n\tend\n\n\treturn number_multiplied\t\nend\n\n\n# ---------- Their Solution ----------\n# Line 37 is better than what I did in line 20-21\n\n# def element_times_index(numbers)\n# new_nums = []\n\n# i = 0\n# while i < numbers.length\n# new_nums << numbers[i] * i\n\n# i += 1\n# end\n\n# return new_nums\n# end\n\n# ---------- Tests ----------\nprint element_times_index([4, 7, 6, 5]) # => [0, 7, 12, 15]\nputs\nprint element_times_index([1, 1, 1, 1, 1, 1]) # => [0, 1, 2, 3, 4, 5]", "def double_each\n numbers = [1,2,3,4,5]\n doubled = []\n numbers.each do |number|\n doubled << number * 2\n end\n doubled\nend", "def multiply_list(arr1, arr2)\r\nresult = []\r\ncounter = 0\r\n\r\narr1.length.times do |num|\r\n result << arr1[counter] * arr2[counter]\r\n counter += 1\r\nend\r\np result\r\nend", "def sequence2(n, m, c)\ni = 0\nwhile(i < n)\n# loop n times\nyield i*m + c\n# pass next element of the sequence to the block\ni += 1\nend\nend", "def doubler(numbers)\n # Write your code here\n array=[]\n numbers.each do |num|\n array << num *= 2\n end\n array\nend", "def ninety_nine_bottles_of_beer\n for i in 1..98\n puts \"#{100 - i} bottles of beer on the wall, #{100 - i} bottles of beer.\"\n puts \"Take one down and pass it around, #{99 - i} bottles of beer on the wall.\"\n puts \"\"\n end\n puts \"1 bottle of beer on the wall, 1 bottle of beer.\"\n puts \"Take one down and pass it around, no more bottles of beer on the wall.\"\n puts \"\"\n puts \"No more bottles of beer on the wall, no more bottles of beer.\"\n puts \"Go to the store and buy some more, 99 bottles of beer on the wall.\"\nend", "def bark_var(i)\n i.times do\n puts \"wow!\"\n end\n end", "def while_loop(no_of_loops, increase_by)\n i = 0\n numbers =[]\n while i < no_of_loops\n puts \"At the top i is #{i}\"\n numbers.push(i)\n\n i += increase_by\n puts \"Numbers now: \", numbers\n puts \"at the bottom i is #{i}\"\n end\nend", "def sequence(num)\n new_arr = []\n if num <= 0\n count = num\n else\n count = 1\n end\n \n num.abs.times do\n new_arr << count\n count += 1\n end\n \n p new_arr\nend", "def make_generator(start, factor)\n Enumerator.new do |y|\n start = start\n loop do\n result = (start * factor) % 2_147_483_647\n y << result\n start = result\n end\n end\nend" ]
[ "0.67374325", "0.6702775", "0.6588957", "0.6558962", "0.6543391", "0.6467349", "0.64239895", "0.6417174", "0.6416611", "0.6413696", "0.6406066", "0.64041847", "0.63754714", "0.6359367", "0.63562423", "0.6316399", "0.631339", "0.6302425", "0.6301963", "0.6291431", "0.6280266", "0.62708473", "0.626995", "0.62679136", "0.6257783", "0.6242731", "0.62073576", "0.6194269", "0.61926734", "0.6186053", "0.61756396", "0.61663634", "0.6163475", "0.616233", "0.6154602", "0.6152495", "0.6148578", "0.61455375", "0.6142757", "0.614068", "0.6135551", "0.6133393", "0.61283046", "0.61080676", "0.610729", "0.6098221", "0.6095944", "0.609563", "0.60887545", "0.6086849", "0.60838956", "0.60834193", "0.6075704", "0.6064609", "0.605951", "0.6059178", "0.60550374", "0.6044279", "0.6034873", "0.60308564", "0.60205215", "0.60175115", "0.6011887", "0.6009803", "0.6001161", "0.59981006", "0.5989812", "0.5979153", "0.5978544", "0.59753233", "0.59672326", "0.596455", "0.59624577", "0.5961492", "0.5961209", "0.5960296", "0.5959334", "0.5958642", "0.5954813", "0.59522396", "0.59509766", "0.5942345", "0.59418637", "0.59392446", "0.59350365", "0.59313273", "0.5930688", "0.5930203", "0.59299105", "0.59282285", "0.59245014", "0.59243137", "0.59234756", "0.5920129", "0.5919085", "0.5918564", "0.5913885", "0.5909745", "0.5907233", "0.5904431" ]
0.8751656
0
Process HAML file. Deals with layout.
def process_haml(domain_path, base_path, static_path) layout = nil # Layout layout_path = domain_path << "/__layout__" if File.exists? settings.dir.dup << "/pages/" << layout_path << ".haml" layout = layout_path.to_sym end # Page code = haml base_path[0..-6].to_sym, :layout => layout File.open(static_path, "w") do |io| io.write(code) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process(haml, base_path, &block)\n helper = Helper.new(base_path, self)\n\n Haml::Engine.new(haml).render(helper, {}, &block)\n end", "def load_haml(modelname, filename)\n @modelname = modelname\n @filename = filename\n $filename = filename\n $is_private = false\n $is_protected = false\n $form_target = nil # TODO\n\n $log.debug \"load haml: #{modelname} #{filename}\"\n # Model name, action\n if filename =~ /views\\/(\\w+)\\/(\\w+).haml/\n # app/views/HOGE/FOO.haml\n @model = Regexp.last_match[1].singularize\n @action = Regexp.last_match[2]\n @format = 'html' # TODO\n $log.debug \"load() HAML #{@model} #{@action} #{@format}\"\n elsif filename =~ /views\\/(\\w+)\\/(\\w+)\\/(\\w+).haml/\n # app/views/HOGE/HOGE/FOO.haml\n @model = Regexp.last_match[1].singularize + ':' + Regexp.last_match[2].singularize\n @action = Regexp.last_match[3]\n @format = 'html' # TODO\n $log.debug \"load() HAML #{@model} #{@action} #{@format}\"\n elsif filename =~ /views\\/(\\w+)\\/(\\w+).(\\w+).haml/\n # app/views/HOGE/XXX.html.haml\n @model = Regexp.last_match[1].singularize\n @action = Regexp.last_match[2]\n @format = Regexp.last_match[3]\n $log.debug \"load() HAML #{@model} #{@action} #{@format} #{filename}\"\n elsif filename =~ /views\\/(\\w+)\\/(\\w+)\\/(\\w+).(\\w+).haml/\n # app/views/HOGE/HOGE/FOO.html.haml\n @model = Regexp.last_match[1] + ':' + Regexp.last_match[2].singularize\n @action = Regexp.last_match[3]\n @format = Regexp.last_match[4]\n $log.debug \"load() HAML #{@model} #{@action} #{@format}\"\n else\n $log.info \"load() HAML unknown action filename=#{filename}\"\n end\n\n if @format != 'html'\n @id = @model + '_' + @action + '_' + @format\n n = @model + \"#\" + @action + \"#\" + @format\n else\n @id = @model + '_' + @action\n n = @model + \"#\" + @action\n end\n\n # new View state\n add_state('view', n, @filename)\n $block_var = []\n\n # HAML -> Ruby -> AST\n haml_code = File.read(@filename)\n ruby_code = conv_haml2ruby(haml_code)\n\n s = Ripper.sexp(ruby_code)\n if s.nil?\n $log.error \"HAML no code #{@filename}\"\n fail \"TODO:\"\n else\n parse_sexp(0, s)\n end\n end", "def haml(path, extras={})\n filename = \"#{Milk::TEMPLATE_DIR}/#{path}.haml\"\n if block_given?\n ::Haml::Engine.new(File.read(filename), :filename => filename).render(self, extras) do\n yield\n end\n else\n ::Haml::Engine.new(File.read(filename), :filename => filename).render(self, extras)\n end\n end", "def haml\n # needed to use haml with erb\n unless is_haml?\n init_haml_helpers\n end\n\n capture_haml do\n yield\n end\n end", "def html\n haml_opts = '-f xhtml'\n # process partials\n puts 'Compiling Partials...'\n inc_files = Dir['./haml/_partials/*.haml']\n inc_files.each do |name|\n file_input = name\n file_output = name.sub('.haml','.inc')\n haml_call = 'haml '+haml_opts+' '+file_input+' '+file_output\n `#{haml_call}`\n puts ' :: Converting '+name+' => '+file_output\n end\n puts 'Partials compile complete...'\n # process pages\n puts 'Compiling HTML files...'\n haml_files = Dir['./haml/*.haml']\n haml_files.each do |name|\n file_input = name\n file_output = name.sub('.haml','.html').sub('./haml/','../www/')\n haml_call = 'haml '+haml_opts+' '+file_input+' '+file_output\n `#{haml_call}`\n puts ' :: Converting '+name+' => '+file_output\n end\n puts 'HTML compile complete...'\n # regex/cleanup script\n puts 'Calling HAML cleanup script...'\n `./_scripts/hamlcleanup.pl haml/_partials/*.inc`\n `./_scripts/hamlcleanup.pl ../www/*.html`\n # move files as needed\nend", "def get_haml file\n f = ::File.join( Root, '/web/views/'+file+'.haml')\n file = File.open(f, \"rb\")\n haml = file.read\n file.close\n haml\n end", "def process_line(text, index)\n @index = index + 1\n\n case text[0]\n when DIV_CLASS; render_div(text)\n when DIV_ID\n return push_plain(text) if text[1] == ?{\n render_div(text)\n when ELEMENT; render_tag(text)\n when COMMENT; render_comment(text[1..-1].strip)\n when SANITIZE\n return push_plain(text[3..-1].strip, :escape_html => true) if text[1..2] == \"==\"\n return push_script(text[2..-1].strip, :escape_html => true) if text[1] == SCRIPT\n return push_flat_script(text[2..-1].strip, :escape_html => true) if text[1] == FLAT_SCRIPT\n return push_plain(text[1..-1].strip, :escape_html => true) if text[1] == ?\\s\n push_plain text\n when SCRIPT\n return push_plain(text[2..-1].strip) if text[1] == SCRIPT\n push_script(text[1..-1])\n when FLAT_SCRIPT; push_flat_script(text[1..-1])\n when SILENT_SCRIPT\n return start_haml_comment if text[1] == SILENT_COMMENT\n\n raise SyntaxError.new(<<END.rstrip, index) if text[1..-1].strip == \"end\"\nYou don't need to use \"- end\" in Haml. Use indentation instead:\n- if foo?\n %strong Foo!\n- else\n Not foo.\nEND\n\n push_silent(text[1..-1], true)\n newline_now\n\n # Handle stuff like - end.join(\"|\")\n @to_close_stack.last << false if text =~ /^-\\s*end\\b/ && !block_opened?\n\n case_stmt = text =~ /^-\\s*case\\b/\n keyword = mid_block_keyword?(text)\n block = block_opened? && !keyword\n\n # It's important to preserve tabulation modification for keywords\n # that involve choosing between posible blocks of code.\n if %w[else elsif when].include?(keyword)\n # @to_close_stack may not have a :script on top\n # when the preceding \"- if\" has nothing nested\n if @to_close_stack.last && @to_close_stack.last.first == :script\n @dont_indent_next_line, @dont_tab_up_next_text = @to_close_stack.last[1..2]\n else\n push_and_tabulate([:script, @dont_indent_next_line, @dont_tab_up_next_text])\n end\n\n # when is unusual in that either it will be indented twice,\n # or the case won't have created its own indentation\n if keyword == \"when\"\n push_and_tabulate([:script, @dont_indent_next_line, @dont_tab_up_next_text, false])\n end\n elsif block || case_stmt\n push_and_tabulate([:script, @dont_indent_next_line, @dont_tab_up_next_text])\n elsif block && case_stmt\n push_and_tabulate([:script, @dont_indent_next_line, @dont_tab_up_next_text])\n end\n when FILTER; start_filtered(text[1..-1].downcase)\n when DOCTYPE\n return render_doctype(text) if text[0...3] == '!!!'\n return push_plain(text[3..-1].strip, :escape_html => false) if text[1..2] == \"==\"\n return push_script(text[2..-1].strip, :escape_html => false) if text[1] == SCRIPT\n return push_flat_script(text[2..-1].strip, :escape_html => false) if text[1] == FLAT_SCRIPT\n return push_plain(text[1..-1].strip, :escape_html => false) if text[1] == ?\\s\n push_plain text\n when ESCAPE; push_plain text[1..-1]\n else push_plain text\n end\n end", "def render(template)\n template = File.read(\"./views/#{template}\")\n engine = Haml::Engine.new(template)\n @response = engine.render\nend", "def _render_one(entry)\n @entry = entry\n @filename = @entry.filename\n\n # avoid double render of layout path\n return if @entry.source_path == @layout_path\n\n # render. Result goes into @content_for_resources\n input = File.read(@entry.source_path)\n \n # render using either erb or haml\n case File.extname(@entry.source_path)\n when /\\.rhtml$/, /\\.html.erb$/\n @content_for_resources += eval(Erubis::Eruby.new.convert(input))\n when /\\.haml$/, /\\.html.haml$/\n require 'haml'\n @content_for_resources += Haml::Engine.new(input).to_html(self)\n end\n\n @filename =nil\n @entry = nil\n end", "def view\n return @view unless @view.nil?\n file = File.join VIEWS, self.template\n @view = Haml::Engine.new File.read(file), HAML_CONFIG\n end", "def render(template_path)\n template = File.read(\"./#{template_path.sub(/^\\//, '')}\")\n engine = Haml::Engine.new(template)\n @response = engine.render(self, assigns_for_template)\nend", "def render(template_path)\n template = File.read(\"./#{template_path.sub(/^\\//, '')}\")\n engine = Haml::Engine.new(template)\n @response = engine.render(self, assigns_for_template)\nend", "def visit(page)\n found = @segments[page.post_title]\n return unless found\n #page.post_content = found\n file = ::Sphonglepress::STATIC_DIR.join(\"from_document\", full_path_for_page(page) << \".html.haml\")\n FileUtils.mkdir_p(file.dirname) unless Dir.exist? file.dirname\n File.open(file, 'w') do |f|\n f.write Haml::HTML.new(found, :xhtml => true).render\n end\n \n end", "def parse_markup\n @html = PARSER.parse(@markup, :base_heading_level => 1)\n end", "def handle\n @response.layout = contained_view(\"info/layout.html.erb\")\n @response.content = contained_view(\"info/index.html.erb\")\n end", "def partial (filename,locals={})\n source = File.read(find(filename))\n engine = Haml::Engine.new(source)\n engine.render(binding,locals)\nend", "def parse(template, output, b = binding())\n # Generate the requested page\n template = File.read(template)\n erb = Erubis::Eruby.new(template)\n @content = erb.result(b)\n \n # Generate the layout\n layout = File.read(\"templates/layout.html.erb\")\n erb_layout = Erubis::Eruby.new(layout)\n \n FileUtils.mkdir_p(File.dirname(output))\n File.open(output, \"w+\") do |f|\n f.puts erb_layout.result(b)\n end\n end", "def is_haml?\n self[:content_type] == 'haml'\n end", "def render(template_path)\n template = File.read(\"#{app.views}/#{template_path.sub(/^\\//, '')}\")\n engine = Haml::Engine.new(template)\n @response = engine.render(self, assigns_for_template)\nend", "def markup_file_contents(contents); end", "def haml_buffer\n @haml_buffer\n end", "def default_render_proc\n lambda do |template, options|\n HamlWrapper.view( template, options )\n end\n end", "def render\n @template.to_haml(0, @options)\n end", "def process_content(path)\n case path.extname\n when '.htm', '.md'\n read_split_content(path.to_s, symbolize_keys: true)\n # when '.md'\n # body, data = read_split_content(path.to_s, symbolize_keys: true)\n # [Kramdown::Document.new(body).to_html, data]\n when '.yml'\n [nil, YAML.load(File.read(path.to_s), symbolize_names: true)]\n end\n end", "def build\n\n @layout_path = bundle.layout_path\n\n # Render each filename. By default, the output goes to the resources\n # string\n @content_for_resources = ''\n entries.each { |fn| _render_one(fn) }\n\n # Finally, render the layout. This should produce the final output to\n # return\n input = File.read(@layout_path)\n \n # render using either erb or haml\n case File.extname(@layout_path)\n when /\\.rhtml$/, /\\.html.erb$/\n return eval(Erubis::Eruby.new.convert(input))\n when /\\.haml$/, /\\.html.haml$/\n require 'haml'\n return Haml::Engine.new(input).to_html(self)\n end\n end", "def visit_tag(node)\n indent = @original_haml_lines[node.line - 1].index(/\\S/)\n\n # We don't want to use a block because assignments in a block are local to that block,\n # so the semantics of the extracted ruby would be different from the one generated by\n # Haml. Those differences can make some cops, such as UselessAssignment, have false\n # positives\n code = 'begin'\n @ruby_chunks << AdHocChunk.new(node,\n [' ' * indent + code])\n indent += 2\n\n tag_chunk = PlaceholderMarkerChunk.new(node, 'tag', indent: indent)\n @ruby_chunks << tag_chunk\n\n current_line_index = visit_tag_attributes(node, indent: indent)\n visit_tag_script(node, line_index: current_line_index, indent: indent)\n\n yield\n\n indent -= 2\n\n if @ruby_chunks.last.equal?(tag_chunk)\n # So there is nothing going \"in\" the tag, remove the wrapping \"begin\" and replace the PlaceholderMarkerChunk\n # by one less indented\n @ruby_chunks.pop\n @ruby_chunks.pop\n @ruby_chunks << PlaceholderMarkerChunk.new(node, 'tag', indent: indent)\n else\n @ruby_chunks << AdHocChunk.new(node,\n [' ' * indent + 'ensure', ' ' * indent + ' HL.noop', ' ' * indent + 'end'],\n haml_line_index: @ruby_chunks.last.haml_end_line_index)\n end\n end", "def smart_haml(view, opts={})\n view = configatron.template_folder_path.gsub(/\\%s/, view.to_s).to_sym\n opts = opts.merge(:layout => configatron.template_folder_path.gsub(/\\%s/, 'layout').to_sym)\n haml(view, opts)\n end", "def parse_page_file\n raise \"File not found: #{@pointer['realpath']}\" unless File.exist?(@pointer['realpath'])\n\n page = File.open(@pointer['realpath'], 'r:UTF-8') {|f| f.read }\n\n begin\n front_matter = page.match(FMregex)\n rescue => e\n raise \"Error trying to read meta-data from #{@pointer['realpath']}.\" +\n \" Check your folder configuration. Error details: #{e}\"\n end\n \n data = front_matter ?\n (YAML.load(front_matter[0].gsub(/---\\n/, \"\")) || {}) :\n {}\n\n result = {\n \"data\" => data,\n \"content\" => page.gsub(FMregex, '')\n }\n\n # variable cache\n @data = data\n @content = result['content']\n\n result\n rescue Psych::SyntaxError => e\n Ruhoh.log.error(\"Psych::SyntaxError while parsing top YAML Metadata in #{ @pointer['realpath'] }\\n\" +\n \"#{ e.message }\\n\" +\n \"Try validating the YAML metadata using http://yamllint.com\"\n )\n nil\n end", "def process\n return @template if @template\n\n out = StringIO.new\n err = StringIO.new\n\n files = Dir.glob(File.join(@path, '*.{yml,yaml}'))\n cfoo = Cfoo::Factory.new(out, err).cfoo\n\n Dir.chdir('/') do\n cfoo.process(*files)\n end\n\n raise(TemplateYamlParseError, err.string) unless err.string.empty?\n\n @template = out.string\n @template\n end", "def refresh\n Dir.glob('haml/**/*.haml').each do |file|\n if file !~ /\\/_/\n file.gsub!(/^haml\\//, '')\n compile(file) unless File.exist?(output_file(file))\n end\n end\n end", "def process_input_file \n File.open(@file, 'r') do |f|\n f.each_line do |line|\n parse_line(line)\n end\n end\n end", "def render\n layout = File.read \"#{site.root}/_layouts/#{@layout}.html\"\n @output = Liquid::Template.parse(layout).render('post'=>self) \n end", "def render(html, options={})\n require \"haml\" unless defined? Haml\n Haml::Engine.new(html, options).render\nend", "def parse_horizontal_rule\n start_line_number = @src.current_line_number\n @src.pos += @src.matched_size\n @tree.children << new_block_el(:hr, nil, nil, location: start_line_number)\n true\n end", "def root_headline\n self.parse_blocks\n end", "def set_rails_haml\n @rails_haml = RailsHaml.find(params[:id])\n end", "def parse!\n md = File.read(filename)\n doc = Kramdown::Document.new(md, input: 'GFM')\n\n # extract toc\n toc_start, toc_end = Danger::Toc::Extractor.convert(doc.root).first\n @has_toc = toc_start && toc_end\n @toc = md.split(\"\\n\")[toc_start, toc_end - toc_start - 1].reject(&:empty?) if @has_toc\n\n # construct toc\n @headers = Danger::Toc::Constructors.current.convert(doc.root).first\n end", "def do_view(packet, mode, *args)\n haml_opts = view_opts(packet, mode, *args)\n orange[:parser].haml(\"#{mode.to_s}.haml\", packet, haml_opts)\n end", "def _parse()\n\t\t@contents = SifterElement.new(self, '', '', @embed_flag, @nobreak_flag) if(!@contents)\n\n\t\tif(!(@fp = File.open(@template_file, 'r')))\n\t\t\tprint(\"#{SIFTER_PACKAGE}: Cannot open file '#{@template_file}'.\\n\")\n\t\t\treturn false\n\t\tend\n\n\t\tline_break = $/\n\t\t$/ = SIFTER_LINE_BREAK if(defined?(SIFTER_LINE_BREAK))\n\n\t\tif(!@contents._parse())\n\t\t\t$/ = line_break\n\t\t\[email protected]\n\n\t\t\tif(!@parent)\n\t\t\t\tprint(\"#{SIFTER_PACKAGE}: Error(s) occurred while parsing file '#{@template_file}'.\\n\")\n\t\t\t\tprint(\"#{SIFTER_PACKAGE}: \" + self.reading_line.to_s + \" lines have been read.\\n\")\n\t\t\tend\n\t\t\treturn false\n\t\tend\n\n\t\t$/ = line_break\n\t\[email protected]\n\t\treturn true\n\tend", "def touch_file(file)\n extension = File.extname(file).sub(/\\./, \"\")\n return unless ::Tilt.mappings.has_key?(extension)\n \n file = File.expand_path(file, @app.root)\n content = File.read(file)\n \n result = parse_front_matter(content)\n \n if result\n data, content = result\n\n data = ::Middleman::Util.recursively_enhance(data).freeze\n @local_data[file] = [data, content]\n @app.cache.set([:raw_template, file], result[1])\n @app.frontmatter_did_change(file)\n end\n end", "def process\n self.read_layouts\n self.transform_pages\n self.write_posts\n end", "def haml_app(view, options = {}) \n options = {:layout => '= yield ', :url => '/tests' }.merge(options)\n get options[:url], :view => view, :layout => options[:layout], :engine => :haml \n end", "def run\n parse_options\n Calamum::Config.apply(config)\n @definition = Calamum::DocParser.new(load_source)\n @definition.load_resources\n Calamum::DocGenerator.init_base_dir\n process_index\n\n if config[:template] == 'twitter'\n process_pages\n process_section(\"overview\", @definition.get_description)\n process_section(\"authentication\", @definition.get_authentication)\n process_errors\n end\n rescue => ex\n puts_error ex.message\n end", "def content!\n if File.exist?(file)\n markdown_to_html\n else\n @type = :empty\n \"\"\n end\n end", "def process(content, uri, args = \"\")\n html_doc = Nokogiri::HTML(content) do |config| config.noerror end\n\n node = html_doc.xpath(\"//div[@class='markdown-body']\").first\n\n stamp(node, uri, 'github-wiki')\n\n if args.include?(\"reduce-headings\") then\n 5.downto(1) { |level|\n node.xpath(\"//h#{level}\").each { |heading_node|\n heading_node.name = \"h#{level+1}\"\n }\n }\n end\n\n node.to_s\n end", "def postload\n if @current_layout && @current_layout.length > 0\n @content_for_layout = @body\n @body = \"\"\n render_rhtml(@current_layout)\n end\n end", "def render\n source = IO.read \"#{Pv.root}/lib/templates/story.txt.erb\"\n template = ERB.new(source)\n template.result(binding)\n end", "def layout; end", "def parse_horizontal_rule; end", "def original_path\n \"content/feed.rss.haml\"\n end", "def call(options = {})\n options = {\n layout: :application,\n page: :index\n }.update(options)\n\n options.tap do |opts|\n opts[:item] = \"app/views/layouts/#{opts[:layout]}.slim\"\n opts[:key] = opts[:page]\n opts[:content] = opts[opts[:key]]\n Services::Site::ProcessTemplate.call opts\n end\n end", "def perform\n page_ref.ensure_attributes :content\n # The recipe_page will assert path markers and clear our content\n # if changes during page parsing were significant\n if content_needed?\n if page_ref.recipe_page_ready? # Ready to build\n # reload if persisted? # Possibly the recipe_page changed us\n recipe_page.ensure_attributes :content # Parse the page into one or more recipes\n end\n content_to_parse =\n (recipe_page&.selected_content(anchor_path, focus_path) if anchor_path.present? && focus_path.present?) ||\n page_ref.trimmed_content\n return unless content_to_parse.present?\n ps = ParserServices.parse entity: self, content: content_to_parse\n new_content = ps.annotate\n nc1 = ParsingServices.new(self).parse_and_annotate content_to_parse\n return unless new_content.present? # Parsing was a success\n accept_attribute :content, new_content, true # Force the new content\n end\n # super if defined?(super)\n end", "def process_line(line, index, block_opened)\n @index = index + 1\n @block_opened = block_opened\n\n case line[0]\n when DIV_CLASS, DIV_ID\n render_div(line)\n when ELEMENT\n render_tag(line)\n when COMMENT\n render_comment(line)\n when SCRIPT\n sub_line = line[1..-1]\n if sub_line[0] == SCRIPT\n push_script(sub_line[1..-1].strip.dump.gsub('\\\\#', '#'), false)\n else\n push_script(sub_line, false)\n end\n when FLAT_SCRIPT\n warn(FLAT_WARNING) unless defined?(Test::Unit)\n push_flat_script(line[1..-1])\n when SILENT_SCRIPT\n sub_line = line[1..-1]\n unless sub_line[0] == SILENT_COMMENT\n mbk = mid_block_keyword?(line)\n push_silent(sub_line, !mbk)\n if (@block_opened && !mbk) || line[1..-1].split(' ', 2)[0] == \"case\"\n push_and_tabulate([:script])\n end\n end\n when FILTER\n name = line[1..-1].downcase\n start_filtered(options[:filters][name] || name)\n when DOCTYPE\n if line[0...3] == '!!!'\n render_doctype(line)\n else\n push_plain line\n end\n when ESCAPE\n push_plain line[1..-1]\n else\n push_plain line\n end\n end", "def parse\n parse_file\n self\n end", "def render( filename, options = {} )\n # To allow different renderers in the future,\n # file extensions shouldn't be passed\n\n filename += \".html.haml\"\n\n template = open( File.join( self.template_root , filename ) ).read\n engine = Haml::Engine.new( template, self.haml_options )\n\n scope = options.dup.delete( :scope ) || Object.new\n return engine.render( scope, options )\n end", "def initialize(file_path)\n\n @title, @abstract = \"\", \"\"\n @metadata = {}\n\n if file_path\n\n @file_path = File.expand_path(file_path)\n\n # Read the YAML front matter.\n convertible = OpenStruct.new.extend(Jekyll::Convertible)\n @metadata = convertible.read_yaml(File.dirname(@file_path), File.basename(@file_path))\n\n # Scrub the YAML out of the markdown.\n markdown = File.read(@file_path).sub(/---(.|\\n)*---/, '')\n\n # Parse the cleaned markdown.\n renderer = Redcarpet::Markdown.new(Redcarpet::Render::HTML)\n document = Nokogiri::HTML::fragment(renderer.render(markdown))\n\n # Set the title.\n header = document.at_css('h1')\n @title = header.text\n header.remove\n\n # Set the abstract.\n @abstract = document.to_s.strip\n\n end\n\n end", "def parse_block_html; end", "def init_haml_helpers\n @haml_buffer = Haml::Buffer.new(@haml_buffer, Haml::Engine.new('').send(:options_for_buffer))\n nil\n end", "def with_raw_haml_concat\n yield\n end", "def process\n self.read_layouts\n self.read_posts\n self.write_posts\n self.transform_pages\n end", "def parse_file\n #needs begin rescue exception handling \n \tbegin \n \t\traise FileNotFoundException.new(\"File not Found\") unless File.exists?(@file_path)\n\t\n \t\tFile.open(@file_path).slice_before(@delimiter).each do |chunk|\n \t\t\tchunk.reject! {|item| item =~ @delimiter }\n \t\ttitle = chunk.shift\n \t\tif @title_hash.has_key?(title)\n \t\t\t@title_hash[title] = @title_hash[title] << chunk \n \t\telse\n \t\t p chunk\n \t\t\t@title_hash[title] = chunk\n \t\tend \t\t\n \t\tend\n \t\t\n \trescue FileNotFoundException => e\n \t\tp e.message\n \tend\n\t\n end", "def content_type\n self[:content_type] == 'haml' ? 'text/html' : self[:content_type]\n end", "def render_for_file_with_dryml(template_path, status = nil, layout = nil, locals = {})\n render_for_file_without_dryml(template_path, status, layout, locals)\n rescue ActionView::MissingTemplate => ex\n # Try to use a DRYML <page> tag instead\n tag_name = @dryml_fallback_tag || \"#{File.basename(template_path).dasherize}-page\"\n\n text = call_dryml_tag(tag_name)\n if text\n render_for_text text, status \n else\n raise ex\n end\n end", "def create\n @rails_haml = RailsHaml.new(rails_haml_params)\n\n respond_to do |format|\n if @rails_haml.save\n format.html { redirect_to @rails_haml, notice: 'Rails haml was successfully created.' }\n format.json { render action: 'show', status: :created, location: @rails_haml }\n else\n format.html { render action: 'new' }\n format.json { render json: @rails_haml.errors, status: :unprocessable_entity }\n end\n end\n end", "def render(options)\n if options[:haml]\n template_content = File.read(options[:haml])\n @page_contents << Haml::Engine.new(template_content).render(self) \n elsif options[:partial]\n template_content = File.read(options[:haml])\n return Haml::Engine.new(template_content).render(self) \n elsif options[:text]\n @page_contents << options[:text]\n else\n raise \"No render type found. Must be haml, partial or text\"\n end\n end", "def parse\n self.new_part\n self.file_contents.each_line do |line|\n\n # parse the current line\n result = self.parser.parse(line, @@parse_signatures)\n\n # if there is no documentation for the result,\n # create a new part and then set the current part to nil.\n if result.nil?\n self.new_part\n self.current_part = nil\n next\n else\n\n # if new doc block is found with the current part == nil,\n # create a new part\n self.new_part if self.current_part.nil?\n end\n \n # log the result if the logger is enabled\n Logger.new(STDOUT).info(result) if @@log_lines\n\n # figure out what to do based on the result type\n case result[:tag]\n when :title\n self.title = result[:title]\n when :route\n self.current_part.set_route(result[:route])\n when :method\n self.current_part.set_method(result[:method])\n when :signature\n self.current_part.set_signature(result[:text])\n when :response\n\n # open the current response tag using the code as a key\n if result[:open]\n @@open_response = result[:code]\n @@open_response_id = result[:id]\n else\n @@open_response = nil\n end\n when :header\n\n # open the current header tag using the code as a key\n if result[:open]\n @@open_header = result[:name]\n else\n @@open_header = nil\n end\n when :param\n\n # open the current param tag using the name as the key\n if result[:open]\n @@open_param = result[:name]\n @@open_param_type = result[:type]\n @@open_param_default = result[:default]\n else\n @@open_param = nil\n end\n when :doc\n\n # figure out if the doc needs to be added to an\n # open response or param tag\n if !@@open_response.nil?\n self.current_part.append_response(@@open_response.to_i, @@open_response_id, result[:text])\n elsif !@@open_param.nil?\n self.current_part.append_param(@@open_param, result[:text], @@open_param_type, @@open_param_default)\n elsif !@@open_header.nil?\n self.current_part.append_header(@@open_header, result[:text])\n else\n self.current_part.append_doc(result[:text])\n end\n end\n\n self.lines += 1\n end\n\n # add the part and create a new one\n self.new_part\n\n # remove any empty parts or parts without method signatures (for ruby docs)\n if self.type == :RUBY\n self.parts = self.parts.select{ |part| !part.route.nil? || !part.signature.nil? }\n end\n end", "def initialize(template, options = {})\n @options = {\n :suppress_eval => false,\n :attr_wrapper => \"'\",\n :locals => {},\n :autoclose => ['meta', 'img', 'link', 'script', 'br', 'hr'],\n :filters => {\n 'sass' => Sass::Engine,\n 'plain' => Haml::Filters::Plain,\n 'preserve' => Haml::Filters::Preserve }\n }\n\n if !NOT_LOADED.include? 'redcloth'\n @options[:filters].merge!({\n 'redcloth' => RedCloth,\n 'textile' => Haml::Filters::Textile,\n 'markdown' => Haml::Filters::Markdown\n })\n end\n if !NOT_LOADED.include? 'bluecloth'\n @options[:filters]['markdown'] = Haml::Filters::Markdown\n end\n\n @options.rec_merge! options\n\n unless @options[:suppress_eval]\n @options[:filters].merge!({\n 'erb' => ERB,\n 'ruby' => Haml::Filters::Ruby\n })\n end\n @options[:filters].rec_merge! options[:filters] if options[:filters]\n\n @precompiled = @options[:precompiled]\n\n @template = template.strip #String\n @to_close_stack = []\n @output_tabs = 0\n @template_tabs = 0\n @index = 0\n\n # This is the base tabulation of the currently active\n # flattened block. -1 signifies that there is no such block.\n @flat_spaces = -1\n\n begin\n # Only do the first round of pre-compiling if we really need to.\n # They might be passing in the precompiled string.\n do_precompile if @precompiled.nil? && (@precompiled = String.new)\n rescue Haml::Error => e\n e.add_backtrace_entry(@index, @options[:filename])\n raise e\n end\n end", "def html!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 1 )\n\n type = HTML\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 319:7: 'html'\n match( \"html\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 1 )\n\n end", "def index\n @rails_hamls = RailsHaml.all\n end", "def process\n self.read_layouts\n self.read_posts\n self.write_posts\n self.write_archives\n self.transform_pages\n end", "def parse_template(path)\n render(File.read(path))\n end", "def process_default_render exp\n process_layout\n process_template template_name, nil\n end", "def render_layout(output, layout, info); end", "def _render_layout_for( res )\n return unless res.layout\n lyt = Resources.layouts.find :filename => res.layout\n return if lyt.nil?\n\n _track_rendering(lyt.path) {\n @content = Filters.process(\n self, lyt, ::Webby::Resources::File.read(lyt.path))\n _render_layout_for(lyt)\n }\n end", "def defineLayoutMenu\n #puts \"Removing Old Menu and Home Layout\"\n rm_rf File.join(\"#{g('wiki_source')}\",URL_LAYOUT_DEFAULT)\n #puts \"Generating New Menu\"\n open(File.join(\"#{g('wiki_source')}\",URL_LAYOUT_DEFAULT), 'w') do |newLayout|\n newLayout.puts '\n <!doctype html><html lang=\"en\"><head><meta charset=\"utf-8\"><title>{{ page.title }}</title></head>\n <body>\n {% include style.html %}\n {% include menu.html %}\n '\n oldUnder=-1\n File.foreach(File.join(\"#{g('wiki_source')}\",URL_MENU_FILE)) do |line|\n currentUnder = count_em(line,\"-\")\n #Fils du courant\n if(currentUnder>oldUnder)\n if(oldUnder==-1)\n newLayout.puts '\n <div class=\"w3-row-padding w3-padding-64 w3-container\">\n <div>\n <div class=\"w3-quarter\" style=\"width:260px\">\n\t\t<nav class=\"w3-bar-block w3-collapse w3-large w3-theme-l5 w3-animate-left w3-small w3-round w3-blue\" style=\"z-index:3;margin-left:10px\" id=\"mySidebar\">\n <div class=\"w3-medium w3-text-white w3-margin-left\" style=\"font-weight:bold\"><div>'\n else\n newLayout.puts \" <div id='sub' class=' w3-padding-small w3-bar-block w3-small'>\"\n end\n oldUnder=currentUnder\n else\n #Père du courant\n if(currentUnder<oldUnder)\n loop do \n newLayout.puts \" </div>\"\n oldUnder = oldUnder -1\n break if oldUnder==currentUnder\n end\n end\n end\n fileWithName = File.join(\"#{g('wiki_dest')}\",\"/\"+line.gsub(\"-\",\"\")).gsub(\"\\n\",\"\")\n title=line\n if(File.exists?(fileWithName+\".md\"))\n File.foreach(fileWithName+\".md\") do |row|\n if(row.include? \"title:\")\n title = row\n break\n end\n end \n newLayout.puts \"<a href='/\"+fileWithName+\"'>\"+title.gsub(\"title: \",\"\")+\"</a><br/>\"\n else\n newLayout.puts \"\"+title.gsub(\"-\",\"\")+\"\"\n end\n end\n newLayout.puts '</div></div></nav></div>\n <div class=\"w3-threequarter\">\n {{ content }}\n </div>\n </div>\n </div>\n </body></html>'\n end\n \n \nend", "def capture_haml_proc\n proc { |*args| capture_haml { yield *args } }\n end", "def perform\n accept(parse_file)\n end", "def parse\n # arrays containing class names for certain formatting\n @bold_classes = []\n @italic_classes = []\n @right_aligned_classes = []\n @centered_classes = []\n\n css_parser.each_rule_set do |rule_set|\n # does this ruleset make text bold?\n if rule_set_is_bold?(rule_set)\n add_classes(rule_set, bold_classes)\n end\n # does this ruleset make text italic?\n if rule_set_is_italic?(rule_set)\n add_classes(rule_set, italic_classes)\n end\n # does this ruleset make text right-aligned?\n if rule_set_is_right_aligned?(rule_set)\n add_classes(rule_set, right_aligned_classes)\n end\n # does this ruleset make text centered?\n if rule_set_is_centered?(rule_set)\n add_classes(rule_set, centered_classes)\n end\n end\n end", "def visit_haml_comment(node)\n # We want to preserve leading whitespace if it exists, but add a leading\n # whitespace if it doesn't exist so that RuboCop's LeadingCommentSpace\n # doesn't complain\n line_index = node.line - 1\n lines = @original_haml_lines[line_index..(line_index + node.text.count(\"\\n\"))].dup\n indent = lines.first.index(/\\S/)\n # Remove only the -, the # will align with regular code\n # -# comment\n # - foo()\n # becomes\n # # comment\n # foo()\n lines[0] = lines[0].sub('-', '')\n\n # Adding a space before the comment if its missing\n # We can't fix those, so make sure not to generate warnings for them.\n lines[0] = lines[0].sub(/\\A(\\s*)#(\\S)/, '\\\\1# \\\\2')\n\n HamlLint::Utils.map_after_first!(lines) do |line|\n # Since the indent/spaces of the extra line comments isn't exactly in the haml,\n # it's not RuboCop's job to fix indentation, so just make a reasonable indentation\n # to avoid offenses.\n ' ' * indent + line.sub(/^\\s*/, '# ').rstrip\n end\n\n # Using Placeholder instead of script because we can't revert back to the\n # exact original comment since multiple syntax lead to the exact same comment.\n @ruby_chunks << HamlCommentChunk.new(node, lines, end_marker_indent: indent)\n end", "def process(website_file, processing_contents)\n return processing_contents if not website_file.config.remove_h1_tags\n\n possible_translators = \\\n translators.select {|name, translator| translator.translates?(website_file)}\n return processing_contents if possible_translators.length == 0\n\n #if possible_translators.nil?\n # throw \"nil 1\"\n #elsif possible_translators[0].nil?\n # throw \"nil 2\"\n #end\n\n translator = possible_translators.values[0]\n\n # Just remove the first one, if we can.\n translator.h1_regex.nil? ? processing_contents : processing_contents.sub(translator.h1_regex, \"\")\n end", "def capture_from_template(*args, &block)\n engine_matches?(block) ? template.capture_haml(*args, &block) : yield(*args)\n end", "def read_definitions_file\n if File.exist?(layouts_file_path)\n YAML.safe_load(ERB.new(File.read(layouts_file_path)).result, YAML_WHITELIST_CLASSES, [], true) || []\n else\n raise LoadError, \"Could not find page_layouts.yml file! Please run `rails generate alchemy:install`\"\n end\n end", "def postprocess(doc)\n normalise_headings(doc)\n find_short_title(doc)\n link_definitions(doc)\n nest_blocklists(doc)\n\n doc\n end", "def process_markup()\n [title,content].each do |text|\n next if !text\n clear_webpage(text).scan(PTN_MARKUP).map{|e|e[0].split(PTN_ELEMENT_SEP)}.flatten.each do |element|\n #debug \"[process_markup] element: \"+element.inspect\n next if !element\n ptn = element.scan(PTN_METADATA)\n #debug \"[process_markup] ptn: \"+ptn.inspect\n if ptn.size > 0\n m[ptn[0][0].to_sym] = parse_value(ptn[0][1])\n else\n create_and_link(element, 'tag' , \"t\")\n #add_tags(element, \"m\")\n end\n end#scan\n end#each\n end", "def template_for(file); end", "def process(input = nil)\n if input.nil?\n input = STDIN\n end\n\n input.each_line do |line|\n detect_filename_in line\n parse line if @filename\n end\n\n if input.is_a? IO\n puts result_as(Suspiciouss::Result::PlainText)\n else\n result_as(Suspiciouss::Result::Markdown)\n end\n end", "def process_template(source_file)\n rfile = ERB.new(File.read(source_file))\n @cookbook = @metadata.name\n\n rfile.result(binding)\n end", "def process_html(html)\r\n html = email_process(html)\r\n process_menu(html)\r\n end", "def process\n case @tag['class']\n when 'pages' then ClassPagesTag.new(@working_dir, @template, @filename, @tag).process\n when 'menu' then ClassMenuTag.new(@working_dir, @template, @filename, @tag).process\n when 'fragment' then ClassFragmentTag.new(@working_dir, @template, @filename, @tag).process\n when 'news' then ClassNewsTag.new(@working_dir, @template, @filename, @tag).process\n else\n error \"Unknown tag #{@tag}\"\n end\n end", "def handle(line)\n parsed = parse(line)\n return unless parsed\n\n handle_parsed(parsed)\n end", "def parse_page_file(file_path)\n \n result = {}\n metadata = []\n remaining = ''\n \n File.open(file_path) do |file|\n \n while (not file.eof?)\n line = file.readline \n if match = line.match(/\\w*:\\s[\\w|\\s]*/)\n metadata.push(line)\n else\n remaining << line if not line.match(/^\\n|\\n\\r$/)\n break\n end\n end \n \n remaining << file.read # Reads the rest of the document\n\n result = {}\n \n if metadata and metadata.length > 0 \n result = YAML::load(metadata.join)\n end\n \n result.store(:body, remaining) if remaining\n \n end \n \n return result \n \n end", "def block_is_haml?(block)\n eval('_hamlout', block.binding)\n true\n rescue\n false\n end", "def render(webroot = Pathname.new('/'))\n @webroot = webroot\n Haml::Engine.new(@template).render(self)\n end", "def set_attributes_from_header(page, filepath)\n template = Locomotive::Mounter::Utils::YAMLFrontMattersTemplate.new(filepath)\n\n if template.attributes\n attributes = template.attributes.clone\n\n # set the editable elements\n page.set_editable_elements(attributes.delete('editable_elements'))\n\n # set the content type\n if content_type_slug = attributes.delete('content_type')\n attributes['templatized'] = true\n attributes['content_type'] = self.mounting_point.content_types.values.find { |ct| ct.slug == content_type_slug }\n end\n\n page.attributes = attributes\n end\n\n page.template = template\n end", "def initialize file_path\n md = file_path.match(/(\\d{4}-\\d{2}-\\d{2}-?(\\d{2}-\\d{2})?)-(\\w*)-([\\w-]*)/)\n\n unless md.nil?\n @date = Date.parse(md[1])\n @tags = md[4].split \"-\"\n end\n\n File.open(file_path) do |file|\n\n @title = \"\"\n @title = file.readline until md = @title.match(/^#+(.*)/) \n @title = md[1]\n\n if (md = @title.match /^\\[(.*)\\]\\((.*)\\)/)\n @title = md[1] \n @link = md[2]\n @type = :link\n else\n @type = :post\n end\n\n @content = Maruku.new(file.read).to_html\n @slug = @title.downcase.gsub(/[^\\w\\s]/, \"\").gsub /\\s+/, \"-\"\n @permalink = \"#{@slug}.html\"\n end\n end", "def render\n ERB.new(File.read(@file)).result(binding)\n end", "def process_template(template)\n @dlogger.debug \"Processing template #{template} for file #{@file}\"\n # The '-' arg allows folks to use <% -%> or <%- -%> to instruct ERB to\n # not insert a newline for that line, which helps avoid a bunch of blank\n # lines in the processed file where there was code in the template.\n erb = ERB.new(IO.read(template), nil, '-')\n # The binding arg ties the template's namespace to this point in the\n # code, thus ensuring that all of the variables above (@file, etc.)\n # are visible to the template code.\n begin\n erb.result(binding)\n rescue Exception => e\n # Help the user figure out where the exception occurred, otherwise they\n # just get told it happened here, which isn't very helpful.\n raise Etch.wrap_exception(e, \"Exception while processing template #{template} for file #{@file}:\\n\" + e.message)\n ensure\n restore_globals\n end\n end", "def place_in_layouts(content, payload, info); end", "def main_content\n do_include(@template)\n end", "def visit_script(node, &block)\n raw_first_line = @original_haml_lines[node.line - 1]\n\n # ==, !, !==, &, &== means interpolation (was needed before HAML 2.2... it's still supported)\n # =, !=, &= mean actual ruby code is coming\n # Anything else is interpolation\n # The regex lists the case for Ruby Code. The 3 cases and making sure they are not followed by another = sign\n\n match = raw_first_line.match(/\\A\\s*(=|!=|&=)(?!=)/)\n unless match\n # The line doesn't start with a - or a =, this is actually a \"plain\"\n # that contains interpolation.\n indent = raw_first_line.index(/\\S/)\n @ruby_chunks << PlaceholderMarkerChunk.new(node, 'interpolation', indent: indent)\n lines = extract_piped_plain_multilines(node.line - 1)\n add_interpolation_chunks(node, lines.join(\"\\n\"), node.line - 1, indent: indent)\n return\n end\n\n script_prefix = match[1]\n _first_line_offset, lines = extract_raw_ruby_lines(node.script, node.line - 1)\n # We want the actual indentation and prefix for the first line\n first_line = lines[0] = @original_haml_lines[node.line - 1].rstrip\n process_multiline!(first_line)\n\n lines[0] = lines[0].sub(/(#{script_prefix}[ \\t]?)/, '')\n line_indentation = Regexp.last_match(1).size\n\n raw_code = lines.join(\"\\n\")\n\n if lines[0][/\\S/] == '#'\n # a \"=\" script that only contains a comment... No need for the \"HL.out = \" prefix,\n # just treat it as comment which will turn into a \"-\" comment\n else\n lines[0] = HamlLint::Utils.insert_after_indentation(lines[0], script_output_prefix)\n end\n\n indent_delta = script_output_prefix.size - line_indentation\n HamlLint::Utils.map_after_first!(lines) do |line|\n HamlLint::Utils.indent(line, indent_delta)\n end\n\n prev_chunk = @ruby_chunks.last\n if prev_chunk.is_a?(ScriptChunk) &&\n prev_chunk.node.type == :script &&\n prev_chunk.node == node.parent\n # When an outputting script is nested under another outputting script,\n # we want to block them from being merged together by rubocop, because\n # this doesn't make sense in HAML.\n # Example:\n # = if this_is_short\n # = this_is_short_too\n # Could become (after RuboCop):\n # HL.out = (HL.out = this_is_short_too if this_is_short)\n # Or in (broken) HAML style:\n # = this_is_short_too = if this_is_short\n # By forcing this to start a chunk, there will be extra placeholders which\n # blocks rubocop from merging the lines.\n must_start_chunk = true\n elsif script_prefix != '='\n # In the few cases where &= and != are used to start the script,\n # We need to remember and put it back in the final HAML. Fusing scripts together\n # would make that basically impossible. Instead, a script has a \"first_output_prefix\"\n # field for this specific case\n must_start_chunk = true\n end\n\n finish_visit_any_script(node, lines, raw_code: raw_code, must_start_chunk: must_start_chunk,\n first_output_prefix: script_prefix, &block)\n end" ]
[ "0.68395865", "0.6383707", "0.62451565", "0.59050316", "0.5784923", "0.5753657", "0.5742401", "0.57275337", "0.55585235", "0.5528374", "0.55230266", "0.55230266", "0.55151683", "0.54675233", "0.538593", "0.537291", "0.5361597", "0.5353956", "0.5309387", "0.53045905", "0.5253906", "0.5250359", "0.52449673", "0.52444977", "0.52243185", "0.5221643", "0.5187967", "0.5181354", "0.51778704", "0.51584166", "0.51555103", "0.5124626", "0.51173437", "0.5109735", "0.5103086", "0.5089186", "0.5077897", "0.5070009", "0.50681823", "0.5066037", "0.5052745", "0.5012932", "0.50089854", "0.5003195", "0.49976954", "0.4989027", "0.49879402", "0.49799064", "0.49771094", "0.49651864", "0.4953573", "0.49432886", "0.49430194", "0.4939852", "0.49396092", "0.4925229", "0.4923522", "0.49210554", "0.4917995", "0.49152333", "0.49096978", "0.4907596", "0.4907471", "0.49053302", "0.49007556", "0.48973814", "0.48968607", "0.48954478", "0.4893407", "0.48929337", "0.48918736", "0.4889219", "0.4888447", "0.48851103", "0.48805407", "0.48686817", "0.48679072", "0.48678413", "0.48594424", "0.48535836", "0.48439676", "0.48338977", "0.48254696", "0.4822541", "0.48196587", "0.4819575", "0.48132473", "0.48041618", "0.48036912", "0.48013306", "0.47979125", "0.47933716", "0.47863877", "0.47810206", "0.4769989", "0.47688806", "0.47672114", "0.47656363", "0.47639886", "0.47622356" ]
0.6069634
3
Converts domain name to path in filesystem
def domain_to_path(host) path = host.split(".") path.reverse! if path.length > 1 path.join("/") # returns end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def canonicalize\n FilePath.new(File.expand_path(to_s))\n end", "def path\n name.split(\"::\").join(\"/\").downcase\n end", "def cleanse_domain(domain)\n domain.downcase!\n domain = domain.sub(/^https?\\:\\/\\//, '').sub(/^www./,'')\n domain = domain.split(\"/\").first\n domain = domain.split(\"@\").last\n\n domain = PublicSuffix.parse(domain)\n domain = \"#{domain.sld}.#{domain.tld}\"\n domain\n end", "def rdfs_domain\n end", "def domain\n unless @domain\n if defined? ActiveSupport::CoreExtensions::String::Inflections\n @domain = name.tableize\n else\n @domain = name.downcase\n end\n end\n @domain\n end", "def absolute_domain\n domain.end_with?(\".\") ? domain : \"#{domain}.\"\n end", "def normalize_domain(domain)\n return domain.downcase.gsub(/\\.$/,'')\n end", "def domain\n @domain ||= PublicSuffix.parse(@fqdn).domain\n end", "def domain_name(url)\n #url.gsub(/http:|https:|www.|\\/\\/|.com.*/,'')\n url.gsub(/http:|https:|www.|\\/\\//,'').split('.').first\nend", "def write_rpz_domain(fd, domain)\n\tif domain[-1] == '.' then\n\t\tdomain = domain[0..-2]\n\tend\n\tif domain[0] == '.' then\n\t\tdomain = domain[1..-1]\n\tend\n\treturn unless /[\\.]/.match(domain)\n\tfd.write(domain + \" IN CNAME .\\n\")\n\tfd.write(\"*.\" + domain + \" IN CNAME .\\n\")\nend", "def path_for_url(dir, subdir, url)\n path = url.gsub(/^[|[:alpha:]]+:\\/\\//, '')\n path.gsub!(/^[.\\/]+/, '')\n path.gsub!(/[^-_.\\/[:alnum:]]/, '_')\n File.join(dir, subdir, path)\n end", "def generate_file_name(domain_name, baseurl)\n if(term.to_s[0..1].eql? \"_:\")\n file_name = \"rdfsites/blanknode/#{term.to_s}/\"\n else\n begin\n uri = Addressable::URI.parse(term.to_s).to_hash\n file_name = \"rdfsites/\" # in this directory all external RDF sites are stored\n if((uri[:host].eql? domain_name) || (\"#{uri[:scheme]}://#{uri[:host]}\".eql? domain_name))\n file_name = \"\"\n uri[:scheme] = nil\n uri[:host] = nil\n if(uri[:path].length > baseurl.length)\n if(uri[:path][0..(baseurl.length)].eql? (baseurl + \"/\"))\n uri[:path] = uri[:path][(baseurl.length)..-1]\n end\n elsif(uri[:path].eql?(baseurl))\n uri[:path] = nil\n end\n end\n key_field = [:scheme, :userinfo, :host, :port, :registry, :path, :opaque, :query, :fragment]\n key_field.each do |index|\n if !(uri[index].nil?)\n case index\n when :path\n file_name += \"#{uri[index][1..-1]}/\"\n when :fragment\n file_name += \"#/#{uri[index]}\"\n else\n file_name += \"#{uri[index]}/\"\n end\n end\n end\n unless file_name[-1] == '/'\n file_name += '/'\n end\n rescue URI::InvalidURIError => x #unclean coding: blanknodes are recognized through errors\n file_name = \"invalids/#{term.to_s}\"\n Jekyll.logger.error(\"Invalid resource found: #{term.to_s} is not a proper uri\")\n Jekyll.logger.error(\"URI parser exited with message: #{x.message}\")\n end\n end\n file_name = file_name.gsub('_','_u')\n file_name = file_name.gsub('//','/') # needs a better regex to include /// ////...\n file_name = file_name.gsub(':','_D')\n file_name = file_name.strip\n if(file_name[-2..-1] == \"#/\")\n file_name = file_name[0..-3]\n end\n file_name += 'index.html'\n @render_path = file_name\n @page_url = file_name.chomp('index.html').chomp('.html')\n file_name\n end", "def normalize(domain)\n domain = domain.chomp(DOT).unicode_normalize(:nfc) unless domain.ascii_only?\n Punycode.encode_hostname(domain).downcase\n end", "def domain_name(str)\n str = str.split('//')\n str = str[str.size - 1].split('.')\n str.delete('www')\n str[0]\nend", "def to_domain\n domain = @uri.domain\n domain ? Wgit::Url.new(domain) : nil\n end", "def to_domain\n domain = @uri.domain\n domain ? Wgit::Url.new(domain) : nil\n end", "def normalized_path(file); end", "def build_domain \n unless self.domain\n self.domain = URI.parse(self.url).host \n self.save\n end\n end", "def domain_name(url)\n url.gsub(\"www.\",\"\").split(\"//\")[1].split(\"/\")[0].split('.')[0]\nend", "def dn_to_domain(dn)\n if dn.include? \"DC=\"\n return dn.gsub(',','').split('DC=')[1..-1].join('.')\n else\n return dn\n end\n end", "def domain_path(post)\n if post.url\n \"/d/#{post.domain}\"\n else\n \"/l/#{post.category.name}\"\n end\n end", "def to_sub_domain\n return nil unless to_host\n\n dot_domain = \".#{to_domain}\"\n return nil unless include?(dot_domain)\n\n sub_domain = to_host.sub(dot_domain, '')\n Wgit::Url.new(sub_domain)\n end", "def eponymous_directory_path\n path.sub(ext, '/').sub(/\\/$/, '') + '/'\n end", "def pathname(path)\n path = path.tr(\"/\", \"\\\\\") if windows?\n Pathname.new(path)\n end", "def normalised_name(path)\n path == '/' ? '/' : File.basename(path)\n end", "def pdns_pathname(uri)\n require 'pathname'\n require 'uri'\n Pathname.new(URI.parse(uri).path)\nend", "def getRealPath(path) Pathname.new(path).realpath.to_s; end", "def getRealPath(path) Pathname.new(path).realpath.to_s; end", "def domain_name(url)\n return nil unless url\n if m=url.match(/([^.\\/ ]+)\\.(com|net|info|org|name|biz|gov|\\w\\w)(\\.\\w+)?(\\/.*)*(\\?.*)*$/)\n \"#{m[1]}.#{m[2]}\"\n else\n url\n end\n end", "def domain(dom)\n domain = URI.extract(dom)\n raise ArgumentError, 'The domain must be a URL.' if domain.blank?\n @domain = URI.parse(domain[0]).normalize.to_s\n end", "def get_domain(url)\n url_partitioned_at_double_hash = url.partition(\"//\")\n domain_partitioned_at_hash = url_partitioned_at_double_hash[2].partition(\"/\")\n domain_partitioned_at_hash[0]\nend", "def url_to_filename(url) #:nodoc:\n\t\t\ttemp = url.gsub(base_url(), '')\n\t\t\ttemp.gsub!('/', '.')\n\t\t\treturn temp\n\t\tend", "def sanitized_dirname\n @remote.gsub(/[^@\\w\\.-]/, '-')\n end", "def sanitized_path(base_directory, questionable_path); end", "def sanitized_path(base_directory, questionable_path); end", "def sanitized_path(base_directory, questionable_path); end", "def sanitized_path(base_directory, questionable_path); end", "def sanitized_path(base_directory, questionable_path); end", "def sanitized_path(base_directory, questionable_path); end", "def path_to_safe_filename(path)\n path = '/' if path == ''\n normalize_path(path).gsub('/', '?').gsub(/[ :]/, '_')\n end", "def name_to_dir(name)\n name.gsub(/[^-A-Za-z0-9_|\\[\\]]/, \"_\")\n end", "def filename(domain_name, baseurl)\n @filename ||= generate_file_name(domain_name, baseurl)\n end", "def db_domain_path(domain, type=\"\")\r\n # if type is not nil or empty, add : before the key\r\n type = \":#{type}\" if type.to_s.length > 0\r\n \"#{db_path(\"domain\")}:#{domain}#{type}\"\r\n # \"automata:domain:#{domain}#{type}\"\r\n end", "def normalize(domain)\n # strip off the protocol (\\w{1,20}://), the URI (/), parameters (?), port number (:), and username (.*@)\n # then split into parts via the .\n parts = domain.gsub(%r{^\\w{1,20}://}, '').gsub(%r{[/?:].*}, '').gsub(/.*?@/, '').split('.')\n # grab the last two parts of the domain\n dom = parts[-2, 2].join '.'\n # if the dom is in the two_level_tld list, then use three parts\n dom = parts[-3, 3].join '.' if @two_level_tld.index dom\n dom = parts[-4, 4].join '.' if @three_level_tld.index dom\n dom\n end", "def sf_fix_protocol(path, domain)\n if path =~ %r{^//[^/]+}\n 'http:' << path\n else\n \"http://#{domain}#{'/' unless path =~ %r{^/[^/]+}}#{path}\"\n end\n end", "def create_domain_name(domain_array)\n domain = domain_array.join('.')\n domain.encode!(\"US-ASCII\", :invalid => :replace, :undef => :replace, :replace => '?')\n domain = '?' unless /[\\w-]+(\\.[\\w-]+)+/ =~ domain\n return domain\n end", "def sanitize_as_filename\n self.gsub(/^.*(\\\\|\\/)/, '').transliterate.downcase.gsub(/[^a-z0-9\\. ]/, ' ').strip.gsub(/[ ]+/, '-')\n end", "def to_windows_path(path)\n path.gsub('/', \"\\\\\")\n end", "def short\n return '' if name == domain.name\n return '' if name.blank?\n\n File.basename(name, \".#{domain.name}\")\n end", "def canonical_hostname(domain)\n # Allow hostname overrides\n return $override_dashboard if $override_dashboard && domain == 'studio.code.org'\n return $override_pegasus if $override_pegasus && domain == 'code.org'\n\n return \"#{name}.#{domain}\" if ['console', 'hoc-levels'].include?($node_name)\n return domain if $node_env == 'production'\n\n # our HTTPS wildcard certificate only supports *.code.org\n # 'env', 'studio.code.org' over https must resolve to 'env-studio.code.org' for non-prod environments\n sep = (domain.include?('.code.org')) ? '-' : '.'\n return \"localhost#{sep}#{domain}\" if $node_env == 'development'\n return \"translate#{sep}#{domain}\" if $node_name == 'crowdin'\n \"#{$node_env}#{sep}#{domain}\"\nend", "def to_www\n @path \n end", "def path_to rp\n File.join(folder, rp)\n end", "def get_domain url\n uri = URI.parse url\n host = uri.host.downcase\n host.start_with?('www.') ? host[4..-1] : host\n end", "def uri_to_name(uri)\n uri = URI.parse(uri)\n path = uri.path\n path = path.chomp(File.extname(path))\n path = path.chomp('trunk')\n File.join(uri.host,path).split('/').reverse.join('.')\n #path.split('/').reverse.join('.')\n end", "def path\n if @website_file.in_blog?\n blog_folder.path + @name\n else\n siteroot.path + @name\n end\n end", "def sanitizeFilePath(path)\n path = path.gsub(/[^-a-z A-Z0-9_.\\/]/, '_').split(\"/\").map { |part|\n part.sub(/^\\.+/, '_').sub(/\\.+$/, '_')\n }.join('/')\nend", "def namespaced_path\n @namespaced_path ||= name.tr('-', '/')\n end", "def pathname(path, link)\n path_string = path&.length&.positive? ? '/' + path.join('/') : ''\n path_string = path_string.tr(' ', '-')\n \"/#{SITEMAP_SUBDIRECTORY}/#{name}#{path_string}/#{link}\"\n end", "def lang2host(lang)\n\t\thost = request.host.split('.')\n\t\tunless host[-1].in? ['dev','io'] # don't touch development TLDs\n\t\t\tcase lang\n\t\t\twhen 'cn' then host[-1] = 'cn'\n\t\t\telse host[-1] = 'com'\n\t\t\tend\n\t\tend\n\t\thost.join('.')\n\tend", "def sf_domain(uri)\n uri = uri.to_s.split('/')\n uri.empty? ? '' : uri[2]\n end", "def store_dir\n #\"documentos/#{model.document_album.escuela_transporte.razonSocial.gsub(\" \",\"_\").mb_chars.normalize(:kd).gsub(/[^x00-\\x7F]/n, '').to_s.upcase.gsub(/[^a-zA-Z0-9_-]/,\"\")}/#{model.document_album.nombre.upcase}/#{model.nombre}\"\n model.document_path\n end", "def list_path\n File.join(File.dirname(__FILE__), \"domains.txt\")\n end", "def name\n path.gsub(/\\./,'_').gsub(%r{/}, '.').gsub(%r{(^\\.|\\.$)},'')\n end", "def scheme_with_host(domain=nil)\n ['http://', domain || self.name, '/'].join(\"\")\n end", "def windows_path(path)\n path.gsub(/\\//, '\\\\')\n end", "def url_to_filename(url) #:nodoc:\n\t\t\treturn url.gsub(base_url, '')\n\t\tend", "def from_path(path_string_or_path)\n path = Pathname.new(path_string_or_path)\n return false unless path.exist?\n path_dir, file = path.relative_path_from(Pathname.new(domains_path)).split\n backwards_path = path_dir.to_s.split('/').push(file.basename('.txt').to_s)\n domain = backwards_path.reverse.join('.')\n Swot.new(domain)\n end", "def normalize_path(path); end", "def normalize_path(path); end", "def path\n return @path.sub(/^\\//,'').sub(/^%2F/,'/')\n end", "def compression_domain_name(dns_query, parsed_dns)\n buf = \"\"\n domain_array = []\n offset = dns_query[parsed_dns[:index],SHORT_LENGTH].unpack(\"n\")[0] & 0x3fff\n\n parsed_dns[:domain_name_dictionary].each do |domain_info|\n if domain_info[:first_index] >= offset\n domain_array << domain_info[:domain_name]\n break if domain_info[:domain_name].nil? or domain_info[:domain_name].include?(\".\")\n end\n end\n domain = domain_array.compact.join('.')\n return domain\n end", "def canonical_path(path)\n if Gem.win_platform?\n unless File.exist?(path)\n raise PDK::CLI::FatalError, _(\"Cannot resolve a full path to '%{path}' as it does not currently exist\") % { path: path }\n end\n Puppet::Util::Windows::File.get_long_pathname(path)\n else\n File.expand_path(path)\n end\n end", "def get_filename(url)\n parts = url.split('/')\n dirname = parts[-2]\n filename = parts[-1].split('.')[0] + \"_ocr.pdf\"\n '990s/' + dirname + '/' + filename\nend", "def filename_doi\n formatted_doi.gsub('/', '.')\n end", "def subdomain\n self.name.gsub('_', '.')\n end", "def format_path(entry)\n server_path = entry.path\n if base_path && server_path[0,base_path.length] == base_path\n if server_path == base_path\n return \".\"\n elsif server_path[base_path.length,1] == \"/\"\n return server_path[base_path.length + 1, server_path.length - base_path.length - 1]\n elsif base_path == \"/\" && server_path[0,1] == \"/\"\n return server_path[1, server_path.length - 1]\n end\n end\n server_path\n end", "def get_domain_data\n get_stored_paths.inject({ 'domain' => base_uri.hostname, 'paths' => {}}) do |hsh, path|\n hsh['paths'][path] = get_path_data(path)\n hsh\n end\n end", "def domain_name(url)\n if url.match(/^www/)\n p url.split(\".\")[1]\n elsif url.match(/^http/)\n x = url.split(\"/\")[2]\n if x.match(/^www/)\n p x.split(\".\")[1]\n else\n p x.split(\".\")[0]\n end\n else\n p url.split(\".\")[0]\n end\nend", "def encode_dir(path)\n path.gsub(\".hg/\",\".hg.hg/\").gsub(\".i/\",\".i.hg/\").gsub(\".d/\",\".d.hg/\")\n end", "def normalize_url(path)\n @known_pairs ||= {}\n @public_directories_regex ||= Regexp.new(Bones.public_directories.join('|'))\n \n if v = @known_pairs[path]\n return v\n else\n value = case\n when path =~ /^(\\w{3,}:\\/\\/|mailto)/\n # don't do anything to this type of URL\n return path\n when path =~ @public_directories_regex\n path\n when File.directory?('pages' / path)\n path\n else\n # don't add .html if there's already an extension\n path =~ /\\..+/ ? path : path + '.html'\n end\n \n @known_pairs[path] = options.base / value\n end \n end", "def directoryname\n new_parts = @parts[0..-2]\n new_parts[0] = absolute_prefix + new_parts[0]\n FilePath.new(*new_parts).to_s\n end", "def normalize(path)\n path.gsub(/\\\\/, \"/\")\n end", "def dns_name\n [\"public\", fqdn].join(\".\")\n end", "def get_domain_name(host)\n domain = nil\n search = nil\n resolv_conf = if host['platform'].include?('windows')\n if host.is_cygwin?\n host.exec(Command.new(\"cat /cygdrive/c/Windows/System32/drivers/etc/hosts\")).stdout\n else\n host.exec(Command.new('type C:\\Windows\\System32\\drivers\\etc\\hosts')).stdout\n end\n else\n host.exec(Command.new(\"cat /etc/resolv.conf\")).stdout\n end\n resolv_conf.each_line do |line|\n if (match = /^\\s*domain\\s+(\\S+)/.match(line))\n domain = match[1]\n elsif (match = /^\\s*search\\s+(\\S+)/.match(line))\n search = match[1]\n end\n end\n return_value ||= domain\n return_value ||= search\n\n return unless return_value\n\n return_value.gsub(/\\.$/, '')\n end", "def canonical_path(path)\n if Gem.win_platform?\n raise PDK::CLI::FatalError, format(\"Cannot resolve a full path to '%{path}', as it does not currently exist.\", path: path) unless PDK::Util::Filesystem.exist?(path)\n\n PDK::Util::Windows::File.get_long_pathname(path)\n else\n PDK::Util::Filesystem.expand_path(path)\n end\n end", "def storage_path(file_name, user_address)\n directory = File.absolute_path?(Rails.configuration.storagePath) ? Rails.configuration.storagePath\n : Rails.root.join('public', Rails.configuration.storagePath, cur_user_host_address(user_address)) # get the path to the directory for the host address\n\n # create a new directory if it doesn't exist\n unless File.directory?(directory)\n FileUtils.mkdir_p(directory)\n end\n\n # put the given file to this directory\n File.join(directory, File.basename(file_name))\n end", "def guess_company_domain\n if self.company_domain.blank?\n string = self.company_name.to_s.downcase.gsub(' ', '') + \".fr\"\n self.company_domain = string\n end\n end", "def get_image_url(str, domain)\n ary = str.split('/')\n if ary[0] == ''\n domain + str\n else\n str\n end\n end", "def storage_path\n File.join(department.institution.storage_path, url_part)\n end", "def domain_name(subdomain: T.unsafe(nil), domain: T.unsafe(nil)); end", "def domain_name(url)\n url.gsub(/http(s)?:\\/\\/(www.)?/, '').match(/[^.]+/)[0]\nend", "def normalize_filename\n self.name = Pathname.normalize_filename(name)\n end", "def file_name\n if file.original_name.starts_with?('http')\n file.original_name.match(/[^\\/]+$/)[0]\n else\n file.original_name\n end\n end", "def domain(tld_length = 1)\n host.split(\":\").first.split(\".\").last(1 + tld_length).join(\".\")\n end", "def windows_path(path)\n path = path.to_path if path.respond_to? :to_path\n fs_object.GetAbsolutePathName(path.to_str)\n end", "def unify_path(s)\r\n p = s.frozen? ? s.dup : s\r\n p.gsub!( /\\\\/, '/' )\r\n p = \"#{$1.upcase}/#{$POSTMATCH}\" if p =~ REGEX_DISK\r\n if RUBY_PLATFORM =~ REGEX_CYGWIN\r\n\tif p =~ REGEX_CYGDRIVE\r\n\t p = \"/cygdrive/#{$1.upcase}/#{$POSTMATCH}\" \r\n\telse\r\n\t p.sub!( REGEX_DISK2, '/cygdrive/\\1/' ) if @name == 'PATH'\r\n\tend\r\n end\r\n return p\r\n end", "def convert_path(path)\n return path\n end", "def domain\n return @domain if defined? @domain\n\n @domain = begin\n PublicSuffix.parse(normalized_domain, default_rule: nil)\n rescue PublicSuffix::DomainInvalid, PublicSuffix::DomainNotAllowed\n nil\n end\n end", "def path_for original\n current_output_directory.join(daily_directory_for((settings[:ordered_by_processing_time] ? processing_time : file_time(original)).strftime(settings[:ordered_time_pattern]), original)).join(slug_for(processing_time, original))\n end", "def search_domains_for(domain)\n domain.downcase!\n serach_domains = []\n \n if domain =~ CookieStore::Cookie::IPADDR\n serach_domains << domain\n else\n domain = domain + '.local' if !(domain =~ /.\\../)\n serach_domains << domain\n serach_domains << \".#{domain}\"\n \n # H is the host domain name of a host; and,\n # H has the form A.B; and\n if domain =~ /[^\\.]+(\\..+)/\n reach = $1\n # B has at least one embedded dot\n if reach =~ /.[\\.:]./\n # B has at least one embedded dot, or B is the string \"local\".\n # then the reach of H is .B.\n serach_domains << reach\n end\n end\n end\n \n serach_domains\n end" ]
[ "0.6311151", "0.6309107", "0.62557983", "0.6147273", "0.6133952", "0.6111725", "0.60539377", "0.5971529", "0.59590876", "0.5959062", "0.59480137", "0.5938237", "0.59320295", "0.5918619", "0.59135175", "0.59135175", "0.5901354", "0.58748674", "0.58710957", "0.58677906", "0.58581114", "0.58500856", "0.58463436", "0.5810592", "0.5807892", "0.5796859", "0.57765025", "0.57765025", "0.57689106", "0.5755691", "0.5747796", "0.57291156", "0.5725647", "0.57088673", "0.57088673", "0.57088673", "0.57088673", "0.57088673", "0.57088673", "0.57078916", "0.57008016", "0.56994116", "0.56828463", "0.5653453", "0.56434226", "0.5637077", "0.56322503", "0.56255573", "0.56248784", "0.56161106", "0.5607545", "0.56048465", "0.56017655", "0.5597151", "0.55906355", "0.55850303", "0.5575591", "0.5570798", "0.5569338", "0.55621284", "0.5556901", "0.55458516", "0.55386186", "0.55373234", "0.55185115", "0.5511744", "0.55050886", "0.5498188", "0.5498188", "0.54929054", "0.5491745", "0.547886", "0.54781055", "0.54658145", "0.5464878", "0.5449349", "0.5447919", "0.5445897", "0.5436567", "0.5433774", "0.54332733", "0.54322815", "0.5417634", "0.5417466", "0.5415081", "0.54089516", "0.5407851", "0.5403909", "0.5400462", "0.5398566", "0.53980964", "0.53930795", "0.53920436", "0.53883785", "0.5381136", "0.5379765", "0.537806", "0.5375493", "0.5370194", "0.5369881" ]
0.71987534
0
Use callbacks to share common setup or constraints between actions.
def set_task @task = Task.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def set_actions\n actions :all\n end", "def define_action_helpers?; end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def workflow\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def setup\n # override and do something appropriate\n end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def save_action; end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def setup(&blk)\n @setup_block = blk\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def callback_phase\n super\n end", "def advice\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def duas1(action)\n action.call\n action.call\nend", "def _handle_action_missing(*args); end" ]
[ "0.6164095", "0.6046031", "0.5945298", "0.59179014", "0.58890367", "0.58341795", "0.5776118", "0.5700777", "0.5700777", "0.5656277", "0.56218207", "0.5423995", "0.5411516", "0.5411516", "0.5411516", "0.5395004", "0.53783494", "0.53593004", "0.53412604", "0.534078", "0.5332865", "0.53135896", "0.52999926", "0.5297309", "0.5296569", "0.5261449", "0.5247048", "0.52376497", "0.52376497", "0.52376497", "0.52376497", "0.52376497", "0.52323204", "0.52310973", "0.523081", "0.5225785", "0.5219039", "0.52136266", "0.5208033", "0.520763", "0.5177365", "0.5175224", "0.5173357", "0.5166104", "0.5162502", "0.51573396", "0.5154547", "0.5153531", "0.51502854", "0.51436496", "0.5142863", "0.51330835", "0.5115634", "0.5115634", "0.511527", "0.5109693", "0.51076853", "0.5093146", "0.5090683", "0.50829846", "0.50819314", "0.50670373", "0.5055505", "0.5053398", "0.50504035", "0.50504035", "0.5037765", "0.5027292", "0.5024484", "0.50150335", "0.5014069", "0.50022113", "0.5001542", "0.49981874", "0.49915564", "0.49915564", "0.49880967", "0.4982312", "0.49787375", "0.49786067", "0.49687737", "0.49676532", "0.49602765", "0.49565676", "0.49550772", "0.495342", "0.49522525", "0.49463704", "0.49447197", "0.49362713", "0.49328062", "0.49280638", "0.49272856", "0.4927058", "0.49221697", "0.4919526", "0.49185994", "0.49184805", "0.49170163", "0.49168405", "0.49167764" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def task_params if params[:task].present? params.require(:task).permit(:id, :name, :description, :due_date, :task_type, :done) else params.permit(:id, :name, :description) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
$db_hostname = 'localhost' $db_user = 'root' $db_pass = 'root' $db_name = 'inventory' $db_table_name = 'inventory' This function opens a connection to the database
def open_connection begin db = Mysql.new($db_hostname, $db_user, $db_pass) rescue Mysql::Error abort "Oops! Couldn't connect to database! Make sure you entered the correct information." end return db end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_connection\n\tbegin\n\t\tdb = Mysql.new $db_hostname, $db_user, $db_pass\n\trescue Mysql::Error\n\t\tabort \"Oops! Couldn't connect to database! Make sure you entered the correct information.\"\n\tend\n\treturn db\nend", "def _connect_database\n _send_command(\"db_connect #{@options[:db_user]}:#{@options[:db_pass]}@#{@options[:db_host]}/#{@options[:db_name]}\")\n end", "def connectDB\n \t#config = YAML.load_file( '/home/ubuntu/DB-Performance-Testing/config/db.yml' )['DB2']\n config = YAML.load_file( @@path + '../config/db.yml' )['DB2']\n\t cstring = \"DATABASE=#{config['db']};HOSTNAME=#{config['hostname']};\"\n\t cstring += \"PORT=#{config['port']};PROTOCOL=#{config['protocol']};UID=#{config['uid']};PWD=#{config['pwd']};\"\n\t @conn = IBM_DB.connect(cstring,\"\",\"\")\n end", "def connect\r\n client = Mysql2::Client.new(:host => \"localhost\", \r\n :database => \"space_ship\",\r\n :username => \"root\", \r\n :password => \"password\")\r\n end", "def db\n \n ActiveRecord::Base.establish_connection(:adapter => \"mysql2\",\n :database => \"prod1\",\n :user => \"root\",\n :password=>\"Sector@123\",\n :local_infile => true).connection()\n \n end", "def db\n \n ActiveRecord::Base.establish_connection(:adapter => \"mysql2\",\n :database => \"prod1\",\n :user => \"root\",\n :password=>\"Sector@123\").connection()\n \n end", "def connect_to_database\n # If no input parameters are defined then read the database params\n # from the command line or the default ones\n unless @db_params then self.database_params= DB_PARAMS end\n\n PGconn.connect( @db_params[:host],\n @db_params[:port],\n @db_params[:options],\n @db_params[:tty],\n @db_params[:dbname],\n @db_params[:login],\n @db_params[:password] )\n end", "def make_connection database=nil\n \n self.sql ||= Mysql2::Client.new(:host => \"#{self.url}\", :username => \"username#{self.user_id}\", :password => \"cis400\", :port => 3306, :database=>\"#{database}\")\n end", "def open_db()\n begin\n # connect to the database\n db_params = {\n host: ENV['host'], # AWS link\n port:ENV['port'], # AWS port, always 5432\n dbname:ENV['dbname'],\n user:ENV['dbuser'],\n password:ENV['dbpassword']\n }\n conn = PG::Connection.new(db_params)\n rescue PG::Error => e\n puts 'Exception occurred'\n puts e.message\n end\nend", "def open_db()\n begin\n # connect to the database\n db_params = {\n host: ENV['host'], # AWS link\n port:ENV['port'], # AWS port, always 5432\n dbname:ENV['dbname'],\n user:ENV['dbuser'],\n password:ENV['dbpassword']\n }\n conn = PG::Connection.new(db_params)\n rescue PG::Error => e\n puts 'Exception occurred'\n puts e.message\n end\nend", "def connect\n \n if !self.connected?\n \n # connect to the MySQL server\n \n @dbh = DBI.connect(\"DBI:Mysql:#{@dataBase}:#{@host}\", \n\t \"#{@user}\", \"#{@password}\")\n \n @connected=true\n \n end\n end", "def dbCon(host, user, pass, port, database)\n\n\t@host = host\n\t@user = user\n\t@pass = pass\n\t@port = port\n\t@database = database\n\n\tdb = Mysql2::Client.new(\n\t\t:host => @host,\n\t\t:username => @user,\n\t\t:password => @pass,\n\t\t:port => @port,\n\t\t:database => @database\n\t\t)\n\n\tdb\nend", "def get_database\n\t\tdb = Mysql2::Client(:host => 'localhost',:user => 'root',:password => 'abcd0311')\n\n\t\tbegin\n\t\t\tdb.query(\"DROP DATABASE #{@month}_#{@year}_clients\")\n\t\t\tdb.query(\"CREATE DATABASE #{@month}_#{@year}_clients\")\n\t\trescue Exception => e\n\t\t\tdb.query(\"CREATE DATABASE #{@month}_#{@year}_clients\")\n\t\tend\n\n\t\tdb.query(\"USE #{@month}_#{@year}_clients\")\n\t\tdb.query(\"CREATE TABLE users(cID integer, name varchar(50), address varchar(50), prov varchar(50), postal varchar(50), email varchar(50), cost float);\")\n\t\tdb\n\tend", "def connect\n \n if !self.connected?\n \n # connect to the MySQL server\n @dbh = DBI.connect(\"DBI:Mysql:#{@dataBase}:#{@host}\", \n\t \"#{@user}\", \"#{@password}\")\n @connected=true\n \n end\n end", "def connect\r\n db = Sequel.connect(:adapter => 'mysql',\r\n :host => 'localhost', \r\n :user => 'root', \r\n :password => 'password',\r\n :database => 'space_ship')\r\n \r\n \r\n #client = Mysql2::Client.new(:host => \"localhost\", \r\n # :database => \"space_ship\",\r\n # :username => \"root\", \r\n # :password => \"password\")\r\n end", "def connect_to_database\n config = Rails.configuration.database_configuration\n host = config[Rails.env][\"host\"]\n dbname = config[Rails.env][\"database\"]\n username = config[Rails.env][\"username\"]\n password = config[Rails.env][\"password\"]\n \n client = Mysql2::Client.new(:host => host, :username => username, :password => password, :flags => Mysql2::Client::MULTI_STATEMENTS)\n \n if client.query(\"SHOW DATABASES LIKE '#{dbname}'\").count == 0\n print \"Database '#{dbname}' not found, creating...\"\n client.query(\"CREATE DATABASE #{dbname}\")\n print \"\\n\" + File.open(SETUP_FILE,\"r\").read\n client.select_db(dbname)\n client.query(File.open(SETUP_FILE,\"r\").read)\n end\n \n finalClient = Mysql2::Client.new(:host => host, :username => username, :password => password, :database => dbname)\n \n return finalClient\n \n end", "def connect\r\n client = Mysql2::Client.new(:host => \"localhost\", \r\n :database => \"school\",\r\n :username => \"root\", \r\n :password => \"password\")\r\n end", "def database_connection\n\t\t\tPG.connect(dbname: \"Kung_Fu\")\n\t\tend", "def configure_database\n\tbegin\n\t @client = Mysql2::Client.new(:host => \"localhost\", :username => \"root\", :password => \"qburst\", :database => \"ruby\")\n\trescue Exception=>e\n\t puts e.message\n\tend\n end", "def connection()\r\n\r\n begin\r\n db_params = {\r\n host: ENV['host'], # AWS link\r\n port: ENV['port'], # AWS port, always 5432\r\n username: ENV['username'],\r\n password: ENV['password'],\r\n database: ENV['database']\r\n }\r\n\r\n client = Mysql2::Client.new(db_params)\r\n\r\n rescue Mysql2::Error => e\r\n puts 'Exception occurred'\r\n puts e.message\r\n end\r\n\r\nend", "def connect_database\n\n\t\t@db = Redis.new\n\n\t\t@db = Redis.connect(\n\t\t\t:db => \"#{Settings.redis.db}\",\n\t\t\t:host => \"#{Settings.redis.host}\",\n\t\t\t:port => Settings.redis.port,\n\t\t\t:password => Settings.redis.password\n\t\t)\n\t\t\n\tend", "def connect dbname=nil\n dbname ||= getdbname\n return nil unless dbname\n #$log.debug \"XXX: CONNECT got #{dbname} \"\n $current_db = dbname\n $db = SQLite3::Database.new(dbname) if dbname\n return $db\nend", "def connect_to_db(db='thesis')\n ActiveRecord::Base.establish_connection(\n :adapter => \"postgresql\",\n :host => \"localhost\",\n :username => \"thesis\",\n :password => \"thesis\",\n :database => db.to_s,\n :encoding => \"utf8\"\n )\nend", "def connect(host, name, user, pass)\n str = sprintf('DBI:Mysql:database=%s;host=%s;flag=%s', \n name, host, 131072)\n begin\n dbh = DBI.connect(str, user, pass)\n rescue => ex\n \n puts sprintf(\"[%s] Failed to connect to '%s' with username '%s'\", Time.new, str, user) + \n \"\\n\\t\" + ex.inspect + \n \"\\n\\t\" + ex.backtrace.join(\"\\n\\t\") \n exit\n \n end\n end", "def connect\n @conn = PG.connect(\n :dbname => 'HackerNewsAppDB1',\n :user => 'paul',\n :password => 'password')\n end", "def connect\n PG::Connection.new(:host => host, :port => port, :user => user, :password => password, :dbname => dbname)\n end", "def connect(args)\n begin\n # sensible? defaults\n args[:host] ||= 'localhost'\n args[:port] ||= 3306\n args[:user] ||= 'root'\n args[:password] ||= ''\n \n db = Mysql.connect(args[:host], args[:user], args[:password], args[:name], args[:port])\n @debug and puts \"-- #{args[:host]} #{args[:name]} server version: \" + db.get_server_info\n return db\n rescue Mysql::Error => e\n $stderr.puts \"Error code: #{e.errno}\"\n $stderr.puts \"Error message: #{e.error}\"\n $stderr.puts \"Error SQLSTATE: #{e.sqlstate}\" if e.respond_to?(\"sqlstate\")\n exit\n end\n end", "def dbconnect(db=nil, host=nil, username=nil, password=nil)\n config = $mydbi_config[:default] \n\n # optionally reset the config to a named datasource\n if db.instance_of?(Symbol)\n if $mydbi_config.key?(db)\n config = $mydbi_config[db] \n db = nil\n else\n throw ArgumentError.new(\"No database connection named ':#{db}' is configured\")\n end\n end\n\n db = config[:db] if db.nil?\n host = config[:host] if host.nil?\n username = config[:username] if username.nil?\n password = config[:password] if password.nil?\n\n $mydbi_db = DBI.connect(\"DBI:Mysql:#{db}:#{host}\", username, password)\nend", "def establish_db_connection()\n @host = '127.0.0.1'\n @username = ''\n @password = ''\n\n my = Mysql.connect(@host, @username, @password)\n res = my.query('SHOW DATABASES;')\n puts res # need to be converted to string \n puts \"Tables_in_valutation\"\n res.each {|x| p x.to_s}\n res.free\nend", "def connect\n @db = Sequel.mysql(@database,\n :user => @db_user,\n :password => @db_password,\n :host => @host,\n :encoding => 'utf8')\n end", "def db\r\n @db ||= PG.connect(\r\n host: ENV['HOST'],\r\n user: ENV['USER_NAME'],\r\n password: ENV['PASSWORD'],\r\n dbname: ENV['DATABASE']\r\n )\r\nend", "def db_connect\n @dbh and db_close\n puts \"DEBUG: Opening DB\" if $DEBUG\n @dbh = DBI.connect(\"dbi:Pg:#{@database[:database]}:#{@database[:host]}\",\n @database[:user],\n @database[:password])\n end", "def db_connect\n @dbh and db_close\n puts \"DEBUG: Opening DB\" if $DEBUG\n @dbh = DBI.connect(\"dbi:Pg:#{@database[:database]}:#{@database[:host]}\",\n @database[:user],\n @database[:password])\n end", "def open()\n begin\n @my = Mysql.connect(@host, @user, @pw, @db)\n # Set the MySQL 'reconnect' flag -> Connection to the database will be \n # automatically maintained even if the Server closes it due to timed-out idle period\n @my.reconnect = true\n debug \" - Open Connection to MYSQL server - reconnect=#{@my.reconnect}\"\n rescue MysqlError => e\n debug \"SQL error message: #{e.error}.\"\n end\t\n end", "def connect_local\n ActiveRecord::Base.establish_connection(\n :adapter => 'postgresql',\n :encoding => 'unicode',\n :database => ENV['DB_NAME'], # accessmon\n :username => ENV['DB_USERNAME'], # accessmon\n :password => ENV['DB_PASSWORD'],\n :pool => POOL_COUNT,\n :port => PORT_NUMBER,\n :host => 'localhost')\n end", "def connect_database\n begin\n db = PG.connect( :dbname => 'artdb' )\n rescue PGError\n puts 'Failed to connect to artdb database.'\n end\n return db\nend", "def connect_to_db()\n SQLite3::Database.new('db/database.db')\n end", "def connect\n PG::Connection.new(:host => host, :port => port, :user => user, :password => password, :sslmode => sslmode, :dbname => dbname)\n end", "def connection\n @db = Connection.client\nend", "def new_connection(params)\n Pod4.logger.info(__FILE__){ \"Connecting to DB\" }\n client = TinyTds::Client.new(params)\n raise \"Bad Connection\" unless client.active?\n\n client.execute(\"use [#{self.class.db}]\").do\n\n client\n\n rescue => e\n handle_error(e)\n end", "def connect\n client = Mysql2::Client.new(:host => HOST,\n :username => USERNAME,\n :password => PASSWORD,\n :database => DATABASE)\n end", "def initialize(host,user,pass,dbname)\n @mHost = host\n @mUser = user\n @mPassword = pass\n @mDBName = dbname\n\n @mResource = Mysql.new(@mHostname,@mUser,@mPassword,@mDBName)\n puts \"DB Connection Successful. \" \n \n # See if table which insertions occurs exist \n checkifexists\n end", "def connection\n return nil if @dry_run\n raise Mysql::Error, \"Cannot connect without database information\" if @database.nil?\n if !@conn\n @conn = Mysql::new(@database[:host], @database[:user], @database[:password], @database[:database])\n create_pruned_table(@conn)\n end\n @conn\n end", "def connect(*args)\n @@connection = FluidDB::Connection.new(*args)\n end", "def connect\n if (@type == \"db2\")\n @config\n Models::Databases::SiteDatabase::Base.setup_connection(@config)\n elsif (@type == \"bops\")\n @config\n Models::Databases::Bops::Base.setup_connection(@config)\n else\n Models::Databases::Dyces::Base.setup_connection(@config)\n end\n\n @connection = @type\n\n Log.instance.debug \"Connected to #@db_url\"\n self\n end", "def connection\n PG.connect(\n dbname: @dbname, host: @host, port: @port,\n user: @user, password: @password\n )\n end", "def open()\n begin\n @my = Mysql.connect(@host, @user, @pw, @db)\n # Set the MySQL 'reconnect' flag -> Connection to the database will be\n # automatically maintained even if the Server closes it due to timed-out idle period\n @my.reconnect = true\n debug \" - Open Connection to MYSQL server - reconnect=#{@my.reconnect}\"\n @connected = true\n rescue MysqlError => e\n debug \"SQL error message: #{e.error}.\"\n end\n end", "def conn\n unless @conn\n # open the database config file\n db_config = YAML.load(ERB.new(File.read(\"config/ourstage_database.yml\")).result )\n database = db_config[environment]['database']\n @conn = EventMachine::Postgres.new(:database => database)\n @conn.setnonblocking(true) # may not be needed? \n end\n @conn\n end", "def create_database\n puts \"Creating database #{@db_name}...\"\n begin\n client = Mysql2::Client.new(:host => @db_host, :username => @db_user, :password => @db_pass)\n client.query(\"CREATE DATABASE #{@db_name}\")\n client.close\n rescue Exception => e\n puts \"An error occurred\\n #{e}\"\n end\n end", "def open_connection\n if @sslca then\n @db = Mysql2::Client.new(\n host: @host, \n username: @username, \n password: @password, \n port: @port, \n database: @database_name,\n sslca: @sslca)\n else\n @db = Mysql2::Client.new(\n host: @host, \n username: @username, \n password: @password, \n port: @port, \n database: @database_name)\n end\n end", "def connect_remote\n #ENV['DATABASE_URL'] ||= \"postgres://glue.pumpingstationone.org/?pool=5\"\n #ActiveRecord::Base.establish_connection(ENV['DATABASE_URL'])\n ActiveRecord::Base.establish_connection(\n :adapter => 'postgresql',\n :encoding => 'unicode',\n :database => ENV['DB_NAME'], # accessmon\n :username => ENV['DB_USERNAME'], # accessmon\n :password => ENV['DB_PASSWORD'],\n :pool => POOL_COUNT,\n :port => PORT_NUMBER,\n :host => ENV['DB_HOST'])\n end", "def connect_db\n ActiveRecord::Base.establish_connection($config)\n log(\"Connected to database\")\nrescue => e\n fatal(\"Failed to connect to the database: #{e}\")\n exit\nend", "def connect_local_admin\n ActiveRecord::Base.establish_connection(\n :adapter => 'postgresql',\n :schema_search_path => 'public',\n :encoding => 'unicode',\n :database => 'postgres',\n :username => ENV['DB_USERNAME'], # accessmon\n :password => ENV['DB_PASSWORD'],\n :pool => POOL_COUNT,\n :port => PORT_NUMBER,\n :host => 'localhost')\n end", "def conn\n config = YAML.load_file('db/pg_config.yml')[Rails.env]\n PG.connect(host: config['host'], port: 5432, dbname: config['dbname'],\n user: config['user'], password: config['password'])\n end", "def connect\n ::Informix.connect(@opts[:database], @opts[:user], @opts[:password])\n end", "def open(ipaddress=\"localhost\", port=23, username=\"alien\", password=\"password\")\n\t\t@con_ipaddress = ipaddress\n\t\t@con_port = port\n\t\t@con_username = username\n\t\t@con_password = password\n\t\t\n\t\topenConnection()\n\tend", "def open\n create_database\n end", "def connect_to_old_db\n ActiveRecord::Base.establish_connection(\n :adapter => \"postgresql\",\n :host => \"localhost\",\n :username => \"postgres\",\n :password => \"vegpuf\",\n :database => \"affluence_staging_25_june\"\n )\nend", "def db_connect\n database_connect_options = @options['database']\n db_connector = DatabaseConnector.new(database_connect_options)\n return db_connector.client\n end", "def db\n return @client if @client\n @client = Mysql2::Client.new(\n host: 'localhost',\n port: nil,\n username: 'root',\n password: nil,\n database: 'isucon5q',\n reconnect: true,\n )\n @client.query_options.merge!(symbolize_keys: true)\n @client\nend", "def initialize(dbname = Namey.db_path) \n @db = Sequel.connect(dbname)\n end", "def doDB\n \t\tbegin\n \t\t# Query the inventory\n \t\tinv = InventoryService.getInv(@@config)\n \t\tyield(inv)\n \t\trescue Exception => ex\n \t\terror = \"Inventory - Error connecting to the Inventory Database - '#{ex}''\"\n \t\traise HTTPStatus::InternalServerError, error\n \t\tend\n \t\tend", "def openDB\n db =Rho::Database.new(Rho::Application.databaseFilePath('local'), \"local\");\n puts \"#{db.to_s}\"\n data = db\n data\n end", "def database(args={})\n args[:connection_name] = @connection_name unless args.has_key?(:connection_name)\n req(:required => [:db_name],\n :args_object => args)\n data = {}\n dbh = Mysqladmin::Exec.new(:connection_name => args[:connection_name])\n dbh.use(args[:db_name])\n dbh.list_tables.each do |table_name|\n data[table_name] = table(:table_name => args[:table_name], :db_name => args[:db_name], :connection_name => args[:connection_name])\n end\n return data\n end", "def connect(dbname, user, auth, attr)\n connection = factory.create_connection\n connection.connection_string = dbname\n connection.open\n return create_database(connection, attr);\n rescue RuntimeError, System::Data::SqlClient::SqlException => err\n raise DBI::DatabaseError.new(err.message)\n end", "def db_connect_mysql(*args)\n\t\t\tif(args[0] == nil or args[0] == \"-h\" or args[0] == \"--help\")\n\t\t\t\tprint_status(\" Usage: db_connect <user:pass>@<host:port>/<database>\")\n\t\t\t\tprint_status(\"Examples:\")\n\t\t\t\tprint_status(\" db_connect user@metasploit3\")\n\t\t\t\tprint_status(\" db_connect user:[email protected]/metasploit3\")\n\t\t\t\tprint_status(\" db_connect user:[email protected]:1500/metasploit3\")\n\t\t\t\treturn\n\t\t\tend\n\n\t\t\tinfo = db_parse_db_uri_mysql(args[0])\n\t\t\topts = { 'adapter' => 'mysql' }\n\n\t\t\topts['username'] = info[:user] if (info[:user])\n\t\t\topts['password'] = info[:pass] if (info[:pass])\n\t\t\topts['database'] = info[:name]\n\t\t\topts['host'] = info[:host] if (info[:host])\n\t\t\topts['port'] = info[:port] if (info[:port])\n\n\t\t\topts['host'] ||= 'localhost'\n\n\t\t\t# This is an ugly hack for a broken MySQL adapter:\n\t\t\t# \thttp://dev.rubyonrails.org/ticket/3338\n\t\t\tif (opts['host'].strip.downcase == 'localhost')\n\t\t\t\topts['host'] = Socket.gethostbyname(\"localhost\")[3].unpack(\"C*\").join(\".\")\n\t\t\tend\n\n\t\t\tif (not framework.db.connect(opts))\n\t\t\t\traise RuntimeError.new(\"Failed to connect to the database: #{framework.db.error}\")\n\t\t\tend\n\t\tend", "def init_database(client)\n return unless client.is_a? Mysql2::Client\n\n client.query('drop database if exists barcrawldb;')\n\n client.query('CREATE DATABASE IF NOT EXISTS barcrawldb;')\n client.query('USE barcrawldb;')\nend", "def test_local_core_connection\n \n # Change username, password, host and port in order to test the connection with a different Ensembl db server\n assert_nothing_raised do \n Ensembl::Core::DBConnection.connect('Homo sapiens',56,:username => \"anonymous\",:host => \"ensembldb.ensembl.org\", :port => 5306)\n end\n end", "def connect_db_method\n begin\n self.con = PG.connect :dbname => self.dbname, :user => self.username, :password => self.password\n return true\n rescue PG::Error => e\n puts e.message\n puts \"Sorry Connection cannot be established\"\n # => Forceful exit from the program\n Kernel.exit(0)\n end\n end", "def initialize\n @database = Sequel.connect(ENV['DATABASE_URL'])\n end", "def open\n connection_string = 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source='\n connection_string << @mdb\n @database = Sequel.ado(:conn_string=>connection_string) # connect to Access DB\n end", "def connect \n\t\t\tfirst_tentative = true\n\t\t\tbegin\n\t\t\t\tdatabase = ActiveOrient.database\n\t\t\t\tlogger.progname = 'OrientDB#Connect'\n\t\t\t\tr = ActiveOrient.db_pool.checkout do | conn |\n\t\t\t\t\tr = conn[\"/connect/#{database}\"].get\n\t\t\t\tend\n\t\t\t\tif r.code == 204\n\t\t\t\t\tlogger.info{\"Connected to database #{database}\"}\n\t\t\t\t\ttrue\n\t\t\t\telse\n\t\t\t\t\tlogger.error{\"Connection to database #{database} could NOT be established\"}\n\t\t\t\t\tnil\n\t\t\t\tend\n\t\t\trescue RestClient::Unauthorized => e\n\t\t\t\tif first_tentative\n\t\t\t\t\tlogger.info{\"Database #{database} NOT present --> creating\"}\n\t\t\t\t\tfirst_tentative = false\n\t\t\t\t\tcreate_database database: database\n\t\t\t\t\tretry\n\t\t\t\telse\n\t\t\t\t\tKernel.exit\n\t\t\t\tend\n\t\t\tend\n\t\tend", "def test_conn_with_named_parameters \n db = MonetDB.new()\n \n db.conn({ :user => \"monetdb\", :passwd => \"monetdb\", :port => 50000, :host => \"localhost\", :database => \"ruby_test\"})\n assert_equal(true, db.is_connected?)\n db.close\n end", "def get_legacy_db_conn\n Mysql2::Client.new(:host => ENV[\"SDBMSS_LEGACY_DB_HOST\"],\n :username => ENV[\"SDBMSS_LEGACY_DB_USER\"],\n :database => ENV[\"SDBMSS_LEGACY_DB_NAME\"],\n :password => ENV[\"SDBMSS_LEGACY_DB_PASSWORD\"],\n )\n end", "def initialize(params = {})\n @host = params[:host] || 'localhost'\n @port = (params[:port] || 3306).to_i\n @user = params[:username] || 'root'\n @password = params[:password] || 'pwd'\n @database = params[:database] || 'ithingy'\n @adapter = params[:adapter] || 'mysql'\n self.connect\n end", "def connect(username=DEFAULT_USERNAME, password=DEFAULT_PASSWORD, lang=DEFAULT_LANG, host=DEFAULT_HOST, port=DEFAULT_PORT, db_name=DEFAULT_DATABASE, auth_type=DEFAULT_AUTHTYPE)\n\t\t# TODO: handle pools of connections\n\n\t\t@username = username\n\t\t@password = password\n\t\t@lang = lang\n\t\t@host = host\n\t\t@port = port\n\t\t@db_name = db_name\n\t\t@auth_type = auth_type\n\n\t\t@connection = MonetDBConnection.new(user = @username, passwd = @password, lang = @lang, host = @host, port = @port)\n\t\[email protected](@db_name, @auth_type)\n\tend", "def connect\n\tend", "def establish_master_connection\n establish_connection(configuration.merge(\n \"database\" => \"postgres\",\n \"password\" => su_password,\n \"schema_search_path\" => \"public\",\n \"username\" => su_username\n ))\n end", "def connection\n self.server[self.database][self.layout]\n end", "def connect(processName)\n\t\t\t@procName = processName\n\t\t\t@db_name = processName + \".db\"\n\t\t\t\n\t\t\t# create the new db if it doesn't exist\n\t\t\tif(!File.exists?(@db_name))\n\t\t\t\tcreate_db\n\t\t\tend\n\n\t\t\t@db = SQLite3::Database.open(@db_name) \n\t\tend", "def open_db\n if Config.db =~ /^sqlite:\\/{3}(.+)$/\n dir = File.dirname($1)\n FileUtils.mkdir_p(dir) unless File.directory?(dir)\n end\n\n Sequel.datetime_class = Time\n\n @db = Sequel.connect(Config.db, :encoding => 'utf8')\n @db.test_connection\n\n if trait[:sql_log]\n require 'logger'\n @db.logger = Logger.new(trait[:sql_log])\n end\n\n rescue => e\n Ramaze::Log.error(\"Unable to connect to database: #{e}\")\n exit(1)\n end", "def connect\n Alf::Tools::friendly_require('sequel')\n @db ||= ::Sequel.connect(@uri, @options)\n end", "def get_db(**db_conn_info)\n Sequel.mysql2(db_conn_info)\nend", "def on_db_host(host)\n\tend", "def database\n database_name ? connection.db(database_name) : nil\n end", "def connect_non_hash\r\n db=SQLite3::Database.new(\"db/slutpro.db\")\r\n return db\r\n end", "def connection; end", "def connection; end", "def connection; end", "def connection; end", "def connection; end", "def connection; end", "def connection; end", "def connection; end", "def use(args)\n @dbh.select_db(args[:db_name])\n end", "def set_up_database(company_code)\n ActiveRecord::Base.clear_all_connections!\n if company_code == \"MKH001\"\n ActiveRecord::Base.establish_connection(DB1_CONF)\n $logged_in_database = DB1_CONF\n $municipality_info = MasterSetup.first\n end\n if company_code == \"DEV001\"\n ActiveRecord::Base.establish_connection(:production) if Rails.env.production?\n ActiveRecord::Base.establish_connection(:development) if Rails.env.development?\n $logged_in_database = :production if Rails.env.production?\n $logged_in_database = :development if Rails.env.development\n $municipality_info = MasterSetup.first\n end\n if company_code == \"SAK001\"\n ActiveRecord::Base.establish_connection(DB2_CONF)\n $logged_in_database = DB2_CONF\n $municipality_info = MasterSetup.first\n end\n if company_code == \"LPN001\"\n ActiveRecord::Base.establish_connection(DB3_CONF)\n $logged_in_database = DB3_CONF\n $municipality_info = MasterSetup.first\n end\n\t if company_code == \"ENG001\"\n ActiveRecord::Base.establish_connection(DB4_CONF)\n $logged_in_database = DB4_CONF\n $municipality_info = MasterSetup.first\n end\n if company_code != \"MKH001\" && company_code != \"SAK001\" && company_code != \"DEV001\" && company_code != \"ENG001\"\n ActiveRecord::Base.clear_all_connections!\n end\n end", "def connect(opts={})\n\n\t\treturn false if not @usable\n\n\t\tnopts = opts.dup\n\t\tif (nopts['port'])\n\t\t\tnopts['port'] = nopts['port'].to_i\n\t\tend\n\n\t\tnopts['pool'] = 256\n\n\t\tbegin\n\t\t\tcreate_db(nopts)\n\n\t\t\t# Configure the database adapter\n\t\t\tActiveRecord::Base.establish_connection(nopts)\n\n\t\t\t# Migrate the database, if needed\n\t\t\tmigrate\n\n\t\t\t# Set the default workspace\n\t\t\tframework.db.workspace = framework.db.default_workspace\n\t\trescue ::Exception => e\n\t\t\tself.error = e\n\t\t\telog(\"DB.connect threw an exception: #{e}\")\n\t\t\tdlog(\"Call stack: #{[email protected]\"\\n\"}\", LEV_1)\n\t\t\treturn false\n\t\tensure\n\t\t\t# Database drivers can reset our KCODE, do not let them\n\t\t\t$KCODE = 'NONE' if RUBY_VERSION =~ /^1\\.8\\./\n\t\tend\n\n\tend", "def db; end", "def db; end", "def resolve_database\n # let user choose where database is\n ## mysql is installed with root user without pass\n # TODO add more database types as well 'postgres'\n database = prompt(\"1\", \"Where database should be stored? \\n1: Same VPS\\n Other options not available now\\n\")\n if database == \"1\"\n @app_config.write(\"database\", \"current_vps\")\n else\n puts \"You chose invalid option!\" && abort\n end\n end" ]
[ "0.69481665", "0.6849301", "0.6827265", "0.6797318", "0.67589647", "0.67538077", "0.6753482", "0.6731647", "0.6726412", "0.6726412", "0.66784143", "0.6668217", "0.6658907", "0.66548544", "0.6631353", "0.6602661", "0.6557693", "0.65363544", "0.65360683", "0.65206105", "0.6496831", "0.648267", "0.64676636", "0.6427652", "0.63738257", "0.63713485", "0.6357112", "0.635589", "0.6338264", "0.63366824", "0.6335155", "0.63159865", "0.63159865", "0.63012666", "0.62923455", "0.6283924", "0.62814075", "0.62243795", "0.62094086", "0.619166", "0.6175634", "0.6157742", "0.61363465", "0.61261743", "0.61136883", "0.6103733", "0.60937417", "0.6082464", "0.6065993", "0.60600126", "0.6038592", "0.60337937", "0.5993542", "0.59786373", "0.5970531", "0.5965689", "0.5956473", "0.5955326", "0.59354144", "0.5919043", "0.59158784", "0.59142864", "0.58878446", "0.58809566", "0.5877597", "0.5877309", "0.5874791", "0.5869935", "0.5869515", "0.58643603", "0.585876", "0.5853468", "0.5848688", "0.5837281", "0.58361614", "0.582139", "0.58202887", "0.58121794", "0.57993656", "0.5774542", "0.57682717", "0.575693", "0.57422847", "0.5733971", "0.57322407", "0.5728368", "0.5724817", "0.5724817", "0.5724817", "0.5724817", "0.5724817", "0.5724817", "0.5724817", "0.5724817", "0.57056296", "0.5700075", "0.568771", "0.5684959", "0.5684959", "0.5682788" ]
0.6884676
1
This function displays the contents of the database
def display_contents # Open connection db = open_connection begin # Set results equal to the result of the MySQL query results = db.query "SELECT * FROM #{$db_name}.#{$db_table_name}" puts "Number of items: #{results.num_rows}" puts "+----------------+---------------------------------+-----------------+----------+---------+-----------------------------+" puts "| Barcode".ljust(17) + "| Item Name:".ljust(34) + "| Item Category".ljust(18) + "| Quantity".ljust(11) + "| Price".ljust(10) + "| Description".ljust(29) + " |" puts "+----------------+---------------------------------+-----------------+----------+---------+-----------------------------+" # Loop through the results and output the data results.each_hash do |item| print "| #{item['Barcode']}".ljust(17) print "| #{item['ItemName']}".ljust(34) print "| #{item['ItemCategory']}".ljust(18) print "| #{item['Quantity']}".ljust(11) print "| #{item['Price']}".ljust(10) print "| #{item['Description']}".ljust(29) + " |" print "\n" end puts "+----------------+---------------------------------+-----------------+----------+---------+-----------------------------+" results.free rescue abort "Could not retrieve information from database. Ensure that table name has been entered properly." ensure db.close end home_screen end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_entries(db)\n\tentries = db.execute(\"SELECT * FROM books\")\n\tif entries == []\n\t\tputs \"You have zero logged books!\"\n\t\tputs\n\telse\n\t\tentries.each do |book|\n\t \t\tputs \"#{book['id']}. #{book['book_name']} by #{book['author']}\"\n\t \t\tputs \"\tPublished: #{book['year_pubished']}, Reading status: #{book['read']} pages read.\"\n\t \t\tputs \" \tGenre: #{book['genre']}\"\n\t \t\tputs \"\tYour rating: #{book['rating']} out 10.\"\n\t \t\tputs\n\t\tend\n\tend\nend", "def view_database\n table_html = '<a href=\"/admin\"> << back to index</a>'\n table_names = ActiveRecord::Base.connection.tables.delete_if { |x| x == 'schema_migrations' }\n table_names.sort.each do |name|\n table_name = \"#{name.titleize.gsub(' ', '').singularize}\"\n table_data = eval(\"#{table_name}.all\")\n\n table_html << \"<h2 style='border-bottom: solid;background-color: lightBlue;'>#{table_name}<a href='/admin/delete_db_view_data/#{table_name}' class='btn btn-large btn-primary' style='float:right'>Delete All</a></h2>\"\n table_data.each do |row|\n table_html << \"<ul style='border: 3px dotted'>\"\n row.attributes.each do |column_name, column_data|\n table_html << \"<li>#{column_name} : #{column_data}</li>\"\n end\n table_html << \"<li><a href='/admin/delete_db_view_record/#{table_name}_#{row.id}' class='btn btn-large btn-primary' style='font-size:20px;'>[Delete Record]</a></li></ul>\"\n end\n\n end\n render :text => table_html\n end", "def db_printer(database)\n my_database_printout = database.execute(\"SELECT * FROM wine_cellar\") # Note that you don't need the semicolon!\n puts \"\\nHere is your current wine list:\\n\" + \"=\"*30 + \"\\n\\n\"\n my_database_printout.each {|data_item| puts \"Item No. #{data_item[0]}: #{data_item[1]} -- #{data_item[2]} -- #{data_item[3]} -- #{data_item[4]}\"}\nend", "def show_list(db)\n\tcurrent_list = db.execute(\"Select * FROM list\")\n\tcurrent_list.each do |row|\n\tputs \"ID: #{row['id']} | #{row['name']} | #{row['gift']} | #{row['price']}\"\n\tend\n\tputs \"---------------------------\"\nend", "def display_contents(everything)\n\t# Open database connection\n\tdb = open_connection\n\tif (everything == true)\n\t\tif (ARGV[1] == nil) # if no file was specified, output to screen\n\t\t\tbegin\n\t\t\t\t# Set results equal to the result of the MySQL query\n\t\t\t\tresults = db.query \"SELECT * FROM #{$db_name}.#{$db_table_name}\"\n\t\t\t\tputs \"\\nNumber of items: #{results.num_rows}\"\n\n\t\t\t\tputs \"+----------------+---------------------------------+-----------------+----------+---------+-----------------------------+\"\n\t\t\t\tputs \"| Barcode\".ljust(17) + \"| Item Name:\".ljust(34) + \n\t\t\t\t\t\"| Item Category\".ljust(18) + \"| Quantity\".ljust(11) + \n\t\t\t\t\t\"| Price\".ljust(10) + \"| Description\".ljust(29) + \" |\"\n\t\t\t\tputs \"+----------------+---------------------------------+-----------------+----------+---------+-----------------------------+\"\n\t\t\t\t# Loop through the results and output the data\n\t\t\t\tresults.each_hash do |item|\n\t\t\t\t\tprint \"| #{item['Barcode']}\".ljust(17)\n\t\t\t\t\tprint \"| #{item['ItemName']}\".ljust(34)\n\t\t\t\t\tprint \"| #{item['ItemCategory']}\".ljust(18)\n\t\t\t\t\tprint \"| #{item['Quantity']}\".ljust(11)\n\t\t\t\t\tprint \"| #{item['Price']}\".ljust(10)\n\t\t\t\t\tprint \"| #{item['Description']}\".ljust(29) + \" |\"\n\t\t\t\t\tprint \"\\n\"\n\t\t\t\tend\n\t\t\t\tputs \"+----------------+---------------------------------+-----------------+----------+---------+-----------------------------+\"\n\t\t\t\tprint \"\\n\"\n\t\t\t\tresults.free\n\t\t\trescue\n\t\t\t\tabort \"Could not retrieve information from database. Ensure that table name has been entered properly.\"\n\t\t\tensure\n\t\t\t\tdb.close\n\t\t\tend\n\t\telse # output to a file\n\t\t\t# set the filename and check if it is a TSV file\n\t\t\tnew_filename = ARGV[1].to_s\n\t\t\tif (new_filename.end_with?(\".tsv\"))\n\t\t\t\t# query the database\n\t\t\t\tdatabase_contents = db.query \"SELECT * FROM #{$db_name}.#{$db_table_name}\"\n\t\t\t\t# create/open the file for writing and add the database contents to it\n\t\t\t\tCSV.open(new_filename, \"w\", {:col_sep => \"\\t\"}) do |csv|\n\t\t\t\t\tdatabase_contents.each_hash do |a|\n\t\t\t\t\t csv << [a['Barcode'], a['ItemName'], a['ItemCategory'], a['Quantity'], a['Price'], a['Description']]\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tputs \"File was successfully created!\"\n\t\t\telse # give an error\n\t\t\t\tabort \"Invalid file format – unable to proceed.\"\n\t\t\tend\n\t\tend\n\telsif (everything == false)\n\t\tif (ARGV[1] == nil) # if no file specified output to screen\n\t\t\tbegin\n\t\t\t\t# Set results equal to the result of the MySQL query\n\t\t\t\tresults = db.query \"SELECT * FROM #{$db_name}.#{$db_table_name} WHERE Quantity=0\"\n\t\t\t\tputs \"\\nNumber of items: #{results.num_rows}\"\n\n\t\t\t\tputs \"+----------------+---------------------------------+-----------------+----------+---------+-----------------------------+\"\n\t\t\t\tputs \"| Barcode\".ljust(17) + \"| Item Name:\".ljust(34) + \n\t\t\t\t\t\"| Item Category\".ljust(18) + \"| Quantity\".ljust(11) + \n\t\t\t\t\t\"| Price\".ljust(10) + \"| Description\".ljust(29) + \" |\"\n\t\t\t\tputs \"+----------------+---------------------------------+-----------------+----------+---------+-----------------------------+\"\n\t\t\t\t# Loop through the results and output the data\n\t\t\t\tresults.each_hash do |item|\n\t\t\t\t\tprint \"| #{item['Barcode']}\".ljust(17)\n\t\t\t\t\tprint \"| #{item['ItemName']}\".ljust(34)\n\t\t\t\t\tprint \"| #{item['ItemCategory']}\".ljust(18)\n\t\t\t\t\tprint \"| #{item['Quantity']}\".ljust(11)\n\t\t\t\t\tprint \"| #{item['Price']}\".ljust(10)\n\t\t\t\t\tprint \"| #{item['Description']}\".ljust(29) + \" |\"\n\t\t\t\t\tprint \"\\n\"\n\t\t\t\tend\n\t\t\t\tputs \"+----------------+---------------------------------+-----------------+----------+---------+-----------------------------+\"\n\t\t\t\tprint \"\\n\"\n\t\t\t\tresults.free\n\t\t\trescue\n\t\t\t\tabort \"Could not retrieve information from database. Ensure that table name has been entered properly.\"\n\t\t\tensure\n\t\t\t\tdb.close\n\t\t\tend\n\t\telse # output to a file\n\t\t\t# set the filename and check if it is a TSV file\n\t\t\tnew_filename = ARGV[1].to_s\n\t\t\tif (new_filename.end_with?(\".tsv\"))\n\t\t\t\t# create/open the file for writing and append it with the\n\t\t\t\t# contents of the array\n\t\t\t\tdatabase_contents = db.query \"SELECT * FROM #{$db_name}.#{$db_table_name} WHERE Quantity=0\"\n\t\t\t\tCSV.open(new_filename, \"w\", {:col_sep => \"\\t\"}) do |csv|\n\t\t\t\t\tdatabase_contents.each_hash do |a|\n\t\t\t\t\t csv << [a['Barcode'], a['ItemName'], a['ItemCategory'], a['Quantity'], a['Price'], a['Description']]\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tputs \"File was successfully created!\"\n\t\t\telse # give an error\n\t\t\t\tabort \"Invalid file format – unable to proceed.\"\n\t\t\tend\n\t\tend\n\tend\nend", "def show\n @contents = DataTable.all\n\n \n end", "def display_students(database)\r\n\tstudents = database.execute(\"SELECT * FROM students\")\r\n\tstudents.each do |student|\r\n\t\tputs \"ID: #{student[0]} Name: #{student[1]}\"\r\n\tend\r\nend", "def viewContacts(db)\r\n\tputs \"-----------------------Contacts---------------------------\"\r\n\tcontact = db.execute(\"SELECT * FROM contacts ORDER BY name\")\r\n\tcontact.each do |entry|\r\n\t\tputs \"----------------------------------------------------------\"\r\n\t \tputs \"| Name: #{entry['name']}\"\r\n\t \tputs \"| ID: #{entry['id']}\" \r\n\t puts \"| Phone: #{entry['phone']}\"\r\n\t puts \"| Address: #{entry['address']}\"\r\n\t puts \"----------------------------------------------------------\"\r\n\t puts \"\"\r\n\t \tend\r\nend", "def display_subjects(database)\r\n\tsubjects = database.execute(\"SELECT * FROM subjects\")\r\n\tsubjects.each do |subject|\r\n\t\tputs \"ID: #{subject[0]} Subject: #{subject[1]}\"\r\n\tend\r\nend", "def print_list(database)\n\tfull_database = database.execute(\"SELECT * FROM restaurants ORDER BY name\")\n\tprint(full_database)\n\tdatabase\nend", "def showTable(db, flag)\n fieldNames = db.fields \n rows = db.data\n \n case(flag)\n when \"f\" then puts(\"*** Field Names #{fieldNames.length} *** \\n\", fieldNames, \"\\n\")\n when \"r\" then puts(\"*** Records *** \\n\", rows)\n when \"p\" then print(\"*** Records *** \\n\", rows) #debug\n end\nend", "def overview(db)\n\toverview = db.execute(\"CREATE VIEW [Your top books!] AS SELECT book_name, author FROM books where rating > 3\")\n\treturn overview\nend", "def display_artists(db)\n\tputs \"The artists are:\"\n\tputs \"----------------\"\n\tartists_list = db.execute(\"SELECT * FROM artists;\")\n\tartists_list.each do |artist|\n\t\tputs \"Artist's Name: #{artist['artist_name']} ; Language is #{artist['language']}\"\n\tend\nend", "def display\n\t\tdisplay_headers\n\t\[email protected] do |row|\n\t\t\tdisplay_row(row)\n\t\tend\n\tend", "def view_test_data(db)\n\ttest_data = db.execute(\"SELECT * FROM test_data\")\n\ttest_data.each do |test_data|\n\tputs \" #{test_data['first_name']} #{test_data['last_name']} is #{test_data['age']} years old, #{test_data['gender']}, and #{test_data['ethnicity']}. #{test_data['customer']}\"\n\tend\nend", "def show\n\n p \"---------\"\n p @contents\n\n end", "def display_playlist(db)\n\tputs \"The playlists are:\"\n\tputs \"------------------\"\n\tlist = db.execute(\"SELECT * FROM playlist;\")\n\tlist.each do |play_list|\n\t\tputs \"Playlist ID: #{play_list['playlist_id']} ; Playlist Name: #{play_list['playlist_name']}\"\n\tend\nend", "def display_songlist(db)\n\tputs \"The songs are:\"\n\tputs \"--------------\"\n\tsongs = db.execute(\"SELECT * FROM songlist;\")\n\tsongs.each do |song|\n\t\tputs \"SONG ID: #{song['song_no']} SONG NAME: #{song['song_name']}.\"\n\tend\nend", "def display_students_db\n all_students = @conn.exec(\"SELECT * FROM students_db;\")\n #usp[e exec to pretty much do everything\n all_students.each do |student|\n student.each do |k,v|\n puts \"#{k}: #{v}\"\n puts all_students\n end\n end\nend", "def show\n @database = Database.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @database }\n end\n end", "def show_db\n \t\n @tab = \"macro\" \n @sub = \"db\" \t\n \t\n @db = Macroval.all\n end", "def display(db)\r\n\tputs \"ID Title Year New? MarketValue System\"\r\n\tputs \"-\" * 75\r\n\tgames = db.execute(\"SELECT * FROM games\")\r\n\tgames.each do |game|\r\n\t\tsys = db.execute(\"SELECT name FROM systems WHERE id=?\", game[2])\r\n\t\tunopened = \"N\" if game[4] == 0\r\n\t\tunopened = \"Y\" if game[4] == 1\r\n\t\tputs \"[#{game[0]}] #{game[1].ljust(25)} #{game[3]} #{unopened.ljust(5)} #{game[5].to_s.ljust(12)} #{sys[0][0]}\"\r\n\tend\t\r\nend", "def display_users(db)\n\tputs \"First name and last name of the users.\"\n\tputs \"--------------------------------------\"\n\tname = db.execute(\"SELECT * FROM users;\")\n\tname.each do |user|\n\t\tputs \"Fisrt name: #{user['first_name']} and last name: #{user['last_name']}. #{ user['is_artist'] == 'true' ? 'This user is an artist.' : 'This user is not an artist.' }\"\n\tend\nend", "def show\n @database = Database.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json=> @database }\n end\n end", "def display_tasks(db)\n tasks = db.execute(\"SELECT * FROM list\")\n tasks.each do |item|\n puts \"ID: #{item[0]} To do: #{item[1]} Due: #{item[2]} Notes: #{item[3]}\"\n end\nend", "def summ_contents(db)\n\tsumm_entries = db.execute(\"SELECT * FROM books\")\n\tif summ_entries == []\n\t\tputs \"You have zero logged books!\"\n\t\tputs\n\telse\n\t\tsumm_entries.each do |book|\n\t \t\tputs \"#{book['book_name']}\"\n\t\tend\n\tend\nend", "def display\n print_out = $db.execute(\"SELECT Exercise.name, Workouts.date, Workouts.weight FROM Workouts JOIN Exercise ON Exercise.id = Workouts.exercise_id \")\n #print print_out\n puts \"Date: #{print_out[0][1]}\"\n puts \"Exercise: #{print_out[0][0]}\"\n\nend", "def printAll( foodDB )\n puts \"\\nThere are currently #{foodDB.size} entries in the database.\\n\\n\"\n puts foodDB.printAll\nend", "def show\n @database = Database.find(params[:id])\n @users = @database.users.collect { |id| User.find_by_id(id) }\n respond_to do |format|\n format.html # show.html.erb\n end\n end", "def info\n specified_db_or_all { |db| display_db_info db }\n end", "def info\n specified_db_or_all { |db| display_db_info db }\n end", "def view_all(db, user_id)\n results = db.execute(\"SELECT exercises.name, exercises_users.reps, exercises_users.weight \n FROM users \n JOIN exercises_users ON users.id = exercises_users.user_id \n JOIN exercises ON exercises_users.exercise_id = exercises.id WHERE users.id = ?\", [user_id])\n results.each do |info_array|\n puts \"#{info_array[0]}:\\t #{info_array[1]} reps\\t #{info_array[2]} pounds\"\n end\nend", "def apt_viewer(db)\n apts = db.execute(\"SELECT * FROM apt_list\")\n apts.each do |apt|\n puts \"\\n\\nApt #{apt['id']}) #{apt['name']}, located at #{apt['address']} is rated #{apt['rating']} because #{apt['comments']}.\\nThe monthly rent is in the range of #{apt['rent_range']} and includes #{apt['amenities']} with an average rush-hour commute time of #{apt['commute']} minutes.\"\n end\nend", "def print_database(database)\n\t\tdatabase.each do |key,info_dict| \n\t\t\tputs 'key:'+key\n\t\t\tinfo_dict.each do |movie_id,rate|\n\t\t\t\tprint movie_id+' '\n\t\t\t\tputs rate+' '\t\n\t\t\tend\n\t\tend\n\tend", "def show\n @bdatabase = Bdatabase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bdatabase }\n end\n end", "def display_one(db, id)\r\n\tputs \"ID Title Year New? MarketValue System\"\r\n\tputs \"-\" * 75\r\n\tgame_entry = db.execute(\"SELECT * FROM games WHERE id=?\", id)\r\n\tgame = game_entry[0]\r\n\tsys = db.execute(\"SELECT name FROM systems WHERE id=?\", game[2])\r\n\tunopened = \"N\" if game[4] == 0\r\n\tunopened = \"Y\" if game[4] == 1\r\n\tputs \"[#{game[0]}] #{game[1].ljust(25)} #{game[3]} #{unopened.ljust(5)} #{game[5].to_s.ljust(12)} #{sys[0][0]}\"\r\nend", "def display_food_log(db)\n food_data = db.execute(\"SELECT * FROM food_log\")\n food_data.each do |macros|\n puts \"On #{macros['date']} you ate #{macros['total_calories']} calories, #{macros['total_fat']} grams of fat, #{macros['total_carbs']} #{macros['total_carbs']} grams of carbohydrates, and #{macros['total_protein']} grams of protein.\"\n end\n\nend", "def print_full(db)\n\tprint_todo_list(db)\n\ttodo_list = db.execute(\"SELECT * FROM todo JOIN activities \n\t\tON activities.id = todo.activity_id AND todo.done='true'\")\n\ttodo_list.each { |act| puts \"#{act['name']} - COMPLETE\" }\nend", "def display_post\n\t\tputs \" \"\n\t\tputs \"#{@title} #{@date}\"\n\t\tputs \"----------------\"\n\t\tputs @content\n\t\tputs \"----------------\"\n\t\tputs \" \"\n\tend", "def view args\n db = get_db\n id = args[0].nil? ? db.max_bug_id : args[0]\n db, row = validate_id id\n die \"No data found for #{id}\" unless row\n puts \"[#{row['type']} \\##{row['id']}] #{row['title']}\"\n puts \"Description:\"\n puts Cmdapp.indent(row['description'],3) if row['description']\n puts \"\\nAdded by #{row['created_by']} on #{row['date_created']}. Updated #{row['date_modified']}.\"\n comment_count = 0\n #puts row\n row.each_pair { |name, val| \n x = (name =~ /[A-Za-z]/)\n next unless x # 2011-09-21 skip names that are just numbers\n next if name == \"project\" && !$use_project\n next if name == \"version\" && !$use_version\n next if name == \"component\" && !$use_component\n next if %w{ id title description created_by date_created date_modified }.include? name\n comment_count = val.to_i if name == \"comment_count\"\n val = Cmdapp.indent2(val, 18) if name == \"fix\"\n n = sprintf(\"%-15s\", name); \n puts \"#{n} : #{val}\" \n }\n puts\n if comment_count > 0\n puts \"Comments :\"\n ctr = 0\n db.select_where \"comments\", \"id\", id do |r|\n #puts \"(#{r['date_created']}) [ #{r['created_by']} ] #{r['comment']}\"\n ctr += 1\n puts \"------- (#{r['date_created']}) #{r['created_by']} (#{ctr})------\"\n puts r['comment']\n end\n puts\n end\n puts \"Log:\"\n ctr = 0\n db.select_where \"log\", \"id\", id do |r|\n ctr += 1\n #puts \"------- (#{r['date_created']}) #{r['created_by']} ------\"\n puts \"------- #{r['date_created']} - #{r['created_by']} (#{ctr})------\"\n puts \" * [#{r['field']}]: #{r['log']} \"\n end\n #pp r\n end", "def show\n @database = Database.find(params[:id])\n @database.refresh_database_state\n \n # If the rds was restored from a snapshot, a few fields have to be modify after becomes available: security_groups, password, size\n @database_client = @database.sync_agi_fields_to_rds unless @database.snapshot_id.blank?\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @database }\n end\n end", "def show\n if is_admin?\n @database = Database.find(params[:id])\n else\n @database = current_user.databases.find(params[:id])\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @database }\n end\n end", "def view_contact_list(list)\n list = list.execute(\"SELECT * FROM contacts\")\n\n list.each do |item|\n puts \"name: #{item[1]}\"\n puts \"occupation: #{item[2]} - association: #{item[3]}\"\n puts \"email: #{item[4]} - phone:#{item[5]}\"\n puts \"-------------------\"\n end\nend", "def view_menu(db)\n menu_one = db.execute(\"SELECT menu.menu_id, appetizers.appetizer_name, appetizers.appetizer_description, main_course.name, main_course.main_course_descr, dessert.dessert_name, dessert.dessert_description\n FROM appetizers, main_course, dessert JOIN menu ON (menu.app_id = appetizers.appetizer_id AND menu.main_courses_id = main_course.main_course_id AND menu.desserts_id = dessert.dessert_id)\")\n response = \"\"\n menu_one.each do |menu_item|\n response << \"Appetizer: #{menu_item['appetizer_name']}, \"\n response << \"Appetizer description: #{menu_item['appetizer_description']}, \"\n response << \"Main course: #{menu_item['name']}, \"\n response << \"Main course description: #{menu_item['main_course_descr']}, \"\n response << \"Dessert: #{menu_item['dessert_name']}, \"\n response << \"Dessert description: #{menu_item['dessert_description']} \"\n end\n response\nend", "def print_list(db, table_name)\n\tputs \"Your current to do list:\"\n\ttasks = db.execute(\"SELECT * FROM #{table_name}\")\n\ttasks.each do |task|\n\t\tputs \"Task: #{task['id']} is #{task['task_name']} and will take #{task['task_time']} hours. It is #{task['importance']}/10 important.\"\n\t\tputs\n\tend\nend", "def show\n @sequence_database = SequenceDatabase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sequence_database }\n end\n end", "def print_table(db, title, rating, comments)\r\n\t\tputs \" - - Title - - Rating - - Comments--\"\r\n\t\tmovie = db.execute(\"SELECT * FROM movies ORDER BY rating ASC\")\r\n\t\tmovie.each do |mov|\r\n\t\t\tprintf \" * %-13s| %-4s| %-5s\\n\", \"#{mov['title']}\", \"#{mov['rating']}\", \"#{mov['comments']}\"\r\n\t\tend\r\n\t\tputs\"-\"*60\r\n\tend", "def display_songs_and_playlists(db)\n\tputs \"The song names with their playlist names\"\n\tputs \"----------------------------------------\"\n\tsong_playlist = db.execute(\"SELECT song_name,playlist_name FROM songlist INNER JOIN playlist USING (playlist_id) ORDER BY songlist.song_no;\")\n\tsong_playlist.each do |song|\n\t\tputs \"The Song is #{song['song_name']} and it is under the playlist name : #{song['playlist_name']}.\"\n\tend\nend", "def print_todo_list(db)\n\ttodo_list = db.execute(\"SELECT * FROM todo JOIN activities \n\t\tON activities.id = todo.activity_id AND todo.done='false'\")\n\ttoday = Time.new.strftime(\"%B %d, %Y\")\n\tputs \"\\nYour daily To-Do List for #{today}:\"\n\tputs '*~'*20+'*'\n\ttodo_list.each { |act| puts act['name'] }\nend", "def display\n puts \"Title: #{@title}\"\n puts \"Author: #{@author}\"\n puts \"Price: #{@price}\"\n end", "def menu\n \n #display menu to user\n [email protected](\"select * from product_storage\")\n rows=[]\n table=Terminal::Table.new\n table.headings=[\"product Id\",\" Name\",\" quantitty\",\"Price\"]\n\n while res3=res15.fetch_row do\n\n rows<<[res3[0],res3[1],res3[2],res3[3]] \n end\n\n table.rows=rows\n puts \"\\n#{table}\"\n\n businesslogic\n end", "def display_training(db)\n training_data = db.execute(\"SELECT food_log.date, food_log.total_calories, food_log.total_fat, food_log.total_carbs, food_log.total_protein, lifting.body_weight, lifting.squats, lifting.bench_press, lifting.overhead_press, lifting.deadlifts, lifting.power_cleans FROM food_log JOIN lifting ON food_log.date = lifting.date;\")\n training_data.each do |training|\n print \"On #{training['date']} you ate #{training['total_calories']} calories, #{training['total_fat']} grams of fat, #{training['total_carbs']} grams of carbohydrates, and #{training['total_protein']} grams of protein.\"\n if training['body_weight'] != nil\n puts \"You also trained that day! You weighed #{training['body_weight']}. These we're your lifts for the day:\"\n puts \"You squatted #{training['squats']}lbs \" if training['squats'] != \"\"\n puts \"You benched #{training['bench_press']} lbs\" if training['bench_press'] != \"\"\n puts \"You pressed #{training['overhead_press']} lbs\" if training['overhead_press'] != \"\"\n puts \"You deadlifted #{training['deadlifts']} lbs\" if training['deadlifts'] != \"\"\n puts \"You power cleaned #{training['power_cleans']} lbs\" if training['power_cleans'] != \"\"\n end\n end\nend", "def show\n @table_header = @project.table_header\n @records = @project.get_table_class.all\n end", "def show\n\t\t#no need b/c we just show all at once\n\tend", "def pp_data(db, table, data = nil)\n if data == nil\n data = view_table(db, table)\n end\n pp_string = ''\n\n data.each do |entry|\n entry.each do |id, val| \n if id.is_a? String\n pp_string += \"#{id}: #{val}\\t| \" \n end \n end\n pp_string += \"\\n\"\n end\n pp_string\nend", "def show_post(params)\n db = SQLite3::Database.new(\"db/database.db\")\n db.results_as_hash = true\n\n params[\"UId_P\"] = db.execute(\"SELECT posts.UserIdP FROM posts WHERE PostId = ?\", params[\"postId\"])\n params[\"PostText\"] = db.execute(\"SELECT posts.Text FROM posts WHERE PostId = ?\", params[\"postId\"])\n params[\"upvotes\"] = db.execute(\"SELECT posts.Upvotes FROM posts WHERE PostId = ?\", params[\"postId\"])\n params[\"post_creator\"] = db.execute(\"SELECT users.Username FROM users WHERE UserId = ?\", params[\"UId_P\"][0][\"UserIdP\"])\n\n return params[\"PostText\"], params[\"post_creator\"], params[\"upvotes\"], params[\"UId_P\"], params[\"postId\"]\n end", "def show\n\t\t end", "def opendb\n db = Rho::Database.new(Rho::Application.databaseFilePath('local'), 'local')\n render :json => db.to_s\n return db.to_s\n end", "def show\n \n end", "def show\n \n end", "def show\t\t\t\t\n\t\t\tend", "def show\n raise ArgumentError.new(\"There is no image\") if self.data == []\n (0...self.data.row_count).each do |i|\n puts self.data.row(i).to_a.join\n end\n end", "def display_branch_list\n table = build_table_view\n\n puts \"\\n\\n\"\n puts table\n end", "def view(options = {})\n\t \tget_records('-view', {}, options)\n\t end", "def show\n if current_user.present?\n @table = ::Table.get_by_id(params[:id], current_user)\n respond_to do |format|\n format.html\n download_formats @table, format\n end\n else\n redirect_to CartoDB.path(self, 'public_table', { id: params[:id], :format => params[:format] })\n end\n end", "def show_tables\r\n tables = Document.new(self).get_tables\r\n puts \"There are #{tables.length} tables\"\r\n index = 1\r\n tables.each do |l|\r\n puts \"table: id: #{l.id}\"\r\n puts \" rows: #{l.row_count}\"\r\n puts \" columns: #{l.column_count}\"\r\n puts \" index: #{index}\"\r\n index += 1\r\n end\r\n end", "def show\n @importtodb = Importtodb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @importtodb }\n end\n end", "def view\n @board.each { |row| puts row.join('') }\n end", "def print_smartphones(db)\n\tsmartphone = db.execute(\"SELECT * FROM smartphones\")\n\n\t\n\tputs \"Name\\tManufacturer\\tOS\"\n\tputs \"____\\t____________\\t__\"\n\tindexI = 0\n\twhile indexI < smartphone.length\n\n\t\tputs smartphone[indexI][0].to_s + \"\\t\" + smartphone[indexI][1].to_s + \"\\t\" + smartphone[indexI][2].to_s\n\t\tindexI = indexI + 1\n\tend\n\n\tputs \"-----------------------------------------------\"\nend", "def show\n @testdb = Testdb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @testdb }\n end\n end", "def show_all_incidents(db)\n\tputs \"Previously reported incidents:\"\n\tputs db.execute(\"SELECT agency_name, description, location, incident_date, incident_time FROM incidents\")\n\nend", "def print_activities(db)\n\ttodo_list = db.execute(\"SELECT * FROM activities\")\n\tputs \"\\nHere are the available activities:\"\n\tputs '*~'*20+'*'\n\t# is_included = to show if the activity is in the todolist\n\ttodo_list.each { |act| puts \"#{act['id']} - #{act['name']}\" }\nend", "def db_list(exp = nil)\n @lastaction = \"db_list\"\n @force_no_grid_xml = true\n model = case @sb[:active_tab] # Build view based on tab selected\n when \"db_connections\" then VmdbDatabaseConnection\n when \"db_details\" then VmdbTableEvm\n when \"db_indexes\" then VmdbIndex\n when \"db_settings\" then VmdbDatabaseSetting\n end\n\n if model == VmdbIndex\n # building a filter with expression to show VmdbTableEvm tables only\n exp = MiqExpression.new(\n \"and\" => [\n {\n \"=\" => {\n \"value\" => \"VmdbTableEvm\",\n \"field\" => \"VmdbIndex.vmdb_table-type\"\n }\n }\n ]\n )\n elsif model == VmdbDatabaseConnection\n @zones = Zone.visible.order(:name).collect { |z| [z.name, z.name] }\n # for now we dont need this pulldown, need to get a method that gives us a list of workers for filter pulldown\n # @workers = MiqWorker.all.sort_by(&:type).collect { |w| [w.friendly_name, w.id] }\n end\n\n @view, @pages = get_view(model, :filter => exp ? exp : nil) # Get the records (into a view) and the paginator\n\n @no_checkboxes = true\n @showlinks = true # Need to set @showlinks if @no_checkboxes is set to true\n @current_page = @pages[:current] unless @pages.nil? # save the current page number\n\n if @show_list\n update_gtl_div('db_list') if params[:action] == \"list_view_filter\" || pagination_or_gtl_request?\n end\n end", "def display_question(id)\n\n puts \"we are in the display question function\"\n # connection.exec( \"SELECT question FROM questions WHERE id = #{id}\" ) do |result|\n # puts \"ID | Title\"\n # result.each do |row|\n # puts \" %s | %s\" % row.values_at('id', 'question')\n # end\n # end\n\n\n end", "def show\n unless @table.has_resource_label?\n @table.resource_label = @table.resource_label_default\n @table.save\n end\n\n @columns = columns(@table)\n\n @page = TogodbPage.find_by_table_id(@table.id)\n unless @page\n @page = create_page\n end\n\n set_metadata(@table)\n set_roles(@table)\n\n @column = TogodbColumn.new(table_id: @table.id)\n set_datasets\n\n @tables = @user.configurable_tables\n @class_map = ClassMap.by_table(@table)\n end", "def show(account)\n matches = @db.find(account)\n if matches.size > 0 then\n matches.each_with_index do |match,i|\n hsay \"#{sprintf(\"%3d\",i + 1)}. #{match.title}\", :header\n max_name_length = match.max_field_length + 1\n match.each do |name,value|\n next if name == \"title\"\n next if value.length == 0\n\n name_out = name.rjust(max_name_length)\n @highline.say(\"<%= color(%Q{#{name_out}}, :name) %> <%= color(':',:separator) %> \")\n\n if match.private_field?(name) then\n @highline.ask(\n \"<%= color(%Q{#{value}},:private) %> <%= color('(press any key).', :prompt) %> \"\n ) do |q|\n q.overwrite = true\n q.echo = false\n q.character = true\n end\n\n @highline.say(\"<%= color(%Q{#{name_out}}, :name) %> <%= color(':',:separator) %> <%= color('#{'*' * 20}', :private) %>\")\n else\n hsay value, :value\n end\n end\n @stdout.puts\n end\n else\n hsay \"No matching records were found.\", :information\n end\n end", "def show_board\n @display.each do |row|\n puts row.join(' ')\n end\n end", "def show\n puts '* database name, @dbname = ' + @dbname\n puts '* which belongs to database set name, @dsname = ' + @ds.dsname\n puts '* Now calling all entity sets to display themselves.....'\n if @hes\n @hes.each_value{|x| x.show}\n else\n puts 'No entity set to show'\n end # if\n \n if @hrs.size > 0\n puts '***** Now calling all relationship sets to display themselves.....'\n @hrs.each_value{|y| y.show}\n else\n puts 'RELATIONSHIP SETS? No relationship set exists in this database.'\n end # if\n end", "def show\n @helpdb = Helpdb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @helpdb }\n end\n end", "def view_table(db, table)\n db.execute(\"SELECT * FROM #{table}\")\nend", "def print_list(db, current_user)\r\n results = db.execute(\"SELECT * FROM items WHERE user_id = ?\", [current_user])\r\n results.each do |item|\r\n puts \"#{item[1]} x#{item[2]}\"\r\n end\r\nend", "def show\n # turn ruby database into json\n # route to the project 3 page with this json\n # id = 1\n end", "def show\n\t end", "def show\n @reference_database = ReferenceDatabase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reference_database }\n end\n end", "def show\n\t\t\n\tend", "def show\n\t\t\n\tend", "def show\n\t\t\n\tend", "def all_movies\n sql = %Q[\n select title from #{@movies_table}\n order by title asc\n ]\n\n # output a header\n puts \"Movies\"\n puts \"------------------------\"\n\n # execute query and iterate through the result set\n results = @db.exec(sql)\n results.each do |movie|\n puts \"#{movie[\"title\"]}\"\n end \n end", "def show\n\n \n end", "def show() end", "def show() end", "def show() end", "def show\n\t\t\n\t\t\n\tend", "def display\r\n end", "def show\n @chapters_per_row = 10\n @bible = Bible.data\n @verses = @reader.verses.index_by(&:number)\n end", "def display_students\n all_students = @conn.exec(\"SELECT * FROM students;\")\n all_students.each do | student|\n student.each do |k,v|\n puts \"#{k}: #{v}\"\n end\n end\nend", "def index\n @databases = Database.all\n respond_to do |format|\n format.html do\n @databases = @databases.includes(:vendor).order('name ASC')\n render :table\n end\n format.csv do\n @databases = @databases.includes(\n :database_subjects,\n :resources,\n :subjects, :vendor,\n :access_plain_text,\n :access_type\n )\n .order('name ASC')\n send_data @databases.to_csv, filename: \"databases-#{Date.today}.csv\"\n end\n end\n end", "def print_personal_list(db, name)\r\n\tputs \"Chores for #{name}\"\r\n\tprint_chores = db.execute(\"SELECT chores.complete_by_day, chores.name FROM chores, family WHERE family.name = ? AND chores.family_id = family.id\", [name])\r\n\tprint_chores.each do |x|\r\n\t\tputs \"#{x[0]} : #{x[1]}\"\r\n\tend\r\nend", "def print_library(db)\n music_library = db.execute(\"SELECT * FROM music\")\n music_library.each do |music|\n p \"#{music[1]} - #{music[2]}, rating = #{music[3]} stars, explicit lyrics present: #{music[4]}, played by user: #{music[5]} on platform: #{music[6]}\"\n end\nend", "def show\n puts \"******* show *******\"\n end" ]
[ "0.72559404", "0.7142108", "0.7101807", "0.7033154", "0.7000157", "0.6966503", "0.6934878", "0.68238765", "0.6814954", "0.6741536", "0.6729001", "0.6693299", "0.6582194", "0.6545666", "0.6535862", "0.65237916", "0.6518217", "0.65140057", "0.641251", "0.6411742", "0.6404482", "0.63998866", "0.63985145", "0.63922733", "0.6391592", "0.63751596", "0.63702685", "0.63615334", "0.6353996", "0.62942713", "0.6287214", "0.6279151", "0.62373793", "0.62104625", "0.62039495", "0.6190373", "0.61895806", "0.6118179", "0.61129683", "0.60963905", "0.60600114", "0.60566247", "0.60472095", "0.6041064", "0.6022489", "0.60169595", "0.6008935", "0.6008275", "0.60059893", "0.59979606", "0.5997312", "0.5988983", "0.5987137", "0.59845805", "0.5980788", "0.5978958", "0.5963668", "0.5960172", "0.59517634", "0.59517634", "0.5948612", "0.5947624", "0.59424555", "0.59405524", "0.5938474", "0.59349185", "0.59317434", "0.59228736", "0.5921429", "0.59192294", "0.59152794", "0.5911858", "0.5908842", "0.5907343", "0.59052217", "0.59051436", "0.5896724", "0.5896585", "0.5891814", "0.58731127", "0.58668834", "0.5859787", "0.5856588", "0.58517784", "0.5836809", "0.5836809", "0.5836809", "0.5835941", "0.58294225", "0.582872", "0.582872", "0.582872", "0.58243847", "0.5821106", "0.58128583", "0.5812129", "0.5798472", "0.57970077", "0.579608", "0.5795682" ]
0.7424993
0
This function allows the user to add information into the database
def add_information # Open connection db = open_connection # Get user input print "Enter Barcode: " barcode = gets.strip print "Enter Item Name: " item_name = gets.strip print "Item Category: " item_category = gets.strip print "Quantity: " quantity = gets.strip print "Price: " price = gets.strip print "Description: " description = gets.strip begin # Prepare database query and execute it insert_new_item = db.prepare "INSERT INTO #{$db_name}.#{$db_table_name} (Barcode, ItemName, ItemCategory, Quantity, Price, Description) VALUES (?, ?, ?, ?, ?, ?)" insert_new_item.execute barcode,item_name,item_category,quantity,price,description insert_new_item.close rescue # Catch any errors abort "There was an error adding information into the database." ensure # Close the connection to the database db.close end puts "Information added successfully!" home_screen end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_person\n puts \"Enter name: \"\n name = gets.chomp\n puts \"Enter job: \"\n job = gets.chomp\n puts \"Enter gender: \"\n gender = gets.chomp\n puts \"Enter age: \"\n age = gets.chomp\n\n # insert_person_to_db\n $db.execute(\"INSERT INTO people (name, job, gender, age) VALUES (?, ?, ?, ?)\", name, job, gender, age)\nend", "def add_person\n puts \"Enter Name:\"\n name = gets.chomp\n puts \"Enter Job:\"\n job = gets.chomp\n puts \"Enter Gender:\"\n gender = gets.chomp\n puts \"Enter Age:\"\n age = gets.chomp\n\n $db.execute(\"INSERT INTO people (name, job, gender, age) VALUES (?, ?, ?, ?)\", name, job, gender, age)\nend", "def add_user(db, name, age, current_weight, goal_weight, max_mile)\n\tdb.execute(\"INSERT INTO users (name, age, current_weight, goal_weight, max_mile) \n\tVALUES (?, ?, ?, ?, ?);\", [name, age, current_weight, goal_weight, max_mile]\n\t)\nend", "def add_input (db, user_input)\r\n db.execute(\"INSERT INTO strength (date, exercise, weight, reps, minutes, difficult) VALUES (?, ?, ?, ?, ?, ?)\", [user_input])\r\nend", "def add_user(db, username)\n puts \"What is the age of the new user?\"\n age = gets.chomp\n db.execute(\"INSERT INTO users (username, age) VALUES (?, ?)\", [username, age])\n puts \"#{username} was added to the table\"\nend", "def add_to_database\n if self.valid?\n User.add({\"name\" => \"#{self.name}\"})\n else\n false\n end\n end", "def add_to_database\n if self.valid?\n Product.add({\"name\" => \"#{self.name}\", \"general_info\" => \"#{self.general_info}\", \"technical_specs\" => \"#{self.technical_specs}\", \"where_to_buy\" => \"#{self.where_to_buy}\"})\n else\n false\n end\n end", "def adduser(journal)\n\tputs \"What is the username that you want to add?\"\n\tuser_name = gets.chomp.capitalize\n\tjournal.execute(\"INSERT INTO users (name) VALUES (?)\", [user_name])\nend", "def add_to_database\n CONNECTION.execute(\"INSERT INTO users (name) VALUES ('#{self.name}');\")\n @id = CONNECTION.last_insert_row_id\n end", "def add_student(database, name)\r\n\tdatabase.execute(\"INSERT INTO students (name) VALUES (?)\", [name])\r\nend", "def add_user(db, user_name)\n db.execute(\"INSERT INTO users (user_name) VALUES (?),\" [user_name])\nend", "def add_entry(db, book_name, year_pubished, genre, author, rating, read)\n\tdb.execute(\"INSERT INTO books (book_name, year_pubished, genre, author, rating, read) VALUES (?, ?, ?, ?, ?, ?)\", [book_name, year_pubished, genre, author, rating, read])\nend", "def add_new_school(db, name)\n db.execute(\"INSERT INTO school (name) VALUES (?)\", [name])\nend", "def add_exercise(db)\n puts \"What is the name of the exercise you want to add?\"\n exercise = gets.chomp\n if is_existing_exercise(db, exercise)\n puts \"#{exercise} is already in the database.\"\n else\n db.execute(\"INSERT INTO exercises (name) VALUES (?)\", [name])\n puts \"#{exercise} was added to the database.\"\n end\nend", "def add_new_contact\nprint \"Contact first name:\"\nfirst_name = gets.chomp\n\nprint \"Contact last name:\"\nlast_name = gets.chomp\n\nprint \"Enter Contact's Email Address\"\nemail = gets.chomp\n\nprint \"Enter Note\"\nnote = gets.chomp\n\nContact.create(first_name, last_name, email, note)\n end", "def save_form_data_to_database\n db = get_db\n db.execute 'INSERT INTO Messages (username, phone, email, option, comment)\n VALUES (?, ?, ?, ?, ?)', [@username, @phone, @email, @option, @comment]\n db.close\nend", "def add_to_database\n if self.can_drink?\n CONNECTION.execute(\"INSERT INTO students (name, age) VALUES ('#{@name}', #{@age});\")\n \n @id = CONNECTION.last_insert_row_id\n else\n false\n end\n end", "def add_to_database\n Partner.add({\"assignment_id\" => \"#{self.assignment_id}\", \"name_worked\" => \"#{self.name_worked}\"})\n end", "def add_friend(db, friend_name, age, birth_month, birth_day, likes_birthdays)\n db.execute(\"INSERT INTO friends (friend_name, age, birth_month, birth_day, likes_birthdays) VALUES (?, ?, ?, ?, ?)\", [friend_name, age, birth_month, birth_day, likes_birthdays])\nend", "def add_reciever(db, name, gift, cost)\n db.execute(\"INSERT INTO personal_gift (name, gift, cost, purchased_id) VALUES (?, ?, ?, 2)\", [name, gift, cost])\nend", "def add_new_classmate(db, tbl)\n puts \"Enter user first name: \"\n fname = gets.chomp\n\n puts \"Enter user last name: \"\n lname = gets.chomp\n\n puts \"Enter user twitter id: \"\n twitter = gets.chomp\n\n insert_classmate = \"insert into #{tbl} (first_name, last_name, twitter) values ('#{fname}', '#{lname}', '#{twitter}')\"\n\n db.exec(insert_classmate)\n\n end", "def saveUser(name,description,email,phone,address)\n self.checkConnectMySQL() \n @connect.query(\"INSERT INTO users(name, description, email, phone, address) VALUES ( '#{name}', '#{description}', '#{email}','#{phone.to_s}','#{address}' )\") \n end", "def add_family(db, name, age)\r\n\tdb.execute(\"INSERT INTO family (name, age) VALUES (?, ?)\", [name, age])\r\nend", "def new_student (db, name)\n db.execute(\"INSERT INTO student (name) VALUES (?)\", [name])\nend", "def new_patient(db, name, dob, insurance)\n\t\n\tdb.execute(\"INSERT INTO patient_info (name, dob, insurance) VALUES (?, ?, ?)\", [name, dob, insurance])\n\nend", "def addContact(db)\r\n\tputs \"******************************New Contact*********************************\"\r\n\tputs \"Enter name:\"\r\n\tname = gets.chomp\r\n\tputs \"Enter Phone Number (No dashes/parens):\"\r\n\tnum = gets.chomp.to_i\r\n\tputs \"Enter Address:\"\r\n\tadd = gets.chomp\r\n\tdb.execute(\"INSERT INTO contacts (name, phone, address) VALUES (?, ?, ?)\", [name, num, add])\r\nend", "def create_user(db, name, weight, exercise, progression)\n db.execute(\"INSERT INTO user (name, weight, exercise, progression) VALUES (?, ?, ?, ?)\", [name, weight, exercise, progression])\nend", "def add\n # 1. Ask the user for the customer name and store in var\n name = @customer_view.ask_name\n # 2. Ask the user for the customer price and store in var\n address = @customer_view.ask_address\n # 3. Create a new customer instance with those values\n customer = Customer.new(name: name, address: address)\n # 4. Add to repository using #create\n @customer_repo.create(customer)\n end", "def add_information(bc)\n\t# get user input\n\tbarcode = bc\n\tprint \"Enter Item Name: \"\n\titem_name = gets.strip\n\tprint \"Item Category: \"\n\titem_category = gets.strip\n\tprint \"Quantity: \"\n\tquantity = gets.strip\n\tprint \"Price: \"\n\tprice = gets.strip\n\tprint \"Description: \"\n\tdescription = gets.strip\n\n\tdb = open_connection\n\tbegin # try to add information to the database\n\t\tdb.query(\"INSERT INTO #{$db_name}.#{$db_table_name} ( \\\n\t\t`Barcode`, `ItemName`, `ItemCategory`, `Quantity`, `Price`, `Description` \\\n\t\t) VALUES ( \\\n\t\t'#{barcode}', '#{item_name}', '#{item_category}', #{quantity}, #{price}, '#{description}')\")\n\trescue Exception => e # abort if error and print error\n\t\tabort \"Could not add information to the database.\"\n\t\tputs \"Error code: #{e.errno}\"\n\t\tputs \"Error message: #{e.error}\"\n\tend # if passed, give success message\n\tputs \"Information successfully added!\"\nend", "def add_new_input(db)\n\tputs \"-\" * 50\n\tputs \"Add New Horse Information: \"\n\tprint \"Name: \"\n\thorse_name = gets.split.map(&:capitalize).join(' ')\n\tprint \"Breed: \"\n\thorse_breed = gets.split.map(&:capitalize).join(' ')\n\tprint \"Color: \"\n\thorse_color = gets.split.map(&:capitalize).join(' ')\n\tprint \"Age: \"\n\thorse_age = gets.to_i\n\tprint \"Rideable (y/n): \"\n\thorse_rideable_input = gets.chomp.downcase\n\tif horse_rideable_input == \"y\"\n\t\thorse_rideable = \"true\"\n\telse\n\t\thorse_rideable = \"false\"\n\tend\n\tadd_new(db, horse_name, horse_breed, horse_color, horse_age, horse_rideable)\nend", "def create_employee(database, first_name, last_name, wage, title, last_four_ssn, business_id)\n database.execute(\"INSERT INTO employees (first_name, last_name, wage, title, last_four_ssn, business_id) VALUES (?, ?, ?, ?, ?, ?)\", [first_name, last_name, wage, title, last_four_ssn, business_id])\nend", "def add_produce (db, name, serving_size, calories, protein, carbs, fat)\n db.execute(\"INSERT INTO produce (name, serving_size, calories, protein, carbs, fat) VALUES (?, ?, ?, ?, ?, ?)\", [name, serving_size, calories, protein, carbs, fat])\nend", "def create_new_hero(db, name, age, specialty, turing_award)\r\n db.execute(\"INSERT INTO tech_heroes(name, age, specialty, turing_award) VALUES (?, ?, ?, ?)\", [name, age, specialty, turing_award])\r\nend", "def add_user(db, user_name)\r\nadd_user = '\r\n\r\n\tINSERT INTO users \r\n\r\n\t(name, cache, expected_income, actual_income, expenses, month)\r\n\tVALUES (?,0,0,0,0,1)'\r\n\tdb.execute(add_user, [user_name]) \r\nend", "def add_staff_member\n\tputs \"\\nTo add a new staff member please enter the following requested information:\\n\"\n\tprint \"Name \"\n\tname = gets.chomp\n\tprint \"Email Address \"\n\temail_address = gets.chomp\n\tprint \"Library branch assigned to \"\n\tlibrary_id = gets.chomp.to_i\n\tlibrary_id = verify_library_exists(library_id)\n\tStaffMember.create(name: name, email_address: email_address, \n\t\t\tlibrary_id: library_id)\nend", "def add_contact\n print \"First name:\"\n first_name = gets.chomp\n\n print \"Last Name:\"\n last_name = gets.chomp\n\n print \"Email:\"\n email = gets.chomp\n\n print \"Notes:\"\n notes = gets.chomp\n\n Contact.create(first_name, last_name, { email: email, notes: notes })\n end", "def add_to_database\n if self.valid?\n Choice.add({\"choice\" => \"#{self.choice}\", \"question_id\" => \"#{self.question_id}\"})\n else\n false\n end\n end", "def register()\n\tentry = {\"userid\" => @userid, \"username\" => @username, \"email\" => @email, \"password\" => @password}\n\tDATABASE.newEntry(\"users\", entry)\n\tend", "def create_user(db, first_name, last_name, age, body_weight, gender)\n\tdb.execute(\"INSERT INTO athlete (first_name, last_name, age, body_weight, gender, gym_trips) VALUES (?,?,?,?,?,?)\", [first_name, last_name, age, body_weight, gender, 0 ])\nend", "def add_restaurant(db, name, type, wait_time, phone)\n db.execute(\"INSERT INTO restaurants (name, type, wait_time, phone) VALUES (?, ?, ?, ?)\", [name, type, wait_time, phone])\nend", "def add_new_contact\n puts \"\\e[H\\e[2J\"\n\n p \"enter firstname\"\n first_name = gets.chomp\n\n p \"enter lastname\"\n last_name = gets.chomp\n\n p \"enter email address\"\n email = gets.chomp\n\n p \"enter note: optional\"\n note = gets.chomp\n\n contact = Contact.create(\n first_name: first_name,\n last_name: last_name,\n email: email,\n note: note\n )\n end", "def add_item(db)\n\tcreate_table_cmd = <<-SQL\n\tCREATE TABLE IF NOT EXISTS items (\n\t\tid INTEGER PRIMARY KEY,\n\t\tname VARCHAR(255),\n\t\tcalories INT\n\t)\n\tSQL\n\tdb.execute(create_table_cmd)\n\n\t$table_exists = true\n\n\tputs \"Please enter item name:\"\n\titem_name = gets.chomp\n\tputs \"Please enter calories for #{item_name}:\"\n\tcals = gets.chomp.to_i\n\tdb.execute(\"INSERT INTO items (name, calories) VALUES (? ,?)\", [item_name, cals])\n\tputs \"Item added successfully!\"\nend", "def storeUser(param) \n @Handle.execute(\"INSERT INTO User(email,name,surname,nickname)\" +\n \" values ('#{param.Email}','#{param.Name}','#{param.Surname}','#{param.Nickname}')\")\n end", "def create_user (db, first_name, last_name, age, location, social_media,time,date)\n\tdb.execute(\"INSERT INTO users (first_name, last_name, age, location, social_media, time, date) values (?,?,?,?,?,?,?)\",[first_name,last_name,age,location,social_media,time,date])\nend", "def add_to_database\n if Valid.name?(self)\n Category.add({\"name\" => \"#{self.name}\"})\n else\n return false\n end\n end", "def add\n # 1. Ask the user for the meal name and store in var\n name = @meal_view.ask_name\n # 2. Ask the user for the meal price and store in var\n price = @meal_view.ask_price\n # 3. Create a new meal instance with those values\n meal = Meal.new(name: name, price: price)\n # 4. Add to repository using #create\n @meal_repo.create(meal)\n end", "def save\n # CREATE/UPDATE\n # TODO: CREATE if id is nil / UPDATE if there is id\n if @id.nil?\n # TODO: CREATE\n query = \"INSERT INTO doctors (name, age, specialty) \"\\\n \"VALUES ('#{@name}', #{@age}, '#{@specialty}')\"\n DB.execute(query)\n else\n # TODO: UPDATE\n query = \"UPDATE doctors SET name = '#{@name}', \"\\\n \"age = #{@age}, specialty = '#{@specialty}' \"\\\n \"WHERE id = #{@id}\"\n DB.execute(query)\n end\n self\n end", "def add_to_database\n hash = self.attr_hash\n columns = hash.keys\n values = hash.values\n if self.valid?\n CONNECTION.execute(\"INSERT INTO #{tablename} (#{columns.join \", \"}) VALUES (#{values.to_s[1...-1]});\")\n @id = CONNECTION.last_insert_row_id\n else\n false\n end\n end", "def save\n conn = Sandwich.open_connection\n\n if self.id\n #Update\n sql = \"UPDATE sandwich SET title='#{self.title}', description='#{self.description}' WHERE id=#{self.id}\"\n else\n #Add\n sql= \"INSERT INTO sandwich (title, description) VALUES ('#{self.title}','#{self.description}')\"\n end\n\n\n conn.exec(sql)\n end", "def add_interest(db, interest)\n db.execute(\"INSERT INTO interests (interest) VALUES (?)\", [interest])\nend", "def insert()\n\n end", "def insert()\n\t\[email protected](\"insert into ausgaben (jahr, monat, name, betrag, gemeinsam, tags) values(:jahr, :monat, :name, :betrag, :gemeinsam, :tags)\", @options)\n\tend", "def store_users(db, name, age, weight)\n\tdb.execute(\"INSERT INTO users (name, age, weight) VALUES (?, ?, ?)\", [name, age, weight])\nend", "def add\n\t\t$employee_info[get_employee_id] = {first_name: get_employee_first_name, last_name: get_employee_last_name, salary: get_employee_salary, tax_rate: get_employee_tax_rate}\n\t\tputs \"\"\n\t\tputs \"\"\n\t\tputs \"Employee successfully added!\"\n\tend", "def add_chores(db, name, complete_by_day)\r\n\tdb.execute(\"INSERT INTO chores (name, complete_by_day, family_id) VALUES (?, ?, 0)\", [name, complete_by_day])\r\nend", "def create_regimen(db, name, age, vitamin)\n db.execute(\"INSERT INTO regimen (name, age, vitamin) VALUES (?, ?, ?)\", [name, age, vitamin])\nend", "def add_contact(list)\n\n puts \"Please enter new contact name:\"\n add_name = gets.chomp.downcase\n\n puts \"Please enter new contact phone number:\"\n add_phone = gets.chomp.downcase\n\n puts \"please enter new contact email address:\"\n add_email = gets.chomp.downcase\n\n puts \"please enter new contact occupation:\"\n add_occupation = gets.chomp.downcase\n\n puts \"please enter how you know new contact:\"\n add_group = gets.chomp.downcase\n\n list.execute(\"INSERT INTO contacts(name, occupation, association, phone_number, email) VALUES ('#{add_name}', '#{add_occupation}','#{add_group}', '#{add_email}', '#{add_phone}') \")\nend", "def add_book(db, title, author, rating)\n db.execute(\"INSERT INTO books (title, author, rating) VALUES (?, ?, ?)\", [title, author, rating])\nend", "def insert()\n\n # Kräver att det finns ett \"set_table(\"Table\")\" i klassen\n @insertable_vars_full = self.instance_variables # Ta med namnen user.username osv\n @insertable_vars_full.shift(1) # Kinda frisky\n @insertable_vars = []\n @insertable_values = []\n @insertable_vars_full.each do |var|\n @insertable_vars << var[1..-1]\n @insertable_values << self.instance_variable_get(var)\n end\n\n\n @insertable_vars_str = @insertable_vars.join(\", \")\n\n @question_marks = \"\"\n @insertable_vars.each do |key|\n @question_marks.concat(\"?,\")\n end\n @question_marks = @question_marks[0..-2]\n\n DB.execute(\"INSERT INTO #{@table} (#{@insertable_vars_str})\n VALUES (#{@question_marks})\", @insertable_values)\n\n end", "def create_entry()\n\tdb.execute( \"INSERT INTO test (name, codename) VALUES (?, ?)\", [name, code_name])\n\nend", "def add_to_list(database, item, quantity, store_name, purchased)\n $database.execute(\"INSERT INTO shopping (item, quantity, store_name, purchased) VALUES (?, ?, ?, ?)\", [item, quantity, store_name, purchased])\nend", "def addinfo\n\nend", "def create_user(db, user_name)\n\tdb.execute(\"INSERT INTO users (user_name) VALUES (?)\", [user_name])\n\tputs \"added new user\"\nend", "def add_vehicle(db)\r\n puts \"What year is the vehicle?\"\r\n year = gets.chomp\r\n puts \"What is the make of the vehicle? (Honda, Toyota, Ford, etc.)\"\r\n make = gets.chomp\r\n puts \"What is the model of the vehicle?\"\r\n model = gets.chomp\r\n db.execute(\"INSERT INTO vehicles (year, make, model) VALUES (#{year}, '#{make}', '#{model}')\")\r\nend", "def add_student(first_name, last_name, birthdate)\n @conn.exec(\"INSERT INTO students_db (first_name, last_name, birthday) VALUES ('#{first_name}', '#{last_name}', '#{last_name}', '#{birthdate}');\")\nend", "def add_to_database\n if self.animal_in_non_retail?\n false\n else\n DB.execute(\"INSERT INTO products (location_id, category_id, name, cost, quantity) VALUES (#{@location_id}, #{@category_id}, '#{@name}', #{@cost}, #{@quantity});\")\n @id = DB.last_insert_row_id\n end\n end", "def add_patron\n\tputs \"\\nTo add a new patron please enter the following requested information:\\n\"\n\tprint \"Name \"\n\tname = gets.chomp\n\tprint \"Email Address \"\n\temail_address = gets.chomp\n\tPatron.create(name: name, email_address: email_address)\nend", "def create_user(db,first_name,last_name,is_artist,playlist_id)\n\tdb.execute(\"INSERT INTO users (first_name,last_name,is_artist,playlist_id) VALUES ('#{first_name}', '#{last_name}', '#{is_artist}', #{playlist_id});\")\nend", "def add_work_item(data)\n name = @table_name.to_s\n sql = @model.from(name.to_sym).insert_sql(\n description: data[:description],\n guide: data[:guide],\n status: data[:status],\n username: data[:name],\n archived: 0\n )\n sql = _format_sql(sql)\n @logger.info(\"Prepared POST query: #{sql}\")\n response = run_statement(sql, \"post\")\n id = response[0][:long_value]\n @logger.info(\"Successfully created work_item_id: #{id}\")\n id\n end", "def add_subject(database, name)\r\n\tdatabase.execute(\"INSERT INTO subjects (name) VALUES (?)\", [name])\r\nend", "def create_user(db,name,age,rating,email)\n\ndb.execute( \"INSERT INTO users(user_name,age,user_rating,user_email)\n VALUES(?,?,?,?)\",[name,age,rating,email])\nend", "def save(prod_name, prod_price, prod_description, prod_status)\n @db.query(\"INSERT INTO products (name, price, description, is_active) VALUES ('#{prod_name}', '#{prod_price}', '#{prod_description}', #{prod_status})\")\n @db.last_id\n end", "def add_geo(db, geo_name, company)\n db.execute(\"INSERT INTO geologists (name, company) \n VALUES (?, ?)\", [geo_name, company])\nend", "def create_new_account(database, email_address, first_name, last_name, password)\r\n database.execute(\"INSERT INTO users (email_address, first_name, last_name, password) VALUES (?, ?, ?, ?)\", [email_address, first_name, last_name, password])\r\nend", "def add_grade(database, student_id, subject_id, grade)\r\n\tdatabase.execute(\"INSERT INTO grades (grade, student_id, subject_id) VALUES (?, ?, ?)\", [grade, student_id, subject_id])\r\nend", "def add_item(db, new_item, new_date)\n db.execute(\"INSERT INTO todolist (item, date, done) VALUES (?, ?, ?)\", [new_item, new_date, \"false\"])\nend", "def insert(**opts)\n add(**opts)\n save!\n end", "def insertOperation\n\t\tputs \"Enter Product Id\"\n\t\tproid = gets.chomp.to_i\n\t\tputs \"Enter Product Name\"\n\t\tproname = gets.chomp\n\t\tproname = \"'\"+proname+\"'\"\n\t\tputs \"Enter Product Quantity\"\n\t\tproqty = gets.chomp.to_i\n\t\tputs \"Enter Product Cost\"\n\t\tprocost = gets.chomp.to_i\t\n\t\t\t\n\t\tbegin\n\t\t\tresult = @statement.executeUpdate(\"insert into products values(#{proid},#{proname},#{proqty},#{procost})\")\n\t\t\tif result\n\t\t\t\tputs \"Record Inserted Successfully...........\"\n\t\t\telse\n\t\t\t\tputs \"Error Occur while inserting Record\"\n\t\t\tend\n\t\t\t\t#Closing the Connections\n\t\t\[email protected]\n\t\t\[email protected]\n\t\trescue Exception => e\n\t\t\tputs e.message\n\t\tend\n\tend", "def add_lower_body(db, name, complete, user_id)\n\tcomplete = \"incomplete\"\n\tdb.execute(\"INSERT INTO lower_body (name, complete, user_id) VALUES (?,?,?)\", [name, complete, user_id])\n\tputs \"added leg workout\"\nend", "def create(product, price, description, quantity)\n\[email protected](\"INSERT INTO amazone (product, price, description, quantity) VALUES ('#{product}', '#{price}', '#{description}', '#{quantity}');\")\n\tputs \"I added your product to the table.\"\nend", "def add_library\n\tputs \"\\nTo add a new library please enter the following requested information:\\n\"\n\tprint \"Library name \"\n\tbranch_name = gets.chomp\n\tprint \"Library address \"\n\taddress = gets.chomp\n\tprint \"Library phone number \"\n\tphone = gets.chomp\n\tLibrary.create(branch_name: branch_name, address: address, phone: phone)\nend", "def add_price(asin, title, price_s, price_i, day, day_i)\r\n $db.execute(\"INSERT INTO prices (asin, title, price_s, price_i, day, day_i) VALUES (?,?,?,?,?,?)\", [asin, title, price_s, price_i, day, day_i])\r\nend", "def add_book\n\tputs \"\\nTo add a new book please enter the following requested information:\\n\"\n\tprint \"Book Title \"\n\ttitle = gets.chomp\n\tprint \"Book Author \"\n\tauthor = gets.chomp\n\tprint \"Book ISBN \"\n\tisbn = gets.chomp\n\tprint \"Book Home Library \"\n\tlibrary_id = gets.chomp.to_i\n\tlibrary_id = verify_library_exists(library_id)\n\tBook.create(title: title, author: author, isbn: isbn, library_id: library_id)\nend", "def create\n Student.conn.exec('INSERT INTO students (name, age, spirit_animal, squad_id) values ($1,$2,$3,$4)', [ name, age, spirit_animal, squad_id])\n end", "def addUser(course_id, name, slug, course_site, instructors, partners, homepage, counter, url_photo, summary)\n @conn.exec_prepared(\"insert_user\", [course_id, name, slug, course_site, instructors, partners, homepage, counter, url_photo, summary])\n end", "def manual_add_entry\n address_book.add_entry(enter_name, enter_phone, enter_email)\n end", "def add_listing(db, seller, make_id, model, year, price)\n db.execute(\"INSERT INTO cars (seller, make_id, model, year, price) VALUES (?, ?, ?, ?, ?)\", [seller, make_id, model, year, price])\nend", "def create_new_user\r\n touch(\"* id:'#{add}'\")\r\n end", "def add_to (table_name,title,code)\r\n\t\"INSERT INTO \" + table_name + \r\n\t\"(title,code) VALUES \r\n\t('\" + title + \"','\" + code + \"')\"\r\nend", "def create_student(db, name, address, age, program)\n\tdb.execute(\"INSERT INTO school (name, address, age, program) VALUES (?, ?, ?, ?)\", [name, address, age, program])\nend", "def add_student(first_name, last_name, birthdate)\n @conn.exec(\"INSERT INTO students (first_name, last_name, birthdate) VALUES ('#{first_name}', '#{last_name}', '#{birthdate}');\")\nend", "def add_student(first_name, last_name, birthdate)\n @conn.exec(\"INSERT INTO students (first_name, last_name, birthdate) VALUES ('#{first_name}', '#{last_name}', '#{birthdate}');\")\nend", "def add_item(db, item_name, item_quantity, current_user)\r\n db.execute(\"INSERT INTO items (item_name, item_quantity, user_id) VALUES (?, ?, ?)\", [item_name, item_quantity, current_user])\r\n # list_hash = {}\r\n # list_hash[item_name] = item_quantity\r\nend", "def add_friend_interest(db, friend_id, interest_id)\n db.execute(\"INSERT INTO friends_interests (friend_id, interest_id) VALUES (?, ?)\", [friend_id, interest_id])\nend", "def create_house_info(db, address, price, years_of_mortgage, interest_rate, monthly_pmt)\n\tdb.execute(\"INSERT INTO house_info (address, price, years_of_mortgage, interest_rate, monthly_pmt) VALUES (?, ?, ?, ?, ?)\", [address, price, years_of_mortgage, interest_rate, monthly_pmt])\nend", "def add_student(first_name, last_name,birthdate)\n @conn.exec(\"INSERT INTO students (first_name, last_name, birthdate) VALUES ('#{first_name}', '#{last_name}', '#{birthdate}');\")\nend", "def add\n @user = User.new(params[:user])\n \n if @user.save\n redirect_to @user, notice: 'User was successfully created.'\n else\n render action: \"new\"\n end\n end", "def add_new_customer_menu\n begin\n puts \"Enter customer first name: \"\n p \">\"\n @first_name = set_field\n\n puts \"Enter customer last name: \"\n p \">\"\n @last_name = set_field\n\n puts \"Enter Phone Number: \"\n p \">\"\n @phone_number = set_field\n\n puts \"Enter street address: \"\n p \">\"\n @street_address = set_field\n\n puts \"Enter City: \"\n p \">\"\n @city = set_field\n\n puts \"Enter State: \"\n p \">\"\n @us_state = set_field\n\n puts \"Enter Zip code: \"\n p \">\"\n @zip_code = set_field\n\n add_new_customer\n rescue SQLite3::Exception => e\n p \"Exception with add_new_customer_menu: #{e}\"\n end\n end", "def add_user(email, name, account_balance)\n users = self.db[:users]\n now = DateTime.now\n users.insert(:email => email, :name => name, :account_balance => account_balance, :created_at => now, :updated_at => now,\n :device_id => \"nil\") # THIS IS ONLY IN DEVELOPMENT MODE\n puts \"<#User email: #{email} name: #{name} account_balance: #{account_balance} device_id: 'nil'>\"\n end", "def create_customer(db, first, last, address, city, phone)\n db.execute(\"INSERT INTO customers (first_name, last_name, address, city, phone) VALUES (?, ?, ?, ?, ?)\", [first, last, address, city, phone])\nend" ]
[ "0.71868336", "0.7167109", "0.7152866", "0.70868003", "0.7064213", "0.70191485", "0.70112765", "0.6990257", "0.6898604", "0.68650216", "0.6854931", "0.6853597", "0.68484724", "0.6813762", "0.68015987", "0.679783", "0.67779434", "0.6746536", "0.67458427", "0.67297417", "0.6714801", "0.67022455", "0.6701276", "0.6693836", "0.6632687", "0.6618933", "0.6612747", "0.6603006", "0.659038", "0.6577408", "0.65707356", "0.6569149", "0.65677387", "0.6560975", "0.6557747", "0.6538992", "0.6533654", "0.6524934", "0.6523659", "0.6519903", "0.6516461", "0.65112174", "0.6495955", "0.6494893", "0.6488881", "0.648846", "0.6483069", "0.6480606", "0.6480427", "0.6476316", "0.6471083", "0.6465216", "0.64611167", "0.64533544", "0.6429496", "0.6422296", "0.6409686", "0.6407793", "0.64032423", "0.64027345", "0.6402108", "0.63972354", "0.6392665", "0.63924664", "0.63912165", "0.6385924", "0.63816416", "0.6373506", "0.6373274", "0.63731915", "0.6366083", "0.63502806", "0.6349819", "0.63412935", "0.6338559", "0.63348126", "0.6322621", "0.6321769", "0.6319156", "0.631409", "0.6313692", "0.63057804", "0.6302377", "0.630088", "0.62900037", "0.62889355", "0.6280377", "0.6278492", "0.6273275", "0.62710255", "0.6265932", "0.6265932", "0.62645143", "0.62622917", "0.62621534", "0.6259157", "0.62516564", "0.6249514", "0.6247416", "0.62383443" ]
0.7112345
3
This function allows the user to delete information from the database
def delete_information # Open connection db = open_connection # Get user input print "Enter the barcode for the item you'd like to delete: " barcode = gets.strip begin # Check if barcode exists delete_item = db.prepare "DELETE FROM #{$db_name}.#{$db_table_name} WHERE Barcode = ?" delete_item.execute barcode delete_item.close rescue # Catch any errors abort "There was an error deleting item from the database. Please ensure that item exists." ensure # Close the connection to the database db.close end print "Information deleted successfully!\n" home_screen end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n \n end", "def delete\n end", "def delete\n end", "def delete\n \n end", "def delete\n end", "def delete\n DATABASE.execute(\"DELETE FROM students WHERE id = #{@id}\")\n end", "def delete\n DATABASE.execute(\"DELETE from students WHERE id = #{id}\")\n end", "def delete\n\n DB.execute(\"DELETE FROM #{table_name} WHERE id = #{@id};\")\n end", "def delete\n\n\tend", "def delete\n\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n binding.pry\n DATABASE.execute(\"DELETE FROM contents WHERE id = #{id}\")\n end", "def delete\n CONNECTION.execute(\"DELETE FROM users WHERE id = #{self.id};\")\n end", "def delete_user\n end", "def deleteOperation\n\t\tputs \"Enter which record do you want to delete (Product Id)\"\n\t\tpro_id = gets.chomp.to_i\n\t\tbegin\n\t\t\tresult = @statement.executeUpdate(\"delete from products where proid = #{pro_id}\")\n\t\t\tif result\n\t\t\t\tputs \"Record deleted successfully\"\n\t\t\telse\n\t\t\t\tputs \"Record doesnot deleted\"\n\t\t\tend\n\t\trescue Exception => e\n\t\t\tputs e.message\n\t\tend\n\t\[email protected]\n\t\[email protected]\n\tend", "def delete_user (db, user_name)\n\tdb.execute(\"DELETE FROM users WHERE user_name=?\", [user_name])\nend", "def delete\n destroy\n end", "def delete_user(userid) \n $db.execute('DELETE FROM users WHERE userid=?', userid)\n end", "def delete_item(db, item_name, current_user)\r\n db.execute(\"DELETE FROM items WHERE item_name = ? AND user_id = ?\", [item_name, current_user])\r\nend", "def delete\n CONNECTION.execute(\"DELETE FROM '#{tablename}' WHERE id = ?;\", @id)\n \"Deleted.\"\n end", "def deleteuser(del_id)\n db.execute(\"DELETE FROM users WHERE user_id=?\", del_id)\n db.execute(\"DELETE FROM listings WHERE user_id=?\", del_id)\nend", "def delete_db_post\n # Tell the user\n puts \"> Tar bort aliaset från databasen\".green\n\n # Connect to the database\n conn = PG.connect( dbname: DB_DATABASE_NAME, user: DB_USER, password: DB_PASSWORD )\n\n # Delete the account\n res = conn.exec \"DELETE FROM #{DB_ALIAS_TABLE} WHERE address = '#{$alias}' AND userid = '#{$email}'\" unless $simulate\n\n # Close the connection\n conn.close\nend", "def db_deleter(database, id)\n database.execute(\"DELETE FROM wine_cellar where id=#{id}\")\nend", "def del\n delete\n end", "def delete\n FC::DB.query(\"DELETE FROM #{self.class.table_name} WHERE id=#{@id.to_i}\") if @id\n end", "def destroy\n # delete object from the DB\n # DB.execute(\"DELETE .....\")\n end", "def destroy\r\n\r\n end", "def delete\n deleted\n save\n end", "def destroy\r\n end", "def destroy\r\n end", "def destroy\r\n end", "def destroy\n\t\tend", "def delete!\n raise \"A database must be setted\" unless self.database\n response = database.delete self\n pristine_copy\n response\n end", "def destroy; delete end", "def delete\n @user = User.find(params[:id])\n @user.delete\n redirect_to root_path\n end", "def delete!\n deleted\n save!\n end", "def destroy\n \n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def delete\n DATABASE.execute(\"DELETE from slides WHERE id = #{id}\")\n end", "def destroy \n \n end", "def delete()\n db = PG connect( {dbname: 'bounty_hunter',\n host: 'localhost'\n })\n sql = 'DELETE from bounty_hunter'\n db.prepare('delete_one', sql)\n db.exec_prepared('delete_one', value)\n db.close()\nend", "def destroy\n @database = Database.find(params[:id])\n path = @database.path\n delete = %x[rm -R #{path}]\n @database.destroy\n\n respond_to do |format|\n format.html { redirect_to databases_url }\n format.json { head :no_content }\n end\n end", "def destroy \r\n\r\n end", "def delete()\n\n db = PG.connect({dbname: \"pizza_shop\", host: \"localhost\"})\n sql = \"DELETE FROM pizza_orders WHERE id = $1\"\n values = [@id]\n db.prepare(\"Delete\", sql)\n db.exec_prepared(\"Delete\", values)\n db.close\n\n end", "def destroy\n \n end", "def destroy\n \n end", "def destroy\n \n end", "def destroy\n \n end", "def destroy\n \n end", "def destroy\n \n end", "def destroy\n \n end", "def destroy\n\n end", "def destroy\n\n end", "def delete_table(db)\n\tputs ('Are you sure you want to wipe the table? (y/n)')\n\tif gets.chomp == 'y'\n\t\tdb.execute(\"DELETE FROM todo\")\n\t\tdb.execute(\"DELETE FROM log\") \n\tend\nend", "def delete_students(db, student_name)\n\tdb.execute(\"DELETE FROM students WHERE name=?\", [student_name])\nend", "def delete(id)\n @conn.exec(\"DELETE FROM students WHERE id = '#{id}';\")\n puts \"Your record has been deleted\"\nend", "def delete()\n sql = \"DELETE FROM tickets WHERE id=#{@id};\"\n SqlRunner.run(sql)\n end", "def delete\n destroy\n end", "def delete\n destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end", "def destroy\n end" ]
[ "0.7882988", "0.7654785", "0.7601904", "0.7582073", "0.7538292", "0.75289404", "0.74948496", "0.7481941", "0.74549866", "0.74135745", "0.73811907", "0.73811907", "0.73811907", "0.73811907", "0.73811907", "0.73811907", "0.73811907", "0.7371326", "0.7367016", "0.7266481", "0.72217256", "0.7214445", "0.71906227", "0.7175291", "0.7155045", "0.71550065", "0.7154695", "0.71491545", "0.71294034", "0.7116001", "0.7106372", "0.70953757", "0.7062833", "0.7062763", "0.7062228", "0.7062228", "0.70540357", "0.70518637", "0.704401", "0.70413965", "0.7029434", "0.70285416", "0.7028243", "0.7023139", "0.7023139", "0.7023139", "0.7023139", "0.7023139", "0.7022016", "0.702154", "0.7012905", "0.701101", "0.7008986", "0.6997383", "0.6991279", "0.6991279", "0.6991279", "0.6991279", "0.6991279", "0.6991279", "0.6991279", "0.6986576", "0.6986576", "0.6975813", "0.6967675", "0.6947714", "0.6945377", "0.6944384", "0.6944384", "0.69437575", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807", "0.6942807" ]
0.7126751
29
This function displays the home screen for the application and receives user choice
def home_screen print "\n+---------------------------------------\n" puts "| What would you like to do?" puts "| 1: List Database Contents" puts "| 2: Enter New Item Into Database" puts "| 3: Remove Item From Database" puts "| 4: Update Item Information" puts "| 5: Exit" print "| " user_choice = gets.strip print "\n" case user_choice when "1" display_contents when "2" add_information when "3" delete_information when "4" update_information when "5" abort "Goodbye!" else puts "You entered an incorrect option." home_screen end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home\n @prompt = TTY::Prompt.new\n clear_terminal\n divider\n choice = @prompt.select(\"Hi,#{@user.name} what do you want to do today?\\n\",\n [\"Look for player information\",\"Look for club information\",\"Look for league information\", \"Trivia\"],\"-> Quit\",\"-> Restart\" )\n divider\n case choice\n when \"Look for player information\"\n players_home\n when \"Look for club information\"\n club_identification\n when \"Look for league information\"\n leagues_home \n when \"Trivia\"\n intro_trivia\n when \"3\"\n league_home\n when \"-> Quit\" || \"QUIT\"\n when \"-> Restart\" || \"RESTART\"\n run\n else\n puts \"Oops you miss the goal, try again...\"\n pause\n home\n end\n end", "def homescreen\n\tputs \"\\e[H\\e[2J\"\n\tputs \"\\n\\n\\t\\t\\t\\t\\tWhat would you like to do?\"\n\tputs \"\\n\\n\\t\\t\\t\\t\\te = enter a book\"\n\tputs \"\\n\\n\\t\\t\\t\\t\\ts = setup the database\"\n\tputs \"\\n\\n\\t\\t\\t\\t\\tu = update a record\"\n\tputs \"\\n\\n\\t\\t\\t\\t\\td = delete a record\"\n\tputs \"\\n\\n\\t\\t\\t\\t\\tf = update a field\"\n\tputs \"\\n\\n\\t\\t\\t\\t\\tv = view all records\"\n\tputs \"\\n\\n\\t\\t\\t\\t\\ti = view some stats\"\n\tputs \"\\n\\n\\t\\t\\t\\t\\tp = import a file\"\n\tputs \"\\n\\n\\t\\t\\t\\t\\tq = quit\"\n\tprint \"\\n\\n\\t\\t\\t\\t\\t\"\t\n\tchoice = gets.chomp\n\n\tif choice == \"e\" || choice == \"E\"\n\t\tadd_book\n\telsif choice == \"s\" || choice == \"S\"\n\t\tcreate_table\n\telsif choice == \"u\" || choice == \"U\"\n\t\tview_all(\"u\")\n\telsif choice == \"d\" || choice == \"D\"\n\t\tview_all(\"d\")\n\telsif choice == \"v\" || choice == \"V\"\n\t\tview_all(\"v\")\n\telsif choice == \"f\" || choice == \"F\"\n\t\tedit_field\n\telsif choice == \"p\" || choice == \"P\"\n\t\timport\n\telsif choice == \"q\" || choice == \"Q\"\n\t\tdisconnect\n\telsif choice == \"i\" || choice == \"I\"\n\t\tstats\n\telse\n\t\thomescreen\n\tend\nend", "def clubs_home\n @prompt = TTY::Prompt.new\n clear_terminal\n choice = @prompt.select(\"Here you have all that you need to know about #{@club_name}!!!\\n\",\n [\"About the Club\",\"Club Stats\",\"Club Roster\", \"Club Players Ratings\", \"Club Minutes\"],\"-> Back\",\"-> Quit\",\"-> Restart\" )\n divider\n case choice\n when \"About the Club\"\n about_clubs\n when \"Club Stats\"\n clubs_stats\n when \"Club Roster\"\n clubs_roster\n when \"Club Players Ratings\"\n clubs_players_rating\n when \"Club Minutes\"\n clubs_minutes\n when \"-> Back\"\n home\n when \"-> Quit\" || \"QUIT\"\n when \"-> Restart\" || \"RESTART\"\n run\n else\n error\n end\n end", "def main_menu\n\tputs \"Welcome to Happitails!\"\n\tputs \"Please choose from the options below\"\n\tputs \"1. Add Animal\"\n\tputs \"2. Create Client\"\n\tputs \"3. Adopt an animal\"\n\tputs \"4. Put animal up for adoption\"\n\tputs \"5. View all animals\"\n\tputs \"6. View all clients\"\n\n\n\t# puts \"Z. SECRET DEBUGGING MODE\"\n\n\tputs \"q. Quit\"\nend", "def main_menu\n choice = self.prompt.select(\"Hi there, #{self.user.name}! What would you like to do today?\", [\"Create a new post\", \"Find a book\", \"View or edit my posts\", \"Delete my account\", \"Logout\"])\n\n case choice\n when \"Create a new post\"\n self.new_post\n when \"Find a book\"\n self.find_book\n when \"View or edit my posts\"\n self.view_edit_posts\n when \"Delete my account\"\n self.delete_account\n when \"Logout\"\n self.spinner(\" ✌️✌️✌️ \")\n self.greet\n end\n end", "def main_menu()\n system 'clear'\n loop do\n headline(\"My Petsitter App\")\n puts \"#{@emoji[:smiling_cat_face_with_open_mouth]} Welcome! #{@emoji[:dog_face]}\".colorize(:bold)\n puts @headline\n input = @prompt.select('Menu:') do |menu|\n menu.choice name: 'Pet Sitters', value: \"PET_SITTERS\"\n menu.choice name: 'Clients', value: \"CLIENTS\"\n menu.choice name: 'Jobs', value: \"JOBS\"\n menu.choice name: 'Logout', value: \"EXIT\"\n end\n puts '-' * 20\n go_to(input)\n end\n end", "def display_main_menu\n loop do\n case main_menu_selection\n when 1\n RunApp.start_quiz(1)\n when 2\n RunApp.start_quiz(2)\n when 3\n exit\n end\n end\n end", "def players_home\n @prompt = TTY::Prompt.new\n clear_terminal\n choice = @prompt.select(\"Tell me, #{@user.name} what player are you looking for today?\\n\",\n [\"Players resume\",\"Top 10 scorers of the league\",\"Top 10 goalkeepers\", \"Top 10 defenders\", \"Top 10 dangerous players\"],\"-> Back\",\"-> Quit\",\"-> Restart\" )\n divider\n case choice\n when \"Players resume\"\n player_info\n when \"Top 10 scorers of the league\"\n table_top_10_Goal_scores\n when \"Top 10 goalkeepers\" \n table_top_10_GoalKeepers\n when \"Top 10 defenders\"\n table_top_10_Defenders\n when \"Top 10 dangerous players\"\n table_top_danger\n when \"-> Back\"\n home\n when \"-> Quit\" || \"QUIT\"\n when \"-> Restart\" || \"RESTART\"\n run\n else\n error\n end\n end", "def login_menu_display\n puts \"Welcome to Ticket Search app!\"\n login_choice = @prompt.select(\"What would you like to do?\", [\"Create Account\", \"Login\", \"Exit\"])\n case login_choice\n when \"Create Account\"\n user_create\n system \"clear\"\n when \"Login\"\n account_login\n system \"clear\"\n when \"Exit\"\n exit\n end\n end", "def show_main_menu\n puts \"\\e[H\\e[2J\"\n puts \"Welcome to the app. What's next?\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" quit - Exit Application\"\n print \"> \"\n end", "def welcome_menu\n prompt = TTY::Prompt.new\n puts\"( ノ ゚ー゚)ノ☀️ Welcome to Weeb Favorites! ☀️ヽ(゚ー゚ヽ)\"\n new = prompt.select(\"Before making modifications, please create a name:\", [\"Create\", \"View Duo List\", \"Modifications\", \"Exit\"])\n\n case new\n\n when 'Create'\n create\n chosen_char\n\n when 'View Duo List'\n find_all_duo\n\n when 'Modifications'\n mods\n\n when 'Exit'\n close_app \n end \nend", "def initial_screen\n clear_screen\n option = main_options\nend", "def start_app\n response = show_menu\n response = show_menu while response < 1 || response > 7\n\n case response\n when 1\n list_books\n when 2\n list_people\n when 3\n create_person\n when 4\n create_book\n when 5\n create_rental\n when 6\n list_rentals_for_person_id\n when 7\n puts 'Thank you for using this app!'\n end\n\n puts \"\\n\"\n end", "def show_main_menu\n puts \"Welcome to the app. What's next?\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" find - Find by name\"\n puts \" quit - Exit Application\"\n print \"> \"\n end", "def secret_menu\n puts \"\"\n options = [\"View Character Dictionary\", \"View Spellbook\", \"View House\", \"View Classmates\", \"Quit\"]\n choice = PROMPT.select(\"Welcome to Hogwarts. Feel free to explore the following:\", options)\n case choice\n when options[0]\n character_dictionary\n when options[1]\n which_user_spellbook_and_path?\n secret_menu_or_quit\n when options[2]\n house_info\n secret_menu_or_quit\n when options[3]\n user_classmates\n when options[4]\n goodbye\n end\n end", "def show_main_menu\n puts \"Welcome to the app. What's next?\".yellow\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" show - display details via index\"\n puts \" find - find someone by name\"\n puts \" quit - Exit Application\"\n print \"> \"\n end", "def show_main_menu\n puts \"Welcome to the app. What would you like to do?\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" quit - Exit Application\"\n puts \" show - shows contact with specific id\"\n puts \" find - find a user\"\n print \"> \"\n end", "def main_menu\n \"Welcome to BATTLESHIP\\nEnter p to play or q to quit\"\n end", "def main_menu(owner_name, owner)\n puts \"#{page_break}\\n\n Select from the following menu options to get started:\\n\n 1 - Make New Appointent\n 2 - Reschedule Appointment\n 3 - Cancel Appointment\n 4 - Search for a Groomer\n 5 - Exit\n \"\n end", "def main_menu\n @active = 0\n @prompt.select(\"\\nWhat would you like to do?\\n\".blue) do |menu|\n menu.choice \"Check out what's on today\", -> {today_menu} \n menu.choice \"Check out things to do on the weekend\", -> {weekend_menu}\n menu.choice \"Look at my favourites\", -> {display_favorites}\n menu.choice \"Exit\".red, -> {leave_app} \n end \n end", "def display_menu\n title_print\n puts \"Hi #{@todays_hero.name}!\"\n puts \"***************************\"\n selection = TTY::Prompt.new.select(\"What would you like to do?\", per_page: 10, cycle: true) do |menu|\n menu.enum '>'\n\n menu.choice 'Start a fight', 1\n menu.choice 'Train for battle', 2\n menu.choice 'Go on a Quest', 3\n menu.choice 'Show Stats', 4\n menu.choice 'Display Instructions', 5\n menu.choice 'Display Leaderboard', 6\n menu.choice 'Exit', 7\n end\n self.start_game_loop(selection)\n end", "def display_menu\n system('clear')\n arr = ['My List', 'Recommendations', 'Playlist', 'Account Details', 'Exit']\n @prompt.select(\"》 MAIN MENU 《\\n\".colorize(:light_green), arr)\n end", "def menu\n\n puts \"________________\"\n\n puts \"insert the user name to continue\"\n @user_name = gets.chomp\n response = User.find_by(user_name: @user_name)\n\n puts \"________________\"\n\n if response\n \n mainscreen\n else\n puts \"try again\"\n menu\n end\n end", "def home()\[email protected]\n @titleLabel.setVisible(true)\n @actionNew.setVisible(true)\nsetWindowTitle('Internet Cafe Customer Management System (I.C.C.M.S.) by SAFEW')\nend", "def show_main_menu\n puts \"Welcome to the app. What's next?\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" show id - Show info for contact id number\"\n puts \" quit - Exit Application\"\n print \"> \"\n end", "def start_menu\n puts \"\"\n choice = @prompt.select(\"Welcome! Please choose from the following options:\") do |menu|\n menu.choice 'Play'\n menu.choice 'Account Management'\n menu.choice 'Check Scoreboard'\n menu.choice \"Exit\"\n end\n\n if choice == \"Play\"\n if @user\n play\n else\n login\n play\n end\n elsif choice == \"Account Management\"\n manage_account\n elsif choice == \"Check Scoreboard\"\n scoreboard\n elsif choice == \"Exit\"\n system 'killall afplay'\n goodbye\n end\nend", "def main_menu\n menu = [\n \"My Stats\",\n \"My Hikes\",\n \"Trails\",\n \"Quit\"]\n choice = nil\n while choice != \"Quit\"\n system 'clear'\n puts \"------MAIN MENU------\"\n choice = @prompt.select(\"What would you like to do #{@current_user.name}?\", menu)\n\n case choice\n when \"My Stats\"\n user_stats\n when \"My Hikes\"\n hike_options\n when \"Trails\"\n trail_options\n end\n end\n end", "def show_main_menu\n puts \"Welcome to the app. What's next?\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" find - Find by name\"\n puts \" delete - Delete by ID\"\n puts \" quit - Exit Application\"\n print \"> \"\n end", "def main_menu\n prompt.select(\"What would you like to do today #{user.name}?\") do |menu|\n menu.choice \"Choose Protein\", -> {choose_protein}\n menu.choice \"Exit!\", -> {exit_helper}\n menu.choice \"Delete Account!?!?\", -> {delete_account_helper}\n end\n end", "def home\n\n # Tell Screen Manager to Display the home screen\n @screens.main\n\n # Forever while loop to stay in the menu until valid input is received.\n # Convert input to uppercase and sanitize whitespace.\n # Each switch case exits to its respective methods.\n # Close the Window if player wants to Quit.\n # If they want to start the game, tell screen manager to change screen passing it, the current turn number,\n # turn, \"un-chopped\" player guess, the list of player characters and a feedback list so that the screen\n # class can easily display these where it needs to.\n # and run the game method.\n while true\n # Recieve player input sanitising any whitespace\n option = gets.upcase.strip\n case option\n when 'Q'\n close\n when 'G'\n # Change the screen to the turn limit screen\n @screens.turn_limit\n\n # Get the max ammount of turns the player wants to play\n # A do..While loop has been used to validate correct input has been entered\n loop do\n #get player input and automatically set it to lowercase, to avoid issues comparing ths stings later on\n tries = gets.to_i\n if tries > 0 && tries < 21\n @player.turn_limit = tries\n @screens.running(@turn_number, @player.turn_limit, @player.player_guess, @player.whole_word, @feedback)\n break\n end\n puts ERRORMESSAGE + 'number.'\n print 'Guess Limit: '\n end\n\n # Run the Game\n game_run\n else\n puts ERRORMESSAGE + 'menu option.'\n print 'Option:'\n end\n end\n end", "def main_menu\n puts \"------------------------------------------------------------------------------------------------------\".colorize(:yellow)\n Artii::Base#asciify\n a = Artii::Base.new\n a.asciify(\"Toy Robot Challenge\")\n system(\"clear\")\n puts a.asciify(\"Toy Robot Challenge\").colorize(:red,)\n\n prompt = TTY::Prompt.new\n choices = [\n {name: 'New Game.', value: 1},\n {name: 'Exit.', value: 2},\n ]\n players_input = prompt.select(\"Select An Option:\", choices) \n case players_input\n when 1\n new_game\n when 2\n exit\n end \nend", "def initial_login\n clear\n ascii_art\n puts '》 Welcome to the Spotify Recommendations App! 《'.colorize(:light_green)\n puts\n selection = @prompt.select(\"Are you a new or returning user? \\n\", %w[New Returning])\n new_user if selection == 'New'\n returning_user if selection == 'Returning'\n end", "def main_menu\n menu_options = [\"Start exploring\", \"Check Inventory\", \"Check Your Score\", \"Go to Pokemon Center\", \"Quit\"]\n menu_prompt = Interactivity.mainMenu \n \n if user.pokemon == nil\n menu_options.shift()\n menu_options.unshift(\"Choose a Pokemon and start exploring\")\n elsif self.user_current_location\n menu_options.shift()\n menu_options.unshift(\"Keep Exploring\")\n end\n \n choice = prompt.select(menu_prompt, menu_options) \n if choice == \"Start exploring\" || choice == \"Choose a Pokemon and start exploring\" || choice == \"Keep Exploring\"\n self.trainer_chooses_pokemon if user.pokemon == nil \n self.trainer_chooses_town\n self.exploring_town\n elsif choice == \"Check Inventory\"\n puts \"MANAGE INVENTORY - CHANGE POKEMONS AROUND\"\n elsif choice == \"Go to Pokemon Center\"\n self.pokemon_center\n elsif choice == \"Check Your Score\"\n puts \"CHECK YOUR SCORE\"\n else\n Interactivity.quit\n end\n end", "def greet\n system \"clear\"\n self.spinner(\"Loading App\")\n self.spinner(\"🔺 Enumerati-ing 🔺 \")\n welcome = \"Welcome\".colorize(:light_green)\n se = \"Student Exchange\".colorize(:light_magenta)\n puts \"_\".colorize(:light_green) * \"Welcome to Student Exchange, the best book exchanging application on campuses throughout USA!\".length\n choice = self.prompt.select(\"Welcome to \".colorize(:light_green) + \"Student Exchange\".colorize(:color => :light_magenta, :mode => :bold) + \", the best book exchanging application on campuses throughout USA!\\n\".colorize(:light_green) + \"Are you a new user or returning user?\".colorize(:color => :light_green).underline, [\"New User\", \"Returning User\", \"Exit\"])\n puts \" \"\n # Based on the user's choice, will redirect them to the appropriate User method\n # We set the user instance object to the user object we created (new user) or retrieved (returning user)\n case choice\n when \"New User\"\n user = User.handle_new_user\n self.spinner(\"Creating Account\")\n self.user = user\n self.main_menu\n when \"Returning User\"\n user = User.handle_returning_user\n self.spinner(\"Restoring Session\")\n self.user = user\n self.main_menu\n when \"Exit\"\n puts \"Smell ya later! 🦄\"\n exit\n end \n end", "def booth_main_menu\n prompt.select(\"Welcome Booth Operator, what would you like to do today?\" ) do |menu|\n menu.choice \"View Merchandise\", -> {self.user.check_merchandise}\n menu.choice \"Update Inventory\", -> {self.user.add_to_inventory}\n menu.choice \"List of Customers\", -> {self.user.list_of_attendees}\n menu.choice \"Number of Sales\", -> {self.user.number_of_sales}\n menu.choice \"Items Sold\", -> {self.user.sales_made}\n menu.choice \"Sales Revenue\", -> {self.user.sales_revenue}\n menu.choice \"Exit\", -> {exit!}\n end\n end", "def login_display\n\t\tsystem(\"clear\")\n puts \"#######################\"\n puts \"# #\"\n puts \"# Welcome!! #\"\n puts \"# #\"\n puts \"# Please select an #\"\n puts \"# option #\"\n puts \"# #\"\n puts \"# 1. New User #\"\n puts \"# #\"\n puts \"# 2. Returning User #\"\n puts \"# #\"\n puts \"# 3. Exit #\"\n puts \"# #\"\n\t\tputs \"#######################\"\n\tend", "def main_menu\n options = [\"View recipe book\", \"Search by ingredient\", \"Quit app\"]\n answer = @prompt.select(\"Choose an option:\".colorize(:color => :blue), (options))\n if answer == options[0]\n select_recipe_from_book(@user.view_recipe_book)\n elsif answer == options[1]\n find_recipe\n elsif answer == options[2]\n puts ''\n puts \"Thanks for using Feed. See you next time!\".colorize(:color => :blue)\n system exit\n end\nend", "def helpdesk_start\n\t# Commented out for initial submission due to guest functionality not fully developed.\n\n\t# Clears terminal screen\n\t# system(\"clear\")\n\t# # Declare new instance of tty-prompt gem class\n\t# prompt = TTY::Prompt.new\n\t# # Declare variable of artii gem class\n\t# a = Artii::Base.new :font => 'slant'\n\t# # Print to screen program title screen with artii and colorize gem customization\n\t# puts a.asciify('OpenDesk').colorize(:green)\n\t# puts \"\\n---------------------------------------------\\n\\nWelcome to OpenDesk - the open source helpdesk app built using Ruby.\"\n\t# # Ask user for chosen input using tty-prompt menu selection\n\t# mode = prompt.select(\"\\nSelect a login option:\") do |menu|\n\t# \tmenu.choice 'Admin', 1\n\t# \tmenu.choice 'Guest', 2\n\t# end\n\t# Call a chosen method dependant on returned menu option\n\t# if mode == 1\n\t\t# admin_login_method\n\t# else\n\t# \tputs \"Guest Mode!\"\n\t# end\nend", "def present_menu_options\n space(1)\n puts \"Choose an option from the list below.\"\n space(1)\n puts '1. Search for events by city'\n puts '2. Search for events by artist or sports team'\n puts '3. See what I have coming up'\n puts '4. Delete my account'\n puts '5. Exit'\n space(1)\n pick_option\nend", "def main_menu\n\t\twhile true\n\t\t\tprint_main_menu\n\t\t\tuser_selected = gets.chomp.to_i\n\t\t\t\tif user_selected == 7\n\t\t\t\tputs \"Current session ended, goodbye!\"\n\t\t\t\treturn\n\t\t\tend\n\t\t\tcall_option(user_selected)\n\t\tend\n\tend", "def welcome_screen\n puts render_ascii_art\n puts \"Welcome to DPL Casino! Enter at your own risk!\"\n puts \"What is your name?\"\n user_input = gets.strip\n puts \"Welcome, #{user_input}!\"\n puts \"Shall we play a game? How much money would you like to play with today?\"\n money = gets.strip.to_i\n @wallet = Wallet.new(money)\n if @wallet.validate_money(money)\n puts \"Big money! Your starting bankroll is: $#{@wallet.current_balance}\"\n puts \"What would you like to do now?\"\n main_menu\n else puts \"Invalid amount. Try again.\"\n welcome_screen\n end\n end", "def main_menu(user_instance)\n user_greeting(user_instance)\n case help\n when \"1\", \"playlist\", \"playlists\"\n system(\"clear\")\n playlists_menu(user_instance)\n when \"2\", \"songs\", \"song\"\n system(\"clear\")\n songs_menu(user_instance)\n # when \"3\", \"artists\", \"artist\"\n # system(\"clear\")\n # artists_menu(user_instance)\n when \"exit\"\n system(\"clear\")\n goodbye\n exit\n else\n system(\"clear\")\n puts \"Please enter a valid command.\".colorize(:red).bold\n main_menu(user_instance)\n end\nend", "def welcome\n self.user_id = nil\n prompt.select(\"\\nWelcome to the Forum! Choose an action - \\n (Press Esc at any time to return to this menu!\") do |menu|\n menu.choice \"Login\", -> {login}\n menu.choice \"Create Account\", -> {account_creation}\n menu.choice \"Browse as a Guest\", -> {\n user_id = nil\n show_threads\n }\n menu.choice \"Exit\", -> {exit}\n end\n \n end", "def start_screen()\n puts \"Welcome to Hangman.\"\n puts \"'N' to start a new game, 'L' to load!\"\n choice = gets.chomp.upcase\n if choice == 'N'\n self.play\n elsif choice == 'L'\n load_game\n else\n puts \"Please choose 'N' or 'L' next time.\"\n puts \"For now the culprit's fate is spared. Take care!\"\n end\n end", "def homeScreen\n puts \"######################################################################\"\n puts \"# #\"\n puts \"# ~~~~~~~~~~~~ Coder Academy 2018 Student Directory ~~~~~~~~~~~~ #\"\n puts \"# #\"\n puts \"######################################################################\"\n puts \"\"\n puts \"\"\n puts \"Type the first name and last name of any student to search\"\n puts \"\"\n puts \"For a list of students, enter 'help'\"\n puts \"To randomise all student data, enter 'randomise!'\"\n puts \"To exit, type 'exit':\"\nend", "def menu\n system('clear')\n selection = @prompt.select('》 PLAYLIST 《', ['Display', 'Add', 'Remove', 'Export To File', 'Back'])\n case selection\n when 'Display'\n list\n else\n case_menu(selection)\n end\n end", "def go_home\n wait_for_home_button\n home_button.click\n end", "def main_menu\n \twhile true\n \t\tprint_main_menu\n\n \t\tprint \"Choose an option:\"\n \t\tuser_input = gets.chomp.to_i\n\n \t\tbreak if user_input == 7\n \t\t\n choose_option(user_input)\n \tend\n end", "def greet\n puts 'Welcome to the school review app, the best resource for school information in the world!'\n @prompt.select(\"Are you a returning user or a new user?\") do |menu|\n menu.choice \"Returning User\", -> { User.handle_returning_user }\n menu.choice \"New User\", -> { User.handle_new_user }\n end\n end", "def greet_screen\n separator\n welcome_user\n separator\n input = gets.chomp\n if input == \"concerts\"\n concert_screen\n elsif input == \"exit\"\n exit_screen\n else\n unrecognized_input\n end\n end", "def home #display the home page of the candidate, has options to search\n end", "def start_menu\n printf \"\\nPrograma para a disciplina de LPD\\n\"\n printf \"Choose one option\\n\"\n printf \"------------------------------------\\n\"\n printf \"1) Insert user\\n\"\n printf \"2) Login user\\n\"\n printf \"3) Delete user\\n\"\n printf \"0) Exit\\n\"\nend", "def prompt_action \n puts \"You have six options: list users, list channels, select user, select channel, display details, send message, or quit.\"\n puts \"\\n\"\n print \"Please enter your choice: \"\n return gets.chomp.downcase\nend", "def main_menu(user)\n user = user\n self.clear\n Ascii.image\n menu = [\"See all my plants\",\"Add new plant\",\"Delete my account\",\"Quit\"]\n menu_selection = @@prompt.select(\"What would you like to do?\",menu)\n \n case menu_selection\n when \"See all my plants\"\n my_plant(user)\n when \"Add new plant\"\n add_plant(user)\n when \"Delete my account\"\n answer = @@prompt.yes?(\"Are you sure?\")\n answer == true ? user.destroy : self.main_menu(user)\n when \"Quit\"\n index = 0\n # binding.pry\n color = [\"#7FFF00\",\"#6B8E23\",\"#008000\",\"#2F4F4F\",\"#00008B\"]\n 5.times do\n self.clear\n # binding.pry\n puts Paint[Ascii.goodbye, color[index]] \n index += 1\n sleep(0.7)\n end \n end\n end", "def displaymenu # Console only\r\n\t\t @output.puts \"Menu: (1) Play | (2) New | (3) Analysis | (9) Exit\"\r\n\t\t end", "def menu\n input = gets.strip.downcase\n \n if input == \"hungry\"\n cuisine_list\n menu # return 'menu' don't want my user to get kicked out of application \n elsif input == \"goodbye\"\n goodbye\n else \n invalid_entry\n end \n end", "def new_game\n puts \"Start A New Game?\".colorize(:light_magenta,)\n puts \"------------------------------------------------------\".colorize(:yellow)\n prompt = TTY::Prompt.new\n choices = [\n {name: 'Yes', value: 1},\n {name: 'No', value: 2},\n ]\n players_input = prompt.select(\"Select An Option:\", choices) \n case players_input\n when 1\n return execute_game\n when 2\n return main_menu\n end \nend", "def home\r\n \r\n end", "def main_menu\r\n puts \"\\nMain Menu.\"\r\n puts \"A. List Buildings\"\r\n puts \"B. List Machines\"\r\n puts \"C. List Snacks\"\r\n puts \"D. List Users\"\r\n puts \"E. Find a Snack\"\r\n puts \"F. Add a New Snack\"\r\n puts \"G. Create New User\"\r\n puts \"H. List Favorites\"\r\n puts \"I. Find Favorites\"\r\n puts \"J. Add Favorites\"\r\n puts \"Q. Quit\"\r\nend", "def menu\n print \"\\nWhat would you like to do? \".colorize(:green)\n input = gets.strip.upcase\n if input == 'ROSTER'\n list_heroes\n elsif input == 'EXIT'\n exit\n else\n display_hero(input)\n end\n end", "def menu_options\n system \"clear\"\n puts \"~~~ Welcome #{@user.username} to the Main Menu ~~~\\n\\n\" \n puts \"{1} Continue from previous story \"\n puts \"{2} Create new story\"\n puts \"{3} Delete a story\"\n puts \"{4} Tutorial\"\n puts \"{5} End My Session\"\nend", "def main_menu\n prompt = TTY::Prompt.new(\n active_color: :red,\n symbols: {marker: \"⮊\"},\n quiet: true\n )\n\n puts \"\"\n menu_selection = prompt.select(\"Select an option:\") do |menu|\n menu.choice \"➊ Start a new game\", 1\n menu.choice \"➋ How to play\", 2\n menu.choice \"➌ Display win counts\", 3\n menu.choice \"➍ Exit program\", 4\n end\n\n case menu_selection\n when 1\n start_game\n when 2\n instructions\n when 3\n check_win_history\n when 4\n puts \"\\nThanks for playing\\n\\nGoodbye!\"\n exit\n else\n raise InvalidMenu\n end\n\n rescue InvalidMenu\n puts \"Invalid menu input. Please try again!\"\n retry\n rescue\n puts \"An unexpected error has occured. The program will now exit.\"\nend", "def main_menu\n\n puts \"Doctor's Office Manager\"\n puts \"Enter 'a' to access the appointments menu.\"\n puts \"Enter 's' to access specialities menu.\"\n puts \"Enter 'p' to access patient menu.\"\n puts \"Enter 'i' to access insurance menu.\"\n puts \"Enter 'd' to access doctor menu.\"\n puts \"Enter 'e' to exit\"\n puts \"Enter 'r' to access README\"\n\n user_choice = gets.chomp.downcase\n\n case user_choice\n when 'a'\n appointment_menu\n when 's'\n specialties_menu\n when 'p'\n patient_menu\n when 'i'\n insurance_menu\n when 'd'\n doctor_menu\n when 'e'\n puts \"Goodbye!\"\n sleep 1\n exit\n when 'r'\n display_readme\n else\n puts \"Enter something proper, ya jackass\"\n end\n\nmain_menu\nend", "def show_main_menu\n puts \" Welcome to the app. What's next?\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" list important - List all contacts\"\n puts \" show :id - Display contact details\"\n puts \" delete - Delete an entry\"\n puts \" find - Find an entry\"\n print \"> \"\n end", "def menu\n puts `clear`\n puts Rainbow(\"Welcome to the Happitails Database\\n\\n\").blue\n print 'Choose: (L)ists, (A)nimal Management, (C)lient Management or (Q)uit. '\n gets.chomp.downcase\nend", "def run\n welcome\n menu_exit\n end", "def main_menu\n while true\n print_main_menu\n user_selected = gets.chomp.to_s\n call_option(user_selected)\n end\n end", "def start\n begin\n Ui.print_formatted WELCOME_MESSAGE\n loop do\n choice = UserInputHandler.request_input @options_msg.join(\"\\n\")\n execute_choice(choice)\n end\n rescue StandardError => e\n handle_error(e)\n end\n end", "def show_main_menu\n puts \"Welcome to Contacts APP, What's next?\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" update - Enter ID to update a contact\"\n puts \" show - Enter ID to show detail of a contact\"\n puts \" find - Find contacts by name\"\n puts \" save - Save contact to CSV file\"\n puts \" quit - Save & Exit Application\"\n print \"> \"\n end", "def display_welcome_message\r\n prompt \"Welcome to Tic Tac Toe!\"\r\n end", "def display_menu()\n return 'Welcome to the Chicken Farm Simulator'\nend", "def welcome\n system 'clear'\n puts \"--------LOGIN--------\"\n menu = [\"Login\", \"Create new user\"]\n choice = @prompt.select(\"\", menu)\n case choice\n when \"Login\"\n login\n when \"Create new user\"\n create_account\n end\n end", "def show_menu\n clear_screen\n\n puts \"[+] #{FreelancerFinder::Job.all.count} Jobs Scraped [+]\".magenta\n puts \"_____________________________________________________________\"\n return @prompt.select(\"Please Select a Menu Option: \") do |menu|\n menu.choice \"show recent\"\n menu.choice \"scrape more\"\n menu.choice \"search\"\n menu.choice \"search by pay\"\n if @last_results\n menu.choice \"results\"\n end\n menu.choice \"exit\"\n end\n\n end", "def main_menu\n finished = false\n while finished == false\n user_input = @prompt.select(\"\\nWelcome, Please choose from the following options\") do |menu|\n menu.choice 'View Rules'\n menu.choice 'View Balance'\n menu.choice 'View Ratio'\n menu.choice 'Play Game'\n menu.choice 'Quit'\n end\n\n if user_input == 'View Rules'\n @rules.each do |rule|\n puts rule\n end \n elsif user_input == 'View Balance'\n puts \"\\nYour bank balance is $#{@user[:balance]}\"\n elsif user_input == 'View Ratio'\n puts \"\\nYour win/loss ratio is #{@user[:ratio]}\"\n elsif user_input == 'Play Game'\n run_game() \n clear_hands()\n else user_input == 'Quit'\n finished = true\n update_file()\n end\n end\n end", "def main_menu\n name_selector\n puts \"Okay #{@name}, what would you like to do?\"\n loop do\n case menu_arrows\n when '1'\n @recommendation.recommendation_menu\n when '2'\n puts 'you have the following number of games in your library: '\n @game_library.game_instances\n puts 'your custom list of games:'\n @game_library.user_games_lister\n when '3'\n puts 'add a game:'\n @game_library.add_title\n when '4'\n @game_library.delete_games\n when '5'\n @time_used.time_wasted\n when '6'\n @game_library.write_games\n puts 'thanks for your time!'\n exit\n end\n end\n end", "def show_main_menu\n puts \"Welcome to Contacts APP, What's next?\"\n puts \" new - Create a new contact\"\n puts \" list - List all contacts\"\n puts \" show - Enter ID to show detail of a contact\"\n puts \" find - Find contacts by name\"\n puts \" add - Add phone numbers\"\n puts \" save - Save contact to CSV file\"\n puts \" quit - Save & Exit Application\"\n print \"> \"\n end", "def see_your_tank\n display_tank_view_selection\n display_my_fish_tank\n puts display_tank_owners\n\n prompt = TTY::Prompt.new\n go_back = prompt.select(\"Select Main Menu to go back\") do |menu|\n menu.choice \"Main Menu\"\n end\n if go_back == \"Main Menu\"\n main_menu\n end\n end", "def menu()\n system('clear')\n puts '==================== M E N U ===================='.colorize(:light_blue)\n puts \" Press enter to start\".colorize(:green)\n gets.chomp\n @@support.help\n numberPlayers\n sleep (0)\n game\n return \"Finishing the game\"\n end", "def selection(choice)\n case choice\n when 1\n view_entries\n when 2\n manual_add_entry\n when 3\n puts 'Awaiting Build...'\n hold_screen\n # search_menu\n when 4\n puts 'Awaiting Build...'\n hold_screen\n # file_selection\n end\n end", "def start\n @choice = list[ get_user_input ]\n puts \"You chose #{@choice}.\\n\\n\"\n end", "def interface\r\n clear\r\n menu_banner\r\n puts\r\n options = [\r\n { name: 'New Game', value: -> { get_user_selection } },\r\n { name: 'Custom quiz collections', value: -> { custom_collection } },\r\n { name: 'History', value: -> { history_select } },\r\n { name: 'Exit', value: lambda {\r\n clear\r\n exit_banner\r\n exit\r\n } }\r\n ]\r\n option = @prompt.select(\"Please select from the following options.\\n\\n\", options,\r\n help: \"(Select with pressing ↑/↓ arrow keys, and then pressing Enter)\\n\\n\", show_help: :always)\r\n end", "def main_menu\n\t\tputs '################################'\n\t\tputs '######### Tic Tac Toe ##########'\n\t\tputs '################################'\n\t\tputs '================================'\n\t\tputs '== Choose your weapon warrior =='\n\t\tputs '================================'\n\t\tputs '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'\n\t\tputs '^^^^^^ Type Your Choice: ^^^^^^^'\n\t\tputs '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'\n\t\tputs '$$$$$$$$$$$ 1. \"X\" $$$$$$$$$$$$$'\n\t\tputs '$$$$$$$$$$$ 2. \"O\" $$$$$$$$$$$$$'\n\t\tputs '--------------------------------'\n\tend", "def main_menu\n @@prompt.select(\"What would you like to do today?\".colorize(:yellow)) do |menu|\n menu.choice \"Read Reviews\", -> {self.read_reviews}\n menu.choice \"Write a review\", -> { self.writing }\n menu.choice \"Update a review\", -> { self.update_reviews }\n menu.choice \"Delete a review\", -> { self.deleting }\n menu.choice \"Log Out\", -> { self.log_out }\n end\n end", "def about_clubs\n clear_terminal\n divider\n @club.club_info\n divider\n choice = @prompt.select(\"\",\n [\"-> Back\",\"-> Quit\",\"-> Restart\"])\n case choice\n when \"-> Back\"\n clubs_home\n when \"-> Quit\" || \"QUIT\"\n when \"-> Restart\" || \"RESTART\"\n run\n else\n error\n end\n end", "def play\n\t\tdisplay_welcome\n\t\twhile true\n\t\t\tchoice = get_menu_choice\n\t\t\tchoice_result = handle_menu_choice choice\n\t\t\tbreak if choice_result == :quit\n\t\tend\n\t\tputs \"Thanks for playing Hangman :-) Play again soon.\"\n\tend", "def display_menu\n # print the options\n puts \"Main menu:\"\n puts \"s = Start game\"\n puts \"c = Change size\"\n puts \"q = Quit\"\n # print the best score\n # if there is no best score yet a message is displayed instead\n if $best_score == 0\n puts \"No games played yet\"\n else\n puts \"Best game: #{$best_score} turns\"\n end\n \n # Then ask for input for one of the options\n print \"Please enter your choice: \"\n \nend", "def main_menu(user)\n calories = Calories.new\n loop do\n calories.calorie_intake(user)\n case Prompts.main_selection\n when '1'\n calories.log_daily_meals\n when '2'\n calories.log_daily_intake\n when '3'\n Details.update_weight(user)\n when '4'\n Quotes.inspirational\n when '5'\n quit\n end\n end\n end", "def main_menu\n\tputs \"Welcome to Creighton Bank!\"\n\tputs \"Please make choose an option:\"\n\tputs \"------------------------------\"\n\tputs \"1. Create a new account\"\n\tputs \"2. View Account Information\"\n\tputs \"3. Exit Program\"\n\n\tprint \"Option: \"\n\n\toption = gets.chomp.to_i\n\n\tif option == 1\n\t\t\tcreate_account\n\t\t\tmain_menu\n\telsif option == 2\n\t\t\taccount_menu\n\telsif option == 3\n\t\t\tputs \"Thank you for stopping by!\"\n\telse\n\t\tputs \"Invalid entry! Please choose from the available options!\"\n\t\tmain_menu\n\n\tend\t\nend", "def display_menu\n puts \"1. Scrapp townhalls' emails from web\"\n puts \"2. Send massive emails to townhalls\"\n puts \"3. Follow towhalls on Twitter\"\n puts \"4. Print me the JSON\"\n puts \"5. Exit program\"\n end", "def intro\n\tputs \"Welcome to HappiTails Animal Shelter!\"\n\tputs \"\"\n\tputs \"Please select an operaiton form the menu below:\"\n\tputs \"1) Display all animals\"\n\tputs \"2) Display all clients\"\n\tputs \"3) Add an animal\"\n\tputs \"4) Add a client\"\n\tputs \"5) Have a client adopt an animal\"\n\tputs \"6) Have a client put an animal up for adoption\"\n\tputs \"0) Exit the program\"\n\tputs \"\"\nend", "def display_menu\n puts \"Choose from the following options: \\n\n to find a candidate, type 'find id' (ex. find 1)\n to view all candidates, type 'all'\n to view all qualified candidates, type 'qualified'\n to exit, type 'quit' \n to view menu, type 'menu' \\n\\n\"\nend", "def main_menu_selection\n puts \"\"\n PROMPT.select(\"What would you like to do?\") do |menu|\n menu.choice \"Download this week's quiz\", 1\n menu.choice \"Download last week's quiz\", 2\n menu.choice \"Exit app\", 3\n end\n end", "def menu\n puts \"#{dashes}\\n\n Choose from the following options - using the numbers (1-6) as your input:\\n\n - 1 - Create your user profile\n - 2 - Search for doctors by region\n - 3 - Search for doctors by specialty\n - 4 - Search for the doctors the user has visited\n - 5 - Does something else\n - 6 - Quit the application\n \"\n end", "def main_menu\n puts \"===============\"\n puts \"Make a selection\"\n puts \"===============\"\n puts \"1: Command line\"\n puts \"2: Atom\"\n puts \"3: Search?\"\n puts \"4: Quit\"\n puts \"===============\"\n\n case gets.strip\n when \"1\"\n command_line_menu\n when \"2\"\n atom_menu\n when \"3\"\n search_function\n reset\n when \"4\"\n exit 0\n else\n bad_choice\n main_menu\n end\nend", "def menu\n puts \"------Calculator----\"\n puts \"Welcome to the calculator!\"\n puts \"Please select an option:\"\n puts \"\\t1) Enter numbers and modifier\"\n puts \"\\t2) Enter a string input\"\n puts \"\\t3) View the calculations you have preformed\"\n puts \"\\t4) Exit\"\n main_menu\n end", "def app_mgmt_launch_app(screen, app)\r\n\r\n if (app == \"Eclipse\")\r\n\t\tspawn(\"sudo #{Cosmos::USERPATH}/../eclipse/eclipse/eclipse\")\r\n elsif (app == \"AppGen\")\r\n\t\tspawn(\"java -jar #{CFS_KIT_GEN_APP_DIR}/CreateApp.jar\")\r\n elsif (app == \"APP_SUMMARY\")\r\n display(\"CFS_KIT APP_SUMMARY_SCREEN\",50,50)\r\n else\r\n prompt(\"Error in screen definition file. Undefined commmand sent to app_mgmt_launch_app()\")\r\n end\r\n\r\nend", "def welcome_screen\n puts \"Bienvenue dans la secret place !\"\nend", "def cfs_kit_launch_app(screen, app)\n\n\n if (app == \"UPDATE_TUTORIAL\")\n # An exception will report any errors \n if cfs_kit_create_tutorial_screen\n prompt (\"Successfuly created tutorial screen file #{tutorial_scr_file}\\nusing #{tutorial_def_file}\")\n end\n elsif (app == \"PROTO_APPP\")\n #TODO - Investigate generic text table editor or tutorial screen\n\t Cosmos.run_process(\"ruby lib/OskCfeFileViewer -f '/mnt/hgfs/OpenSatKit/cosmos/cfs_kit/file_server/cfe_es_syslog.dat'\")\n\t #Cosmos.run_process(\"ruby lib/OskTxtFileViewer -f '/mnt/hgfs/OpenSatKit/cosmos/test.json'\")\n #require 'osk_tbl_editor'\n #Cosmos.run_process(\"ruby lib/OskTblEditor\")\n\t #require 'cfs_fcx_cmdgen'\n #Cosmos.run_process(\"ruby lib/CfsFcxCmdGen\")\n #Cosmos.run_process(\"ruby tools/ConfigEditor\")\n #Cosmos::OskTblEditor.run\n #Cosmos.run_cosmos_tool('ConfigEditor')\n\n elsif (app == \"TUTORIAL\")\n cfs_kit_launch_tutorial_screen\n end\n\nend", "def welcome\n puts \"---------------------------------------------\".center(70).blue\n puts \"Welcome to the Makers Academy Student Database!\".center(70).green\n puts \"---------------------------------------------\".center(70).blue\n interactive_menu\nend", "def home\n\t\t\n\tend" ]
[ "0.7408151", "0.7368465", "0.69837356", "0.69769496", "0.6955913", "0.6898987", "0.68598676", "0.6807351", "0.6773787", "0.67671025", "0.6749658", "0.6742748", "0.6718981", "0.67119163", "0.67043835", "0.66926783", "0.6626166", "0.66145456", "0.6613175", "0.66129744", "0.6593256", "0.65803987", "0.65742874", "0.65673244", "0.6566525", "0.6565501", "0.65425223", "0.65393674", "0.6513899", "0.650621", "0.6478261", "0.64774805", "0.6470879", "0.64518213", "0.6441311", "0.6430516", "0.6427318", "0.64262414", "0.6421337", "0.64183915", "0.6416983", "0.64043456", "0.64037824", "0.63943183", "0.6382243", "0.6381134", "0.63692445", "0.6361239", "0.635537", "0.6352774", "0.63444215", "0.63421476", "0.63364744", "0.6335613", "0.6329491", "0.63202685", "0.6311429", "0.62822115", "0.6282014", "0.6281824", "0.6277478", "0.6275381", "0.6266785", "0.6258288", "0.6256248", "0.6255165", "0.6253951", "0.625331", "0.62525815", "0.62478733", "0.6238694", "0.6226196", "0.62218565", "0.62125516", "0.62114495", "0.62112576", "0.6202557", "0.62024766", "0.6202266", "0.6200206", "0.6198113", "0.6194444", "0.6183597", "0.61620605", "0.6153738", "0.61521775", "0.61484027", "0.6147723", "0.6143761", "0.61393607", "0.61348253", "0.6132396", "0.61319786", "0.6131729", "0.6123462", "0.6117334", "0.61095804", "0.61014605", "0.61014265", "0.6101077" ]
0.7824819
0
This function loads the sample data from the global $sample_data_filename
def load_sample_data begin # try to load the file # open the file and create an array to hold it sample_data_file = File.open($sample_data_filename) sample_contents = Array.new{Array.new} i = 0 # add the contents of the file to the two-dimensional array sample_data_file.each do |line| sample_contents[i] = line.split(",").map(&:strip) i += 1 end return sample_contents rescue # catch exceptions abort "Unable to continue - sample data file #{$sample_data_filename} not found." end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_sample(file)\n path = Rails.root.join(\"lib\", \"assets\", \"sample_data\", \"#{file}.json\")\n file_data = File.read(path)\n return JSON.parse(file_data, symbolize_names: true)\n end", "def sample_data(file_name)\n file = File.expand_path(File.dirname(\"spec/assets/*\")) + \"/#{file_name}\"\n File.read(file)\nend", "def read_data_file(path); end", "def load_data(data_file)\n puts \"FileGenTask: Loading data from YML file [ #{data_file} ]\" if @verbose\n df = DataFile.new\n @data = df.read( data_file )\n end", "def load_data(dir_path,file_name=nil)\n \tloca_path='/Users/jinfenglin/Dropbox/cosi105b_jinfenglin/movies-2/'\n\t\tif file_name\n base=loca_path+dir_path+'/'+file_name.to_s+'.base'\n test=loca_path+dir_path+'/'+file_name.to_s+'.test'\n base_file=open(base)\n test_file=open(test)\n build_database(base_file,@base_data_user_key,@base_data_movie_key)\n build_database(test_file,@test_data_user_key,@test_data_movie_key)\n else\n path=loca_path+dir_path+'/u.data'\n file=open(path)\n build_database(file,@base_data_user_key,@base_data_movie_key)\n end\n end", "def load_data\n\t\tload_using_arr(train_file,train_hash,0,1)\n\t\tload_using_arr(train_file,movie_hash,1,0)\n\tend", "def get_data\n\t\tdata_hash = {path: @data_file_path, training: @training_file_name, testing: @testing_file_name}\n\t\tDataLoader.new(data_hash)\n\tend", "def sample(*names)\n File.read(sample_path(*names))\nend", "def load_data(filename=nil)\n filename=data_file(filename)\n return unless File.exist?(filename)\n case File.extname(filename).downcase\n when \".yaml\",\".yml\"\n YAML.load(File.open(filename))\n when \".json\"\n JSON.parse(File.read(filename))\n else\n File.read(filename)\n end\n end", "def load_data (training_set, test_set = :NIL)\n base = training_set + \"/u.data\" if test_set == :NIL\n\t\tbase = training_set + \"/\" + test_set.to_s + \".base\" if test_set != :NIL\n\t\tfile = File.open (base)\n\n\t\ti=0\n\t\tfile.each_line do |line|\n\t\t\t@movieStore[i] = line.split(/\\s/)\n\t\t\ti += 1\n\t\tend\n\t\tif test_set != :NIL then\n\t\t\ttest_set = training_set + \"/\" + test_set.to_s + \".test\"\n\t\t\tfile2 = File.open(test_set)\n\t\t file2.each_line do |line|\n\t\t\t @test_set << line.split(/\\s/)\n\t\t end\n else\n @test_set = @movieStore\n end\n \n\t\tuser_movie_index()\n\tend", "def load_files\n @data = Hash.new\n @cities.keys.each { |city| \n @data[city] = Array.new(@cities[city])\n (@cities[city]+1).times { |i|\n @data[city][i] = Hash.new\n @trunc_params.each { |x|\n begin\n @data[city][i][x] = IO.readlines(@basedir+\"/#{city}/sample_#{i}/#{x}.out\")\n @data[city][i][x].map! do |x| process_line x end\n rescue SystemCallError\n File.open('errorout','a') do |f| f.puts(@basedir+\"/#{city}/sample_#{i}/#{x}.out\") end\n @data[city][i][x] = nil\n end\n }\n }\n }\n end", "def load_data(file)\n\t\t@user_set = Hash.new\n\t\t@sim_set = Hash.new\n\t\t@movies = Array.new\n\t\tFile.open(file).each do |line|\n\t\t\tline = line.split(\" \")\n\t\t\tgenerate_movies(line[0]) unless file.include? \"test\"\n\t\t\tgenerate_user_pref(line[0], line[1], line[2])\n\t\tend\n\t\t# generate_predictions unless file.include? \"test\"\n\tend", "def load_file(filename); end", "def load_file(filename); end", "def DataLoadFromFile(filename)\n file = File.new(filename)\n \n @xml_data = file\n self.ScrapAnalyse()\n end", "def load_data(filename)\n if File.exist? filename\n line_num = 0\n File.foreach (filename) do |line|\n line_num += 1\n line = line.chomp.to_i\n if line_num == 1\n @number_of_vertices = line \n else\n @weights << line\n end\n end\n end\n end", "def load_data\n\t\tFile.open(\"#{@path_to_training}\", \"r\").each_line do |line|\n\t\t\ta = line.split\n\t\t\tadd_movie(a[1].to_i, a[0].to_i, a[2].to_i)\n\t\t\tadd_user(a[0].to_i, a[1].to_i, a[2].to_i)\n\t\tend\n\t\tif File.file?(\"#{@path_to_test}\") then\n\t\t\tFile.open(\"#{@path_to_test}\", \"r\").each_line do |line|\n\t\t\t\ta = line.split\n\t\t\t\t@list_of_test_set << Rating.new(a[0].to_i, a[1].to_i, a[2].to_i)\n\t\t\tend\n\t\tend\n\tend", "def load_data(options={})\n @data = @files.collect do |seeds_file|\n seeds_file.instanciate_data(@keys, :override => options[:override]) \n end.flatten.compact\n end", "def sample1\n Anomalous.load('spec/sample_data/sample.mat', data_format: :matlab)\nend", "def load(filename)\n\t\tend", "def load_data(data_set)\n\t\tif data_set != :u\n\t\t\tload_hashes(\"#{data_set}.base\") # training set\n\t\t\tload_test(\"#{data_set}.test\") # test set\n\t\telse\n\t\t\tload_hashes(\"#{data_set}.data\") # training set\n\t\tend\n\tend", "def payload_example(sample_name)\n payload_examples_path.join(sample_name).read\n end", "def fixture_data( filename )\n\t\tfixture = FIXTURE_DIR + filename\n\t\treturn fixture.open( 'r', encoding: 'binary' )\n\tend", "def sample_text(name)\n File.read(File.expand_path(\"samples/#{name}\", __dir__))\nend", "def load_file (filename)\n @name = nil\n File.open(filename, mode: 'r').each do |ln|\n flds = ln.split(',')\n if !@name\n @name = flds[0]\n end\n dts = flds[1];\n @obvs << \"#{dts[2..3]}-#{dts[4..5]}-#{dts[6..7]}\"\n @values << flds[2].to_f\n end\n #puts \"load_file: #{@values.size}\"\n end", "def read_data_from_file(filename=nil)\n filename = default_data_filename if filename.nil?\n @raw_data = File.read(filename)\n end", "def load_test(filename)\n datafile = open(filename)\n #three data structure to store the data\n @test_data=Array.new #array of arrays which stores each line of the the data\n @test_movies=Hash.new #map that for each unique movie id in the data file, stores its relevant records\n @test_users=Hash.new #map that for each unique user in the data file, stores its relevant records\n datafile.each_line do |line|\n linedata=line.split(\" \").map(&:to_i)\n @test_data.push(linedata)\n if !@test_users.has_key?(linedata[0])\n @test_users[linedata[0]]=[linedata]\n else\n @test_users[linedata[0]].push(linedata)\n end\n \n if !@test_movies.has_key?(linedata[1])\n @test_movies[linedata[1]]=[linedata]\n else\n @test_movies[linedata[1]].push(linedata)\n end\n end\n datafile.close\n end", "def sample_file(filename)\n File.new(\"#{Rails.root}/test/fixtures/files/#{filename}\")\n end", "def load_students(filename = \"students.csv\")\n file = File.open(filename, \"r\")\n file.readlines.each do |line|\n name, cohort = line.chomp.split(',')\n append_data(name,cohort)\n #@students << {name:name, cohort: cohort}\n end\n puts \"Loaded #{@students.count} from #{filename}\"\n file.close\nend", "def load_data\n data = {}.with_indifferent_access\n\n %w[.json .yaml].each do |ext|\n Dir.glob(\"#{DATA_DIR}/*#{ext}\") do |fname|\n key = File.basename(fname, ext).to_sym\n puts \"Loading data[:#{key}] from #{fname}...\"\n data[key] =\n if ext == '.json'\n JSON.parse(File.read(fname))\n else\n Psych.parse(fname)\n end\n end\n end\n\n data\n end", "def loadSamples(filename)\n return Lognorm.ln_loadSamples(self, filename) == 0 ? true : false\n end", "def data name\n File.read data_path(name)\nend", "def load_students(filename = \"students.csv\")\n #open file for loading\n file = File.open(filename, \"r\")\n file.readlines.each do |line|\n name, cohort = line.chomp.split(\",\")\n # add student data to the @students variable\n @students << {name: name, cohort: cohort}\n end\n file.close\n end", "def load(filename)\n end", "def load_wav filename\n sample_rate = nil\n fmt = nil\n data = ''\n File.open(filename) do |file|\n head = file.read(12)\n until file.eof?\n type = file.read(4)\n size = file.read(4).unpack(\"V\")[0].to_i\n case type\n when 'fmt '\n fmt = file.read(size)\n fmt = {\n :id => fmt.slice(0,2).unpack('c')[0],\n :channel => fmt.slice(2,2).unpack('c')[0],\n :hz => fmt.slice(4,4).unpack('V').join.to_i,\n :byte_sec => fmt.slice(8,4).unpack('V').join.to_i,\n :block_size => fmt.slice(12,2).unpack('c')[0],\n :bit_sample => fmt.slice(14,2).unpack('c')[0]\n }\n when 'data'\n data += file.read size\n else\n raise type\n end\n end\n end\n [fmt, data]\nend", "def read_data\n @files.each do |file|\n @source.location = file[:location]\n instance_variable_set('@' + file[:var].to_s,\n @source.send(file[:method], file[:klass]))\n end\n end", "def sample_from( data )\n logger.info \"sampling a random #{options['percentage']}% of the data\"\n samples = []\n total = 0\n fraction = options['percentage'] / 100.0\n data.each_line do |l|\n total += 1\n if rand < fraction\n samples << l.strip\n end\n end\n logger.info \"sampled #{samples.size} of #{total}\"\n return Filelist.new( StringIO.new( samples.join(\"\\n\") ) )\n end", "def load_data(filename)\n if File.exist? filename\n line_num = 0\n File.foreach (filename) do |line|\n line_num += 1\n line = line.chomp.to_i\n if line_num == 1\n @number_of_symbols = line \n else\n @input_weights << line\n insert line\n end\n end\n end\n end", "def load_data(folder,dataset=nil)\n train = dataset == nil ? \"#{folder}/u.data\" : \"#{folder}/#{dataset.to_s}.base\" \n test = dataset == nil ? \"\" : \"#{folder}/#{dataset.to_s}.test\"\n @trainset=read_file train\n @testset=read_file test\n #build user and movie index using hashes\n @[email protected]_by { |item| item.u_id }\n @[email protected]_by { |item| item.m_id }\n @rating_index={}\n @trainset.each {|item| @rating_index[[item.u_id,item.m_id]]=item.rating }\n end", "def load_data\r\n\t\t@data_array = IO.readlines(@path)\r\n\t\tratings_array=[]\r\n\t\t# ya this is gonna be an array of hashes\r\n\t\t# with array index as movie id and hash with kew of rank and value of count \r\n\t\tmovie_pop_array_hash=[]\r\n\t\tuser_ratings_arr = []\r\n\t\tdata_array.each do |line|\r\n\t\t\ttemp = line.split(\"\\t\")\r\n\t\t\ttemp.map! { |i| i.to_i }\r\n\t\t\t####### THIS CREATES MOVIE POPULARITY TABLES\r\n\t\t\tmovie_pop_store(movie_pop_array_hash, temp)\r\n\t\t\t####### THIS CREATES USER RATING TABLES\r\n\t\t\tuser_rate(user_ratings_arr, temp)\r\n\t\t\t@movie_viewers[temp[0]] << temp[1]\r\n\t\tend\r\n\t\t@mov_pop_ar_hs = movie_pop_array_hash\r\n\t\t@user_ratings = user_ratings_arr\t\r\n\tend", "def load_test(data_set)\n\t\tFile.open(data_set, \"r\") do |f|\n\t\t\tf.each_line do |line|\n\t\t\t\t@@line_array = line.split(' ')\n\t\t\t\t@test_set.push([@@line_array[0].to_i, @@line_array[1].to_i, @@line_array[2].to_i])\n\t\t\tend\n\t\tend\n\tend", "def test_using_random_sample\n @filelist = nil\n sublist = sample_from( self.filelist ) \n results = test_using_sublist( sublist )\n output.puts \"Test Using Random Sample\".center(72)\n output.puts \"=\" * 72\n report_results( results )\n\n end", "def load(file_path); end", "def load(file_path); end", "def preload_data\n @file.seek(0)\n @contents = StringIO.new(@file.read)\n @file.close\n end", "def readSample(expFileName)\n #openoffice.default_sheet = openoffice.sheets[2]\n #puts openoffice.default_sheet.to_s\n file_WORDSPOTSAMPLEEXP = File.path(expFileName+\"_WORDSPOTSAMPLEEXP.csv\")\n puts \"[readSample] started: #{file_WORDSPOTSAMPLEEXP}\"\n #sheet = openoffice.sheets[2]\n sampleMapByKey = {}\n CSV.foreach(file_WORDSPOTSAMPLEEXP,:headers => true) do |col|\n ekey = col[1].to_s()#B\n break if ekey.empty?\n sampleElement =Spnt::Exp::Data::ExpFoundResult.new(ekey)\n sampleElement.id = col[0].to_i()#A\n sampleElement.filename = col[2].to_s()#C\n sampleElement.label = col[3].to_s()#D\n sampleElement.shouldStart = col[4].to_i()#E\n sampleElement.shouldEnd = col[5].to_i()#F\n sampleMapByKey[ekey] = sampleElement\n end\n\n # (2..10000).each { |i|\n # ekey = openoffice.cell(i, 'B').to_s()\n # break if ekey.empty?\n # sampleElement =Spnt::Exp::Data::ExpFoundResult.new(ekey)\n # sampleElement.id = openoffice.cell(i, 'A').to_i()\n # sampleElement.filename = openoffice.cell(i, 'C').to_s()\n # sampleElement.label = openoffice.cell(i, 'D').to_s()\n # sampleElement.shouldStart = openoffice.cell(i, 'E').to_i()\n # sampleElement.shouldEnd = openoffice.cell(i, 'F').to_i()\n # sampleMapByKey[ekey] = sampleElement\n # puts \"[readSample] done #{i}: #{ekey}\"\n # }\n sampleMapByKey\n end", "def load(data)\n end", "def initialize\n load_data\n end", "def load_sample_data(skip = {})\n Sidekiq::Client.push(\n 'class' => SampleDataWorker,\n 'queue' => 'imports',\n 'args' => [self.id, skip]\n )\n end", "def load_data(file_name)\n\t\tindata = []\n\t\t#csv reader as shown in class; typecasted because I ran into some weird bugs\n\t\tCSV.foreach(\"#{file_name}\", col_sep: \"\\t\") do |row| \n\t\t\tindata.push({\"user_id\"=>row[0].to_i, \"movie_id\"=>row[1].to_i, \"rating\" => row[2].to_i, \"timestamp\" => row[3].to_i})\n\t\tend\n\t\treturn indata\n\tend", "def initialize(file)\n @data = { :students => [] }\n @file = file\n load_data\n end", "def load_data_from_file(default=json_default)\n KiJSONFile.load_json(path, default)\n end", "def load_hapmap_data\n \n column_headings = []\n result = \"\"\n File.open(\"#{RAILS_ROOT}/test/mocks/#{@hapmap_filename}\",\"r\") do |file|\n while (f = file.gets)\n\n next if f =~ /^#/ # ignore lines that start with a hash - comments\n f.strip! # remove any whitespace, linefeeds, etc.\n\n # if this line has the column headings, extract and do the next line\n if f =~ /^rs#/\n column_headings = f.split(/\\s/)\n next\n end\n\n # Split the hapmap file based on spaces\n snp_data = f.split(/\\s/)\n\n result = @controller.load_hapmap_snp_data(column_headings,snp_data)\n\n end # end of file_array.each loop\n end# of File.open\n \n end", "def sample_dir\n\t\t\"#{@dir}/samples\"\n\tend", "def load_data(filename)\n a = {}\n\n if File.exist? filename\n File.foreach (filename) do |line|\n line = line.chomp.split(' ')\n a[line[0]] = Array.new if !a[line[0]]\n a[line[0]][0] = Array.new if !a[line[0]][0]\n a[line[0]][0] << line[1]\n a[line[0]][1] = Array.new if !a[line[0]][1]\n a[line[0]][2] = false\n end\n end\n\n return a\n end", "def load_file(file); end", "def require_data(*file); end", "def require_data(*file); end", "def load_file(path, name)\n data_file = PStore.new(path)\n data = nil\n data_file.transaction do\n data = data_file[name]\n end\n if data == nil\n data = Array.new\n end\n data\nend", "def read_csv_test_data(filename)\n path = File.join(File.dirname(File.expand_path(__FILE__)) + \"/../../../../tests/data\", filename)\n read_csv_data_from_file(path)\n end", "def load_data(filename)\n\t\t@filename = filename\n\t\t@moviedata = Hash.new { |hash, key| hash[key] = [0, 0]}\n\t\t@userdata = Hash.new { |hash, key| hash[key] = []}\n\t\tnumlines = 0;\n\t\tFile.open(filename, 'r').each_line do |line|\n\t\t\tline = line.split '\t'\n\t\t\tnumlines += 1\n\n\t\t\t@moviedata[line[1].to_sym][0] += 1\n\t\t\t@moviedata[line[1].to_sym][1] += line[2].to_i\n\n\t\t\t@userdata[line[0].to_sym].push([line[1], line[2].to_i])\n\t\tend\n\t\t#puts numlines\n\tend", "def get_file_data files, suffix_pattern = \"\\.fastq\\.gz\"\n files = [files].flatten\n\n $NAME_PATTERN = /(.*)_S(\\d+)_L(\\d{3})_R(\\d)_(\\d{3})#{suffix_pattern}/\n # L1401_S1_L001_R1_001.fastq.gz\n # $1 = \"L1401\"\n # $2 = \"1\"\n # $3 = \"001\"\n # $4 = \"1\"\n # $5 = \"001\"\n\n sample_sheet_data = get_sample_sheet_data()\n\n\n file_data = files.collect do |file|\n base_name = File.basename(file)\n match = base_name =~ $NAME_PATTERN\n raise \"ERROR: #{file} does not match expected file name pattern\" unless match\n data = {:name => base_name, :path => file,\n :sample_name => $1, \n :lane => $3.to_i, :read => $4.to_i, :set => $5.to_i}\n barcode = sample_sheet_data[\"samples\"][$2.to_i - 1][\"index\"]\n\n if !(barcode =~ /([ATCGN]+|NoIndex|Undetermined)/)\n raise \"ERRROR: invalid barcode for sample: #{barcode}\"\n end\n data[:barcode] = barcode\n\n puts data.inspect\n data\n end\n file_data\n end", "def load_data(filename)\n File.open(filename, 'r').each_line do |line|\n line = line.split '\t'\n\n @moviedata[line[1].to_sym][0] += 1\n @moviedata[line[1].to_sym][1] += line[2].to_i\n\n @userdata[line[0].to_sym].push([line[1], line[2].to_i])\n \n end\n #puts numlines\n end", "def load_data\n return false unless File.exist?(@file)\n\n @data = YAML.load_file(@file)\n @data = { :students => [] } unless @data\n @data[:students] = [] unless @data.key?(:students)\n end", "def load_query_response\n load_file('sample_query_response.json')\nend", "def create_samples data\n data.each do |line|\n if !line.empty?\n if line[0].include? \"sample\"\n # check and see if this sample exists in inventory\n sample_array = line[0].partition(\":\")\n sample_name = sample_array[2].strip #removes leading and trailing whitespace.\n sample_check = Sample.find_by_name(sample_name)\n if sample_check.nil?\n # create the media\n sample = createMedia(sample_name, \"new sample\", \"media\")\n show do\n title \"Sample Created\"\n \n note \"The sample #{sample_name} has been sucessfully created in Aquarium\"\n end\n end\n end\n end\n end \n \n show do\n title \"Samples Created\"\n \n note \"The samples in #{FILENAME} have been sucessfully created in Aquarium.\"\n note \"Please double check and see if you include the word \\\"sample:\\\" before your sample name.\"\n end\n end", "def prepLoadSamples(inputStr, sampleTypes)\n \n # reformat input stripwells, associate positions on analyzer 96-well tray\n stripwells = operations.map { |op| op.input(inputStr).collection }.uniq\n \n case sampleTypes\n when 'DNA'\n # associate row, col for each sample\n operations.each_with_index do |op, i|\n op.associate :qc_row, (i/WELLS_PER_STRIPWELL.to_f).floor\n op.associate :qc_column, i % WELLS_PER_STRIPWELL\n #op.plan.associate \"qc_row_and_column_#{op.input(inputStr).sample.id}\", \"Your QC result for #{op.input(inputStr).sample.id} is in row #{op.get(:qc_row)} and column #{op.get(:qc_column)}\"\n end\n num_samples = 0\n \n show do \n title \"Relabel stripwells for stripwell rack arrangement\"\n note \"Place the stripwells in a green stripwell rack.\"\n note \"To wipe off old labels, use ethanol on a Kimwipe.\"\n warning \"Please follow each step carefully.\"\n # new label for each well\n stripwells.each_with_index do |s, i|\n num_samples = num_samples + s.num_samples\n note \"Grab stripwell #{s} (#{s.num_samples} wells). Wipe off the current ID. Label the first well <b>#{i+1}</b>\"\n end\n end\n \n rows = (num_samples/WELLS_PER_STRIPWELL.to_f).ceil\n # samples are sucked up as entire strips, so need to fill empty wells in last row with EB (techs have aliquots)\n eb_wells = rows*WELLS_PER_STRIPWELL - num_samples\n \n show do \n title \"Prepare EB stripwells\"\n note \"Make a stripwell of #{eb_wells} wells, pipette <b>10 uL</b> of <b>EB buffer</b> into each of its wells\"\n note \"Label the 1st well <b>#{stripwells.size+1}</b>\"\n end\n \n show do \n title \"Uncap stripwells\"\n note \"Uncap the stripwells and make sure there are no air bubbles\"\n end\n \n show do \n title \"Remove empty wells\"\n note \"Remove all empty wells from the stripwells\"\n note \"The size(s) of the stripwell(s) should be: \"\n stripwells.each_with_index do |s, i|\n note \"<b>Stripwell #{i+1}:</b> #{s.num_samples} well(s)\"\n end\n note \"<b>EB:</b> #{eb_wells} well(s)\"\n end\n # arrange stripwells before loading\n show do \n title \"Arrange stripwells in holder\"\n note \"Arrange the stripwells in the green tube rack so that there is a well in each column and row.\"\n note \"Make sure to mantain the order of the stripwells, as labeled (1,2,3, etc.)\"\n end \n when 'RNA'\n # RNA QIAXcel prep before hand has empty wells filled with buffer; Make sure to direct tech to align stripwells correctly\n stripwell_to_row = Hash.new(0)\n tab = [['Stripwell ID','Row #']]\n \n stripwells.each_with_index do |s, idx| \n tab.push([s.id, idx + 1])\n stripwell_to_row[s.id] = idx\n end\n \n groupby_stripwell = operations.group_by {|op| op.input(inputStr).item.id}\n groupby_stripwell.each do |stripwell, ops|\n ops.each_with_index do |op, i| \n op.associate :qc_row, stripwell_to_row[stripwell]\n op.associate :qc_column, op.input(inputStr).column\n end\n end\n\n # Associate row, col for each sample - TODO: account for ladder in the first stripwell ie: if ladder sample type in stripwell.matrix add 1 to each column\n # operations.each_with_index do |op, i|\n # op.associate :qc_row, (op.input(inputStr).row + 1 /WELLS_PER_STRIPWELL.to_f).floor\n # op.associate :qc_column, op.input(inputStr).column % WELLS_PER_STRIPWELL\n # end\n\n show do \n title 'Aligning RNA Samples for the Fragment Analyzer'\n separator\n note \"<b>Follow the table below to align the stripwells correctly on the green tube rack.</b>\"\n table tab\n end\n num_samples = 0\n stripwells.each do |s|\n s.matrix.each do |row|\n row.each do |well| \n if well != -1\n num_samples + 1\n end\n end\n end\n end\n \n end\n # log_info 'num_samples', num_samples\n # load samples\n show do \n title \"Arrange stripwells in fragment analyzer\"\n note \"Arrange the stripwells in the fragment analyzer in the EXACT SAME ORDER as they are arranged in the green tube rack.\"\n note \"Close the lid on the machine.\"\n end\n \n #return \n num_samples\n \n end", "def get_data(arg)\n dir_to_data = Dir.pwd + '/features/support'\n data = YAML.load_file(\"#{dir_to_data}/data_list.yml\")\n data['DataSet'][\"#{arg}\"]\nend", "def download_sample_probe_list\n temp = [[\"Probes for calibration\"], [\"EukS_1209_25_dT\"], [\"EukS_328_25_dT\"], [\"DinoB_25_dT\"], [\"Test1 (EukS_1209_25dT)\"]]\n send_sample_file(\"sample_probe_list\", temp)\n end", "def read_data\n\t\t@testers_data = CSV.read(\"data/testers.csv\")\n\n\t\t@testers_device_data = CSV.read(\"data/tester_device.csv\")\n\n\t\t@devices_data = CSV.read(\"data/devices.csv\")\n\n\t\t@bugs_data = CSV.read(\"data/bugs.csv\")\n\tend", "def load_data\n @data ||= CSV.read(@file)\n end", "def _initialize\n filename = @filename\n filehandle = File.open(filename, 'rb')\n\n @filehandle = filehandle\n @datasize = FileTest.size(filename)\n @using_tmpfile = false\n\n # Read the entire external chart binary into the the data buffer.\n # This will be retrieved by _get_data() when the chart is closed().\n @data = @filehandle.read(@datasize)\n end", "def load_data(filename='./ml-100k/u.data')\n datafile = open(filename)\n #three data structure to store the data\n @data=Array.new #array of arrays which stores each line of the the data\n @movies=Hash.new #map that for each unique movie id in the data file, stores its relevant records\n @users=Hash.new #map that for each unique user in the data file, stores its relevant records\n datafile.each_line do |line|\n linedata=line.split(\" \").map(&:to_i)\n @data.push(linedata)\n if [email protected]_key?(linedata[0])\n @users[linedata[0]]=[linedata]\n else\n @users[linedata[0]].push(linedata)\n end\n \n if [email protected]_key?(linedata[1])\n @movies[linedata[1]]=[linedata]\n else\n @movies[linedata[1]].push(linedata)\n end\n end\n datafile.close\n end", "def load_data() \n target_data = open(@trainingfile, \"r\")\n target_data.each_line do |line|\n reviewer_val, movie_val, rating_val, timestamp_val = line.split\n userarray = [{reviewer_val => rating_val}]\n moviearray = [{movie_val => rating_val}]\n if @movie_hash.has_key?(movie_val) #adding arrays to the hashes...\n @movie_hash[movie_val].push({reviewer_val => rating_val})\n else \n @movie_hash[movie_val] = userarray\n end\n \n if @user_hash.has_key?(reviewer_val)\n @user_hash[reviewer_val].push({movie_val => rating_val})\n else\n @user_hash[reviewer_val] = moviearray\n end\n \n end \n target_data.close \n end", "def load_file_data(file)\n @data = separate_into_blocks(IO.readlines(file))\n end", "def read_data_object( filename )\n\n data_dir = self.config['data_dir'] || '_data'\n data_path = File.join(self.config['source'], data_dir)\n if File.symlink?(data_path)\n return \"Data directory '#{data_path}' cannot be a symlink\"\n end\n file = File.join(data_path, filename)\n\n return \"File #{file} could not be found\" if !File.exists?( file )\n \n result = nil\n Dir.chdir(data_path) do\n rows = []\n CSV.foreach(filename, headers: true, col_sep: ',') do |row|\n rows << row.to_hash\n end\n result = rows\n end\n puts \"## Error: No data in #{file}\" if result.nil?\n result = JSON.parse( result.to_json ) if result\n { 'data' => result,\n 'mtime' => File.mtime(file) }\n end", "def load_data\n raise NotImplementedError\n end", "def load_data\n examples = Dir.glob('spec/support/*.ldif')\n res = examples.each_with_object({}) do |ex,hsh|\n _klass, name = File.basename(ex, '.ldif').split('_')\n nete = Net::LDAP::Entry.from_single_ldif_string(File.read(ex))\n entry = AdDir::Entry.from_ldap_entry(nete)\n instance_variable_set(\"@#{name}\", entry)\n hsh[name.to_sym] = nete\n end\nend", "def load_students(filename = \"students.csv\")\n# if the argument is not supplied, then the value \"students.csv\" will be used\n# (this time for reading)\n file = File.open(filename, \"r\")\n# then we read all lines into an array and iterate over it.\n file.readlines.each do |line|\n# On every iteration we discard the training new line character from the line,\n# split it at the comma (this will give us an array with two elements)\n# and assign it to the name and cohort variables.\n name, cohort = line.chomp.split(',')\n# we have the name and the cohort, we create a new hash and put it into the list of students.\n @students << {name: name, cohort: cohort.to_sym}\n end #<- readlines.each.do\n# Finally, we close the file.\nfile.close\nend", "def load_specification(file_name); end", "def read_data(file)\n if ENV['RACK_ENV'] == 'test'\n local = File.expand_path(\"../test/data/#{file}\", __FILE__)\n else\n local = File.expand_path(\"../data/#{file}\", __FILE__)\n\n if USE_GOOGLE_DRIVE\n remote = google_session.file_by_title(file.to_s)\n remote.download_to_file(local)\n end\n end\n\n YAML.load_file(local)\nend", "def load_source!\n @source = load_file_contents\n end", "def init_gamedata\r\n file = File.open(@filename, \"r\")\r\n @time_stamp = file.mtime\r\n @characters = Marshal.load(file)\r\n @frame_count = Marshal.load(file)\r\n @game_system = Marshal.load(file)\r\n @game_switches = Marshal.load(file)\r\n @game_variables = Marshal.load(file)\r\n @total_sec = @frame_count / Graphics.frame_rate\r\n file.close\r\n end", "def load_data\n raise \"Data is temporarily disabled\" unless EolConfig.data?\n EOL.log_call\n # Sad that we need to load all of this for the about and glossary tabs, but\n # TODO - we can cache this, later:\n @taxon_data = []\n @range_data = []\n @data_point_uris = []\n @categories = []\n @include_other_category = @data_point_uris &&\n @data_point_uris.detect { |d| d.predicate_known_uri.nil? ||\n d.predicate_known_uri.toc_items.blank? }\n @units_for_select = []\n end", "def load_dataE(filename)\r\n Log.ger.debug('Read '+filename)\r\n File.open(filename, \"rb\") { |f|\r\n obj = Marshal.load(f)\r\n }\r\nend", "def load_test_data(query_type, suffix = \"\")\n filename = @path + query_type + suffix + @extension\n JSON.parse(File.open(filename, 'r').read)\n end", "def load_data(filename)\n if File.exist? filename\n File.foreach (filename) do |line|\n number = line.chomp.to_i\n next if (@hash1.key?(number) || @hash2.key?(number))\n @hash1[number] = true if number <= 0\n @hash2[number] = true if number > 0\n end\n end\n end", "def initialize(filename)\n @data_source\n @metros = Hash.new\n if !File.file?(filename)\n puts \"Files does not exit. check your path\"\n exit\n end\n file = File.read(filename)\n dataset = JSON.parse(file)\n initialize_data_source(dataset['data sources'])\n initialize_metros(dataset['metros'])\n if (dataset.has_key?('single_route'))\n initialize_routes(dataset['routes'], 1)\n else\n initialize_routes(dataset['routes'], 0)\n end\n end", "def readDataSingleSource(nameout)\n\t\t\tif nameout.include?(\".source\") == false\n\t\t\t\tnameout = nameout + \".source\"\n\t\t\tend\n\t\t\tdatautils = DataUtils.new\n\t\t\t#puts \"nameout: \" + nameout;\n\t\t\t@l = -1;\n\t\t\t@b = -1;\n\t\t\t@r = -1;\n\t\t\t@ell_a = -1;\n\t\t\t@ell_b = -1;\n\t\t\t@ell_phi = -1;\n\t\t\t\n\t\t\t@sicalc = 0\n\t\t\t@sicalc_error = 0\n\n\t\t\t#read upper limit\n\t\t\tindex2 = 0;\n\t\t\t@r = -1;\n\t\t\t@galcoeff = \"-1\"\n\t\t\t@galcoeff_err = \"-1\"\n\t\t\t@galcoeffzero = \"-1\"\n\t\t\t@galcoeffzero_err = \"-1\"\t\n\t\t\t@isocoeff = \"-1\"\n\t\t\t@isocoeff_err = \"-1\"\n\t\t\t@isocoeffzero = \"-1\"\n\t\t\t@isocoeffzero_err = \"-1\"\t\n\t\t\t@fitdata = \"-1, -1, -1, -1, -1, -1, -1\"\n\t\t\tFile.open(nameout).each_line do | line |\n\t\t\t\tindex2 = index2 + 1;\n\t\t\t\tlll = line.split(\" \")\n\t\t\t\tif index2.to_i == 15\n\t\t\t\t\t@label =lll[0];\n\t\t\t\t\t@fix =lll[1];\n\t\t\t\t\t@si_start = lll[2];\n\t\t\t\t\t@ulconflevel = lll[3];\n\t\t\t\t\t@srcconflevel = lll[4];\n\t\t\t\t\t@startL = lll[5];\n\t\t\t\t\t@startB = lll[6];\n\t\t\t\t\t@startFlux = lll[7];\n\t\t\t\t\t@lmin = lll[9];\n\t\t\t\t\t@lmax = lll[11];\n\t\t\t\t\t@bmin = lll[14];\n\t\t\t\t\t@bmax = lll[16];\n\t\t\t\tend\n\t\t\t\tif index2.to_i == 16\n\t\t\t\t\t@sqrtTS =lll[0];\n\t\t\t\tend\n\t\t\t\tif index2.to_i == 17\n\t\t\t\t\t@l_peak = lll[0];\n\t\t\t\t\t@b_peak = lll[1];\n\t\t\t\t\t@dist = lll[2];\n\t\t\t\tend\n\t\t\t\tif index2.to_i == 18\n\t\t\t\t\t@l = lll[0]\n\t\t\t\t\t@b = lll[1]\n\t\t\t\t\t@distellipse = lll[2];\n\t\t\t\t\t@r = lll[3];\n\t\t\t\t\t@ell_a = lll[4];\n\t\t\t\t\t@ell_b = lll[5];\n\t\t\t\t\t@ell_phi = lll[6];\n\t\t\t\t\t@fullellipseline = format(\"%.2f %.2f %.2f %.2f %.2f %.2f %.2f\", @l, @b, @distellipse, @r, @ell_a, @ell_b, @ell_phi)\n\t\t\t\tend\n\t\t\t\tif index2.to_i == 19\n\t\t\t\t\t@counts = lll[0]\n\t\t\t\t\t@counts_error = lll[1]\n\t\t\t\t\t@counts_error_p = lll[2]\n\t\t\t\t\t@counts_error_m = lll[3]\n\t\t\t\t\t@counts_ul = lll[4];\n\t\t\t\tend\n\t\t\t\tif index2.to_i == 20\n\t\t\t\t\t@flux = lll[0]\n\t\t\t\t\t@flux_error = lll[1]\n\t\t\t\t\t@flux_error_p = lll[2]\n\t\t\t\t\t@flux_error_m = lll[3]\n\t\t\t\t\t@flux_ul = lll[4];\n\t\t\t\t\t@exposure = lll[5]\n\t\t\t\tend\n\t\t\t\tif index2.to_i == 21\n\t\t\t\t\t@sicalc = lll[0]\n\t\t\t\t\t@sicalc_error = lll[1]\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tif index2.to_i == 22\n\t\t\t\t\t@fit_cts = lll[0]\n\t\t\t\t\t@fit_fcn0 = lll[1]\n\t\t\t\t\t@fit_fcn1 = lll[2]\n\t\t\t\t\t@fit_edm0 = lll[3]\n\t\t\t\t\t@fit_edm1 = lll[4]\n\t\t\t\t\t@fit_iter0 = lll[5]\n\t\t\t\t\t@fit_iter1 = lll[6]\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tif index2.to_i == 23\n\t\t\t\t\t@galcoeff = lll[0]\n\t\t\t\t\t@galcoeff_err = lll[1]\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tif index2.to_i == 24\n\t\t\t\t\t@galcoeffzero = lll[0]\n\t\t\t\t\t@galcoeffzero_err = lll[1]\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tif index2.to_i == 25\n\t\t\t\t\t@isocoeff = lll[0]\n\t\t\t\t\t@isocoeff_err = lll[1]\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tif index2.to_i == 26\n\t\t\t\t\t@isocoeffzero = lll[0]\n\t\t\t\t\t@isocoeffzero_err = lll[1]\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tif index2.to_i == 27\n\t\t\t\t\t@tstart = lll[0]\n\t\t\t\t\t@tstop = lll[1]\n\t\t\t\t\t\n\t\t\t\t\t@timestart_utc = @tstart\n\t\t\t\t\t@timestop_utc = @tstop\n\t\t\t\t\t@timestart_tt = datautils.time_utc_to_tt(@tstart);\n\t\t\t\t\t@timestop_tt = datautils.time_utc_to_tt(@tstop);\n\t\t\t\t\t@timestart_mjd = datautils.time_tt_to_mjd(@timestart_tt);\n\t\t\t\t\t@timestop_mjd = datautils.time_tt_to_mjd(@timestop_tt);\n\t\t\t\t\t\n\t\t\t\t\t#calcolo fase orbitale\n\t\t\t\t\t@orbitalphase = -1;\n\t\t\t\t\tif(@calcorbitalphase_period.to_f != 0)\n\t\t\t\t\t\ttimemjd = @timestart_mjd.to_f + (@timestop_mjd.to_f-@timestart_mjd.to_f)\n\t\t\t\t\t\t@orbitalphase = (timemjd.to_f - @calcorbitalphase_t0.to_f) / @calcorbitalphase_period.to_f;\n\t\t\t\t\t\t@orbitalphase = @orbitalphase.to_f - @orbitalphase.to_i;\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tif index2.to_i == 28\n\t\t\t\t\t@energyrange = lll[0]\n\t\t\t\t\t@fovrange = lll[1]\n\t\t\t\t\t@albedo = lll[2]\n\t\t\t\t\t@binsize = lll[3] \n\t\t\t\t\t@expstep = lll[4] \n\t\t\t\t\t@phasecode = lll[5] \n\t\t\t\tend\n\t\t\tend\n\n\tend", "def fromFile( filename ) \n lines = IO.readlines( filename )\n loadAll( lines )\n end", "def samplesheet_file\n\t\t\"#{dir}/samplesheet\"\n\n\tend", "def load_genre_list()\n File.open('./genre_list')\nend", "def load\n eval(@data, TOPLEVEL_BINDING, @filename)\n end", "def samples; end", "def samples; end", "def load(file); end", "def sample\n @data.keys.sample\n end", "def load_movie_data\n\t\tfull_file_path = @data_file_path + '/' + MOVIE_DATA_FILE\n\t\tCSV.foreach(full_file_path, {col_sep: \"|\", encoding: 'windows-1251:utf-8'}) do |row|\n\t\t\tid, title, date, released, url, *genre_bools = row\t\n\t\t\thas_genres = GENRE_LIST.zip(genre_bools).select{ |genre, bool| bool == '1'}.map{ |genre, bool| genre}\n\t\t\tmovie = get_obj(Movie, @all_movies, id)\n\t\t\tmovie.genres.merge has_genres\n\t\tend\n\tend", "def load\n input(@infile)\n true\n end", "def load_student_file\n @student_records = {}\n open(@student_file) do |input_file|\n CSV::Reader.parse(input_file) do |csv_record|\n @student_records[csv_record[0].to_s] = create_student_record(csv_record)\n end\n puts \"#{@student_records.size} records loaded from student.csv\"\n puts \"record for 716012 => \" + @student_records['716012'].inspect\n puts \"record for 725311 => \" + @student_records['725311'].inspect\n end\n end" ]
[ "0.71004534", "0.67214215", "0.63412744", "0.62579703", "0.62555635", "0.62486875", "0.6206031", "0.6188572", "0.61854774", "0.6144315", "0.6103762", "0.60928303", "0.6086961", "0.6086961", "0.6067275", "0.6058215", "0.5995293", "0.59876657", "0.59452933", "0.5939697", "0.5922949", "0.59164864", "0.59083855", "0.58758795", "0.5861335", "0.58493024", "0.5840726", "0.58385247", "0.5824355", "0.58193564", "0.58169377", "0.57994556", "0.5797016", "0.57914805", "0.578655", "0.57824236", "0.5771893", "0.57638687", "0.5756725", "0.57523257", "0.5750476", "0.5730838", "0.5707748", "0.5707748", "0.57067454", "0.56999755", "0.569767", "0.56936103", "0.5687519", "0.5687418", "0.566163", "0.5644826", "0.5623829", "0.5618943", "0.5606677", "0.5603326", "0.56022257", "0.56022257", "0.5589472", "0.55883586", "0.5582233", "0.5576801", "0.55765665", "0.55672115", "0.5555167", "0.5554827", "0.5554475", "0.55510414", "0.55492496", "0.55449367", "0.5534868", "0.5534436", "0.553241", "0.5523996", "0.5504148", "0.5495258", "0.54929644", "0.5482163", "0.54810685", "0.5478079", "0.54752654", "0.547203", "0.5468142", "0.5467222", "0.54662395", "0.5461349", "0.5458541", "0.5438173", "0.5426279", "0.5423375", "0.54143685", "0.5411872", "0.5410962", "0.5403121", "0.5403121", "0.54015356", "0.53904676", "0.53821313", "0.53795815", "0.53787273" ]
0.79335976
0
Sometimes we need to create more than one subject from a MARC field with a subfield 0, but the subject creation will fail if you try to create subjects with duplicate authority ids. Only create an authority id for the first subject created, and leaves authority id blank
def set_auth_id(node) siblings = node.search("./preceding-sibling::*[not(@code='0' or @code='2')]") auth_id = node.parent.at_xpath("subfield[@code='0']").inner_text if siblings.empty? auth_id end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n admin_only\n @subject = Subject.new(subject_params)\n\n new_tutor_ids = []\n unless params[:subject][:people_teaching_attributes].blank?\n params[:subject][:people_teaching_attributes].each do |attribute|\n id = attribute[1][:incoming_tutor_id]\n new_tutor_ids << id unless attribute[1][:_destroy] == \"1\"\n end\n end\n\n respond_to do |format|\n if @subject.save\n\n unless new_tutor_ids == []\n new_tutor_ids.each do |id|\n e = ProvidingEnrollment.new\n e.user_id = id\n e.subject_id = @subject.id\n e.save!\n end\n end\n\n format.html { redirect_to @subject, notice: 'Subject was successfully created.' }\n format.json { render :show, status: :created, location: @subject }\n else\n format.html { render :new }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "def assign_subject!\n return if subject_code.present?\n update(slice_subject_id: nil)\n end", "def create\n @subject = Subject.new(subject_params)\n respond_to do |format|\n if @subject.save\n @sub_subject= SubSubject.new\n @[email protected]\n @[email protected]\n @sub_subject.is_none=true\n @sub_subject.save\n\n format.html { redirect_to subjects_path, notice: @subject.name + ' was successfully created.' }\n format.json { render :show, status: :created, location: @subject }\n else\n format.html { render :new }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_corridor_subjects(specialization_id, type, *ids)\n ids.each {|i|\n type.create(:subject_id => i, :specialization_id => specialization_id)\n }\n end", "def create_crf_records(sub)\n\n if sub.subject_id != nil and sub.enrolled == 1\n CRF_TO_CREATE.each do |crf|\n if crf.exists?(subject_id: sub.subject_id)\n #do nothing\n else\n crf.create(subject_id: sub.subject_id)\n end\n end \n end\n end", "def find_or_create_preallowed_id\n # first lets see if such seubject already eixst to avoid dups\n preallowed_id = Client.find(CLIENT_ID).get(:subject_id_from_name, :subject_name => login)\n \n if preallowed_id != nil and preallowed_id != \"0\"\n return preallowed_id\n end\n \n #otherwise create a new one\n subject = Subject.create(:name => self.login)\n return subject.id\n end", "def create\n hasError = 0\n @subject = Subject.new(params[:subject])\n if params[:teachers_id] == nil\n session[:error] =\"You have to select one or more teachers.\"\n hasError = 1\n else\n if @subject.save\n params[:teachers_id].each{|t|\n teacher_aux =Teacher.find(t)\n @subject.teachers << teacher_aux\n }\n CustomLogger.debug(\"Subject created\")\n CustomLogger.debug(\"--------------\") \n to_log(@subject) \n @subject= Subject.new\n end\n end\n restore_lists\n end", "def clean_primary_subject()\n self.area_of_study = self.clean_subject_string(self.area_of_study)\n self.save\n end", "def create\n base_params = subject_params.select {|k,v| k != \"discipline\"}\n @subject = Subject.new(base_params)\n @subject.discipline= Discipline.find(subject_params[:discipline][:id])\n \n if @subject.save\n #respond_with @subject\n render json: @subject\n #format.html { redirect_to @subject, notice: 'Subject was successfully created.' }\n #format.json { render action: 'show', status: :created, location: @subject }\n else\n respond_with @subject.errors, status: :unprocessable_entity\n #format.html { render action: 'new' }\n #format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end", "def create\n @subject = current_user.subjects.where(project_id: @project.id).new(subject_params)\n if @subject.save\n redirect_to [@project, @subject], notice: \"Subject was successfully created.\"\n else\n render :new\n end\n end", "def create\n @subject = Subject.new(params[:subject])\n\n respond_to do |format|\n if @client.subjects << @subject\n flash[:notice] = 'Subject was successfully created.'\n format.html { redirect_to client_subject_url(@client, @subject) }\n format.xml { render :xml => @subject, :status => :created, :location => [@client, @subject] }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @subject.errors, :status => :unprocessable_entity }\n end\n end\n end", "def subject_id\n raise ArgumentError, \"#subject_id not implemented for #{self.class}\"\n end", "def assign_canned_subject\n self.subject = canned_subject\n end", "def create\n delivery_list = DeliveryList.find(params[:delivery_list_id])\n authorize delivery_list\n authorize @record\n authorize DeliverySubject\n DeliverySubject.create(\n delivery_list_id: delivery_list.id,\n deliverable_type: @record.class.model_name,\n deliverable_id: @record.id\n )\n render 'renew_list_subjects'\n end", "def create_subjects\n Subject.create!([{\n name: \"History\",\n teacher_id:1 \n },\n {\n name: \"Math\",\n teacher_id: 2\n },\n {\n name: \"Economics\",\n teacher_id: 3\n }])\nend", "def materizalize\n if new_record? && subject.anonymous? && type\n # TODO: doesn't subject.anonymous? imply subject.id == nil ???\n @subject = self.class.id_for(subject.id)\n end\n end", "def set_additional_subject\n @additional_subject = AdditionalSubject.find(params[:id])\n end", "def prepare_fields_for_creation\n\t\t#\tdon't assign if given or is mother (childid is currently protected)\n\t\tself.childid = get_next_childid if !is_mother? and childid.blank?\n\n\t\t#\tdon't assign if given or is not case (patid is currently protected)\n\t\tself.patid = sprintf(\"%04d\",get_next_patid.to_i) if is_case? and patid.blank?\n\n#\tshould move this from pre validation to here for ALL subjects.\n#\t\tpatid.try(:gsub!,/\\D/,'')\n#\t\tself.patid = sprintf(\"%04d\",patid.to_i) unless patid.blank?\n\n\t\t#\tdon't assign if given or is not case (orderno is currently protected)\n\t\tself.orderno = 0 if is_case? and orderno.blank?\n\n\t\t#\tdon't assign if given or is mother (studyid is currently protected)\n\t\t#\tor if can't make complete studyid\n\t\tif !is_mother? and studyid.blank? and\n\t\t\t\t!patid.blank? and !case_control_type.blank? and !orderno.blank?\n\t\t\tself.studyid = \"#{patid}-#{case_control_type}-#{orderno}\" \n\t\tend\n\n\t\t#\tperhaps put in an after_save with an update_attribute(s)\n\t\t#\tand simply generate a new one until all is well\n\t\t#\tdon't assign if given (subjectid is currently protected)\n\t\tself.subjectid = generate_subjectid if subjectid.blank?\n\n\t\t#\tcases and controls: their own subjectID is also their familyID.\n\t\t#\tmothers: their child's subjectID is their familyID. That is, \n\t\t#\t\t\t\t\ta mother and her child have identical familyIDs.\n\t\t#\tdon't assign if given (familyid is currently protected)\n\t\tself.familyid = subjectid if !is_mother? and familyid.blank?\n\n\t\t#\tcases (patients): matchingID is the study_subject's own subjectID\n\t\t#\tcontrols: matchingID is subjectID of the associated case \n\t\t#\t\t(like PatID in this respect).\n\t\t#\tmothers: matchingID is subjectID of their own child's associated case. \n\t\t#\t\t\tThat is, a mother's matchingID is the same as their child's. This \n\t\t#\t\t\twill become clearer when I provide specs for mother study_subject creation.\n#\tmatchingid is manually set in some tests. will need to setup for stubbing this.\n\t\t#\tdon't assign if given (matchingid is currently NOT protected)\n\t\tself.matchingid = subjectid if is_case? and matchingid.blank?\n\tend", "def create\n @authority = Authority.new(authority_params)\n\n respond_to do |format|\n if @authority.save\n session[:last_authority_id] = @authority.id\n format.html { redirect_to authority_url(@authority), notice: \"Authority was successfully created.\" }\n format.json { render :show, status: :created, location: @authority }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @authority.errors, status: :unprocessable_entity }\n end\n end\n end", "def create \n params[:subject][:title].strip! if !params[:subject][:title].nil?\n params[:subject][:content].strip! if !params[:subject][:content].nil?\n @subject = Subject.new(params.require(:subject).permit(:title, :content, :for_correctors, :important, :for_wepion))\n @subject.user = current_user.sk\n @subject.last_comment_time = DateTime.now\n @subject.last_comment_user = current_user.sk\n \n @subject.for_wepion = false if @subject.for_correctors # We don't allow Wépion if for correctors\n\n if @subject.title.size > 0\n @subject.title = @subject.title.slice(0,1).capitalize + @subject.title.slice(1..-1)\n end\n\n # Set associated object (category, section, chapter, exercise, problem)\n err = set_associated_object\n error_create([err]) and return if !err.empty?\n\n # Attached files\n @error_message = \"\"\n attach = create_files\n error_create([@error_message]) and return if !@error_message.empty?\n\n if @subject.save\n attach_files(attach, @subject)\n\n if current_user.sk.root?\n for g in [\"A\", \"B\"] do\n if params.has_key?(\"groupe\" + g)\n User.where(:group => g).each do |u|\n UserMailer.new_message_group(u.id, @subject.id, current_user.sk.id).deliver\n end\n end\n end\n end\n\n flash[:success] = \"Votre sujet a bien été posté.\"\n redirect_to subject_path(@subject, :q => @q)\n else\n destroy_files(attach)\n error_create(@subject.errors.full_messages) and return\n end\n end", "def create\n @subject = subject_scope.new(subject_params)\n\n respond_to do |format|\n if @subject.save\n format.html { redirect_to report_cards_form_subjects_path(@form), notice: 'Subject was successfully created.' }\n format.json { render :show, status: :created, location: report_cards_form_subjects_path(@form) }\n else\n format.html { render :new }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subject_item = SubjectItem.new(tutor_id: @tutor.id, subject_id: subject_item_params[:subject_id])\n\n respond_to do |format|\n if @subject_item.save\n format.html { redirect_to @tutor, notice: 'Subject was successfully added.' }\n format.json { render :show, status: :created, location: @subject_item }\n else\n format.html { render :new }\n format.json { render json: @subject_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n \t@subject = Subject.new(subject_params)\n\n\trespond_to do |format|\n\t if @subject.valid? and !params[:content].empty?\n\t\[email protected]\n\t\tfirst_message = Message.create(content: params[:content], user_id: current_user.id, subject_id: @subject.id)\t\n\n\t\tformat.html { redirect_to @subject, notice: 'Subject was successfully created.' }\n\t\tformat.json { render :show, status: :created, location: @subject }\n\t else\n\t\tsetup_new_subject_params\n\t\tif params[:content].empty?\n\t\t\t@missing_content = true\n\t\tend\n\t\tformat.html { render :new }\n\t\tformat.json { render json: @subject.errors, status: :unprocessable_entity }\n\t end\n\t end\n end", "def create\n @subject = Subject.new(params[:subject])\n @subject_types = SubjectType.select_list\n respond_to do |format|\n if @subject.save\n format.html { redirect_to(admin_subject_path(@subject), :notice => 'Subject was successfully created.') }\n format.xml { render :xml => @subject, :status => :created, :location => @subject }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @subject.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @manual_subject = Manual::Subject.new(params[:manual_subject])\n\n respond_to do |format|\n if @manual_subject.save\n format.html { redirect_to @manual_subject, notice: 'Subject was successfully created.' }\n format.json { render json: @manual_subject, status: :created, location: @manual_subject }\n else\n format.html { render action: \"new\" }\n format.json { render json: @manual_subject.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_new(authority_name, label)\n DogBiscuits::Importers::Authority.new(authority_name).create_record(label) if Qa::Authorities::Local.subauthority_for(authority_name).search(label).empty?\n rescue Qa::InvalidSubAuthority\n Rails.logger.error(\"Invalid sub-authority: #{auth}\")\n end", "def create\n @subject = current_user.subjects.new(subject_params)\n respond_to do |format|\n if @subject.save\n format.html { redirect_to @subject, notice: \"已成功创建学生账户:#{@subject.title}. \"}\n format.json { render :show, status: :created, location: @subject }\n else\n format.html { render :new }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "def validate_subject\n errors.add(:subject_id, 'not presence') if Subject.find_by_id( self[:subject_id] ) == nil\n end", "def create_enrollment\n Enrollment.create!([{\n subject_id: 1,\n student_id: 1\n },\n {\n subject_id: 2,\n student_id: 2\n },\n {\n subject_id: 3,\n student_id: 3\n },\n {\n subject_id: 1,\n student_id: 4\n },\n {\n subject_id: 2,\n student_id: 5\n },\n {\n subject_id: 3,\n student_id: 6\n },\n {\n subject_id: 1,\n student_id: 7\n },\n {\n subject_id: 2,\n student_id: 8\n },\n {\n subject_id: 3,\n student_id: 9\n },\n {\n subject_id: 1,\n student_id: 10\n }])\nend", "def generate_subjectid\n\t\tsubjectids = ( (1..999999).to_a - StudySubject.select('subjectid'\n\t\t\t).collect(&:subjectid).collect(&:to_i) )\n\t\tsprintf(\"%06d\",subjectids[rand(subjectids.length)].to_i)\n\tend", "def update_subjects_via_api(subject_name_array)\n return if subject_name_array.blank?\n\n # record the list of current teacher set <--> subject associations,\n # so we can prune the subjects later.\n old_subjects = Array.new\n\n self.subjects.each do |subject|\n old_subjects.push(subject.id)\n end\n\n # delete the current teacher set <--> subject associations,\n # so we can remake them fresh from the bib info.\n self.subjects.clear\n\n # Create all the subjects and teacher_set <--> subject associations specified in the bib\n # record we're processing, ignoring duplicate associations.\n subject_name_array.each do |subject_name|\n subject_name = clean_subject_string(subject_name)\n\n subject = Subject.find_or_create_by(title: subject_name)\n subject_teacher_set = SubjectTeacherSet.find_or_create_by(teacher_set_id: self.id, subject_id: subject.id)\n end\n\n prune_subjects(old_subjects)\n end", "def handle_subjects(subjects)\n subjects.each do |link|\n subject = link['_resolved']\n term, *terms = subject['terms']\n code, ind2 = case term['term_type']\n when 'uniform_title'\n ['630', source_to_code(subject['source'])]\n when 'temporal'\n ['648', source_to_code(subject['source'])]\n when 'topical'\n ['650', source_to_code(subject['source'])]\n when 'geographic', 'cultural_context'\n ['651', source_to_code(subject['source'])]\n when 'genre_form', 'style_period'\n ['655', source_to_code(subject['source'])]\n when 'occupation'\n ['656', '7']\n when 'function'\n ['656', '7']\n else\n ['650', source_to_code(subject['source'])]\n end\n sfs = [['a', term['term']]]\n\n terms.each do |t|\n tag = case t['term_type']\n when 'uniform_title'; 't'\n when 'genre_form', 'style_period'; 'v'\n when 'topical', 'cultural_context'; 'x'\n when 'temporal'; 'y'\n when 'geographic'; 'z'\n end\n sfs << [tag, t['term']]\n end\n\n if ind2 == '7'\n sfs << ['2', subject['source']]\n end\n\n # add authority ID as subject 6xx $0\n authority_id = subject['authority_id']\n subfield_0 = authority_id ? [0, authority_id] : nil\n sfs.push(subfield_0) unless subfield_0.nil?\n\n ind1 = code == '630' ? \"0\" : \" \"\n df!(code, ind1, ind2).with_sfs(*sfs)\n end\n end", "def add_authority(name, type, klass)\n self.payload += self.add_record(name, type, klass).encode\n self.authority_rr += 1\n end", "def submit_new_course\r\n @school = School.find(params[:nid]) rescue render_return\r\n render_return unless @user_supported_schools.include_schools?(@school)\r\n render_return unless logged_in_user.can_add_more_course(@school)\r\n #status = logged_in_user.is_admin? ? :approved : :pending \r\n status = :pending\r\n if params[:s1].to_i > 0\r\n subject = @school.subjects.find(params[:s1]) rescue render_return\r\n else\r\n s = Subject.new(:code=>params[:s_code].to_s,:name=>params[:s_name].to_s)\r\n s.before_save\r\n subject = @school.subjects.find(:first,:conditions=>[\"code LIKE ?\",s.code]) \r\n unless subject \r\n subject = Subject.new(:code=>s.code,:name=>s['name'],\r\n :creator_id=>logged_in_user.id,\r\n :status=>status)\r\n \r\n render_return unless subject.before_save\r\n @school.subjects << subject \r\n end\r\n end\r\n \r\n c = Course.new(:name=>params[:cname],:number=>params[:cnum])\r\n course = @school.courses.find(:first,:conditions=>[\"subject_code LIKE '#{subject.code}' AND number LIKE ? \",c.number])\r\n render_return if course\r\n course = Course.new(:subject_id=>subject.id,\r\n :creator_id=>logged_in_user.id,\r\n :subject_code=>subject.code,\r\n :number => c.number,\r\n :name=> c.name,\r\n :status=>status)\r\n\r\n render_return unless c.before_save\r\n @school.courses << course \r\n render_p \"course_display/list_subjects\",{'caller'=>params[:caller],'subjects'=>@school.subjects.reload,'subject'=>subject}\r\n \r\n end", "def create\n\t\t@subject = Subject.new(subject_params)\n\n\t\trespond_to do |format|\n\t\t\tif @subject.save\n\t\t\t\tcreate_audit __method__, 'subject', @subject.id\n\t\t\t\tformat.html { redirect_to @subject, notice: 'Subject was successfully created.' }\n\t\t\t\tformat.json { render action: 'show', status: :created, location: @subject }\n\t\t\telse\n\t\t\t\tformat.html { render action: 'new' }\n\t\t\t\tformat.json { render json: @subject.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def create\n @subject = Subject.new(subject_params)\n if @subject.save\n redirect_to(subjects_path)\n else\n render('new')\n end\n end", "def create_forum_subject(contest)\n s = Subject.create(:contest => contest,\n :user_id => 0,\n :title => \"Concours ##{contest.number}\",\n :content => helpers.get_new_contest_forum_message(contest),\n :last_comment_time => DateTime.now,\n :last_comment_user_id => 0,\n :category => Category.where(:name => \"Mathraining\").first)\n end", "def save_subject\n @exam = session[:exam]\n if session[:exam].subject_id == nil\n session[:exam].subject_id = params[:subject][:id]\n end\n @indices = PlanSubject.find_unfinished_by_subject(\\\n session[:exam].subject_id, :indices => true)\n end", "def set_subject\n @subject = Subject.friendly.find(params[:id])\n end", "def assign_icf_master_id\n\t\tif icf_master_id.blank?\n\t\t\tnext_icf_master_id = IcfMasterId.next_unused.first\n\t\t\tif next_icf_master_id\n\t\t\t\tself.update_column(:icf_master_id, next_icf_master_id.to_s)\n\t\t\t\tnext_icf_master_id.study_subject = self\n\t\t\t\tnext_icf_master_id.assigned_on = Date.today\n\t\t\t\tnext_icf_master_id.save!\n\t\t\tend\n\t\tend\n\t\tself\n\tend", "def create_record(init)\n subject.transaction(requires_new: true) do\n InternalId.create!(\n **scope,\n usage: usage_value,\n last_value: init.call(subject) || 0\n )\n end\n rescue ActiveRecord::RecordNotUnique\n lookup\n end", "def new\n @subject = current_user.subjects.where(project_id: @project.id).new(subject_params)\n end", "def set_subject\n @subject = params[:id] ? Subject.find(params[:id]) : Subject.new(subject_params)\n end", "def set_subject\n @subject = params[:id] ? Subject.find(params[:id]) : Subject.new(subject_params)\n end", "def create\n @subject = Subject.new(subject_params)\n @user = current_user\n @subject.user = @user\n\n respond_to do |format|\n if @subject.save\n format.html { redirect_to @subject, notice: 'Subject was successfully created.' }\n format.json { render :show, status: :created, location: @subject }\n else\n format.html { render :new }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "def inverse_company_id_field\n :subject_company_id\nend", "def create_sha1_id\n self.sha1_id = Digest::SHA1.hexdigest(\"#{self.id}-#{self.contactable_type}-#{self.contactable_id}\")\n end", "def set_subject\n @subject = Subject.find params[:subject_id]\n end", "def create\n @subject_permission = SubjectPermission.new(params[:subject_permission])\n\n respond_to do |format|\n if @subject_permission.save\n format.html { redirect_to(@subject_permission, :notice => 'SubjectPermission was successfully created.') }\n format.xml { render :xml => @subject_permission, :status => :created, :location => @subject_permission }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @subject_permission.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @subject = Subject.new(subject_params)\n\n respond_to do |format|\n if @subject.save\n format.html { redirect_to @subject, notice: t('controller.successfully_created', model: t('activerecord.models.subject')) }\n format.json { render json: @subject, status: :created, location: @subject }\n else\n prepare_options\n format.html { render action: \"new\" }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @m_authority = MAuthority.new(params[:m_authority])\n\n respond_to do |format|\n if @m_authority.save\n format.html { redirect_to :controller => \"m_authorities\", :action => \"index\" }\n #format.html { redirect_to @m_authority }\n format.json { render json: @m_authority, status: :created, location: @m_authority }\n else\n format.html { render action: \"new\" }\n format.json { render json: @m_authority.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subject = Subject.new(subject_params)\n @subject.user = current_user\n respond_to do |format|\n if @subject.save\n format.html { redirect_to new_subject_topic_path(@subject), notice: 'Subject was successfully created, create new topics?' }\n format.json { render :show, status: :created, location: @subject }\n else\n format.html { render :new }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "def post_authorization_subject_bulkadd_with_http_info(subject_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: AuthorizationApi.post_authorization_subject_bulkadd ...\"\n end\n \n \n # verify the required parameter 'subject_id' is set\n fail ArgumentError, \"Missing the required parameter 'subject_id' when calling AuthorizationApi.post_authorization_subject_bulkadd\" if subject_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'body' is set\n fail ArgumentError, \"Missing the required parameter 'body' when calling AuthorizationApi.post_authorization_subject_bulkadd\" if body.nil?\n \n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/authorization/subjects/{subjectId}/bulkadd\".sub('{format}','json').sub('{' + 'subjectId' + '}', subject_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'subjectType'] = opts[:'subject_type'] if opts[:'subject_type']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AuthorizationApi#post_authorization_subject_bulkadd\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def uniqueness_for_school_and_subject\n school = School.find(school_id)\n school.courses.where(subject_id: subject_id).each do |course|\n if (course.call_number == call_number)\n errors.add(:course, 'course call number already exists')\n return\n elsif (course.friendly_name == friendly_name)\n errors.add(:course, 'course friendly name already exists')\n return\n end\n end\n end", "def do_before_save\n if self.subject_link.empty?\n self.subject_link = DcPage.clear_link(self.subject.downcase.strip) \n # add id to link, but only if something is written in subject \n self.subject_link << \"-#{self.id.to_s}\" if self.subject_link.size > 1 \n end\n# menu_id is returned as string Array class if entered on form as tree_select object.\n self.menu_id = self.menu_id.scan(/\"([^\"]*)\"/)[0][0] if self.menu_id.to_s.match('\"')\nend", "def create\n unless current_user.admin? \n redirect_to '/', :alert => \"Acceso denegado.\" #por ahora solo un adminsitrador puede ver esto\n end\n @subject = Subject.new(subject_params)\n\n \n if @subject.save\n redirect_to request.referrer\n flash[:noticep]='Asignatura creada exitosamente'\n else\n flash[:noticen]='Error al guardar'\n end\n \n end", "def create\n error_message = ''\n if request.get?\n respond_to do |format|\n format.html{\n redirect_to(:controller => 'subjects', :action => 'index')\n }\n format.yaml{ render :text => _('posted data have no questions.') }\n end\n return\n end\n body = YAML.load(params[:batch][:body])\n login = body.delete(\"login\")\n password = body.delete(\"password\")\n raise PermissionError unless batch_logged_in?(login, password)\n @user = batch_current_user(current_user, login, password)\n @subject = nil\n @questions = []\n @choices = []\n ActiveRecord::Base.transaction do\n @subject = Subject.create!(:user_id => @user.id,\n :name => body.delete(\"title\"),\n :start_date => body.delete(\"start\"),\n :end_date => body.delete(\"end\"),\n :max_respondents => body.delete(\"max\"))\n questions = body.delete(\"questions\")\n raise EmptyDataError if questions.nil? or questions.empty?\n questions.each_with_index do |question, index|\n question_type = QuestionType.where(:name => question[\"question_type\"]).first\n @questions <<\n Question.create!(:subject_id => @subject.id,\n :position => index + 1,\n :body => question[\"body\"],\n :question_type_id => question_type.id)\n if 'select' == @questions.last.question_type.name\n choices = question[\"choices\"]\n raise EmptyDataError if choices.nil? || choices.empty?\n choices.each_with_index do |choice, index|\n @choices << Choice.create!(:question_id => @questions.last.id,\n :position => index + 1,\n :body => choice)\n end\n end\n end\n end\n respond_to do |format|\n format.html{\n message = _('data was successfully created.')\n flash[:notice] = message\n redirect_to(:controller => 'subjects',\n :action => 'show',\n :id => @subject.id)\n }\n format.yaml{ render :text => message }\n end\n rescue PermissionError => ex\n error_message = _('permission denied.')\n logger.debug(error_message)\n rescue EmptyDataError => ex\n error_message = _('posted data have no questions or choices.')\n logger.debug(error_message)\n rescue ActiveRecord::RecordInvalid => ex\n error_message = _('invalid data.')\n logger.debug(error_message)\n logger.debug(ex.message)\n logger.debug(ex.backtrace)\n rescue StandardError => ex\n error_message = _('something wrong.')\n logger.debug(error_message)\n logger.debug(ex.message)\n logger.debug(ex.backtrace)\n ensure\n unless error_message.blank?\n flash[:error] = error_message\n respond_to do |format|\n format.html{\n redirect_to(:controller => 'subjects', :action => 'index')\n }\n format.yaml{ render :text => error_message }\n end\n end\n end", "def create_new_subject_item_note\n if subject_item_note.save\n redirect_to student_subjects_path(params[:subject_item_note][:student_id]), notice: I18n.t('shared.created', resource: 'subject_item_note')\n else\n redirect_to student_subjects_path(params[:subject_item_note][:student_id]), :flash => { :error => subject_item_note.errors.full_messages.join(', ') }\n end\n end", "def index\n @curriculum_subjects = Subject.all.where(is_core: false, is_pivats: false, is_lunch: false, is_tutorial: false, is_ppa: false)\n @core_subjects = Subject.all.where(is_core: true, is_pivats: false)\n authorize @curriculum_subjects\n\n @subject = Subject.new\n @subject.sub_subjects.build\n # authorize @curriculum_subjects\n\n end", "def set_test_subject_id\n self.test_subject_id = self.sample.test_subject_id if self.test_subject_id.blank? && !self.sample.nil?\n end", "def subject_params\n params[:subject].permit(:name,:display_name,:is_pfc,:is_ppa,:is_core,:position, sub_subjects_attributes:\n [:id ,:subject_id,:name,:display_name,:is_core,:is_pfc,:is_tutorial,:is_none,:position,:_destroy\n ]\n )\n end", "def create_subject(options = {})\n default_values = { :name => 'Test subject' }\n Subject.create(default_values.merge(options))\n end", "def create\n @resource = Resource.new(resource_params)\n subject = Subject.find(params[:resource][:subject])\n @resource.subject = subject\n @resource.user_id = current_user.id\n if @resource.save\n flash[:success] = \"Successfully created resource\"\n subject.resource_count = subject.resource_count + 1\n subject.save\n redirect_to subject_url(subject)\n else\n flash[:danger] = \"Failed to create resource\"\n redirect_to new_resource_url\n end\n end", "def create\n @resource = Resource.new(resource_params)\n subject = Subject.find(params[:resource][:subject])\n @resource.subject = subject\n @resource.user_id = current_user.id\n if @resource.save\n flash[:success] = \"Successfully created resource\"\n subject.resource_count = subject.resource_count + 1\n subject.save\n redirect_to subject_url(subject)\n else\n flash[:danger] = \"Failed to create resource\"\n redirect_to new_resource_url\n end\n end", "def subject_params\n params.require(:subject).permit(:id, :name, :description, :discipline => [:id, :name, :description])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n begin\n @subject = Subject.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n logger.error \"Attempt to access invalid subject #{params[:id]}\"\n @subject_not_found = true\n render json: {message: \"Illegal subject access request\"}, status: :unauthorized\n return\n else\n @subject_not_found = false\n end\n end", "def create\n teacher_exclusive\n @subject = Subject.create title: params[:title], start_date: params[:start_date], end_date: params[:end_date], teacher_id: @current_user.id\n\t\n\n respond_to do |format|\n if @subject.save\n format.html { redirect_to @subject, notice: 'La matière a été insérée' }\n format.json { render :show, status: :created, location: @subject }\n else\n format.html { render :new }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n get_subject\n @pcp_step = @pcp_subject.current_step\n if @pcp_step.status_closed?\n render_bad_logic t( 'pcp_items.msg.subj_closed' )\n return\n end\n if @pcp_step.in_commenting_group? && user_has_permission?( :to_update ) then\n @pcp_item = @pcp_subject.pcp_items.new( pcp_item_params )\n @pcp_item.transaction do\n @pcp_item.pcp_step_id = @pcp_step.id\n @pcp_item.set_next_seqno\n if @pcp_item.save\n respond_to do |format|\n format.html { redirect_to @pcp_item, notice: t( 'pcp_items.msg.new_ok' )}\n end\n else\n respond_to do |format|\n format.html { render :new }\n end\n end\n end\n else\n render_no_permission\n end\n end", "def open_subject_id_form\n click_subject_buttons('Subject ID')\n end", "def set_subject\r\n @subject = Subject.find(params[:id])\r\n end", "def set_subject\n @subject = Subject.find(params[:subject_id])\n end", "def create\n @course_subject = CourseSubject.new(course_subject_params)\n\n respond_to do |format|\n if @course_subject.save\n format.html { redirect_to @course_subject, notice: 'Course subject was successfully created.' }\n format.json { render :show, status: :created, location: @course_subject }\n else\n format.html { render :new }\n format.json { render json: @course_subject.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @title = \"Create New Subject\"\n @subject = Subject.new(params[:subject])\n\n respond_to do |format|\n if @subject.save\n format.html { redirect_to @subject, notice: 'Subject was successfully created.' }\n format.json { render json: @subject, status: :created, location: @subject }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_subject_access_request\n @subject_access_request = SubjectAccessRequest.find(params[:id])\n end", "def create\n @tutor_subject = TutorSubject.new(tutor_subject_params)\n\n respond_to do |format|\n if @tutor_subject.save\n format.html { redirect_to @tutor_subject, notice: 'Tutor subject was successfully created.' }\n format.json { render :show, status: :created, location: @tutor_subject }\n else\n format.html { render :new }\n format.json { render json: @tutor_subject.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subject = Subject.new(params[:subject])\n\n respond_to do |format|\n if @subject.save\n format.html { redirect_to :subjects, :notice => 'Subject was successfully created.' }\n format.json { render :json => @subject, :status => :created, :location => @subject }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @subject.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n \n @subject = Subject.new(:name => 'Default')\n @subject_count = Subject.count + 1\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def subject_params\r\n params.require(:subject).permit(:code, :name, :description)\r\n end", "def create\n params[:certification][:course_id].each do |i|\n begin\n cert = @person.certifications.build(course_id: i, year_id: params[:certification][:year_id])\n cert.save\n rescue\n end\n end\n @certification = @person.certifications.build(certification_params)\n respond_to do |format|\n format.html { redirect_to @person, notice: 'Certification was successfully created.' }\n end\n end", "def handle_subjects(subjects)\n subjects.each do |link|\n subject = link['_resolved']\n term, *terms = subject['terms']\n ind1 = ' '\n code, *ind2 = case term['term_type']\n when 'uniform_title'\n value = term['term'].split(\" \")[0]\n first_indicator = '0'\n if value\n hsh = {}\n hsh['A'] = '2'\n hsh['An'] = '3'\n hsh['The'] = '4'\n articles = []\n articles = hsh.keys\n first_indicator = hsh[value] if articles.include?(value)\n end\n ['630', first_indicator, source_to_code(subject['source'])]\n when 'temporal'\n ['648', source_to_code(subject['source'])]\n when 'topical'\n ['650', source_to_code(subject['source'])]\n when 'geographic', 'cultural_context'\n ['651', source_to_code(subject['source'])]\n when 'genre_form', 'style_period'\n ['655', source_to_code(subject['source'])]\n when 'occupation'\n ['656', '7']\n when 'function'\n ['656', '7']\n else\n ['650', source_to_code(subject['source'])]\n end\n\n sfs = [['a', term['term']]]\n\n terms.each do |t|\n tag = case t['term_type']\n when 'uniform_title'; 't'\n when 'genre_form', 'style_period'; 'v'\n when 'topical', 'cultural_context'; 'x'\n when 'temporal'; 'y'\n when 'geographic'; 'z'\n end\n sfs << [tag, t['term']]\n end\n\n # code borrowed from Yale to export subject authority id\n unless subject['authority_id'].nil?\n sfs << ['0', subject['authority_id']]\n end\n\n \n # N.B. ind2 is an array at this point.\n if ind2[0] == '7'\n sfs << ['2', subject['source']]\n end\n\n # adding this code snippet because I'm making ind2 an array\n # for code 630 if the title begins with an article\n if (ind2.is_a?(Array) && code == '630')\n ind1, ind2 = ind2\n else\n ind2 = ind2[0]\n end\n\n df!(code, ind1, ind2).with_sfs(*sfs)\n end\n end", "def create\n @university_subject = UniversitySubject.new(university_subject_params)\n\n respond_to do |format|\n if @university_subject.save\n format.html { redirect_to @university_subject, notice: 'University subject was successfully created.' }\n format.json { render action: 'show', status: :created, location: @university_subject }\n else\n format.html { render action: 'new' }\n format.json { render json: @university_subject.errors, status: :unprocessable_entity }\n end\n end\n end", "def subject_params\n #params.require(:subject).permit(:name, :category_id, :user_id, messages_attributes: [:id, :created_at, :update_at, :subject_id, :content, :user_id, :category_id])\n\tparams.require(:subject).permit(:name, :category_id, :user_id)\n end", "def createDiarySubject _obj, _args\n \"_obj createDiarySubject _args;\" \n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end" ]
[ "0.61229634", "0.60943455", "0.5982701", "0.59781104", "0.58848864", "0.58431", "0.5729768", "0.568986", "0.5645864", "0.56101215", "0.5574035", "0.5566314", "0.5512646", "0.55067426", "0.54951084", "0.54820055", "0.54783064", "0.546708", "0.542672", "0.54250157", "0.54154795", "0.5403627", "0.5389695", "0.5377156", "0.5372371", "0.5363774", "0.5334391", "0.53260463", "0.53053176", "0.5291739", "0.52647775", "0.5231706", "0.52295005", "0.5228181", "0.5228152", "0.52101344", "0.52056706", "0.5202645", "0.5198481", "0.51933485", "0.5177349", "0.51597595", "0.51530606", "0.51530606", "0.51499903", "0.5146953", "0.51447535", "0.5140274", "0.5135657", "0.5128625", "0.51283634", "0.51236737", "0.5098051", "0.50940895", "0.5091818", "0.5090063", "0.50866574", "0.50853705", "0.50821096", "0.50813454", "0.507345", "0.5066359", "0.5061094", "0.5061094", "0.5057753", "0.50570875", "0.50570875", "0.5051201", "0.50431234", "0.5038215", "0.5033013", "0.50268435", "0.50213563", "0.5019581", "0.5012736", "0.50081336", "0.5007702", "0.5006638", "0.50054085", "0.49841967", "0.49804407", "0.49598587", "0.49574152", "0.49545285", "0.49500775", "0.49464858", "0.4935221", "0.4935221", "0.4935221", "0.4935221", "0.4935221", "0.4935221", "0.4935221", "0.4935221", "0.4935221", "0.4935221", "0.4935221", "0.4935221", "0.4935221", "0.4935221", "0.4935221" ]
0.0
-1
usually, rel will be :subjects, but in some cases it will be :places
def subject_map(terms, rel = :subjects) { :obj => :subject, :rel => rel, :map => { 'self::subfield' => proc { |subject, node| subject.publish = true subject.terms = terms.call(node) subject.source = node.parent.at_xpath("subfield[@code='2']").inner_text unless node.parent.at_xpath("subfield[@code='2']").nil? subject.vocabulary = '/vocabularies/1' subject.authority_id = set_auth_id(node) unless node.parent.at_xpath("subfield[@code='0']").nil? } }, :defaults => { :source => 'Source not specified' } } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rel; end", "def relation_subjects(record)\n query = ActiveFedora::SolrQueryBuilder.construct_query_for_rel(\n [[:has_model, proxy_class.to_rdf_representation], [:proxyFor, record.id]]\n )\n rows = ActiveFedora::SolrService::MAX_ROWS\n ActiveFedora::SolrService.query(query, fl: 'id', rows: rows).map(&:rdf_uri)\n end", "def rel\n @rel ||= (val = attributes['rel']) ? val.downcase.split(' ') : []\n end", "def nsubj\n rel 'nsubj'\n end", "def relationship_tag(rel_attr); end", "def add_relationship(rel_attr); end", "def add_relation\n rel = @bib.relation.detect { |r| r.type == \"partOf\" }\n if rel\n title_main = rel.bibitem.title.detect { |t| t.type == \"main\" }\n @item.booktitle = title_main.title.content\n end\n end", "def rels\n @rels ||= root.data._rels\n end", "def relationship_related_link(attribute_name); end", "def for_subjects(subjects)\n result = Hash[subjects.map {|node| [node, false]}]\n subjects_by_id = Hash[subjects.map {|subject| [subject.id, subject]}]\n subject_rlshp_sources = Hash.new { |h, k| h[k] = [] }\n [:subject, :subject_agent_subrecord, :subject_agent_subrecord_place].each do |t|\n Subject.relationship_dependencies[t].each { |d| subject_rlshp_sources[d] << t }\n end\n\n subject_rlshp_sources.each do |model, sources|\n sources.each do |source|\n # i.e. one or more: subject_rlshp, subject_agent_subrecord_rlshp, subject_agent_subrecord_place_rlshp\n link_relationship = model.find_relationship(source)\n link_table = link_relationship.table_name\n\n link_relationship.reference_columns_for(model).each do |model_link_column|\n link_relationship.reference_columns_for(Subject).each do |subject_link_column|\n # Join subject_rlshp to (e.g.) accession\n linked_records = model\n .join(link_table,\n Sequel.qualify(link_table, model_link_column) => Sequel.qualify(model.table_name, :id))\n .filter(Sequel.qualify(link_table, subject_link_column) => subjects_by_id.keys)\n .select(Sequel.qualify(model.table_name, :id),\n Sequel.qualify(model.table_name, :publish),\n Sequel.qualify(model.table_name, :suppressed),\n Sequel.as(Sequel.qualify(link_table, subject_link_column),\n :subject_id))\n\n if model.columns.include?(:repo_id)\n linked_records = linked_records\n .select_append(Sequel.as(Sequel.qualify(model.table_name, :repo_id),\n :repository_id))\n end\n\n published_status = if model.included_modules.include?(TreeNodes)\n for_tree_nodes(linked_records\n .select_append(Sequel.qualify(model.table_name, :parent_id),\n Sequel.qualify(model.table_name, :root_record_id))\n .all)\n elsif model.to_s =~ /^Agent/\n for_agents_linked_to_subject(linked_records.all)\n else\n for_top_level_records(linked_records.all)\n end\n\n published_status.each do |linked_record, published|\n if published\n result[subjects_by_id.fetch(linked_record[:subject_id])] = true\n end\n end\n end\n end\n end\n end\n\n result\n end", "def rel? kind\n rel.include? kind\n end", "def rels\n @traversal_result = :rels\n self\n end", "def relationship_links(source)\n {}\n end", "def macro\n :belongs_to_related\n end", "def link\n subject_link\nend", "def associations; end", "def child_relation; end", "def related_attrs\n relationship = flex_options[:relationship_name]\n send relationship\n end", "def relations\n _relations\n end", "def relations\n _relations\n end", "def rel(rels)\n # rel must be an array.\n data[:rel] = Array(rels)\n end", "def edge_relation a_subject_kind:, a_subject_name:, b_subject_kind:, b_subject_name:\n a_subject_label = make_label a_subject_kind, a_subject_name\n b_subject_label = make_label b_subject_kind, b_subject_name\n\n add_relation a_subject_label, :RELATION, b_subject_label\n end", "def related_to(*args)\n@relations = args.map(&:to_s)\nend", "def edge_access subject_kind:, subject_name:, namespace:\n subject_label = make_label subject_kind, subject_name\n ns_label = make_label namespace\n\n add_relation subject_label, :ACCESS, ns_label\n end", "def model_relationships; end", "def relationships\n @relationships ||= {}\n end", "def relations\n @relations ||= {}\n end", "def subject_uri\n @subject_uri ||= ::RDF::URI(RDF::Node.new.to_s.gsub(\"_:\", \"#\"))\n end", "def belongs_to_list(rel_type, params = {})\n decl_relationships[rel_type] = Neo4j::Relationships::DeclRelationshipDsl.new(rel_type, params)\n end", "def rdfs_sub_property_of\n end", "def relations\n return @artist_data[\"relations\"]\n end", "def e_relational\n ElementReqs::Relational\n end", "def related?\n self.rel == \"related\"\n end", "def publication_place\n end", "def associates\n self.doc_refs\n end", "def relations\n @relations ||= process_rels\n end", "def rel_type\n getType().name()\n end", "def find_relation\n if relation_name.present?\n self.relation = Relation.mode(sender_subject.class.to_s,\n receiver_subject.class.to_s).\n find_by_name(relation_name)\n end\n end", "def relationship(sym)\n self.class.relationship(sym)\n end", "def associated\n end", "def associated_acts\n if self.type == \"Person\"\n arr = Array.new\n artist_relations = get_relations(self.relations, \"artist\")\n artist_relations.each do |relation|\n if relation[\"type\"] == \"member of band\"\n arr << relation\n end\n end\n return arr\n else\n return nil\n end\n end", "def rel\n @node[\"rel\"] || \"alternate\"\n end", "def belongs_to\n return self.property.name if self.renter_id == 0\n return self.renter.full_name2 if (self.renter_id != 0) \n end", "def related\n request('related')\n end", "def relation_alias(embed)\n relation_aliases[embed]\n end", "def related_organisms\n organisms = assays.collect(&:organisms).flatten\n organisms |= models.collect(&:organism).flatten\n organisms.uniq.compact\n end", "def related_organisms\n organisms = related_assays.collect{|a| a.organisms}.flatten.uniq.compact\n organisms = organisms | related_models.collect{|m| m.organism}.uniq.compact\n organisms\n end", "def full_title\n # if used default namespaces -> remove from full title\n if (self.namespace == '101') or (self.namespace == 'Concept')\n self.title\n else\n # else use normal building of full url\n self.namespace + ':' + self.title\n end\n end", "def relation_of(field)\n meta = meta_of(field)\n meta ? meta.relation : nil\n end", "def relationships_with_name(input, name)\n input.relations(name)\n end", "def source_relations\n query = \"at:link[@rel = '#{Rel[repository.cmis_version][:relationships]}']/@href\"\n link = data.xpath(query, NS::COMBINED)\n if link.length == 1\n link = Internal::Utils.append_parameters(link.text, \"relationshipDirection\" => \"source\", \"includeSubRelationshipTypes\" => true)\n Collection.new(repository, link)\n else\n raise \"Expected exactly 1 relationships link for #{key}, got #{link.length}, are you sure this is a document/folder?\"\n end\n end", "def relationship\n relationship? ? children[1] : nil\n end", "def relation\n relation = nodes.reduce(root) do |a, e|\n a.associations[e.name.key].join(:join, a, e)\n end\n schema.(relation)\n end", "def rdf_subject\n @rdf_subject ||= RDF::Node.new\n end", "def relations\n self.class.relations\n end", "def get_relations(service)\n\t\treturn @transport.get_path(\"relations\",service)\n\tend", "def rel!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 33 )\n\n type = REL\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 167:7: 'rel'\n match( \"rel\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 33 )\n\n end", "def fetch\n if self.rdf_subject.to_s.include?('rightsstatements') then\n self.rdf_subject.to_s.gsub!('vocab', 'data')\n self.rdf_subject.to_s.gsub!(/\\/$/, '.ttl')\n end\n\n super\n\n if self.rdf_subject.to_s.include?('rightsstatements') then\n self.rdf_subject.to_s.gsub!('data', 'vocab')\n self.rdf_subject.to_s.gsub!('.ttl', '/')\n end\n end", "def target_relations\n query = \"at:link[@rel = '#{Rel[repository.cmis_version][:relationships]}']/@href\"\n link = data.xpath(query, NS::COMBINED)\n if link.length == 1\n link = Internal::Utils.append_parameters(link.text, \"relationshipDirection\" => \"target\", \"includeSubRelationshipTypes\" => true)\n Collection.new(repository, link)\n else\n raise \"Expected exactly 1 relationships link for #{key}, got #{link.length}, are you sure this is a document/folder?\"\n end\n end", "def get_relations_referring_to_object(type, id)\n api_call_with_type(type, id, \"#{type}/#{id}/relations\")\n end", "def related_identifier_nested\n self[Solrizer.solr_name('related_identifier_nested', :displayable)]\n end", "def subresources\n if any?\n { collection_rel => self }\n else\n {}\n end\n end", "def one_relationship(name)\n end", "def subject\n title \n end", "def relationship(sym)\n if @relationships\n @relationships[sym]\n else\n self.class.relationship(sym)\n end\n end", "def get_relations_for_actor(search)\n # Self\n q = \"SELECT *\n WHERE { ?x <http://www.semanticweb.org/ontologies/2011/10/moviesandtv.owl#hasName> \\\"#{search}\\\" }\"\n results = query(q)\n relations = [{:person_uri => results.last[:x], :name => search}]\n # Shows\n q = \"SELECT *\n WHERE { ?x <http://www.semanticweb.org/ontologies/2011/10/moviesandtv.owl#hasName> \\\"#{search}\\\" .\n ?x <http://www.semanticweb.org/ontologies/2011/10/moviesandtv.owl#isActorIn> ?show .\n ?show <http://www.semanticweb.org/ontologies/2011/10/moviesandtv.owl#hasTitle> ?name }\"\n results = query(q)\n results.each do |result|\n relations << {:show_uri => result[:show], :name => result[:name]}\n end\n return relations\n end", "def rels(node)\n @batch_inserter.getRelationships(node)\n end", "def acts_of_homonymy_for_ref\n syn = self.proj.sensus.by_label(self.label_id).by_ref(self.ref_id).ordered_by_label.collect{|s| s.ontology_class}.uniq\n syns = []\n syn.each_with_index do |s1,i|\n syn[(i+1)..(syn.size)].each do |s2|\n syns << [s1, s2]\n end\n end\n syns\n end", "def relation(rel, &relation_definition)\n raise NotImplementedError, 'relation is not supported yet'\n end", "def synonyms; end", "def related\n @related ||= Artist.related(self)\n end", "def fetch_related_objects(subject,association_name,*indices)\n check_subject_and_association(subject,association_name)\n __send__(plural_association_method(subject.type,association_name),subject.rod_id,*indices)\n end", "def related_url\n return OrderedStringHelper.deserialize(super )\n end", "def related_url\n return OrderedStringHelper.deserialize(super )\n end", "def rdfa_relation(name,tag,relation,options={})\n property_value = relation\n property_uri = name\n property_datatype = options[:datatype]\n if(name.instance_of?(Symbol))\n key = self.class.resource_mapping.keys.detect do |k|\n k == name\n end\n raise Exception.new(\"Unknown rdfa property #{name} for object #{self}\") if key.nil?\n property_uri = \"#{SemanticResource::Configuration.namespaces_map[self.class.resource_mapping[key].first]}#{self.class.resource_mapping[key].last}\"\n end\n options.delete(:datatype)\n\n rdfa = StringIO.new\n\n rdfa << \"<#{tag} rel='#{property_uri}'\"\n rdfa << \" href='#{property_value}'\"\n\n options.each_pair do |k,v|\n rdfa << \"#{k}='#{v}' \"\n end\n if(block_given?)\n rdfa << \">\"\n rdfa << yield if block_given?\n rdfa << \"</#{tag}>\"\n else\n rdfa << \" />\"\n end\n\n rdfa.string\n end", "def related\n Birdman::Requester.get(\"movies/#{id}/related\")\n end", "def responsable_of\n self.references\n end", "def resource_belongs_to(subject, resource_helper: true, urls: true, **options)\n resource_helper(subject) if resource_helper\n collection = options[:collection] || resource_class.model_name.plural\n source_relation_proc = BelongsTo.source_relation(subject, collection, options)\n protected define_method(:source_relation, &source_relation_proc)\n protected define_method(:index_url, &BelongsTo.index_url(subject, urls)) if urls\n end", "def resolved_author; end", "def get_relation(ref_key)\n if @generic_relations_store.key?(ref_key)\n\n if @generic_relations_store[ref_key]['relationsubject']\n gr_subject = @generic_relations_store[ref_key]['relationsubject'].match('^http://d.opencalais.com') ?\n get_entity(@generic_relations_store[ref_key]['relationsubject']) :\n @generic_relations_store[ref_key]['relationsubject']\n else\n gr_subject = 'N/A'\n end\n\n\n if @generic_relations_store[ref_key]['relationobject']\n gr_object = @generic_relations_store[ref_key]['relationobject'].match('^http://d.opencalais.com') ?\n get_entity(@generic_relations_store[ref_key]['relationobject']) :\n @generic_relations_store[ref_key]['relationobject']\n else\n gr_object = 'N/A'\n end\n\n GenericRelation.new(gr_subject,\n @generic_relations_store[ref_key]['verb'],\n gr_object,\n @generic_relations_store[ref_key]['instances'][0]['exact'] ||= 'N/A')\n else\n nil\n end\n end", "def relationship( name, &block )\n require_identifier!\n return if context.linkage_only?\n\n include_or_mark_partial name do\n builder = RelationshipBuilder.new( context )\n yield builder\n\n relationships = ( output[:relationships] ||= {} )\n relationships[ name.to_sym ] = builder.compile\n end\n end", "def path\n send self.class.subject_path\n end", "def index\n @reforganism = Reforganism.find(params[:id])\n @referents = @reforganism.referents\n end", "def relation\n raise NotImplementedError\n end", "def refers_to(*args)\n require \"og/relation/refers_to\"\n relations! << Og::RefersTo.new(args, :owner_class => self)\n end", "def my_squirrels\n # which one knows about BOTH the trees and the nests?\n my_nests.map do |nest|\n nest.squirrel.name\n end\n end", "def find_relations\n puts '2nd pass: find relations'\n find :relations\n self\n end", "def association(association_name); end", "def subjects_person\n get_item_data_by_name('SubjectPerson')\n end", "def subject_name\n subject&.name\n end", "def subject\n area_of_study\n end", "def fetch\n if self.rdf_subject.to_s.include?('itis.gov')\n fetch_itis\n elsif self.rdf_subject.to_s.include?('ubio.org')\n fetch_ubio\n else\n if self.rdf_subject.to_s.include?('wikidata') then\n self.rdf_subject.to_s.gsub!('http://www.wikidata.org/entity/', 'https://www.wikidata.org/wiki/Special:EntityData/')\n self.rdf_subject.to_s.concat('.nt')\n end\n\n super\n\n if self.rdf_subject.to_s.include?('wikidata') then\n self.rdf_subject.to_s.gsub!('https://www.wikidata.org/wiki/Special:EntityData/', 'http://www.wikidata.org/entity/')\n self.rdf_subject.to_s.gsub!('.nt', '')\n end\n end\n end", "def add_subject_terminology(t)\n t.subject(:attributes=>{:authority=>\"UoH\"}) {\n t.topic\n t.temporal\n t.geographic\n }\n t.subject_topic(:proxy=>[:subject, :topic], :index_as=>[:displayable, :facetable])\n t.subject_geographic(:proxy=>[:subject, :geographic], :index_as=>[:displayable])\n t.subject_temporal(:proxy=>[:subject, :temporal], :index_as=>[:displayable])\n end", "def relations_info\n self::RELATIONS_INFO\n end", "def inverse_company_id_field\n :subject_company_id\nend", "def extract_related_content\n end", "def subject\n self['subject']\n end", "def hierarchical_subject_link(hierarchical_subject)\n label = hierarchical_subject.last\n subject = hierarchical_subject.join(\" — \")\n\n subject_link(subject, label)\n end", "def related\n council.wards\n end", "def relation_name\n fetch(:relation_name, :children)\n end" ]
[ "0.63231575", "0.62572974", "0.6161934", "0.6097942", "0.5964886", "0.59556246", "0.5808036", "0.57749945", "0.57052696", "0.5643922", "0.56438655", "0.5627229", "0.55772585", "0.5560013", "0.55511343", "0.5538708", "0.5523052", "0.5514665", "0.5509129", "0.5509129", "0.5493288", "0.5480293", "0.5476907", "0.5462572", "0.54577434", "0.5434966", "0.5418518", "0.5412351", "0.5408883", "0.54002136", "0.5399272", "0.53827727", "0.5350186", "0.53419983", "0.53394204", "0.5339419", "0.5336285", "0.5319744", "0.53172106", "0.5314968", "0.5312737", "0.530181", "0.5296486", "0.52789587", "0.5257871", "0.52349675", "0.52330595", "0.5206769", "0.5202124", "0.51876587", "0.51848245", "0.51814824", "0.51746106", "0.51739687", "0.5167693", "0.51607347", "0.5157813", "0.5152864", "0.51458555", "0.5139655", "0.5129146", "0.51198477", "0.5106169", "0.5099716", "0.50987005", "0.5093391", "0.5079512", "0.5076822", "0.507457", "0.50734407", "0.50733405", "0.50684834", "0.50478876", "0.50478876", "0.5033371", "0.5033261", "0.50316393", "0.50275594", "0.50256735", "0.5019609", "0.50188446", "0.5016305", "0.50145984", "0.50069535", "0.5006531", "0.5005357", "0.50032294", "0.5002051", "0.5001778", "0.4999486", "0.49915674", "0.49903074", "0.4983589", "0.49797416", "0.4978737", "0.49785778", "0.49726868", "0.4972315", "0.4966957", "0.49603337" ]
0.607824
4
Sets operator and inserts separators in between variables.
def translate self.operator = OPERATORS.fetch(operator) { raise CompileError, "#{operator} operator not supported" } separator = Node[:separator].new(operator.separator) prefix = Node[:separator].new(operator.prefix) self.payload = Array(payload.inject { |list, element| Array(list) << t(separator) << t(element) }) payload.unshift(prefix) if operator.prefix self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def operators= new_ops\n @operators = new_ops.gsub(/[^+*-]/, '').split(//)\n reset\n end", "def operator_ruby_string\n operator_string + \" \"\n end", "def complete_operator(node)\n definition.operator_by_field_name(node.value).map { |o| o.end_with?(' ') ? o : \"#{o} \" }\n end", "def make_operator op\n between(opt(@whitespace), op, opt(@whitespace))\n end", "def set_Operator(value)\n set_input(\"Operator\", value)\n end", "def set_Operator(value)\n set_input(\"Operator\", value)\n end", "def operator_c_string\n operator_string + \" \"\n end", "def default_separator=(separator); end", "def cmd_concat_operator\n\t\t\" & \"\n\tend", "def quote_factor_operator=( op )\n if( PERMITTED_OPERATORS.include?( op ) && (@quote_factor != 0 && op == \"'/'\") )\n @quote_factor_operator = op if PERMITTED_OPERATORS.include?( op )\n end\n end", "def tokenize_operator(&block) # :yields: SQLTree::Token\n operator = current_char\n if operator == '-' && /[\\d\\.]/ =~ peek_char\n tokenize_number(&block)\n else\n operator << next_char if SQLTree::Token::OPERATORS_HASH.has_key?(operator + peek_char)\n operator_class = SQLTree::Token.const_get(SQLTree::Token::OPERATORS_HASH[operator].to_s.upcase)\n handle_token(operator_class.new(operator), &block)\n end\n end", "def operator\n case @matches[2]\n when \"plus\" then :+\n when \"minus\" then :-\n when \"divided by\" then :/\n when \"multiplied by\" then :*\n end\n end", "def sep\n puts\n puts '=' * 70\n puts\nend", "def sep; end", "def sep; end", "def operator_to_string\n {\n \"+\" => 'plus', \n \"-\" => 'minus'\n }\n end", "def operator=(value)\n @operator = value\n end", "def operator=(value)\n @operator = value\n end", "def operator=(value)\n @operator = value\n end", "def operator\n @operator ||= case [min, max]\n when [0, 0] then ''\n when [0, 1] then '?'\n when [1, Infinity] then '+'\n else\n [min, max].map {|n| n == 0 || n == Infinity ? '' : n.to_s }.join('*')\n end\n end", "def operator\n @operator ||= case [min, max]\n when [0, 0] then ''\n when [0, 1] then '?'\n when [1, Infinity] then '+'\n else\n [min, max].map {|n| n == 0 || n == Infinity ? '' : n.to_s }.join('*')\n end\n end", "def lsep\n \"==================================================================================\"\n end", "def set_delimiter delim\n @lt2_delimiter = case delim\n when Regexp\n delim\n else\n delim.to_s\n end\n end", "def sep(separator)\n ->(a, b){ a << separator.html_safe << b }\n end", "def add_operator( operator )\r\n @operators << operator\r\n end", "def convert_operator_to_text(op)\n case op\n when '1'\n 'add'\n when '2'\n 'subtract'\n when '3'\n 'multiply'\n when '4'\n 'divide'\n end\nend", "def default_separator; end", "def separator; end", "def operation\n case @segment[%r(^([<>]{1,2})), 1]\n when '>': :replace\n when '>>': :append\n when '<<': :prepend\n when '<': :insert_alpha\n end\n end", "def to_s\n identifier = \"#{fieldx}_#{value}\".downcase.gsub(/\\W/,'_')\n \"#{operator}#{identifier}\"\n end", "def operator_label(op)\n op.to_s.gsub(\"_\", \" \")\n end", "def delim!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 13 )\n\n\n\n type = DELIM\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 305:3: '|'\n match( 0x7c )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 13 )\n\n\n end", "def set_delimiters(start, stop)\n @start_delim = start\n @stop_delim = stop\n puts \"FileGenTask: Setting token delimeters to #{@start_delim}, #{@stop_delim}\" if @verbose\n end", "def expr_to_s\n buf = ''\n each_term do |term|\n if term[:operator]\n buf << term[:operator]\n end\n buf << term[:token]\n end\n buf\n end", "def expression(operator, val)\n val = (val.is_a?(String) || val.is_a?(Symbol)) ? \"'#{val}'\" : val\n \"#{@attr} #{operator} #{val}\"\n end", "def operator\n @operator || (self.persisted? ? 'SET' : 'ADD')\n end", "def separator(text)\n puts '--%s' % text\nend", "def match_operator(p, value)\n if p[0] == '!'\n @@operator_map[p[0]].call(_match(p[1], value))\n elsif p[0] == '^'\n @@operator_map[p[0]].call(_match(p[1][0], value), _match(p[1][1], value))\n else\n @@operator_map[p[0]].call(p[1].each {|operator_or_filter| _match(operator_or_filter, value)})\n end\n end", "def test_compose_operator\n tokenizer = Tokenizer.new\n tokenizer.text = \"<><=<>=\"\n tokenizer.tokenize\n tokens = tokenizer.tokens\n\n #test type of token\n assert_equal(\"OperatorToken\", tokens.first.class.name)\n\n #test values\n assert_equal(\"TEMPLATE\", tokens.first.val_name)\n assert_equal(\"LESS-OR-EQUAL\", tokens[1].val_name)\n assert_equal(\"TEMPLATE\", tokens[2].val_name)\n assert_equal(\"ASSIGMENT\", tokens.last.val_name)\n\n #test position of <=\n assert_equal(1, tokens[1].line_info)\n assert_equal(2, tokens[1].start_index)\n assert_equal(4, tokens[1].end_index)\n end", "def add_expr(src, code, indicator)\n case indicator\n when '=='\n add_expr_escaped(src, code)\n else\n super\n end\n end", "def separator(str)\n # We store separators as simple strings in the options array to maintain\n # order. They are ignored by the parser.\n @@options << str\n end", "def opcode(op,cond,args) \"#{op}#{cond} #{args.join ','}\" end", "def format(fmt)\n prefix = ''\n prefix = \"#{@comparison_operator} \" if has_comparison_operator?\n\n \"#{prefix}#{super fmt}\"\n end", "def html_operator\n select_tag(input_name(:operators), options_for_select(operators.collect {|o| [operator_label(o), o]}, operator), :id => dom_id(:operator), :onchange => js_value_settle)\n end", "def inputPrecedence(operator)\n if ['+', '-'].include? operator\n return 1\n elsif ['*', '/', '%'].include? operator\n return 2\n elsif '^'.eql? operator\n return 4\n else\n return 5\n end\n end", "def opcode(op,args) \"#{op} #{args.join ','}\" end", "def opcode(op,args) \"#{op} #{args.join ','}\" end", "def opcode(op,args) \"#{op} #{args.join ','}\" end", "def opcode(op,args) \"#{op} #{args.join ','}\" end", "def separator=(value)\n @separator = value\n end", "def to_s\n operator_string + \" \" + @expression.to_s\n end", "def separator\n @parts.push(separator: true)\n end", "def operation=(op)\n self[:operation] = op.to_s.first.upcase\n end", "def operator\n @operator ||= (name.split('::').last.chomp('Assay').downcase + '?').to_sym\n end", "def separator(type); end", "def string_concat_infix(operator, *args)\n if args.blank? || args.size < 2\n fail ArgumentError, \"string concatenation requires operator and two or more arguments, given '#{args.size}'\"\n end\n\n result = Arel::Nodes::InfixOperation.new(operator, args[0], args[1])\n\n if args.size > 2\n args.drop(2).each do |a|\n result = Arel::Nodes::InfixOperation.new(operator, result, a)\n end\n end\n\n result\n end", "def prefixo\n return ' ~> '\n end", "def complex_expression_sql_append(sql, op, args)\n case op\n when :^\n j = ' # '\n c = false\n args.each do |a|\n sql << j if c\n literal_append(sql, a)\n c ||= true\n end\n when :ILIKE, :'NOT ILIKE'\n sql << '('\n literal_append(sql, args[0])\n sql << ' ' << op.to_s << ' '\n literal_append(sql, args[1])\n sql << ')'\n else\n super\n end\n end", "def escape_find_operators(s)\n s.gsub(FM_FIND_OPERATORS_RE, \"\\\\\\\\\\\\1\")\n end", "def seperator(str)\n @stack << str.to_s\n end", "def to_s\n @operator\n end", "def lex_en_interp_backslash_delimited; end", "def lex_en_interp_backslash_delimited; end", "def lex_en_interp_backslash_delimited; end", "def is_operator char\n\t\t@@allowed_operator.include? char\n\tend", "def to_infix\n case self\n in [:all]\n \"\"\n in [:none]\n \"none\"\n in [:wildcard, name]\n name\n in [:tag, name]\n name\n in [:metatag, name, value, quoted]\n \"#{name}:#{quoted_value}\"\n in :not, child\n child.term? ? \"-#{child.to_infix}\" : \"-(#{child.to_infix})\"\n in :opt, child\n child.term? ? \"~#{child.to_infix}\" : \"~(#{child.to_infix})\"\n in :and, *children\n children.map { _1.children.many? ? \"(#{_1.to_infix})\" : _1.to_infix }.join(\" \")\n in :or, *children\n children.map { _1.children.many? ? \"(#{_1.to_infix})\" : _1.to_infix }.join(\" or \")\n end\n end", "def orginize_equation\n gsub!(' ','')\n ##TODO:: orginaize \n end", "def inputPrecedence(operator)\n if operator == \"+\" || operator == \"-\"\n\t\t\treturn 1\n\t\tend\n\n if operator == \"*\" || operator == \"/\" || operator == \"%\"\n\t\t\treturn 2\n\t\tend\n\n if operator == \"^\"\n\t\t\treturn 4\n\t\tend\n\n if operator == \"(\"\n\t\t\treturn 5\n\t\tend\n\n end", "def visitOperator(elem, data)\r\n @@log.debug(\"XmlRuleVisitor::visitOperator\")\r\n @@log.debug(elem.inspect)\r\n\r\n if (!elem.has_text?)\r\n @@log.error(\"An OPERATOR element does not have any text.\")\r\n return data\r\n end\r\n\r\n case elem.text\r\n when '&lt;'\r\n data += ' < '\r\n\r\n when '&gt;'\r\n data += ' > '\r\n\r\n when '&lt;&gt;', '<>'\r\n data += ' != '\r\n\r\n when 'OR'\r\n data += \" ||\\n\\t\\t\"\r\n\r\n when 'AND'\r\n data += \" &&\\n\\t\\t\"\r\n\r\n else\r\n data += \" #{elem.text} \"\r\n end\r\n\r\n return data\r\n end", "def seperator\n puts \"*\"*49\n end", "def translate\n self.operator = OPERATORS.fetch(operator) { raise CompileError, \"#{operator} operator not supported\" }\n separator = Node[:separator].new(operator.separator)\n prefix = Node[:separator].new(operator.prefix)\n self.payload = Array(payload.inject { |list, element| Array(list) << t(separator.dup) << t(element) })\n payload.unshift(prefix) if operator.prefix\n self\n end", "def oper=(value)\n @oper = value\n end", "def operators\n {\n \"+\" => -> {@num1 + @num2},\n \"-\" => -> {@num1 - @num2}\n }\n end", "def default_separator(value = T.unsafe(nil)); end", "def delimiter=(new_delimiter)\n self.left_delimiter = new_delimiter\n self.right_delimiter = new_delimiter\n end", "def collect_operator(mat)\n return collect_negative_number if mat == '-' && (@str[1] =~ /\\d/)\n\n Token.new OPERATORS[mat]\n end", "def prescedence_of operator\n case operator\n when \"*\" then 2\n when \"/\" then 2\n when \"+\" then 1\n when \"-\" then 1\n when \"(\" then 0 \n end\n end", "def to_s\n if Prefix===prefix\n s = symbol ? \"#{prefix.symbol}#{symbol}\" : \"#{prefix.name}#{term})\"\n else\n s = symbol ? \"#{symbol}\" : \"#{term}\"\n end\n if power != 1\n s = s + (power > 0 ? \"^#{power}\" : \"#{power}\")\n end\n s\n end", "def formatted(separator = ';')\n \"#{prefix}#{id}#{separator}#{control_codes}\"\n end", "def basic_op(operator, value1, value2)\nvalue1.send operator, value2\nend", "def add_expression(indicator, code)\n if ((indicator == '=') ^ @escape)\n add_expression_result(code)\n else\n add_expression_result_escaped(code)\n end\n end", "def pack_doper(operator, token) #:nodoc:\n doper = ''\n string = ''\n\n # Return default doper for non-defined filters.\n if operator.nil?\n return pack_unused_doper, string\n end\n\n if token.to_s =~ /^blanks|nonblanks$/i\n doper = pack_blanks_doper(operator, token)\n elsif operator == 2 or\n !(token.to_s =~ /^([+-]?)(?=\\d|\\.\\d)\\d*(\\.\\d*)?([Ee]([+-]?\\d+))?$/)\n # Excel treats all tokens as strings if the operator is equality, =.\n string = token.to_s\n\n encoding = 0\n length = string.length\n\n # Handle utf8 strings\n if string =~ NonAscii\n string = NKF.nkf('-w16B0 -m0 -W', string)\n encodign = 1\n end\n\n string = [encoding].pack('C') + string\n doper = pack_string_doper(operator, length)\n else\n string = ''\n doper = pack_number_doper(operator, token)\n end\n\n return [doper, string]\n end", "def add_seperator\n add_child Nokogiri::XML::Node.new('separator', document)\n end", "def on_semicolon(token)\n log \"SEMICOLON: '#{token}'\"\n super(token)\n end", "def operator; end", "def separator\n puts \" \"\n puts pastel.bright_magenta(\"======================================================\")\n puts \" \"\n end", "def separator\n puts \" \"\n puts pastel.bright_magenta(\"======================================================\")\n puts \" \"\n end", "def separator\n puts \" \"\n puts pastel.bright_magenta(\"======================================================\")\n puts \" \"\n end", "def to_s(operator: 'exact')\n \"#{category},#{operator},#{URI.encode(value.gsub(';', ''))}\"\n end", "def delimiter\n \" \"\n end", "def delimiter\n \" \"\n end", "def operator\n node_parts[1]\n end", "def insert_prefix(code, operations, strings)\n if strings.empty?\n operations.reverse_each do |op|\n code.insert(op[:ends], \"line#{VM_PREFIX}\")\n end\n else\n operations.reverse_each do |op|\n code.insert(op[:ends], \"line#{VM_PREFIX}\") if is_not_in_string?(op[:starts], strings)\n end\n end\n code\nend", "def divider(char=\"-\")\n char * 80\nend", "def make_delimiters\n ((self).split(//)*2+['',''])[0,2] # *2 doubles up single delimiters\n end", "def quote(sep = nil)\n sep ||= \"'\"\n sep + self + sep\n end", "def basic_op(operator, value1, value2)\n case operator\n when \"+\"\n value1 + value2\n when \"-\"\n value1 - value2\n when \"*\"\n value1 * value2\n when \"/\"\n value1 / value2\n end\nend", "def precedence\n case @operator\n when '+', '-'\n # addition and subtraction\n 0\n when '*', '/'\n # multiplication and division\n 1\n when '**', '^'\n # powers / roots (e.g. 2^(1/2))\n 2\n end\n end", "def basic_op(operator, value1, value2)\n case operator\n when '+'\n value1 + value2\n when '-'\n value1 - value2\n when '*'\n value1 * value2\n when '/'\n value1 / value2\n end\nend", "def select_operator\n return '>' if self.class.name.downcase.include?('arm')\n return '==' if self.class.name.downcase.include?('leg')\n end" ]
[ "0.6840857", "0.67293906", "0.6564949", "0.65172076", "0.64232785", "0.64232785", "0.6243785", "0.61767745", "0.6145631", "0.61209726", "0.6101651", "0.6072702", "0.602878", "0.5966229", "0.5966229", "0.5961776", "0.5845326", "0.5845326", "0.5845326", "0.5832655", "0.5832655", "0.5832411", "0.58261305", "0.58075213", "0.5777306", "0.5746386", "0.5746265", "0.5746179", "0.57143813", "0.5710934", "0.56995845", "0.56449103", "0.5640176", "0.5596879", "0.557648", "0.5573765", "0.5556642", "0.55349106", "0.55263186", "0.55124444", "0.5511254", "0.54834145", "0.5479198", "0.5477611", "0.5469151", "0.54585326", "0.54585326", "0.54585326", "0.54585326", "0.5442061", "0.5420087", "0.5411315", "0.5411134", "0.5407884", "0.54021484", "0.5393213", "0.53897375", "0.53850573", "0.5377472", "0.53662354", "0.53572756", "0.53571445", "0.53571445", "0.53571445", "0.5353243", "0.53306067", "0.53253937", "0.5324478", "0.53192794", "0.5306171", "0.5289278", "0.528771", "0.5283745", "0.52720404", "0.52697825", "0.52697366", "0.5268973", "0.52402127", "0.52307147", "0.5229067", "0.52272624", "0.5226186", "0.5222223", "0.52120495", "0.52120185", "0.52094454", "0.52094454", "0.52094454", "0.5208953", "0.5204685", "0.5204685", "0.5199869", "0.51944065", "0.519289", "0.5188999", "0.5185776", "0.51832247", "0.5178689", "0.5174917", "0.5174035" ]
0.53355706
65
buffer for potential look ahead
def lookahead_buffer @lookahead_buffer ||= [] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def look_ahead(kclass, index, char, buffer, classified_sentence, nivel_parentese)\n if @raw[index + 1] && kclass::REGEX.match( \"#{buffer}#{char}#{@raw[index + 1]}\" )\n buffer.concat char\n else\n classified_sentence.push kclass.new(buffer+char)\n buffer.clear\n end\n end", "def look_ahead(pos)\n offset = @index + pos - 1\n if @buffer.length < offset + 1\n char = @input.read(offset + 1 - @buffer.length)\n @buffer << char if not char.nil?\n end\n\n if offset < @buffer.length\n @buffer[offset]\n else\n :EOF\n end\n end", "def look_ahead(pos)\n offset = @index + pos - 1\n if @buffer.length < offset + 1\n char = @input.read(offset + 1 - @buffer.length)\n @buffer << char if not char.nil?\n end\n\n if offset < @buffer.length\n @buffer[offset]\n else\n EOF\n end\n end", "def test_srch_back_for_nonexist_pattern\n @buffer = Buffer.new 'Now is the time for all good men to come to the aid of their country'\n @buffer.fin\n @buffer.srch_back 'xxyyzz'\n assert_eq '', @buffer.at\n end", "def lookahead(input: $srcin)\n $lookahead = input.getc\nend", "def buffer\n @line[@pos, @line.length - @pos] unless @line.nil?\n end", "def consume()\n la(1)\n return @lookahead.shift\n end", "def lookahead(input: $input)\n $lookahead = input.getc\nend", "def lookahead(input: $input)\n $lookahead = input.getc\nend", "def scan_for_at(token); end", "def advance\n @lookahead = next_token()\n end", "def token_buffer_stash(buf)\n @buffers.push(buf)\n end", "def peek\r\n @peek_buffer ||= get unless eoln?\r\n end", "def lookahead(ll_index = 0)\n retun nil if @current + ll_index >= tokens.size\n tokens[@current + ll_index]\n end", "def buffer; end", "def buffer; end", "def buffer; end", "def match_tokens\n ([email protected]).each{|n|\n @tokens.each{|k,vs|\n vs.each{|v| # Each value of each token\n # If match\n #puts \"#{@buffer[0..n]} -- #{v}\"\n if @buffer[0..n] == v then\n t = Token.new(k, v, \"#{@[email protected](\"\\n\")}.#{@[email protected]}\", nil) # Construct token, compensate for readahead\n @buffer = @buffer[n-1..-1] # Cut from left of buffer\n return t # return token\n end\n }\n }\n }\n return nil\n end", "def remainder_as_buffer; end", "def scan(buffer, source_offset)\n buffer.scan(\n /[%a-z0-9_\\-=\\&]*(?:sid|session|sess|user|usr|login|pass|secret|token)[%a-z0-9_\\-=\\&]*=[%a-z0-9_\\-=&]+/mi\n ).each do |m|\n # This may hit an earlier identical match, but thats ok\n last_offset = buffer.index(m)\n report_hit(:type => 'URLParams', :data => m, :offset => source_offset + last_offset)\n last_offset += m.length\n end\n end", "def match_next(pattern,mms,buf_size=524288)\r\n while true\r\n start_pos = @[email protected]\r\n result = pattern.match(@buffer)\r\n if result\r\n offset_begin, offset_end = result.offset(0)\r\n @buffer = @buffer[offset_end,@buffer.length]\r\n return [result,start_pos+offset_begin,start_pos+offset_end]\r\n else\r\n return nil if @io.eof?\r\n @buffer = @buffer[-mms..-1] if @buffer.length>mms # backup by one mms\r\n @buffer << (@io.read(buf_size) || '')\r\n end\r\n end\r\n\r\n end", "def lookahead(lookahead = nil) \n @lookahead = lookahead unless lookahead.nil?\n @lookahead\n end", "def pre_match\n m = @match\n @string[0...(@pos - m.to_s.size)] if (not m.equal?(nil))\n end", "def pre_match() end", "def test_word_fwd_no_match\n assert_nil @buffer.word_fwd\n end", "def next(buffer)\r\n unless @active && @old_buffer == buffer\r\n @active = source.rebuild(buffer)\r\n end\r\n\r\n if @active\r\n @old_buffer = source.next\r\n else\r\n @old_buffer = nil\r\n end\r\n end", "def test_goto_position_backwards\n @buffer = Buffer.new 'hellow world'\n @buffer.fin\n @buffer.goto_position 5\n assert_eq @buffer.position, 5\n assert_eq @buffer.at, 'w'\n end", "def forwardtrack_searching(location, expectation)\n result = location.dup\n line = lines[result[0] - 1]\n begin\n if (expectation_location = line.index(expectation, result[1]))\n result[1] = expectation_location + expectation.size\n return result\n end\n result[0] += 1\n result[1] = 0\n line = lines[result[0] - 1]\n end while result[0] <= lines.size\n location\n end", "def peek; end", "def peek; end", "def backtrack_searching(location, expectation)\n result = location.dup\n line = lines[result[0] - 1]\n begin\n if (expectation_location = line.rindex(expectation, result[1]))\n result[1] = expectation_location\n return result\n end\n result[0] -= 1\n line = lines[result[0] - 1]\n result[1] = line.size\n end while result[0] >= 0\n location\n end", "def clean_buffer; self.input_buffer = self.input_buffer[self.input_buffer.length-4,self.input_buffer.length-1]; end", "def peek()\n \n end", "def track(element)\n return list_for(element) << element if lookahead_buffer.empty?\n return lookahead_buffer << element if lookahead? element\n\n lookahead = lookahead_buffer.dup\n lookahead = create_lookahead(lookahead, false) if element.is_a? Node[:separator]\n lookahead_buffer.clear\n\n payload.concat(lookahead) << element\n end", "def track(element)\n return list_for(element) << element if lookahead_buffer.empty?\n return lookahead_buffer << element if lookahead? element\n\n lookahead = lookahead_buffer.dup\n lookahead = create_lookahead(lookahead, false) if element.is_a? Node[:separator]\n lookahead_buffer.clear\n\n payload.concat(lookahead) << element\n end", "def fwd_after_peek\n @pos = @head_pos\n end", "def scan(buffer, source_offset)\n buffer.scan(\n /-----BEGIN\\s*[^\\-]+-----+\\r?\\n[^\\-]*-----END\\s*[^\\-]+-----\\r?\\n?/m\n ).each do |m|\n # This may hit an earlier identical match, but thats ok\n last_offset = buffer.index(m)\n report_hit(:plugin => self, :type => 'PEM', :data => m, :offset => source_offset + last_offset)\n last_offset += m.length\n end\n end", "def match(p0) end", "def match(p0) end", "def buffer_checkpoint(message)\n log_header\n if config.live_logging\n log_line(message)\n else\n @buffer << message\n end\n end", "def ignore?(buf); end", "def exp_buffer\n result = @receive_buffer\n @receive_buffer = ''\n result\n end", "def offset_after_match\n offset + match_length\n end", "def _buffer( the_binding )\n @_buffer = eval( \"_buf\", the_binding )\n end", "def parse(source_buffer); end", "def parse(source_buffer); end", "def parse(source_buffer); end", "def peek(src)\n ctx = src.is_a?(Context) ? src : Context.new(src)\n starting_pos = ctx.bio.pos\n begin\n parse ctx\n ensure\n ctx.bio.restore_to starting_pos\n end\n end", "def source_buffer; end", "def source_buffer; end", "def source_buffer; end", "def consume_remaining_buffer(stack, buf)\n return if buf.length == 0\n stack << buf.dup\n buf.replace('')\n end", "def backtrack_expecting!(location, offset, expectation)\n if text_at(location, offset, expectation.length) == expectation\n location[1] += offset\n true\n end\n end", "def address_lookahead\n\tlookahead = []\n\twhile @sym == SYM_ATOM ||\n @sym == SYM_ATOM_NON_ASCII ||\n @sym == SYM_QTEXT ||\n @sym == SYM_PERIOD\n\t lookahead.push([@sym, @lexeme])\n\t get\n\tend\n\tretval = @sym\n\tputback(@sym, @lexeme)\n\tputback_array(lookahead)\n\tget\n\tretval\n end", "def next\n\t\t@ibuf = (@ibuf+1).modulo(@nbuf)\n\t\t@buffers[@ibuf]\n\tend", "def buffer(x) \n $game_player.iframes = 30 if $game_player.iframes == 0\n unless self.input_buffer[-1]==x\n self.input_buffer << x \n end\n end", "def forward_regex regex\n if regex.is_a? Symbol\n regex = @text_patterns[regex]\n raise \"Pattern specified #{regex} does not exist in text_patterns \" unless regex\n end\n $multiplier = 1 if !$multiplier || $multiplier == 0\n line = @current_index\n _arr = _getarray\n buff = _arr[line].to_s\n return unless buff\n pos = @curpos || 0 # list does not have curpos\n $multiplier.times {\n found = buff.index(regex, pos)\n if !found\n # if not found, we've lost a counter\n if line+1 < _arr.length\n line += 1\n else\n return\n end\n pos = 0\n else\n pos = found + 1\n end\n $log.debug \" forward_word: pos #{pos} line #{line} buff: #{buff}\"\n }\n $multiplier = 0\n @current_index = line\n @curpos = pos\n ensure_visible\n @repaint_required = true\n end", "def scan_until(pattern); end", "def peek\n end", "def peek\n end", "def buffer_prev\n buffer_update_info\n if @_buffer_ctr < 1\n buffer_last\n return\n end\n @_buffer_ctr -= 1 if @_buffer_ctr > 0\n x = @_buffer_ctr\n l = @_buffers[x]\n if l\n populate_buffer_from_filename x\n l = @_buffers[x]\n $log.debug \"bp calling set_content with #{l.class} \"\n set_content l, @_buffers_conf[x]\n buffer_update_position\n end\n end", "def exp_buffer\n result = @exp_buffer\n @exp_buffer = ''\n result\n end", "def source_buffer=(_arg0); end", "def peek\r\n @buffer ||= @io.gets\r\n @buffer\r\n end", "def scan_for_on(token); end", "def scan(pattern); end", "def start_re=(_); end", "def forward(offset = 1)\n self[offset]\n @buffer.slice!(0, offset)\n end", "def fill_buffer(options={})\n next_line = []\n unplaced_tokens = []\n # Repeat line-by-line until the whole buffer is placed (a tail end may remain)\n loop do\n # Drop leading whitespace in a line\n while @line_buffer.size > 0\n break unless [:whitespace, :end_of_line].include?(@line_buffer[0].type)\n @line_buffer.shift\n end\n break if @line_buffer.size == 0\n line_size = 0\n unplaced_tokens_size = 0\n last_interval_end = nil\n tokens_placed = false\n # Place tokens in unplaced_tokens; move them to line when they fit, breaking only at whitespace\n loop do\n next_token = @line_buffer.shift\n next_output_text = next_token.output_text\n line_size += next_output_text.size\n unplaced_tokens_size += next_output_text.size\n unplaced_tokens << next_token\n if [:whitespace, :end_of_line].include?(next_token.type) \n if line_size - next_output_text.size <= net_line_length\n next_line += unplaced_tokens\n unplaced_tokens = []\n unplaced_tokens_size = 0\n tokens_placed = true\n else\n break\n end\n end\n last_interval_end = next_token.interval.end\n break if @line_buffer.size == 0\n end\n # At this point: \n # - @line_buffer has had several (possibly all) tokens shifted out of it,\n # - next_line has some (possibly zero) tokens in it, all of which will fit in the next line\n # - unplaced_tokens contains a set of tokens (possibly none) waiting to be placed; they may overflow the line\n # - line_size contains the combined lengths of the tokens in next_line and unplaced_tokens\n # - unplaced_tokens_size contains the combined length of the tokens in unplaced_tokens\n break if line_size < net_line_length\n hyphenated_tokens = unplaced_tokens.flat_map {|token| hyphenate(token)}\n unplaced_tokens = []\n unplaced_tokens_size = 0\n target_line_length = net_line_length - HYPHEN.size\n hyphenated_syllable_count = 0\n while hyphenated_tokens.size > 0\n token = hyphenated_tokens.last # Go in reverse\n break if token.type==:word && hyphenated_syllable_count > 0 && line_size <= target_line_length\n if token.output_text == \"-\" && hyphenated_syllable_count > 0 && line_size <= target_line_length\n hyphenated_tokens.pop\n break\n end\n unplaced_tokens.unshift(hyphenated_tokens.pop)\n token_size = token.output_text.size\n unplaced_tokens_size += token_size\n line_size -= token_size\n hyphenated_syllable_count = token.type == :word ? hyphenated_syllable_count + 1 : 0\n end\n if hyphenated_tokens.size > 0\n next_line += hyphenated_tokens\n next_line << ParsedNode.create(:other, text: HYPHEN, interval: Range.new(last_interval_end, last_interval_end, true)) \\\n if hyphenated_syllable_count > 0\n else\n if !tokens_placed && unplaced_tokens.size > 0 # Didn't place anything\n if unplaced_tokens.first.output_text.size > net_line_length\n long_token = unplaced_tokens.first\n target_line_length = net_line_length\n target_line_length -= HYPHEN.size if long_token.type==:word\n next_line << ParsedNode.create(\n long_token.type,\n text: long_token.output_text[0, target_line_length],\n interval: Range.new(long_token.interval.begin, long_token.interval.begin+target_line_length, true)\n )\n next_line << ParsedNode.create(\n :other,\n text: HYPHEN,\n interval: Range.new(long_token.interval.begin+target_line_length, long_token.interval.begin+target_line_length, true)\n ) if long_token.type == :word\n unplaced_tokens[0] = ParsedNode.create(\n long_token.type,\n text: long_token.output_text[target_line_length..-1],\n interval: Range.new(long_token.interval.begin+target_line_length, long_token.interval.end, true)\n )\n else\n while unplaced_tokens.size > 0 do\n token = unplaced_tokens.first\n token_size = token.output_text.size\n break if line_size + token_size > net_line_length\n next_line << unplaced_tokens.shift\n line_size += token_size\n end\n end\n end\n end\n if unplaced_tokens.size==0 && @line_buffer.size==0\n flush_buffer(next_line, options)\n else\n flush_buffer(next_line)\n end\n next_line = unplaced_tokens\n unplaced_tokens = []\n end\n @line_buffer = next_line + unplaced_tokens\n end", "def flush_buffer; self.input_buffer = \"AAAA\"; end", "def prepare_token(token)\n case token\n when Fast::FindWithCapture\n token.previous_captures = find_captures\n end\n end", "def catch_text\n # get the actual offset\n start = @buffer.get_iter_at_offset(@@offset)\n\n # get the command\n cmd = @buffer.get_text(start, @buffer.end_iter)\n\n # Save the command to the history object\n @historic.append(cmd)\n\n # Write the command to our pipe\n send_cmd(cmd)\n\n # Add a return line to our buffer\n insert_text(\"\\n\")\n\n # Call the prompt\n prompt()\n\n # Create the mark tag if not exist\n if (not @buffer.get_mark('end_mark'))\n @buffer.create_mark('end_mark', @buffer.end_iter, false)\n end\n\n # Save our offset\n @@offset = @buffer.end_iter.offset\n end", "def scan_full(pattern, advance_pointer, return_string)\n do_scan pattern, advance_pointer, return_string, true\n end", "def read_buffer; end", "def rl_noninc_forward_search(count, key)\r\n noninc_search(1, (key == '?') ? '?' : nil)\r\n end", "def refrigerate\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 36 )\n refrigerate_start_index = @input.index\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return \n end\n # at line 319:5: ( 'R' | 'r' ) ( 'E' | 'e' ) ( 'F' | 'f' ) ( 'R' | 'r' ) ( 'I' | 'i' ) ( 'G' | 'g' ) ( 'E' | 'e' ) ( 'R' | 'r' ) ( 'A' | 'a' ) ( 'T' | 't' ) ( 'E' | 'e' )\n if @input.peek( 1 ).between?( T__20, T__21 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__28, T__29 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__30, T__31 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__20, T__21 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__24, T__25 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__56, T__57 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__28, T__29 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__20, T__21 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__48, T__49 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__16, T__17 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__28, T__29 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 36 )\n memoize( __method__, refrigerate_start_index, success ) if @state.backtracking > 0\n\n end\n \n return \n end", "def with_buffer\n if @chain_appends\n unless @buffer_on_stack\n @src << '; ' << @bufvar\n end\n yield\n @buffer_on_stack = true\n else\n @src << ' ' << @bufvar\n yield\n @src << ';'\n end\n end", "def buffer_line_cycle\n ((line_number..count).to_a + \n (1..line_number).to_a).uniq\n end", "def scan_for_w(token); end", "def refrigerator\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 35 )\n refrigerator_start_index = @input.index\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return \n end\n # at line 315:5: ( 'R' | 'r' ) ( 'E' | 'e' ) ( 'F' | 'f' ) ( 'R' | 'r' ) ( 'I' | 'i' ) ( 'G' | 'g' ) ( 'E' | 'e' ) ( 'R' | 'r' ) ( 'A' | 'a' ) ( 'T' | 't' ) ( 'O' | 'o' ) ( 'R' | 'r' )\n if @input.peek( 1 ).between?( T__20, T__21 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__28, T__29 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__30, T__31 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__20, T__21 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__24, T__25 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__56, T__57 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__28, T__29 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__20, T__21 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__48, T__49 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__16, T__17 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__18, T__19 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__20, T__21 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 35 )\n memoize( __method__, refrigerator_start_index, success ) if @state.backtracking > 0\n\n end\n \n return \n end", "def list_for(element)\n expect_lookahead?(element) ? lookahead_buffer : payload\n end", "def list_for(element)\n expect_lookahead?(element) ? lookahead_buffer : payload\n end", "def scan_full(pattern, succptr, getstr)\n _scan_headonly(pattern, succptr, getstr)\n end", "def lookahead_asciiz(start_ofs, end_ofs)\n sz = lookahead_u2(start_ofs, end_ofs)\n return nil if sz <= 2\n str = lookahead_data(start_ofs+2, end_ofs, sz)\n return nil unless str[-1,1] == \"\\x00\"\n str = str[0..-2]\n return nil unless str =~ /\\A[\\x09\\x0a\\x0d\\x20-\\x7e]*\\z/\n\n return [sz+2, str]\n rescue LookaheadFailure\n nil\n end", "def consume_spans(buffer)\n buffer.enumerator.map(&:itself)\n end", "def fill_buffer\n fill_buffer(@root)\n # System.out.println(\"revIndex=\"+tokenTypeToStreamIndexesMap);\n @p = 0 # buffer of nodes intialized now\n end", "def advance; end", "def advance; end", "def advance; end", "def consumed\n input[0, max_offset]\n end", "def read_and_advance(length)\n data = nil\n cursor_start = current.position\n case current.direction\n when :forward\n data = @buffer.slice(current.position, length)\n adjust(length)\n when :backward\n adjust(-length)\n data = @buffer.slice(current.position, length)\n end\n\n record_trace(cursor_start, data.bytes, current.name)\n data\n end", "def <<(buf)\n @buffer << buf\n parse\n end", "def skip\n @str.slice! @last_re if peek_next_type != :eos\n end", "def parse_line_second_pass(line, buffer)\n # Nop\n end", "def apply_to(tokenstream) \n target=self.class.prepare_tokenstream(tokenstream, @direction)\n cache_check=@@cache[[tokenstream, [@landmarks, @direction, @exhaustive]]]\n if cache_check\n token_locs=cache_check\n else\n token_locs=[]\n while result=seek_landmarks(target)\n token_locs << correct_match_location(tokenstream, result)\n break unless exhaustive?\n end\n @@cache[[tokenstream, [@landmarks, @direction, @exhaustive]]]=token_locs\n end\n if block_given?\n generate_match_data(target, token_locs).each {|md| yield md}\n end\n return token_locs\n end", "def substring_remainder\n if @matches.nil?\n @buffer\n else\n start_index = substring_up_to_match.length\n @buffer[start_index..-1]\n end\n end", "def substring_up_to_match\n @matches.nil? ? nil : @buffer.match(expr_substring_to_match)[0]\n end", "def must_see(char)\n spaces\n if next_is char\n # All good, input as expected.\n char\n elsif input.eos?\n # Finally, the case we've been waiting for:\n # Input exhausted, but still elements to close.\n append char\n else\n append char\n # The magic trick:\n # We implicitly use the stack to count how many closing tags we have/need.\n # We pair with exception's `ensure` mechanism to actually write them out.\n if debug\n msg = \"Seen so far: %s\" % result.clone\n raise UnexpectedTokenError, msg\n else\n raise UnexpectedTokenError\n end\n end\n end", "def next_token; @stack.shift; end" ]
[ "0.712338", "0.686266", "0.683747", "0.6594998", "0.63869214", "0.63171285", "0.6259396", "0.62466055", "0.62466055", "0.61881804", "0.60869163", "0.608431", "0.6067577", "0.59948516", "0.5991536", "0.5991536", "0.5991536", "0.59722984", "0.5960861", "0.58967763", "0.58943546", "0.58852863", "0.5862821", "0.5861024", "0.5837921", "0.57626593", "0.57619035", "0.57581323", "0.5719884", "0.5719884", "0.5688282", "0.56436056", "0.56390804", "0.5616529", "0.5616529", "0.5609716", "0.5605878", "0.55872345", "0.55872345", "0.5542839", "0.5542716", "0.5541356", "0.55321693", "0.5530167", "0.55275005", "0.55275005", "0.55275005", "0.5527236", "0.5516044", "0.5516044", "0.5516044", "0.551425", "0.5512165", "0.5510704", "0.5510544", "0.5502204", "0.5497014", "0.54795253", "0.5461693", "0.5461693", "0.54607177", "0.5456891", "0.5432403", "0.54146624", "0.5414207", "0.54140615", "0.5402157", "0.54013866", "0.5400206", "0.5396668", "0.5387248", "0.53771436", "0.53528804", "0.5346651", "0.53366506", "0.53184634", "0.5314809", "0.53126574", "0.53112364", "0.5307269", "0.5305263", "0.5305263", "0.5300144", "0.5294805", "0.52936584", "0.528646", "0.52756", "0.52756", "0.52756", "0.52737594", "0.5268628", "0.52644366", "0.52605444", "0.5251871", "0.5242965", "0.5241407", "0.5241209", "0.5239045", "0.5233309" ]
0.7432294
1
handle a single element from the array
def track(element) return list_for(element) << element if lookahead_buffer.empty? return lookahead_buffer << element if lookahead? element lookahead = lookahead_buffer.dup lookahead = create_lookahead(lookahead, false) if element.is_a? Node[:separator] lookahead_buffer.clear payload.concat(lookahead) << element end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def retrieve_first_element_from_array(array)\n array[0]\nend", "def retrieve_first_element_from_array(array)\n return array[0]\nend", "def first_element(array)\n array[0]\nend", "def first_item(elective_array)\n return elective_array[0]\nend", "def retrieve_first_element_from_array(array)\n array.first\nend", "def first_event(array)\n array.first\nend", "def get_first_element(arr)\n return arr.first()\nend", "def first(arr)\n return arr[0]\nend", "def one(array)\n return array.first if array.one?\n\n raise SizeError,\n \"expected size to be exactly 1 but size was #{array.size}\"\n end", "def get_first_element(arr)\n arr.first\nend", "def using_first(array)\n first_element=array.first\nend", "def using_first(array)\narray.first\nend", "def first_of(array)\n return array[0]\nend", "def first_of(array)\n return array[0]\nend", "def first_of(array)\n output = array[0]\n return output\nend", "def first_of(arr)\n return arr[0]\nend", "def first_of(arr)\n return arr[0]\nend", "def first_of(arr)\n return arr[0]\nend", "def using_first(array)\n array.first\nend", "def using_first(array)\n array.first\nend", "def using_first(array)\n array.first\nend", "def using_first(array)\n array.first\nend", "def first_element_with_array_methods(array)\n return array.first\nend", "def e\r\n a = [1, 2, 1.0]\r\n a[0]\r\nend", "def first_element_with_array_methods(array)\n array.first\nend", "def first_element_with_array_methods(array)\n array.first\nend", "def element i=0\n @array[i]\n end", "def print_val(arr)\n arr[1]\n end", "def return_edinburgh(array)\n return array[1]\nend", "def first_element_with_array_methods\n @taylor_swift.index (0)\n end", "def mabye_one_element_array(ast)\n if ast.is_a?(Array) && ast.size == 1\n ast[0]\n else\n ast\n end\n end", "def element_at(arr, index)\n arr[index]\nend", "def first_element_with_array_methods(array)\n south_east_asia = [\"Thailand\", \"Cambodia\", \"Singapore\", \"Myanmar\"]\n south_east_asia.first\n end", "def peek\r\n @arr[0]\r\n end", "def peek()\n @arr[1]\n end", "def third_element(array)\n array[2]\nend", "def third_element(array)\n array[2]\nend", "def head\n \t@array[0]\n end", "def at(index)\n \t@array[index]\n end", "def item; @data && index >= 0 ? @data[index] : nil; end", "def first_element_with_array_methods(first_country)\n first_country = @south_east_asia.first\nend", "def saved_for_special_occasion(array)\n puts array[2]\nend", "def element_at(arr, index)\n # return the element of the Array variable `arr` at the position `index`\n # arr.at(index) # or\n # arr[index]\n arr[index] \n end", "def single_value(row)\n row.values.at(0)\n end", "def custom_first(arr, num=0)\n return arr[0] if num == 0\n arr[0, num]\nend", "def element_at(arr, index)\n arr[index]\n # or arr.at(index)\nend", "def custom_first(arr, num_of_elements = 0)\n return arr[0] if num_of_elements == 0\n arr[0, num_of_elements]\nend", "def element_at(arr, index)\n # return the element of the Array variable `arr` at the position `index`\n # arr.at(index) # or\n # arr[index]\n return arr[index]\nend", "def custom_first(arr, num = 0)\n return arr[0] if num == 0\n arr[0, num]\nend", "def element\n @collection[index]\n end", "def d\r\n a = [1, 2, 1.0]\r\n a[2]\r\nend", "def first_element(array)\n taylor_swift = [\"Welcome to New York\", \"Blank Space\", \"Style\", \"Out of The Woods\"]\n taylor_swift[0]\nend", "def first_movie (array)\n array.first\nend", "def item; @data[@index]; end", "def element_at(arr, index)\n # return the element of the Array variable `arr` at the position `index`\n # arr.at(index) # or\n # arr[index]\n arr[index]\nend", "def retrieve_element_from_index(array, index_number)\n return array[index_number]\nend", "def first\n @elements.empty? ? nil : @elements[0]\n end", "def value_of(*path)\n @response.to_array(*path).first\n end", "def first_element(my_first_element)\n my_first_element = @taylor_swift[1-1]\nend", "def index(element); end", "def get_perlin_item_1d(x, array)\n array[get_perlin_int_1d(x, 0, array.length-1)]\n end", "def get_perlin_item_1d(x, array)\n array[get_perlin_int_1d(x, 0, array.length-1)]\n end", "def scalar \n\t\t\t@elem[3]\n\t\tend", "def whats_in_front\n @array[0]\n end", "def retrieve_element_from_index(array, index_number)\n array[index_number]\nend", "def retrieve_element_from_index(array, index_number)\n array[index_number]\nend", "def item\n @data[@index];\n end", "def [] i\n @array[i]\n end", "def first_item (electives)\n electives[0] \nend", "def array_method(input)\n\treturn input[-1]\nend", "def first\r\n self[0]\r\n end", "def current\n validates_possibility_of :current\n self.array[index]\n end", "def first\n self[0]\n end", "def rassoc obj\n @array.each do |elem|\n if elem.respond_to? :at and elem.at(1) == obj\n return elem\n end\n end\n\n nil\n end", "def get_item(index_num)\r\n @arr.fetch(index_num)\r\n end", "def dom_class_first(object, array)\n if (object == array.first)\n return \"first\"\n end\n nil\n end", "def calls_array\n a = return_array\n a[1]\n end", "def next()\n x = @arr[@i]\n @i += 1\n x\n end", "def first\n to_a.first\n end", "def extract_single_value(row, field)\n values = extract_values(row, field)\n return nil unless values.count.positive?\n\n values.first\n end", "def all_or_one(what, &block)\n result = Array(what).each(&block)\n return what.is_a?(Array) ? result : result.first\n end", "def swill(array)\n puts array[3]\nend", "def item; @data[self.index]; end", "def sample(array)\n return nil if array.empty?\n array[int(array.size)]\n end", "def get_single_element\n i = 0\n while i < (@bits.attr_length << LOG_BITS)\n if (member(i))\n return i\n end\n i += 1\n end\n return Label::INVALID\n end", "def element_selection(array)\n puts array[0]\n puts array[-1]\n puts array.first(2)\n return array.last(2)\nend", "def process_single(item)\n @index = Yarpler::Models::Index.new\n @index.index = item[0].to_s\n @index.variable = item[1].to_s\n @index.attribute = item[2].to_s\n end", "def looked_for(array_or_elem) #:nodoc:\n return {} unless array_or_elem \n array_or_elem = [ array_or_elem ] unless array_or_elem.is_a?(Array) \n array_or_elem.index_by { |x| x }\n end", "def now_serving(array)\n if array.size >0\n element = array.shift\n puts \"Currently serving #{element}.\"\n else\n puts \"There is nobody waiting to be served!\"\n end\n\nend", "def [](e)\n return @elements[e]\n end", "def elem(i)\r\n @elemek[i]\r\n end", "def first\n\t\t\tarray = pop\n\t\t\traise ArgumentError, \"FIRST: first element is not an Array.\" unless array.is_a? Array\n\t\t\traise ArgumentError, \"FIRST: empty array.\" if array.length == 0\n\t\t\tpush array.first\n\t\tend", "def at(array, i)\n array[i]\nend", "def elem?; end", "def elem?; end", "def first\n self[0]\n end", "def first\n self[0]\n end", "def first\n all[0]\n end", "def one(array)\n array.shift\n array << 6\nend", "def [](point)\n @array[point.first][point.last]\n end", "def make_value(array)\n value = array[2]\n return value\n end" ]
[ "0.6777386", "0.675957", "0.6727587", "0.6725391", "0.67118245", "0.66755676", "0.6492667", "0.64710563", "0.6448609", "0.6434025", "0.6419177", "0.6396486", "0.63961774", "0.63961774", "0.6299944", "0.6276904", "0.6276904", "0.6276904", "0.62559927", "0.62559927", "0.62559927", "0.62559927", "0.6239252", "0.62321246", "0.62288827", "0.62288827", "0.6107722", "0.6076761", "0.6007172", "0.60048664", "0.60032487", "0.5980835", "0.5976556", "0.597525", "0.5958915", "0.5940898", "0.5940898", "0.59305495", "0.592495", "0.59041643", "0.5904036", "0.58915544", "0.5862154", "0.5861578", "0.5846337", "0.5794664", "0.5790421", "0.5776908", "0.57699865", "0.5767109", "0.57556725", "0.5746102", "0.57341", "0.5690273", "0.56800634", "0.56517774", "0.5624926", "0.5576925", "0.5575506", "0.5572387", "0.5567886", "0.5567886", "0.5556197", "0.55560255", "0.55459535", "0.55459535", "0.554333", "0.55366457", "0.5530353", "0.55221957", "0.5521563", "0.5514519", "0.5510143", "0.55051893", "0.5504673", "0.550263", "0.54869187", "0.5483435", "0.5461559", "0.5456074", "0.5444283", "0.54440063", "0.54364127", "0.54316753", "0.54290193", "0.5427992", "0.54245657", "0.54174346", "0.53983504", "0.53914714", "0.53764117", "0.5360189", "0.53597516", "0.5336642", "0.5336642", "0.5321367", "0.5321367", "0.5320011", "0.5310951", "0.5303663", "0.5288709" ]
0.0
-1
turn look ahead buffer into look ahead node
def create_lookahead(elements, *args) return elements unless elements.size > 1 [Node[:with_look_ahead].new(elements, *args)] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def look_ahead(kclass, index, char, buffer, classified_sentence, nivel_parentese)\n if @raw[index + 1] && kclass::REGEX.match( \"#{buffer}#{char}#{@raw[index + 1]}\" )\n buffer.concat char\n else\n classified_sentence.push kclass.new(buffer+char)\n buffer.clear\n end\n end", "def look_ahead(pos)\n offset = @index + pos - 1\n if @buffer.length < offset + 1\n char = @input.read(offset + 1 - @buffer.length)\n @buffer << char if not char.nil?\n end\n\n if offset < @buffer.length\n @buffer[offset]\n else\n :EOF\n end\n end", "def lookahead_buffer\n @lookahead_buffer ||= []\n end", "def lookahead_buffer\n @lookahead_buffer ||= []\n end", "def look_ahead(pos)\n offset = @index + pos - 1\n if @buffer.length < offset + 1\n char = @input.read(offset + 1 - @buffer.length)\n @buffer << char if not char.nil?\n end\n\n if offset < @buffer.length\n @buffer[offset]\n else\n EOF\n end\n end", "def lookahead(ll_index = 0)\n retun nil if @current + ll_index >= tokens.size\n tokens[@current + ll_index]\n end", "def fill_buffer\n fill_buffer(@root)\n # System.out.println(\"revIndex=\"+tokenTypeToStreamIndexesMap);\n @p = 0 # buffer of nodes intialized now\n end", "def match_tokens\n ([email protected]).each{|n|\n @tokens.each{|k,vs|\n vs.each{|v| # Each value of each token\n # If match\n #puts \"#{@buffer[0..n]} -- #{v}\"\n if @buffer[0..n] == v then\n t = Token.new(k, v, \"#{@[email protected](\"\\n\")}.#{@[email protected]}\", nil) # Construct token, compensate for readahead\n @buffer = @buffer[n-1..-1] # Cut from left of buffer\n return t # return token\n end\n }\n }\n }\n return nil\n end", "def advance\n @lookahead = next_token()\n end", "def atom\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 3 )\n return_value = AtomReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n __CHUNK9__ = nil\n char_literal10 = nil\n group8 = nil\n term11 = nil\n\n tree_for_CHUNK9 = nil\n tree_for_char_literal10 = nil\n\n begin\n # at line 22:5: ( group | ( CHUNK ':' )? ( term )+ )\n alt_6 = 2\n look_6_0 = @input.peek( 1 )\n\n if ( look_6_0 == T__14 || look_6_0 == T__16 || look_6_0 == T__18 )\n alt_6 = 1\n elsif ( look_6_0.between?( CHUNK, REGEX ) )\n alt_6 = 2\n else\n raise NoViableAlternative( \"\", 6, 0 )\n end\n case alt_6\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 22:7: group\n @state.following.push( TOKENS_FOLLOWING_group_IN_atom_112 )\n group8 = group\n @state.following.pop\n @adaptor.add_child( root_0, group8.tree )\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 23:7: ( CHUNK ':' )? ( term )+\n # at line 23:7: ( CHUNK ':' )?\n alt_4 = 2\n look_4_0 = @input.peek( 1 )\n\n if ( look_4_0 == CHUNK )\n look_4_1 = @input.peek( 2 )\n\n if ( look_4_1 == T__13 )\n alt_4 = 1\n end\n end\n case alt_4\n when 1\n # at line 23:9: CHUNK ':'\n __CHUNK9__ = match( CHUNK, TOKENS_FOLLOWING_CHUNK_IN_atom_122 )\n\n tree_for_CHUNK9 = @adaptor.create_with_payload( __CHUNK9__ )\n @adaptor.add_child( root_0, tree_for_CHUNK9 )\n\n char_literal10 = match( T__13, TOKENS_FOLLOWING_T__13_IN_atom_124 )\n\n tree_for_char_literal10 = @adaptor.create_with_payload( char_literal10 )\n root_0 = @adaptor.become_root( tree_for_char_literal10, root_0 )\n\n\n end\n # at file 23:23: ( term )+\n match_count_5 = 0\n while true\n alt_5 = 2\n look_5_0 = @input.peek( 1 )\n\n if ( look_5_0.between?( CHUNK, REGEX ) )\n alt_5 = 1\n\n end\n case alt_5\n when 1\n # at line 23:23: term\n @state.following.push( TOKENS_FOLLOWING_term_IN_atom_130 )\n term11 = term\n @state.following.pop\n @adaptor.add_child( root_0, term11.tree )\n\n else\n match_count_5 > 0 and break\n eee = EarlyExit(5)\n\n\n raise eee\n end\n match_count_5 += 1\n end\n\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 3 )\n\n end\n \n return return_value\n end", "def parse(source_buffer); end", "def parse(source_buffer); end", "def parse(source_buffer); end", "def next(buffer)\r\n unless @active && @old_buffer == buffer\r\n @active = source.rebuild(buffer)\r\n end\r\n\r\n if @active\r\n @old_buffer = source.next\r\n else\r\n @old_buffer = nil\r\n end\r\n end", "def lookahead(lookahead = nil) \n @lookahead = lookahead unless lookahead.nil?\n @lookahead\n end", "def scan_for_at(token); end", "def token_ref!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 56)\n\n type = TOKEN_REF\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 581:4: 'A' .. 'Z' ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*\n match_range(?A, ?Z)\n # at line 581:13: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*\n loop do #loop 16\n alt_16 = 2\n look_16_0 = @input.peek(1)\n\n if (look_16_0.between?(?0, ?9) || look_16_0.between?(?A, ?Z) || look_16_0 == ?_ || look_16_0.between?(?a, ?z)) \n alt_16 = 1\n\n end\n case alt_16\n when 1\n # at line \n if @input.peek(1).between?(?0, ?9) || @input.peek(1).between?(?A, ?Z) || @input.peek(1) == ?_ || @input.peek(1).between?(?a, ?z)\n @input.consume\n else\n mse = MismatchedSet(nil)\n recover(mse)\n raise mse\n end\n\n\n\n else\n break #loop 16\n end\n end\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 56)\n\n end", "def lookahead(input: $srcin)\n $lookahead = input.getc\nend", "def advance\n if @token_queue.any?\n return @token_queue.shift\n end\n\n # Ugly, but dependent on Ragel output. Consider refactoring it somehow.\n klass = self.class\n _lex_trans_keys = klass.send :_lex_trans_keys\n _lex_key_spans = klass.send :_lex_key_spans\n _lex_index_offsets = klass.send :_lex_index_offsets\n _lex_indicies = klass.send :_lex_indicies\n _lex_trans_targs = klass.send :_lex_trans_targs\n _lex_trans_actions = klass.send :_lex_trans_actions\n _lex_to_state_actions = klass.send :_lex_to_state_actions\n _lex_from_state_actions = klass.send :_lex_from_state_actions\n _lex_eof_trans = klass.send :_lex_eof_trans\n\n pe = @source_pts.size + 2\n p, eof = @p, pe\n\n cmd_state = @command_start\n @command_start = false\n\n \n# line 10991 \"lib/parser/lexer.rb\"\nbegin\n\ttestEof = false\n\t_slen, _trans, _keys, _inds, _acts, _nacts = nil\n\t_goto_level = 0\n\t_resume = 10\n\t_eof_trans = 15\n\t_again = 20\n\t_test_eof = 30\n\t_out = 40\n\twhile true\n\tif _goto_level <= 0\n\tif p == pe\n\t\t_goto_level = _test_eof\n\t\tnext\n\tend\n\tif @cs == 0\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\tend\n\tif _goto_level <= _resume\n\tcase _lex_from_state_actions[ @cs] \n\twhen 97 then\n# line 1 \"NONE\"\n\t\tbegin\n @ts = p\n\t\tend\n# line 11019 \"lib/parser/lexer.rb\"\n\tend\n\t_keys = @cs << 1\n\t_inds = _lex_index_offsets[ @cs]\n\t_slen = _lex_key_spans[ @cs]\n\t_wide = ( (@source_pts[p] || 0))\n\t_trans = if ( _slen > 0 && \n\t\t\t_lex_trans_keys[_keys] <= _wide && \n\t\t\t_wide <= _lex_trans_keys[_keys + 1] \n\t\t ) then\n\t\t\t_lex_indicies[ _inds + _wide - _lex_trans_keys[_keys] ] \n\t\t else \n\t\t\t_lex_indicies[ _inds + _slen ]\n\t\t end\n\tend\n\tif _goto_level <= _eof_trans\n\t @cs = _lex_trans_targs[_trans]\n\tif _lex_trans_actions[_trans] != 0\n\tcase _lex_trans_actions[_trans]\n\twhen 28 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 117 then\n# line 817 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n\twhen 29 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n\twhen 59 then\n# line 1217 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n\twhen 63 then\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n\twhen 304 then\n# line 1261 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 36 then\n# line 1542 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 38 then\n# line 1562 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 40 then\n# line 1590 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 70 then\n# line 1782 \"lib/parser/lexer.rl\"\n\t\tbegin\n heredoc_e = p \t\tend\n\twhen 343 then\n# line 1874 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 1; diag_msg = :ivar_name \t\tend\n\twhen 346 then\n# line 1875 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2; diag_msg = :cvar_name \t\tend\n\twhen 354 then\n# line 1895 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = nil \t\tend\n\twhen 383 then\n# line 1984 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 302 then\n# line 2072 \"lib/parser/lexer.rl\"\n\t\tbegin\n ident_tok = tok; ident_ts = @ts; ident_te = @te; \t\tend\n\twhen 470 then\n# line 2258 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 16; @num_digits_s = p \t\tend\n\twhen 464 then\n# line 2259 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = p \t\tend\n\twhen 467 then\n# line 2260 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = p \t\tend\n\twhen 461 then\n# line 2261 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 2; @num_digits_s = p \t\tend\n\twhen 476 then\n# line 2262 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n\twhen 438 then\n# line 2263 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n\twhen 453 then\n# line 2264 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 446 then\n# line 2321 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 443 then\n# line 2322 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 88 then\n# line 2510 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 7 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n\twhen 113 then\n# line 1094 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DBEG, '#{'.freeze)\n\n if current_literal.heredoc?\n current_literal.saved_herebody_s = @herebody_s\n @herebody_s = nil\n end\n\n current_literal.start_interp_brace\n @command_start = true\n @cs = 773;\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 5 then\n# line 1020 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 109 then\n# line 945 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 108 then\n# line 866 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 766;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 115 then\n# line 1036 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @version >= 27\n literal.extend_string(tok, @ts, @te)\n else\n message = tok.start_with?('#@@') ? :cvar_name : :ivar_name\n diagnostic :error, message, { :name => tok(@ts + 1, @te) }, range(@ts + 1, @te)\n end\n end\n\t\tend\n\twhen 114 then\n# line 1020 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 111 then\n# line 1007 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n literal.extend_space @ts, @te\n end\n\t\tend\n\twhen 112 then\n# line 866 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 766;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 6 then\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 4 then\n# line 866 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 766;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 142 then\n# line 1094 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DBEG, '#{'.freeze)\n\n if current_literal.heredoc?\n current_literal.saved_herebody_s = @herebody_s\n @herebody_s = nil\n end\n\n current_literal.start_interp_brace\n @command_start = true\n @cs = 773;\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 10 then\n# line 1020 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 139 then\n# line 945 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 138 then\n# line 866 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 766;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 144 then\n# line 1036 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @version >= 27\n literal.extend_string(tok, @ts, @te)\n else\n message = tok.start_with?('#@@') ? :cvar_name : :ivar_name\n diagnostic :error, message, { :name => tok(@ts + 1, @te) }, range(@ts + 1, @te)\n end\n end\n\t\tend\n\twhen 143 then\n# line 1020 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 141 then\n# line 866 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 766;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 11 then\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 9 then\n# line 866 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 766;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 167 then\n# line 945 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 166 then\n# line 866 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 766;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 169 then\n# line 1007 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n literal.extend_space @ts, @te\n end\n\t\tend\n\twhen 170 then\n# line 866 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 766;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 173 then\n# line 945 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 172 then\n# line 866 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 766;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 175 then\n# line 866 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 766;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 182 then\n# line 1094 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DBEG, '#{'.freeze)\n\n if current_literal.heredoc?\n current_literal.saved_herebody_s = @herebody_s\n @herebody_s = nil\n end\n\n current_literal.start_interp_brace\n @command_start = true\n @cs = 773;\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 13 then\n# line 1020 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 179 then\n# line 945 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 178 then\n# line 866 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 766;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 184 then\n# line 1036 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @version >= 27\n literal.extend_string(tok, @ts, @te)\n else\n message = tok.start_with?('#@@') ? :cvar_name : :ivar_name\n diagnostic :error, message, { :name => tok(@ts + 1, @te) }, range(@ts + 1, @te)\n end\n end\n\t\tend\n\twhen 183 then\n# line 1020 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 181 then\n# line 866 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 766;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 12 then\n# line 866 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 766;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 186 then\n# line 945 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 185 then\n# line 866 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 766;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 193 then\n# line 1094 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DBEG, '#{'.freeze)\n\n if current_literal.heredoc?\n current_literal.saved_herebody_s = @herebody_s\n @herebody_s = nil\n end\n\n current_literal.start_interp_brace\n @command_start = true\n @cs = 773;\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 15 then\n# line 1020 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 189 then\n# line 945 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 188 then\n# line 866 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 766;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 195 then\n# line 1036 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @version >= 27\n literal.extend_string(tok, @ts, @te)\n else\n message = tok.start_with?('#@@') ? :cvar_name : :ivar_name\n diagnostic :error, message, { :name => tok(@ts + 1, @te) }, range(@ts + 1, @te)\n end\n end\n\t\tend\n\twhen 194 then\n# line 1020 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 191 then\n# line 1007 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n literal.extend_space @ts, @te\n end\n\t\tend\n\twhen 192 then\n# line 866 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 766;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 14 then\n# line 866 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 766;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 197 then\n# line 945 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 196 then\n# line 866 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 766;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 199 then\n# line 1007 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n literal.extend_space @ts, @te\n end\n\t\tend\n\twhen 200 then\n# line 1191 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tREGEXP_OPT, tok(@ts, @te - 1), @ts, @te - 1)\n p = p - 1;\n \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 201 then\n# line 1178 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n unknown_options = tok.scan(/[^imxouesn]/)\n if unknown_options.any?\n diagnostic :error, :regexp_options,\n { :options => unknown_options.join }\n end\n\n emit(:tREGEXP_OPT)\n @cs = 781;\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 16 then\n# line 1330 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if tok =~ /^\\$([1-9][0-9]*)$/\n emit(:tNTH_REF, tok(@ts + 1).to_i)\n elsif tok =~ /^\\$([&`'+])$/\n emit(:tBACK_REF)\n else\n emit(:tGVAR)\n end\n\n @cs = (stack_pop); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 202 then\n# line 1330 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if tok =~ /^\\$([1-9][0-9]*)$/\n emit(:tNTH_REF, tok(@ts + 1).to_i)\n elsif tok =~ /^\\$([&`'+])$/\n emit(:tBACK_REF)\n else\n emit(:tGVAR)\n end\n\n @cs = (stack_pop); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 204 then\n# line 1343 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if tok =~ /^@@[0-9]/\n diagnostic :error, :cvar_name, { :name => tok }\n end\n\n emit(:tCVAR)\n @cs = (stack_pop); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 203 then\n# line 1353 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if tok =~ /^@[0-9]/\n diagnostic :error, :ivar_name, { :name => tok }\n end\n\n emit(:tIVAR)\n @cs = (stack_pop); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 225 then\n# line 1374 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(KEYWORDS_BEGIN);\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 211 then\n# line 1382 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tIDENTIFIER)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 18 then\n# line 1386 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1\n @cs = 781; \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 208 then\n# line 1395 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 220 then\n# line 1399 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; p = p - 1; \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 20 then\n# line 1405 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if version?(23)\n type, delimiter = tok[0..-2], tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n else\n p = @ts - 1\n \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 207 then\n# line 1418 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 206 then\n# line 527 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 224 then\n# line 1374 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(KEYWORDS_BEGIN);\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 221 then\n# line 1378 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tCONSTANT)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 223 then\n# line 1382 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tIDENTIFIER)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 218 then\n# line 1386 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n @cs = 781; \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 214 then\n# line 1395 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 219 then\n# line 1402 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 212 then\n# line 1415 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 217 then\n# line 1418 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 19 then\n# line 1395 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin emit_table(PUNCTUATION)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 17 then\n# line 1418 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = p - 1; \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 210 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 43 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS_BEGIN);\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 44 then\n\tbegin begin p = (( @te))-1; end\n emit(:tCONSTANT)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 45 then\n\tbegin begin p = (( @te))-1; end\n emit(:tIDENTIFIER)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 22 then\n# line 1430 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tLABEL, tok(@ts, @te - 2), @ts, @te - 1)\n p = p - 1; @cs = 766; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 227 then\n# line 1436 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 226 then\n# line 527 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 229 then\n# line 1433 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 228 then\n# line 1436 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 21 then\n# line 1436 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = p - 1; \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 235 then\n# line 1462 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 474; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 234 then\n# line 1468 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 233 then\n# line 527 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 245 then\n# line 1447 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tCONSTANT)\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 236 then\n# line 1451 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tIDENTIFIER)\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 241 then\n# line 1462 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 474; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 239 then\n# line 1465 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 244 then\n# line 1468 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 268 then\n# line 1528 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Unlike expr_beg as invoked in the next rule, do not warn\n p = @ts - 1\n \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 251 then\n# line 1546 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if tok(tm, tm + 1) == '/'.freeze\n # Ambiguous regexp literal.\n if @version < 30\n diagnostic :warning, :ambiguous_literal, nil, range(tm, tm + 1)\n else\n diagnostic :warning, :ambiguous_regexp, nil, range(tm, tm + 1)\n end\n end\n\n p = tm - 1\n \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 257 then\n# line 1574 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 24 then\n# line 1582 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 259 then\n# line 1591 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = tm - 1; \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 39 then\n# line 1602 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 246 then\n# line 1616 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 247 then\n# line 527 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 258 then\n# line 1537 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 254 then\n# line 1563 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :warning, :ambiguous_prefix, { :prefix => tok(tm, @te) },\n range(tm, @te)\n\n p = tm - 1\n \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 256 then\n# line 1579 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 250 then\n# line 1602 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 249 then\n# line 1607 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 267 then\n# line 1616 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 25 then\n# line 1607 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n\t\tend\n\twhen 41 then\n# line 1616 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 23 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 71 then\n\tbegin begin p = (( @te))-1; end\n\n if tok(tm, tm + 1) == '/'.freeze\n # Ambiguous regexp literal.\n if @version < 30\n diagnostic :warning, :ambiguous_literal, nil, range(tm, tm + 1)\n else\n diagnostic :warning, :ambiguous_regexp, nil, range(tm, tm + 1)\n end\n end\n\n p = tm - 1\n \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\twhen 72 then\n\tbegin begin p = (( @te))-1; end\n\n diagnostic :warning, :ambiguous_prefix, { :prefix => tok(tm, @te) },\n range(tm, @te)\n\n p = tm - 1\n \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\twhen 77 then\n\tbegin begin p = (( @te))-1; end\n\n p = @ts - 1\n \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\telse\n\tbegin begin p = (( @te))-1; end\nend\nend \n\t\t\tend\n\twhen 43 then\n# line 1652 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1\n \tbegin\n\t\t @cs = 474\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 272 then\n# line 527 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 273 then\n# line 1652 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 474\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 44 then\n# line 1652 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = @ts - 1\n \tbegin\n\t\t @cs = 474\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 42 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 84 then\n\tbegin begin p = (( @te))-1; end\n\n if @cond.active?\n emit(:kDO_COND, 'do'.freeze, @te - 2, @te)\n else\n emit(:kDO, 'do'.freeze, @te - 2, @te)\n end\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 85 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1\n \tbegin\n\t\t @cs = 474\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 283 then\n# line 1688 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_do(true)\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 276 then\n# line 1694 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 277 then\n# line 527 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 278 then\n# line 1691 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 281 then\n# line 1694 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 287 then\n# line 1718 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 286 then\n# line 527 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 295 then\n# line 1710 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 289 then\n# line 1712 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 293 then\n# line 1718 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 288 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 92 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 93 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 56 then\n# line 1733 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1; @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 328 then\n# line 1750 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type = delimiter = tok[0].chr\n p = p - 1; \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 320 then\n# line 1757 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type, delimiter = @source_buffer.slice(@ts).chr, tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 54 then\n# line 1764 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type, delimiter = tok[0..-2], tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 341 then\n# line 1839 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = p - 1; p = p - 1;\n emit(:tSYMBEG, tok(@ts, @ts + 1), @ts, @ts + 1)\n \tbegin\n\t\t @cs = 333\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 329 then\n# line 1847 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type, delimiter = tok, tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 340 then\n# line 1855 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tSYMBOL, tok(@ts + 1, @ts + 2))\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 68 then\n# line 1869 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tSYMBOL, tok(@ts + 1), @ts)\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 351 then\n# line 1910 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n escape = { \" \" => '\\s', \"\\r\" => '\\r', \"\\n\" => '\\n', \"\\t\" => '\\t',\n \"\\v\" => '\\v', \"\\f\" => '\\f' }[@source_buffer.slice(@ts + 1)]\n diagnostic :warning, :invalid_escape_use, { :escape => escape }, range\n\n p = @ts - 1\n \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 350 then\n# line 1920 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n diagnostic :fatal, :incomplete_escape, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 330 then\n# line 1979 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION_BEGIN)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 51 then\n# line 2000 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = p - 1;\n\n if version?(18)\n ident = tok(@ts, @te - 2)\n\n emit((@source_buffer.slice(@ts) =~ /[A-Z]/) ? :tCONSTANT : :tIDENTIFIER,\n ident, @ts, @te - 2)\n p = p - 1; # continue as a symbol\n\n if !@static_env.nil? && @static_env.declared?(ident)\n @cs = 781;\n else\n @cs = (arg_or_cmdarg(cmd_state));\n end\n else\n emit(:tLABEL, tok(@ts, @te - 2), @ts, @te - 1)\n @cs = 766;\n end\n\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 327 then\n# line 2038 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if @version >= 30\n if @lambda_stack.any? && @lambda_stack.last + 1 == @paren_nest\n # To reject `->(...)` like `->...`\n emit(:tDOT3)\n else\n emit(:tBDOT3)\n end\n elsif @version >= 27\n emit(:tBDOT3)\n else\n emit(:tDOT3)\n end\n\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 48 then\n# line 2074 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tIDENTIFIER, ident_tok, ident_ts, ident_te)\n p = ident_te - 1\n\n if !@static_env.nil? && @static_env.declared?(ident_tok) && @version < 25\n @cs = 446;\n else\n @cs = 505;\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 314 then\n# line 2093 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = @ts - 1\n @cs_before_block_comment = @cs\n \tbegin\n\t\t @cs = 185\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 55 then\n# line 2109 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1; \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 298 then\n# line 527 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 325 then\n# line 1733 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1; @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 324 then\n# line 1740 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tSTAR, '*'.freeze)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 321 then\n# line 1764 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n type, delimiter = tok[0..-2], tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 319 then\n# line 1770 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :fatal, :string_eof, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 348 then\n# line 1830 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :error, :unterminated_heredoc_id, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 331 then\n# line 1869 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1), @ts)\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 344 then\n# line 1877 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @version >= 27\n diagnostic :error, diag_msg, { name: tok(tm, @te) }, range(tm, @te)\n else\n emit(:tCOLON, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = @ts\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 349 then\n# line 1920 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :fatal, :incomplete_escape, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 355 then\n# line 1926 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 322 then\n# line 1979 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION_BEGIN)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 326 then\n# line 2027 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @version >= 27\n emit(:tBDOT2)\n else\n emit(:tDOT2)\n end\n\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 301 then\n# line 1315 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 311 then\n# line 2090 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 313 then\n# line 2093 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n p = @ts - 1\n @cs_before_block_comment = @cs\n \tbegin\n\t\t @cs = 185\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 316 then\n# line 2109 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1; \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 53 then\n# line 1770 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n diagnostic :fatal, :string_eof, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 72 then\n# line 1830 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n diagnostic :error, :unterminated_heredoc_id, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 73 then\n# line 1897 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 47 then\n# line 1315 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 52 then\n# line 2090 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n\t\tend\n\twhen 67 then\n# line 2109 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = @ts - 1; \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 50 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 98 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1; @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 105 then\n\tbegin begin p = (( @te))-1; end\n\n diagnostic :error, :unterminated_heredoc_id, nil, range(@ts, @ts + 1)\n end\n\twhen 116 then\n\tbegin begin p = (( @te))-1; end\n\n if @version >= 27\n emit(:tPIPE, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1;\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n p -= 2\n \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n end\n\twhen 120 then\n\tbegin begin p = (( @te))-1; end\n emit_table(PUNCTUATION_BEGIN)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 121 then\n\tbegin begin p = (( @te))-1; end\n emit(:kRESCUE, 'rescue'.freeze, @ts, tm)\n p = tm - 1\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 122 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS_BEGIN)\n @command_start = true\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 126 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1\n \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\twhen 127 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 131 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1; \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 386 then\n# line 2129 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 387 then\n# line 527 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 388 then\n# line 2117 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 392 then\n# line 2129 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 76 then\n# line 2139 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1\n \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 396 then\n# line 2144 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n \tbegin\n\t\t @cs = (push_literal(tok, tok, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 395 then\n# line 2154 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 394 then\n# line 527 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 398 then\n# line 2148 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 397 then\n# line 2154 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 75 then\n# line 2154 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 431 then\n# line 2165 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tLAMBDA, '->'.freeze, @ts, @ts + 2)\n\n @lambda_stack.push @paren_nest\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 85 then\n# line 2206 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:kCLASS, 'class'.freeze, @ts, @ts + 5)\n emit(:tLSHFT, '<<'.freeze, @te - 2, @te)\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 406 then\n# line 2342 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type, delimiter = tok, tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts, nil, false, false, true))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 78 then\n# line 2360 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1; \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 427 then\n# line 2367 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 453; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 480 then\n# line 2391 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit_table(PUNCTUATION)\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 420 then\n# line 2400 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit_table(PUNCTUATION);\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 425 then\n# line 2435 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tOP_ASGN, tok(@ts, @te - 1))\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 411 then\n# line 2439 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tEH, '?'.freeze)\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 408 then\n# line 2458 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 410 then\n# line 2471 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tSEMI, ';'.freeze)\n @command_start = true\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 485 then\n# line 2475 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n diagnostic :error, :bare_backslash, nil, range(@ts, @ts + 1)\n p = p - 1;\n end\n\t\tend\n\twhen 405 then\n# line 2481 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n diagnostic :fatal, :unexpected, { :character => tok.inspect[1..-2] }\n end\n\t\tend\n\twhen 404 then\n# line 527 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 496 then\n# line 2202 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(KEYWORDS)\n @cs = 333; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 494 then\n# line 2206 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:kCLASS, 'class'.freeze, @ts, @ts + 5)\n emit(:tLSHFT, '<<'.freeze, @te - 2, @te)\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 493 then\n# line 2217 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(KEYWORDS)\n @command_start = true\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 435 then\n# line 2292 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :error, :no_dot_digit_literal\n end\n\t\tend\n\twhen 482 then\n# line 2352 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tCONSTANT)\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 424 then\n# line 2360 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1; \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 432 then\n# line 2367 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 453; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 488 then\n# line 1315 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 430 then\n# line 2391 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit_table(PUNCTUATION)\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 426 then\n# line 2400 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit_table(PUNCTUATION);\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 419 then\n# line 2406 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 433 then\n# line 2458 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 417 then\n# line 2465 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 423 then\n# line 2481 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :fatal, :unexpected, { :character => tok.inspect[1..-2] }\n end\n\t\tend\n\twhen 83 then\n# line 2265 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 79 then\n# line 2292 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n diagnostic :error, :no_dot_digit_literal\n end\n\t\tend\n\twhen 82 then\n# line 2324 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 77 then\n# line 2481 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n diagnostic :fatal, :unexpected, { :character => tok.inspect[1..-2] }\n end\n\t\tend\n\twhen 80 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 144 then\n\tbegin begin p = (( @te))-1; end\n\n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n\n if tok == '{'.freeze\n emit(:tLAMBEG, '{'.freeze)\n else # 'do'\n emit(:kDO_LAMBDA, 'do'.freeze)\n end\n else\n if tok == '{'.freeze\n emit(:tLCURLY, '{'.freeze)\n else # 'do'\n emit_do\n end\n end\n if tok == '{'.freeze\n @paren_nest += 1\n end\n @command_start = true\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 145 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 333; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 146 then\n\tbegin begin p = (( @te))-1; end\n emit(:kCLASS, 'class'.freeze, @ts, @ts + 5)\n emit(:tLSHFT, '<<'.freeze, @te - 2, @te)\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 147 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 148 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @command_start = true\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 149 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 150 then\n\tbegin begin p = (( @te))-1; end\n\n emit_table(KEYWORDS)\n\n if version?(18) && tok == 'not'.freeze\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = 474; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 151 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18)\n emit(:tIDENTIFIER)\n\n unless !@static_env.nil? && @static_env.declared?(tok)\n @cs = (arg_or_cmdarg(cmd_state));\n end\n else\n emit(:k__ENCODING__, '__ENCODING__'.freeze)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 152 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 153 then\n\tbegin begin p = (( @te))-1; end\n\n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 155 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18, 19, 20)\n diagnostic :error,\n :trailing_in_number, { :character => tok(@te - 1, @te) },\n range(@te - 1, @te)\n else\n emit(:tINTEGER, tok(@ts, @te - 1).to_i, @ts, @te - 1)\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 156 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18, 19, 20)\n diagnostic :error,\n :trailing_in_number, { :character => tok(@te - 1, @te) },\n range(@te - 1, @te)\n else\n emit(:tFLOAT, tok(@ts, @te - 1).to_f, @ts, @te - 1)\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 157 then\n\tbegin begin p = (( @te))-1; end\n\n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 159 then\n\tbegin begin p = (( @te))-1; end\n emit(:tCONSTANT)\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 163 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 164 then\n\tbegin begin p = (( @te))-1; end\n\n if tm == @te\n # Suffix was consumed, e.g. foo!\n emit(:tFID)\n else\n # Suffix was not consumed, e.g. foo!=\n emit(:tIDENTIFIER, tok(@ts, tm), @ts, tm)\n p = tm - 1\n end\n @cs = 474; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 166 then\n\tbegin begin p = (( @te))-1; end\n\n emit_table(PUNCTUATION);\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 167 then\n\tbegin begin p = (( @te))-1; end\n emit_table(PUNCTUATION)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 95 then\n# line 2511 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = tm - 1; \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 501 then\n# line 2514 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tNL, nil, @newline_s, @newline_s + 1)\n p = p - 1; @cs = 185; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 504 then\n# line 2497 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @version < 27\n # Ruby before 2.7 doesn't support comments before leading dot.\n # If a line after \"a\" starts with a comment then \"a\" is a self-contained statement.\n # So in that case we emit a special tNL token and start reading the\n # next line as a separate statement.\n #\n # Note: block comments before leading dot are not supported on any version of Ruby.\n emit(:tNL, nil, @newline_s, @newline_s + 1)\n p = p - 1; @cs = 185; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 503 then\n# line 2514 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tNL, nil, @newline_s, @newline_s + 1)\n p = p - 1; @cs = 185; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 90 then\n# line 2497 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n if @version < 27\n # Ruby before 2.7 doesn't support comments before leading dot.\n # If a line after \"a\" starts with a comment then \"a\" is a self-contained statement.\n # So in that case we emit a special tNL token and start reading the\n # next line as a separate statement.\n #\n # Note: block comments before leading dot are not supported on any version of Ruby.\n emit(:tNL, nil, @newline_s, @newline_s + 1)\n p = p - 1; @cs = 185; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 86 then\n# line 2514 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin emit(:tNL, nil, @newline_s, @newline_s + 1)\n p = p - 1; @cs = 185; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 91 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 180 then\n\tbegin begin p = (( @te))-1; end\n\n if @version < 27\n # Ruby before 2.7 doesn't support comments before leading dot.\n # If a line after \"a\" starts with a comment then \"a\" is a self-contained statement.\n # So in that case we emit a special tNL token and start reading the\n # next line as a separate statement.\n #\n # Note: block comments before leading dot are not supported on any version of Ruby.\n emit(:tNL, nil, @newline_s, @newline_s + 1)\n p = p - 1; @cs = 185; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 182 then\n\tbegin begin p = (( @te))-1; end\n emit(:tNL, nil, @newline_s, @newline_s + 1)\n p = p - 1; @cs = 185; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 507 then\n# line 2524 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit_comment(@eq_begin_s, @te)\n \tbegin\n\t\t @cs = (@cs_before_block_comment)\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 506 then\n# line 2532 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :fatal, :embedded_document, nil,\n range(@eq_begin_s, @eq_begin_s + '=begin'.length)\n end\n\t\tend\n\twhen 106 then\n# line 2542 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin @eq_begin_s = @ts\n \tbegin\n\t\t @cs = 967\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 2 then\n# line 2546 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = pe - 3 end\n\t\tend\n\twhen 98 then\n# line 2549 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin cmd_state = true; p = p - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 99 then\n# line 527 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 100 then\n# line 2539 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 105 then\n# line 2542 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin @eq_begin_s = @ts\n \tbegin\n\t\t @cs = 967\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 104 then\n# line 2549 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin cmd_state = true; p = p - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 1 then\n# line 2549 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin cmd_state = true; p = p - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 66 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n\twhen 110 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 945 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 140 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 945 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 168 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 945 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 174 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 945 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 180 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 945 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 187 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 945 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 190 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 945 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 198 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 945 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 269 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1528 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Unlike expr_beg as invoked in the next rule, do not warn\n p = @ts - 1\n \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 260 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1591 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = tm - 1; \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 252 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1602 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 352 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1910 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n escape = { \" \" => '\\s', \"\\r\" => '\\r', \"\\n\" => '\\n', \"\\t\" => '\\t',\n \"\\v\" => '\\v', \"\\f\" => '\\f' }[@source_buffer.slice(@ts + 1)]\n diagnostic :warning, :invalid_escape_use, { :escape => escape }, range\n\n p = @ts - 1\n \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 315 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2093 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = @ts - 1\n @cs_before_block_comment = @cs\n \tbegin\n\t\t @cs = 185\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 434 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2447 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if @paren_nest == 0\n diagnostic :warning, :triple_dot_at_eol, nil, range(@ts, @te - 1)\n end\n\n emit(:tDOT3, '...'.freeze, @ts, @te - 1)\n p = p - 1;\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 508 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2524 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit_comment(@eq_begin_s, @te)\n \tbegin\n\t\t @cs = (@cs_before_block_comment)\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 505 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2529 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n\t\tend\n\twhen 107 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2542 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin @eq_begin_s = @ts\n \tbegin\n\t\t @cs = 967\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 3 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2546 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = pe - 3 end\n\t\tend\n\twhen 456 then\n# line 635 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tRATIONAL, Rational(chars)) } \t\tend\n# line 2265 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 454 then\n# line 636 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tIMAGINARY, Complex(0, chars)) } \t\tend\n# line 2265 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 459 then\n# line 637 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tIMAGINARY, Complex(0, Rational(chars))) } \t\tend\n# line 2265 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 457 then\n# line 638 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars, @ts, @te - 2); p -= 2 } \t\tend\n# line 2265 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 455 then\n# line 639 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars, @ts, @te - 2); p -= 2 } \t\tend\n# line 2265 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 458 then\n# line 640 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars, @ts, @te - 6); p -= 6 } \t\tend\n# line 2265 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 447 then\n# line 644 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tIMAGINARY, Complex(0, Float(chars))) } \t\tend\n# line 2324 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 448 then\n# line 645 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tFLOAT, Float(chars), @ts, @te - 2); p -= 2 } \t\tend\n# line 2324 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 449 then\n# line 649 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tRATIONAL, Rational(chars)) } \t\tend\n# line 2324 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 451 then\n# line 650 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tIMAGINARY, Complex(0, Rational(chars))) } \t\tend\n# line 2324 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 450 then\n# line 651 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tFLOAT, Float(chars), @ts, @te - 6); p -= 6 } \t\tend\n# line 2324 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 134 then\n# line 666 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = \"\"\n\n codepoints = tok(@escape_s + 2, p - 1)\n codepoint_s = @escape_s + 2\n\n if @version < 24\n if codepoints.start_with?(\" \") || codepoints.start_with?(\"\\t\")\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(@escape_s + 2, @escape_s + 3)\n end\n\n if spaces_p = codepoints.index(/[ \\t]{2}/)\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(codepoint_s + spaces_p + 1, codepoint_s + spaces_p + 2)\n end\n\n if codepoints.end_with?(\" \") || codepoints.end_with?(\"\\t\")\n diagnostic :fatal, :invalid_unicode_escape, nil, range(p - 1, p)\n end\n end\n\n codepoints.scan(/([0-9a-fA-F]+)|([ \\t]+)/).each do |(codepoint_str, spaces)|\n if spaces\n codepoint_s += spaces.length\n else\n codepoint = codepoint_str.to_i(16)\n\n if codepoint >= 0x110000\n diagnostic :error, :unicode_point_too_large, nil,\n range(codepoint_s, codepoint_s + codepoint_str.length)\n break\n end\n\n @escape += codepoint.chr(Encoding::UTF_8)\n codepoint_s += codepoint_str.length\n end\n end\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 162 then\n# line 666 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = \"\"\n\n codepoints = tok(@escape_s + 2, p - 1)\n codepoint_s = @escape_s + 2\n\n if @version < 24\n if codepoints.start_with?(\" \") || codepoints.start_with?(\"\\t\")\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(@escape_s + 2, @escape_s + 3)\n end\n\n if spaces_p = codepoints.index(/[ \\t]{2}/)\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(codepoint_s + spaces_p + 1, codepoint_s + spaces_p + 2)\n end\n\n if codepoints.end_with?(\" \") || codepoints.end_with?(\"\\t\")\n diagnostic :fatal, :invalid_unicode_escape, nil, range(p - 1, p)\n end\n end\n\n codepoints.scan(/([0-9a-fA-F]+)|([ \\t]+)/).each do |(codepoint_str, spaces)|\n if spaces\n codepoint_s += spaces.length\n else\n codepoint = codepoint_str.to_i(16)\n\n if codepoint >= 0x110000\n diagnostic :error, :unicode_point_too_large, nil,\n range(codepoint_s, codepoint_s + codepoint_str.length)\n break\n end\n\n @escape += codepoint.chr(Encoding::UTF_8)\n codepoint_s += codepoint_str.length\n end\n end\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 373 then\n# line 666 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = \"\"\n\n codepoints = tok(@escape_s + 2, p - 1)\n codepoint_s = @escape_s + 2\n\n if @version < 24\n if codepoints.start_with?(\" \") || codepoints.start_with?(\"\\t\")\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(@escape_s + 2, @escape_s + 3)\n end\n\n if spaces_p = codepoints.index(/[ \\t]{2}/)\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(codepoint_s + spaces_p + 1, codepoint_s + spaces_p + 2)\n end\n\n if codepoints.end_with?(\" \") || codepoints.end_with?(\"\\t\")\n diagnostic :fatal, :invalid_unicode_escape, nil, range(p - 1, p)\n end\n end\n\n codepoints.scan(/([0-9a-fA-F]+)|([ \\t]+)/).each do |(codepoint_str, spaces)|\n if spaces\n codepoint_s += spaces.length\n else\n codepoint = codepoint_str.to_i(16)\n\n if codepoint >= 0x110000\n diagnostic :error, :unicode_point_too_large, nil,\n range(codepoint_s, codepoint_s + codepoint_str.length)\n break\n end\n\n @escape += codepoint.chr(Encoding::UTF_8)\n codepoint_s += codepoint_str.length\n end\n end\n \t\tend\n# line 1897 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 118 then\n# line 706 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 146 then\n# line 706 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 357 then\n# line 706 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 1897 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 121 then\n# line 713 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_escape\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 149 then\n# line 713 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_escape\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 360 then\n# line 713 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_escape\n \t\tend\n# line 1897 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 123 then\n# line 740 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 151 then\n# line 740 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 362 then\n# line 740 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 1897 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 120 then\n# line 747 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s, p).to_i(8) % 0x100) \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 148 then\n# line 747 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s, p).to_i(8) % 0x100) \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 359 then\n# line 747 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s, p).to_i(8) % 0x100) \t\tend\n# line 1897 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 137 then\n# line 751 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s + 1, p).to_i(16)) \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 165 then\n# line 751 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s + 1, p).to_i(16)) \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 376 then\n# line 751 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s + 1, p).to_i(16)) \t\tend\n# line 1897 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 136 then\n# line 755 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_hex_escape, nil, range(@escape_s - 1, p + 2)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 164 then\n# line 755 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_hex_escape, nil, range(@escape_s - 1, p + 2)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 375 then\n# line 755 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_hex_escape, nil, range(@escape_s - 1, p + 2)\n \t\tend\n# line 1897 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 131 then\n# line 761 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = tok(@escape_s + 1, p).to_i(16).chr(Encoding::UTF_8) \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 159 then\n# line 761 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = tok(@escape_s + 1, p).to_i(16).chr(Encoding::UTF_8) \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 370 then\n# line 761 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = tok(@escape_s + 1, p).to_i(16).chr(Encoding::UTF_8) \t\tend\n# line 1897 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 130 then\n# line 765 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 158 then\n# line 765 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 369 then\n# line 765 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 1897 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 135 then\n# line 771 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 163 then\n# line 771 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 374 then\n# line 771 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 1897 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 132 then\n# line 785 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 160 then\n# line 785 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 371 then\n# line 785 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 1897 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 119 then\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 147 then\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 358 then\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 1897 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 171 then\n# line 817 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 176 then\n# line 817 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 57 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 30 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1542 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 32 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1562 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 34 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1590 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 213 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1415 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 232 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1433 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 240 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1465 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 33 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1602 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 271 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1607 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 263 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1613 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 282 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1691 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 294 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1712 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 290 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1715 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 58 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1733 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1; @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 49 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2074 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tIDENTIFIER, ident_tok, ident_ts, ident_te)\n p = ident_te - 1\n\n if !@static_env.nil? && @static_env.declared?(ident_tok) && @version < 25\n @cs = 446;\n else\n @cs = 505;\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 312 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2090 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 393 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2117 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 389 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2120 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @in_kwarg\n p = p - 1; \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n else\n \tbegin\n\t\t @cs = 185\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 402 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2148 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 399 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2151 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \tbegin\n\t\t @cs = 185\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 486 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2465 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 418 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2468 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \tbegin\n\t\t @cs = 961\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 101 then\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2539 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 262 then\n# line 1059 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n current_literal = literal\n if current_literal\n current_literal.start_interp_brace\n end\n \t\tend\n# line 1509 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n emit(:tLAMBEG, '{'.freeze, @te - 1, @te)\n else\n emit(:tLCURLY, '{'.freeze, @te - 1, @te)\n end\n @command_start = true\n @paren_nest += 1\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 284 then\n# line 1059 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n current_literal = literal\n if current_literal\n current_literal.start_interp_brace\n end\n \t\tend\n# line 1675 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n emit(:tLAMBEG, '{'.freeze)\n else\n emit(:tLBRACE_ARG, '{'.freeze)\n end\n @paren_nest += 1\n @command_start = true\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 384 then\n# line 1059 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n current_literal = literal\n if current_literal\n current_literal.start_interp_brace\n end\n \t\tend\n# line 1955 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n @command_start = true\n emit(:tLAMBEG, '{'.freeze)\n else\n emit(:tLBRACE, '{'.freeze)\n end\n @paren_nest += 1\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 499 then\n# line 1059 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n current_literal = literal\n if current_literal\n current_literal.start_interp_brace\n end\n \t\tend\n# line 2173 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n\n if tok == '{'.freeze\n emit(:tLAMBEG, '{'.freeze)\n else # 'do'\n emit(:kDO_LAMBDA, 'do'.freeze)\n end\n else\n if tok == '{'.freeze\n emit(:tLCURLY, '{'.freeze)\n else # 'do'\n emit_do\n end\n end\n if tok == '{'.freeze\n @paren_nest += 1\n end\n @command_start = true\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 500 then\n# line 1068 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n current_literal = literal\n if current_literal\n if current_literal.end_interp_brace_and_try_closing\n if version?(18, 19)\n emit(:tRCURLY, '}'.freeze, p - 1, p)\n @cond.lexpop\n @cmdarg.lexpop\n else\n emit(:tSTRING_DEND, '}'.freeze, p - 1, p)\n end\n\n if current_literal.saved_herebody_s\n @herebody_s = current_literal.saved_herebody_s\n end\n\n\n p = p - 1;\n @cs = (next_state_for_literal(current_literal));\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\n @paren_nest -= 1\n \t\tend\n# line 2410 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit_table(PUNCTUATION)\n\n if @version < 24\n @cond.lexpop\n @cmdarg.lexpop\n else\n @cond.pop\n @cmdarg.pop\n end\n\n if tok == '}'.freeze || tok == ']'.freeze\n if @version >= 25\n @cs = 781;\n else\n @cs = 511;\n end\n else # )\n # fnext expr_endfn; ?\n end\n\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 60 then\n# line 1217 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n\twhen 64 then\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 216 then\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1415 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 231 then\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1433 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 243 then\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1465 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 265 then\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1610 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 280 then\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1691 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 292 then\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1712 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 318 then\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2090 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 391 then\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2117 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 401 then\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2148 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 422 then\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2465 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 103 then\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2539 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 237 then\n# line 1261 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1455 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tFID, tok(@ts, tm), @ts, tm)\n @cs = (arg_or_cmdarg(cmd_state)); p = tm - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 332 then\n# line 1261 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1861 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 303 then\n# line 1261 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 2063 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 415 then\n# line 1261 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 144 then\n\tbegin begin p = (( @te))-1; end\n\n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n\n if tok == '{'.freeze\n emit(:tLAMBEG, '{'.freeze)\n else # 'do'\n emit(:kDO_LAMBDA, 'do'.freeze)\n end\n else\n if tok == '{'.freeze\n emit(:tLCURLY, '{'.freeze)\n else # 'do'\n emit_do\n end\n end\n if tok == '{'.freeze\n @paren_nest += 1\n end\n @command_start = true\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 145 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 333; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 146 then\n\tbegin begin p = (( @te))-1; end\n emit(:kCLASS, 'class'.freeze, @ts, @ts + 5)\n emit(:tLSHFT, '<<'.freeze, @te - 2, @te)\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 147 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 148 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @command_start = true\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 149 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 150 then\n\tbegin begin p = (( @te))-1; end\n\n emit_table(KEYWORDS)\n\n if version?(18) && tok == 'not'.freeze\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = 474; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 151 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18)\n emit(:tIDENTIFIER)\n\n unless !@static_env.nil? && @static_env.declared?(tok)\n @cs = (arg_or_cmdarg(cmd_state));\n end\n else\n emit(:k__ENCODING__, '__ENCODING__'.freeze)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 152 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 153 then\n\tbegin begin p = (( @te))-1; end\n\n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 155 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18, 19, 20)\n diagnostic :error,\n :trailing_in_number, { :character => tok(@te - 1, @te) },\n range(@te - 1, @te)\n else\n emit(:tINTEGER, tok(@ts, @te - 1).to_i, @ts, @te - 1)\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 156 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18, 19, 20)\n diagnostic :error,\n :trailing_in_number, { :character => tok(@te - 1, @te) },\n range(@te - 1, @te)\n else\n emit(:tFLOAT, tok(@ts, @te - 1).to_f, @ts, @te - 1)\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 157 then\n\tbegin begin p = (( @te))-1; end\n\n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 159 then\n\tbegin begin p = (( @te))-1; end\n emit(:tCONSTANT)\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 163 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 164 then\n\tbegin begin p = (( @te))-1; end\n\n if tm == @te\n # Suffix was consumed, e.g. foo!\n emit(:tFID)\n else\n # Suffix was not consumed, e.g. foo!=\n emit(:tIDENTIFIER, tok(@ts, tm), @ts, tm)\n p = tm - 1\n end\n @cs = 474; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 166 then\n\tbegin begin p = (( @te))-1; end\n\n emit_table(PUNCTUATION);\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 167 then\n\tbegin begin p = (( @te))-1; end\n emit_table(PUNCTUATION)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 238 then\n# line 1262 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1455 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tFID, tok(@ts, tm), @ts, tm)\n @cs = (arg_or_cmdarg(cmd_state)); p = tm - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 333 then\n# line 1262 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1861 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 305 then\n# line 1262 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 2063 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 416 then\n# line 1262 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 2374 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if tm == @te\n # Suffix was consumed, e.g. foo!\n emit(:tFID)\n else\n # Suffix was not consumed, e.g. foo!=\n emit(:tIDENTIFIER, tok(@ts, tm), @ts, tm)\n p = tm - 1\n end\n @cs = 474; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 334 then\n# line 1267 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1861 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 306 then\n# line 1267 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 2063 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 335 then\n# line 1268 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1861 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 307 then\n# line 1268 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 2063 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 339 then\n# line 1269 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1861 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 310 then\n# line 1269 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 2063 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 338 then\n# line 1270 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1861 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 309 then\n# line 1270 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 98 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1; @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 105 then\n\tbegin begin p = (( @te))-1; end\n\n diagnostic :error, :unterminated_heredoc_id, nil, range(@ts, @ts + 1)\n end\n\twhen 116 then\n\tbegin begin p = (( @te))-1; end\n\n if @version >= 27\n emit(:tPIPE, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1;\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n p -= 2\n \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n end\n\twhen 120 then\n\tbegin begin p = (( @te))-1; end\n emit_table(PUNCTUATION_BEGIN)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 121 then\n\tbegin begin p = (( @te))-1; end\n emit(:kRESCUE, 'rescue'.freeze, @ts, tm)\n p = tm - 1\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 122 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS_BEGIN)\n @command_start = true\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 126 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1\n \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\twhen 127 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 131 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1; \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 336 then\n# line 1271 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 3 \t\tend\n# line 1861 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 308 then\n# line 1271 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 3 \t\tend\n# line 2063 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 337 then\n# line 1276 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1861 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 481 then\n# line 1281 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 2356 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tCONSTANT, tok(@ts, tm), @ts, tm)\n p = tm - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 261 then\n# line 1287 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n \t\tend\n# line 1503 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tLBRACK, '['.freeze, @te - 1, @te)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 377 then\n# line 1287 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n \t\tend\n# line 1969 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tLBRACK, '['.freeze)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 484 then\n# line 1287 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n \t\tend\n# line 2443 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tLBRACK2, '['.freeze)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 487 then\n# line 1293 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @paren_nest -= 1\n \t\tend\n# line 2410 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit_table(PUNCTUATION)\n\n if @version < 24\n @cond.lexpop\n @cmdarg.lexpop\n else\n @cond.pop\n @cmdarg.pop\n end\n\n if tok == '}'.freeze || tok == ']'.freeze\n if @version >= 25\n @cs = 781;\n else\n @cs = 511;\n end\n else # )\n # fnext expr_endfn; ?\n end\n\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 253 then\n# line 1300 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n\n if version?(18)\n @command_start = true\n end\n \t\tend\n# line 1484 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if version?(18)\n emit(:tLPAREN2, '('.freeze, @te - 1, @te)\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n emit(:tLPAREN_ARG, '('.freeze, @te - 1, @te)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 266 then\n# line 1300 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n\n if version?(18)\n @command_start = true\n end\n \t\tend\n# line 1497 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tLPAREN2, '('.freeze)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 274 then\n# line 1300 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n\n if version?(18)\n @command_start = true\n end\n \t\tend\n# line 1629 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tLPAREN_ARG, '('.freeze, @te - 1, @te)\n if version?(18)\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 323 then\n# line 1300 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n\n if version?(18)\n @command_start = true\n end\n \t\tend\n# line 1974 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tLPAREN, '('.freeze)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 428 then\n# line 1300 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n\n if version?(18)\n @command_start = true\n end\n \t\tend\n# line 2406 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 429 then\n# line 1310 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @paren_nest -= 1\n \t\tend\n# line 2410 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit_table(PUNCTUATION)\n\n if @version < 24\n @cond.lexpop\n @cmdarg.lexpop\n else\n @cond.pop\n @cmdarg.pop\n end\n\n if tok == '}'.freeze || tok == ']'.freeze\n if @version >= 25\n @cs = 781;\n else\n @cs = 511;\n end\n else # )\n # fnext expr_endfn; ?\n end\n\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 71 then\n# line 1782 \"lib/parser/lexer.rl\"\n\t\tbegin\n heredoc_e = p \t\tend\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 347 then\n# line 1783 \"lib/parser/lexer.rl\"\n\t\tbegin\n new_herebody_s = p \t\tend\n# line 1784 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n tok(@ts, heredoc_e) =~ /^<<(-?)(~?)([\"'`]?)(.*)\\3$/m\n\n indent = !$1.empty? || !$2.empty?\n dedent_body = !$2.empty?\n type = $3.empty? ? '<<\"'.freeze : ('<<'.freeze + $3)\n delimiter = $4\n\n if @version >= 27\n if delimiter.count(\"\\n\") > 0 || delimiter.count(\"\\r\") > 0\n diagnostic :error, :unterminated_heredoc_id, nil, range(@ts, @ts + 1)\n end\n elsif @version >= 24\n if delimiter.count(\"\\n\") > 0\n if delimiter.end_with?(\"\\n\")\n diagnostic :warning, :heredoc_id_ends_with_nl, nil, range(@ts, @ts + 1)\n delimiter = delimiter.rstrip\n else\n diagnostic :fatal, :heredoc_id_has_newline, nil, range(@ts, @ts + 1)\n end\n end\n end\n\n if dedent_body && version?(18, 19, 20, 21, 22)\n emit(:tLSHFT, '<<'.freeze, @ts, @ts + 2)\n p = @ts + 1\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (push_literal(type, delimiter, @ts, heredoc_e, indent, dedent_body));\n\n @herebody_s ||= new_herebody_s\n p = @herebody_s - 1\n end\n end\n\t\tend\n\twhen 342 then\n# line 1874 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 1; diag_msg = :ivar_name \t\tend\n# line 1877 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @version >= 27\n diagnostic :error, diag_msg, { name: tok(tm, @te) }, range(tm, @te)\n else\n emit(:tCOLON, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = @ts\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 345 then\n# line 1875 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2; diag_msg = :cvar_name \t\tend\n# line 1877 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @version >= 27\n diagnostic :error, diag_msg, { name: tok(tm, @te) }, range(tm, @te)\n else\n emit(:tCOLON, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = @ts\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 353 then\n# line 1895 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = nil \t\tend\n# line 1897 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 380 then\n# line 1984 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1985 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:kRESCUE, 'rescue'.freeze, @ts, tm)\n p = tm - 1\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 471 then\n# line 2258 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 16; @num_digits_s = p \t\tend\n# line 2264 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 465 then\n# line 2259 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = p \t\tend\n# line 2264 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 468 then\n# line 2260 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = p \t\tend\n# line 2264 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 462 then\n# line 2261 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 2; @num_digits_s = p \t\tend\n# line 2264 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 477 then\n# line 2262 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 2264 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 440 then\n# line 2263 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n# line 2264 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 478 then\n# line 2264 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 634 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n\twhen 89 then\n# line 2510 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 2511 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = tm - 1; \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 8 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 444 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2322 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 222 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1374 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 43;\t\tend\n\twhen 209 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1378 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 44;\t\tend\n\twhen 205 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1382 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 45;\t\tend\n\twhen 26 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1546 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 71;\t\tend\n\twhen 255 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1563 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 72;\t\tend\n\twhen 27 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1602 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 77;\t\tend\n\twhen 248 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1607 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 78;\t\tend\n\twhen 275 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1639 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 84;\t\tend\n\twhen 45 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1652 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 85;\t\tend\n\twhen 296 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1706 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 92;\t\tend\n\twhen 285 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1710 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 93;\t\tend\n\twhen 69 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1830 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 105;\t\tend\n\twhen 385 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1938 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 116;\t\tend\n\twhen 299 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1979 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 120;\t\tend\n\twhen 379 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1985 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 121;\t\tend\n\twhen 378 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1991 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 122;\t\tend\n\twhen 74 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2063 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 126;\t\tend\n\twhen 297 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1315 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 127;\t\tend\n\twhen 300 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2109 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 131;\t\tend\n\twhen 495 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2173 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 144;\t\tend\n\twhen 490 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2202 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 145;\t\tend\n\twhen 498 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2212 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 147;\t\tend\n\twhen 491 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2217 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 148;\t\tend\n\twhen 492 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2222 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 149;\t\tend\n\twhen 497 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2226 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 150;\t\tend\n\twhen 489 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2237 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 151;\t\tend\n\twhen 483 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2251 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 152;\t\tend\n\twhen 409 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2265 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 153;\t\tend\n\twhen 442 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2309 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 156;\t\tend\n\twhen 81 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2324 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 157;\t\tend\n\twhen 412 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2352 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 159;\t\tend\n\twhen 403 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1315 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 163;\t\tend\n\twhen 414 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2374 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 164;\t\tend\n\twhen 407 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2400 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 166;\t\tend\n\twhen 413 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2406 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 167;\t\tend\n\twhen 87 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2497 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 180;\t\tend\n\twhen 502 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2514 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 182;\t\tend\n\twhen 177 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 945 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n# line 817 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n\twhen 124 then\n# line 706 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 725 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 152 then\n# line 706 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 725 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 363 then\n# line 706 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 725 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 1897 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 129 then\n# line 706 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 157 then\n# line 706 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 368 then\n# line 706 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1897 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 122 then\n# line 717 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = @source_buffer.slice(p - 1).chr\n\n if @version >= 27 && ((0..8).include?(@escape.ord) || (14..31).include?(@escape.ord))\n diagnostic :fatal, :invalid_escape\n end\n \t\tend\n# line 725 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 150 then\n# line 717 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = @source_buffer.slice(p - 1).chr\n\n if @version >= 27 && ((0..8).include?(@escape.ord) || (14..31).include?(@escape.ord))\n diagnostic :fatal, :invalid_escape\n end\n \t\tend\n# line 725 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 361 then\n# line 717 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = @source_buffer.slice(p - 1).chr\n\n if @version >= 27 && ((0..8).include?(@escape.ord) || (14..31).include?(@escape.ord))\n diagnostic :fatal, :invalid_escape\n end\n \t\tend\n# line 725 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 1897 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 128 then\n# line 717 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = @source_buffer.slice(p - 1).chr\n\n if @version >= 27 && ((0..8).include?(@escape.ord) || (14..31).include?(@escape.ord))\n diagnostic :fatal, :invalid_escape\n end\n \t\tend\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 156 then\n# line 717 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = @source_buffer.slice(p - 1).chr\n\n if @version >= 27 && ((0..8).include?(@escape.ord) || (14..31).include?(@escape.ord))\n diagnostic :fatal, :invalid_escape\n end\n \t\tend\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 367 then\n# line 717 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = @source_buffer.slice(p - 1).chr\n\n if @version >= 27 && ((0..8).include?(@escape.ord) || (14..31).include?(@escape.ord))\n diagnostic :fatal, :invalid_escape\n end\n \t\tend\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1897 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 126 then\n# line 740 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 154 then\n# line 740 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 365 then\n# line 740 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1897 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 133 then\n# line 771 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 785 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 161 then\n# line 771 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 785 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 372 then\n# line 771 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 785 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 1897 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 116 then\n# line 817 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 145 then\n# line 817 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 356 then\n# line 817 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 1897 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 61 then\n# line 1217 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 215 then\n# line 1217 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1415 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 230 then\n# line 1217 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1433 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 242 then\n# line 1217 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1465 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 264 then\n# line 1217 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1610 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \tbegin\n\t\t @cs = 781\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 279 then\n# line 1217 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1691 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 291 then\n# line 1217 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1712 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 317 then\n# line 1217 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2090 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 390 then\n# line 1217 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2117 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 400 then\n# line 1217 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2148 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 421 then\n# line 1217 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2465 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 102 then\n# line 1217 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2539 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 473 then\n# line 2262 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 2264 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 634 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n\twhen 437 then\n# line 2263 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n# line 2264 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 634 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n\twhen 452 then\n# line 2264 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 634 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2265 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 445 then\n# line 2321 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 643 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tFLOAT, Float(chars)) } \t\tend\n# line 2324 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 441 then\n# line 2322 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 643 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tFLOAT, Float(chars)) } \t\tend\n# line 2324 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 270 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1607 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 78;\t\tend\n\twhen 35 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1602 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 77;\t\tend\n\twhen 46 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1652 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 85;\t\tend\n\twhen 94 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2497 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 180;\t\tend\n\twhen 65 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1733 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 98;\t\tend\n\twhen 84 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2206 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 146;\t\tend\n\twhen 93 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2497 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 180;\t\tend\n\twhen 37 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1562 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1563 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 72;\t\tend\n\twhen 382 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1984 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 2063 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 126;\t\tend\n\twhen 381 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1984 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1315 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 127;\t\tend\n\twhen 474 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2262 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 2265 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 153;\t\tend\n\twhen 127 then\n# line 706 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 725 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 155 then\n# line 706 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 725 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 366 then\n# line 706 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 725 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1897 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 125 then\n# line 717 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = @source_buffer.slice(p - 1).chr\n\n if @version >= 27 && ((0..8).include?(@escape.ord) || (14..31).include?(@escape.ord))\n diagnostic :fatal, :invalid_escape\n end\n \t\tend\n# line 725 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 153 then\n# line 717 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = @source_buffer.slice(p - 1).chr\n\n if @version >= 27 && ((0..8).include?(@escape.ord) || (14..31).include?(@escape.ord))\n diagnostic :fatal, :invalid_escape\n end\n \t\tend\n# line 725 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 890 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 364 then\n# line 717 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = @source_buffer.slice(p - 1).chr\n\n if @version >= 27 && ((0..8).include?(@escape.ord) || (14..31).include?(@escape.ord))\n diagnostic :fatal, :invalid_escape\n end\n \t\tend\n# line 725 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1897 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 781; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 469 then\n# line 2258 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 16; @num_digits_s = p \t\tend\n# line 2264 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 634 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2265 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 463 then\n# line 2259 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = p \t\tend\n# line 2264 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 634 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2265 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 466 then\n# line 2260 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = p \t\tend\n# line 2264 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 634 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2265 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 460 then\n# line 2261 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 2; @num_digits_s = p \t\tend\n# line 2264 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 634 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2265 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 472 then\n# line 2262 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 2264 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 634 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2265 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 436 then\n# line 2263 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n# line 2264 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 634 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2265 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 31 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 857 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1562 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1563 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 72;\t\tend\n\twhen 62 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1217 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1733 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 98;\t\tend\n\twhen 92 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1217 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1220 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2497 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 180;\t\tend\n\twhen 479 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2264 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 634 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2297 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 155;\t\tend\n\twhen 475 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2262 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 2264 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 634 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2297 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 155;\t\tend\n\twhen 439 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2263 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n# line 2264 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 634 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2297 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 155;\t\tend\n# line 23534 \"lib/parser/lexer.rb\"\n\tend\n\tend\n\tend\n\tif _goto_level <= _again\n\tcase _lex_to_state_actions[ @cs] \n\twhen 96 then\n# line 1 \"NONE\"\n\t\tbegin\n @ts = nil;\t\tend\n# line 23544 \"lib/parser/lexer.rb\"\n\tend\n\n\tif @cs == 0\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\tp += 1\n\tif p != pe\n\t\t_goto_level = _resume\n\t\tnext\n\tend\n\tend\n\tif _goto_level <= _test_eof\n\tif p == eof\n\tif _lex_eof_trans[ @cs] > 0\n\t\t_trans = _lex_eof_trans[ @cs] - 1;\n\t\t_goto_level = _eof_trans\n\t\tnext;\n\tend\n\tend\n\n\tend\n\tif _goto_level <= _out\n\t\tbreak\n\tend\nend\n\tend\n\n# line 286 \"lib/parser/lexer.rl\"\n # %\n\n # Ragel creates a local variable called `testEof` but it doesn't use\n # it in any assignment. This dead code is here to swallow the warning.\n # It has no runtime cost because Ruby doesn't produce any instructions from it.\n if false\n testEof\n end\n\n @p = p\n\n if @token_queue.any?\n @token_queue.shift\n elsif @cs == klass.lex_error\n [ false, [ '$error'.freeze, range(p - 1, p) ] ]\n else\n eof = @source_pts.size\n [ false, [ '$eof'.freeze, range(eof, eof) ] ]\n end\n end", "def convert_buffer_to_token(token_type); end", "def advance\n if @token_queue.any?\n return @token_queue.shift\n end\n\n # Ugly, but dependent on Ragel output. Consider refactoring it somehow.\n klass = self.class\n _lex_trans_keys = klass.send :_lex_trans_keys\n _lex_key_spans = klass.send :_lex_key_spans\n _lex_index_offsets = klass.send :_lex_index_offsets\n _lex_indicies = klass.send :_lex_indicies\n _lex_trans_targs = klass.send :_lex_trans_targs\n _lex_trans_actions = klass.send :_lex_trans_actions\n _lex_to_state_actions = klass.send :_lex_to_state_actions\n _lex_from_state_actions = klass.send :_lex_from_state_actions\n _lex_eof_trans = klass.send :_lex_eof_trans\n\n pe = @source_pts.size + 2\n p, eof = @p, pe\n\n cmd_state = @command_start\n @command_start = false\n\n \n# line 11330 \"lib/parser/lexer.rb\"\nbegin\n\ttestEof = false\n\t_slen, _trans, _keys, _inds, _acts, _nacts = nil\n\t_goto_level = 0\n\t_resume = 10\n\t_eof_trans = 15\n\t_again = 20\n\t_test_eof = 30\n\t_out = 40\n\twhile true\n\tif _goto_level <= 0\n\tif p == pe\n\t\t_goto_level = _test_eof\n\t\tnext\n\tend\n\tif @cs == 0\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\tend\n\tif _goto_level <= _resume\n\tcase _lex_from_state_actions[ @cs] \n\twhen 97 then\n# line 1 \"NONE\"\n\t\tbegin\n @ts = p\n\t\tend\n# line 11358 \"lib/parser/lexer.rb\"\n\tend\n\t_keys = @cs << 1\n\t_inds = _lex_index_offsets[ @cs]\n\t_slen = _lex_key_spans[ @cs]\n\t_wide = ( (@source_pts[p] || 0))\n\t_trans = if ( _slen > 0 && \n\t\t\t_lex_trans_keys[_keys] <= _wide && \n\t\t\t_wide <= _lex_trans_keys[_keys + 1] \n\t\t ) then\n\t\t\t_lex_indicies[ _inds + _wide - _lex_trans_keys[_keys] ] \n\t\t else \n\t\t\t_lex_indicies[ _inds + _slen ]\n\t\t end\n\tend\n\tif _goto_level <= _eof_trans\n\t @cs = _lex_trans_targs[_trans]\n\tif _lex_trans_actions[_trans] != 0\n\tcase _lex_trans_actions[_trans]\n\twhen 29 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 117 then\n# line 825 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n\twhen 30 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n\twhen 60 then\n# line 1229 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n\twhen 64 then\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n\twhen 310 then\n# line 1273 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 37 then\n# line 1566 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 39 then\n# line 1586 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 41 then\n# line 1614 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 71 then\n# line 1806 \"lib/parser/lexer.rl\"\n\t\tbegin\n heredoc_e = p \t\tend\n\twhen 349 then\n# line 1898 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 1; diag_msg = :ivar_name \t\tend\n\twhen 352 then\n# line 1899 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2; diag_msg = :cvar_name \t\tend\n\twhen 360 then\n# line 1919 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = nil \t\tend\n\twhen 392 then\n# line 2008 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 308 then\n# line 2115 \"lib/parser/lexer.rl\"\n\t\tbegin\n ident_tok = tok; ident_ts = @ts; ident_te = @te; \t\tend\n\twhen 479 then\n# line 2301 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 16; @num_digits_s = p \t\tend\n\twhen 473 then\n# line 2302 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = p \t\tend\n\twhen 476 then\n# line 2303 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = p \t\tend\n\twhen 470 then\n# line 2304 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 2; @num_digits_s = p \t\tend\n\twhen 485 then\n# line 2305 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n\twhen 447 then\n# line 2306 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n\twhen 462 then\n# line 2307 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 455 then\n# line 2364 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 452 then\n# line 2365 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 89 then\n# line 2575 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 7 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n\twhen 113 then\n# line 1106 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DBEG, '#{'.freeze)\n\n if current_literal.heredoc?\n current_literal.saved_herebody_s = @herebody_s\n @herebody_s = nil\n end\n\n current_literal.start_interp_brace\n @command_start = true\n @cs = 803;\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 5 then\n# line 1032 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 348\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 109 then\n# line 957 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 108 then\n# line 874 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 796;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 115 then\n# line 1048 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @version >= 27\n literal.extend_string(tok, @ts, @te)\n else\n message = tok.start_with?('#@@') ? :cvar_name : :ivar_name\n diagnostic :error, message, { :name => tok(@ts + 1, @te) }, range(@ts + 1, @te)\n end\n end\n\t\tend\n\twhen 114 then\n# line 1032 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 348\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 111 then\n# line 1019 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n literal.extend_space @ts, @te\n end\n\t\tend\n\twhen 112 then\n# line 874 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 796;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 6 then\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 4 then\n# line 874 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 796;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 145 then\n# line 1106 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DBEG, '#{'.freeze)\n\n if current_literal.heredoc?\n current_literal.saved_herebody_s = @herebody_s\n @herebody_s = nil\n end\n\n current_literal.start_interp_brace\n @command_start = true\n @cs = 803;\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 10 then\n# line 1032 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 348\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 142 then\n# line 957 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 141 then\n# line 874 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 796;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 147 then\n# line 1048 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @version >= 27\n literal.extend_string(tok, @ts, @te)\n else\n message = tok.start_with?('#@@') ? :cvar_name : :ivar_name\n diagnostic :error, message, { :name => tok(@ts + 1, @te) }, range(@ts + 1, @te)\n end\n end\n\t\tend\n\twhen 146 then\n# line 1032 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 348\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 144 then\n# line 874 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 796;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 11 then\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 9 then\n# line 874 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 796;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 173 then\n# line 957 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 172 then\n# line 874 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 796;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 175 then\n# line 1019 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n literal.extend_space @ts, @te\n end\n\t\tend\n\twhen 176 then\n# line 874 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 796;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 179 then\n# line 957 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 178 then\n# line 874 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 796;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 181 then\n# line 874 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 796;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 188 then\n# line 1106 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DBEG, '#{'.freeze)\n\n if current_literal.heredoc?\n current_literal.saved_herebody_s = @herebody_s\n @herebody_s = nil\n end\n\n current_literal.start_interp_brace\n @command_start = true\n @cs = 803;\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 13 then\n# line 1032 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 348\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 185 then\n# line 957 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 184 then\n# line 874 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 796;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 190 then\n# line 1048 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @version >= 27\n literal.extend_string(tok, @ts, @te)\n else\n message = tok.start_with?('#@@') ? :cvar_name : :ivar_name\n diagnostic :error, message, { :name => tok(@ts + 1, @te) }, range(@ts + 1, @te)\n end\n end\n\t\tend\n\twhen 189 then\n# line 1032 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 348\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 187 then\n# line 874 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 796;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 12 then\n# line 874 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 796;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 192 then\n# line 957 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 191 then\n# line 874 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 796;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 199 then\n# line 1106 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DBEG, '#{'.freeze)\n\n if current_literal.heredoc?\n current_literal.saved_herebody_s = @herebody_s\n @herebody_s = nil\n end\n\n current_literal.start_interp_brace\n @command_start = true\n @cs = 803;\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 15 then\n# line 1032 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 348\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 195 then\n# line 957 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 194 then\n# line 874 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 796;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 201 then\n# line 1048 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @version >= 27\n literal.extend_string(tok, @ts, @te)\n else\n message = tok.start_with?('#@@') ? :cvar_name : :ivar_name\n diagnostic :error, message, { :name => tok(@ts + 1, @te) }, range(@ts + 1, @te)\n end\n end\n\t\tend\n\twhen 200 then\n# line 1032 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 348\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 197 then\n# line 1019 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n literal.extend_space @ts, @te\n end\n\t\tend\n\twhen 198 then\n# line 874 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 796;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 14 then\n# line 874 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 796;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 203 then\n# line 957 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 202 then\n# line 874 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 796;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 205 then\n# line 1019 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n literal.extend_space @ts, @te\n end\n\t\tend\n\twhen 206 then\n# line 1203 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tREGEXP_OPT, tok(@ts, @te - 1), @ts, @te - 1)\n p = p - 1;\n \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 207 then\n# line 1190 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n unknown_options = tok.scan(/[^imxouesn]/)\n if unknown_options.any?\n diagnostic :error, :regexp_options,\n { :options => unknown_options.join }\n end\n\n emit(:tREGEXP_OPT)\n @cs = 811;\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 16 then\n# line 1342 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if tok =~ /^\\$([1-9][0-9]*)$/\n emit(:tNTH_REF, tok(@ts + 1).to_i)\n elsif tok =~ /^\\$([&`'+])$/\n emit(:tBACK_REF)\n else\n emit(:tGVAR)\n end\n\n @cs = (stack_pop); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 208 then\n# line 1342 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if tok =~ /^\\$([1-9][0-9]*)$/\n emit(:tNTH_REF, tok(@ts + 1).to_i)\n elsif tok =~ /^\\$([&`'+])$/\n emit(:tBACK_REF)\n else\n emit(:tGVAR)\n end\n\n @cs = (stack_pop); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 210 then\n# line 1355 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if tok =~ /^@@[0-9]/\n diagnostic :error, :cvar_name, { :name => tok }\n end\n\n emit(:tCVAR)\n @cs = (stack_pop); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 209 then\n# line 1365 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if tok =~ /^@[0-9]/\n diagnostic :error, :ivar_name, { :name => tok }\n end\n\n emit(:tIVAR)\n @cs = (stack_pop); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 231 then\n# line 1386 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(KEYWORDS_BEGIN);\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 217 then\n# line 1394 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tIDENTIFIER)\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 18 then\n# line 1398 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1\n @cs = 811; \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 348\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 214 then\n# line 1407 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 226 then\n# line 1411 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; p = p - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 20 then\n# line 1417 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if version?(23)\n type, delimiter = tok[0..-2], tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n else\n p = @ts - 1\n \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 213 then\n# line 1430 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 212 then\n# line 528 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 230 then\n# line 1386 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(KEYWORDS_BEGIN);\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 227 then\n# line 1390 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tCONSTANT)\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 229 then\n# line 1394 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tIDENTIFIER)\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 224 then\n# line 1398 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n @cs = 811; \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 348\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 220 then\n# line 1407 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 225 then\n# line 1414 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 564\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 218 then\n# line 1427 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 223 then\n# line 1430 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 19 then\n# line 1407 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin emit_table(PUNCTUATION)\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 17 then\n# line 1430 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = p - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 216 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 43 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS_BEGIN);\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 44 then\n\tbegin begin p = (( @te))-1; end\n emit(:tCONSTANT)\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 45 then\n\tbegin begin p = (( @te))-1; end\n emit(:tIDENTIFIER)\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 22 then\n# line 1442 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tLABEL, tok(@ts, @te - 2), @ts, @te - 1)\n p = p - 1; @cs = 796; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 233 then\n# line 1460 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 232 then\n# line 528 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 235 then\n# line 1457 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 234 then\n# line 1460 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 21 then\n# line 1460 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = p - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 241 then\n# line 1486 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 495; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 240 then\n# line 1492 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 239 then\n# line 528 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 251 then\n# line 1471 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tCONSTANT)\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 242 then\n# line 1475 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tIDENTIFIER)\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 247 then\n# line 1486 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 495; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 245 then\n# line 1489 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 250 then\n# line 1492 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 274 then\n# line 1552 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Unlike expr_beg as invoked in the next rule, do not warn\n p = @ts - 1\n \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 257 then\n# line 1570 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if tok(tm, tm + 1) == '/'.freeze\n # Ambiguous regexp literal.\n if @version < 30\n diagnostic :warning, :ambiguous_literal, nil, range(tm, tm + 1)\n else\n diagnostic :warning, :ambiguous_regexp, nil, range(tm, tm + 1)\n end\n end\n\n p = tm - 1\n \tbegin\n\t\t @cs = 564\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 263 then\n# line 1598 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; p = p - 1; \tbegin\n\t\t @cs = 564\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 25 then\n# line 1606 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1; \tbegin\n\t\t @cs = 564\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 265 then\n# line 1615 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = tm - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 40 then\n# line 1626 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 252 then\n# line 1640 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 564\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 253 then\n# line 528 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 264 then\n# line 1561 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 564\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 260 then\n# line 1587 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :warning, :ambiguous_prefix, { :prefix => tok(tm, @te) },\n range(tm, @te)\n\n p = tm - 1\n \tbegin\n\t\t @cs = 564\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 262 then\n# line 1603 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 564\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 256 then\n# line 1626 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 255 then\n# line 1631 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 273 then\n# line 1640 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 564\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 26 then\n# line 1631 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n\t\tend\n\twhen 42 then\n# line 1640 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = p - 1; \tbegin\n\t\t @cs = 564\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 24 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 72 then\n\tbegin begin p = (( @te))-1; end\n\n if tok(tm, tm + 1) == '/'.freeze\n # Ambiguous regexp literal.\n if @version < 30\n diagnostic :warning, :ambiguous_literal, nil, range(tm, tm + 1)\n else\n diagnostic :warning, :ambiguous_regexp, nil, range(tm, tm + 1)\n end\n end\n\n p = tm - 1\n \tbegin\n\t\t @cs = 564\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\twhen 73 then\n\tbegin begin p = (( @te))-1; end\n\n diagnostic :warning, :ambiguous_prefix, { :prefix => tok(tm, @te) },\n range(tm, @te)\n\n p = tm - 1\n \tbegin\n\t\t @cs = 564\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\twhen 78 then\n\tbegin begin p = (( @te))-1; end\n\n p = @ts - 1\n \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\telse\n\tbegin begin p = (( @te))-1; end\nend\nend \n\t\t\tend\n\twhen 44 then\n# line 1676 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1\n \tbegin\n\t\t @cs = 495\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 278 then\n# line 528 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 279 then\n# line 1676 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 495\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 45 then\n# line 1676 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = @ts - 1\n \tbegin\n\t\t @cs = 495\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 43 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 85 then\n\tbegin begin p = (( @te))-1; end\n\n if @cond.active?\n emit(:kDO_COND, 'do'.freeze, @te - 2, @te)\n else\n emit(:kDO, 'do'.freeze, @te - 2, @te)\n end\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 86 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1\n \tbegin\n\t\t @cs = 495\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 289 then\n# line 1712 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_do(true)\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 282 then\n# line 1718 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 283 then\n# line 528 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 284 then\n# line 1715 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 287 then\n# line 1718 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 293 then\n# line 1742 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 564\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 292 then\n# line 528 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 301 then\n# line 1734 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1; \tbegin\n\t\t @cs = 564\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 295 then\n# line 1736 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 299 then\n# line 1742 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 564\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 294 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 93 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 94 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1; \tbegin\n\t\t @cs = 564\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 57 then\n# line 1757 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1; @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 334 then\n# line 1774 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type = delimiter = tok[0].chr\n p = p - 1; \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 326 then\n# line 1781 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type, delimiter = @source_buffer.slice(@ts).chr, tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 55 then\n# line 1788 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type, delimiter = tok[0..-2], tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 347 then\n# line 1863 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = p - 1; p = p - 1;\n emit(:tSYMBEG, tok(@ts, @ts + 1), @ts, @ts + 1)\n \tbegin\n\t\t @cs = 353\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 335 then\n# line 1871 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type, delimiter = tok, tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 346 then\n# line 1879 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tSYMBOL, tok(@ts + 1, @ts + 2))\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 69 then\n# line 1893 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tSYMBOL, tok(@ts + 1), @ts)\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 357 then\n# line 1934 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n escape = { \" \" => '\\s', \"\\r\" => '\\r', \"\\n\" => '\\n', \"\\t\" => '\\t',\n \"\\v\" => '\\v', \"\\f\" => '\\f' }[@source_buffer.slice(@ts + 1)]\n diagnostic :warning, :invalid_escape_use, { :escape => escape }, range\n\n p = @ts - 1\n \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 356 then\n# line 1944 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n diagnostic :fatal, :incomplete_escape, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 336 then\n# line 2003 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION_BEGIN)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 52 then\n# line 2024 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = p - 1;\n\n if version?(18)\n ident = tok(@ts, @te - 2)\n\n emit((@source_buffer.slice(@ts) =~ /[A-Z]/) ? :tCONSTANT : :tIDENTIFIER,\n ident, @ts, @te - 2)\n p = p - 1; # continue as a symbol\n\n if !@static_env.nil? && @static_env.declared?(ident)\n @cs = 811;\n else\n @cs = (arg_or_cmdarg(cmd_state));\n end\n else\n emit(:tLABEL, tok(@ts, @te - 2), @ts, @te - 1)\n @cs = 796;\n end\n\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 49 then\n# line 2117 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tIDENTIFIER, ident_tok, ident_ts, ident_te)\n p = ident_te - 1\n\n if !@static_env.nil? && @static_env.declared?(ident_tok) && @version < 25\n @cs = 466;\n else\n @cs = 526;\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 320 then\n# line 2136 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = @ts - 1\n @cs_before_block_comment = @cs\n \tbegin\n\t\t @cs = 187\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 56 then\n# line 2152 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 304 then\n# line 528 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 330 then\n# line 1757 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1; @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 329 then\n# line 1764 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tSTAR, '*'.freeze)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 325 then\n# line 1794 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :fatal, :string_eof, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 354 then\n# line 1854 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :error, :unterminated_heredoc_id, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 337 then\n# line 1893 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1), @ts)\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 350 then\n# line 1901 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @version >= 27\n diagnostic :error, diag_msg, { name: tok(tm, @te) }, range(tm, @te)\n else\n emit(:tCOLON, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = @ts\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 355 then\n# line 1944 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :fatal, :incomplete_escape, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 361 then\n# line 1950 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 327 then\n# line 2003 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION_BEGIN)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 331 then\n# line 2051 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @version >= 27\n emit(:tBDOT2)\n else\n emit(:tDOT2)\n end\n\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 332 then\n# line 2062 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n # Here we scan and conditionally emit \"\\n\":\n # + if it's there\n # + and emitted we do nothing\n # + and not emitted we return `p` to \"\\n\" to process it on the next scan\n # + if it's not there we do nothing\n followed_by_nl = @te - 1 == @newline_s\n nl_emitted = false\n dots_te = followed_by_nl ? @te - 1 : @te\n\n if @version >= 30\n if @lambda_stack.any? && @lambda_stack.last + 1 == @paren_nest\n # To reject `->(...)` like `->...`\n emit(:tDOT3, '...'.freeze, @ts, dots_te)\n else\n emit(:tBDOT3, '...'.freeze, @ts, dots_te)\n\n if @version >= 31 && followed_by_nl && @context.in_def_open_args?\n emit(:tNL, @te - 1, @te)\n nl_emitted = true\n end\n end\n elsif @version >= 27\n emit(:tBDOT3, '...'.freeze, @ts, dots_te)\n else\n emit(:tDOT3, '...'.freeze, @ts, dots_te)\n end\n\n if followed_by_nl && !nl_emitted\n # return \"\\n\" to process it on the next scan\n p = p - 1;\n end\n\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 307 then\n# line 1327 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 317 then\n# line 2133 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 319 then\n# line 2136 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n p = @ts - 1\n @cs_before_block_comment = @cs\n \tbegin\n\t\t @cs = 187\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 322 then\n# line 2152 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 54 then\n# line 1794 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n diagnostic :fatal, :string_eof, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 73 then\n# line 1854 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n diagnostic :error, :unterminated_heredoc_id, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 74 then\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 48 then\n# line 1327 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 53 then\n# line 2133 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n\t\tend\n\twhen 68 then\n# line 2152 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = @ts - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 51 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 99 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1; @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 106 then\n\tbegin begin p = (( @te))-1; end\n\n diagnostic :error, :unterminated_heredoc_id, nil, range(@ts, @ts + 1)\n end\n\twhen 117 then\n\tbegin begin p = (( @te))-1; end\n\n if @version >= 27\n emit(:tPIPE, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1;\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n p -= 2\n \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n end\n\twhen 121 then\n\tbegin begin p = (( @te))-1; end\n emit_table(PUNCTUATION_BEGIN)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 122 then\n\tbegin begin p = (( @te))-1; end\n emit(:kRESCUE, 'rescue'.freeze, @ts, tm)\n p = tm - 1\n @cs = 540; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 123 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS_BEGIN)\n @command_start = true\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 127 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1\n \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\twhen 128 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 132 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 395 then\n# line 2172 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 564\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 396 then\n# line 528 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 397 then\n# line 2160 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 401 then\n# line 2172 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 564\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 77 then\n# line 2182 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1\n \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 405 then\n# line 2187 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n \tbegin\n\t\t @cs = (push_literal(tok, tok, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 404 then\n# line 2197 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 564\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 403 then\n# line 528 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 407 then\n# line 2191 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 406 then\n# line 2197 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 564\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 76 then\n# line 2197 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = p - 1; \tbegin\n\t\t @cs = 564\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 440 then\n# line 2208 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tLAMBDA, '->'.freeze, @ts, @ts + 2)\n\n @lambda_stack.push @paren_nest\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 86 then\n# line 2249 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:kCLASS, 'class'.freeze, @ts, @ts + 5)\n emit(:tLSHFT, '<<'.freeze, @te - 2, @te)\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 415 then\n# line 2385 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type, delimiter = tok, tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts, nil, false, false, true))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 79 then\n# line 2403 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1; \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 348\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 436 then\n# line 2410 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 474; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 489 then\n# line 2434 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit_table(PUNCTUATION)\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 429 then\n# line 2443 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit_table(PUNCTUATION);\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 434 then\n# line 2478 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tOP_ASGN, tok(@ts, @te - 1))\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 420 then\n# line 2482 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tEH, '?'.freeze)\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 417 then\n# line 2501 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 419 then\n# line 2514 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tSEMI, ';'.freeze)\n @command_start = true\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 494 then\n# line 2518 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n diagnostic :error, :bare_backslash, nil, range(@ts, @ts + 1)\n p = p - 1;\n end\n\t\tend\n\twhen 414 then\n# line 2524 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n diagnostic :fatal, :unexpected, { :character => tok.inspect[1..-2] }\n end\n\t\tend\n\twhen 413 then\n# line 528 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 505 then\n# line 2245 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(KEYWORDS)\n @cs = 353; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 503 then\n# line 2249 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:kCLASS, 'class'.freeze, @ts, @ts + 5)\n emit(:tLSHFT, '<<'.freeze, @te - 2, @te)\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 502 then\n# line 2260 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(KEYWORDS)\n @command_start = true\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 444 then\n# line 2335 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :error, :no_dot_digit_literal\n end\n\t\tend\n\twhen 491 then\n# line 2395 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tCONSTANT)\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 433 then\n# line 2403 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1; \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 348\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 441 then\n# line 2410 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 474; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 497 then\n# line 1327 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 439 then\n# line 2434 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit_table(PUNCTUATION)\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 435 then\n# line 2443 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit_table(PUNCTUATION);\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 428 then\n# line 2449 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 442 then\n# line 2501 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 426 then\n# line 2508 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 432 then\n# line 2524 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :fatal, :unexpected, { :character => tok.inspect[1..-2] }\n end\n\t\tend\n\twhen 84 then\n# line 2308 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 80 then\n# line 2335 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n diagnostic :error, :no_dot_digit_literal\n end\n\t\tend\n\twhen 83 then\n# line 2367 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 78 then\n# line 2524 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n diagnostic :fatal, :unexpected, { :character => tok.inspect[1..-2] }\n end\n\t\tend\n\twhen 81 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 145 then\n\tbegin begin p = (( @te))-1; end\n\n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n\n if tok == '{'.freeze\n emit(:tLAMBEG, '{'.freeze)\n else # 'do'\n emit(:kDO_LAMBDA, 'do'.freeze)\n end\n else\n if tok == '{'.freeze\n emit(:tLCURLY, '{'.freeze)\n else # 'do'\n emit_do\n end\n end\n if tok == '{'.freeze\n @paren_nest += 1\n end\n @command_start = true\n\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 146 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 353; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 147 then\n\tbegin begin p = (( @te))-1; end\n emit(:kCLASS, 'class'.freeze, @ts, @ts + 5)\n emit(:tLSHFT, '<<'.freeze, @te - 2, @te)\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 148 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 149 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @command_start = true\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 150 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 540; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 151 then\n\tbegin begin p = (( @te))-1; end\n\n emit_table(KEYWORDS)\n\n if version?(18) && tok == 'not'.freeze\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = 495; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 152 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18)\n emit(:tIDENTIFIER)\n\n unless !@static_env.nil? && @static_env.declared?(tok)\n @cs = (arg_or_cmdarg(cmd_state));\n end\n else\n emit(:k__ENCODING__, '__ENCODING__'.freeze)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 153 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 154 then\n\tbegin begin p = (( @te))-1; end\n\n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 156 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18, 19, 20)\n diagnostic :error,\n :trailing_in_number, { :character => tok(@te - 1, @te) },\n range(@te - 1, @te)\n else\n emit(:tINTEGER, tok(@ts, @te - 1).to_i, @ts, @te - 1)\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 157 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18, 19, 20)\n diagnostic :error,\n :trailing_in_number, { :character => tok(@te - 1, @te) },\n range(@te - 1, @te)\n else\n emit(:tFLOAT, tok(@ts, @te - 1).to_f, @ts, @te - 1)\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 158 then\n\tbegin begin p = (( @te))-1; end\n\n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 160 then\n\tbegin begin p = (( @te))-1; end\n emit(:tCONSTANT)\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 164 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 165 then\n\tbegin begin p = (( @te))-1; end\n\n if tm == @te\n # Suffix was consumed, e.g. foo!\n emit(:tFID)\n else\n # Suffix was not consumed, e.g. foo!=\n emit(:tIDENTIFIER, tok(@ts, tm), @ts, tm)\n p = tm - 1\n end\n @cs = 495; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 167 then\n\tbegin begin p = (( @te))-1; end\n\n emit_table(PUNCTUATION);\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 168 then\n\tbegin begin p = (( @te))-1; end\n emit_table(PUNCTUATION)\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 516 then\n# line 2565 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tNL, nil, @newline_s, @newline_s + 1)\n if @version < 27\n p = p - 1; @cs = 187; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n emit(:tBDOT3)\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 95 then\n# line 2576 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = tm - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 510 then\n# line 2579 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tNL, nil, @newline_s, @newline_s + 1)\n p = p - 1; @cs = 187; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 513 then\n# line 2540 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @version < 27\n # Ruby before 2.7 doesn't support comments before leading dot.\n # If a line after \"a\" starts with a comment then \"a\" is a self-contained statement.\n # So in that case we emit a special tNL token and start reading the\n # next line as a separate statement.\n #\n # Note: block comments before leading dot are not supported on any version of Ruby.\n emit(:tNL, nil, @newline_s, @newline_s + 1)\n p = p - 1; @cs = 187; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 515 then\n# line 2554 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tNL, nil, @newline_s, @newline_s + 1)\n if @version < 27\n p = p - 1; @cs = 187; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n emit(:tBDOT2)\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 514 then\n# line 2576 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = tm - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 512 then\n# line 2579 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tNL, nil, @newline_s, @newline_s + 1)\n p = p - 1; @cs = 187; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 90 then\n# line 2540 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n if @version < 27\n # Ruby before 2.7 doesn't support comments before leading dot.\n # If a line after \"a\" starts with a comment then \"a\" is a self-contained statement.\n # So in that case we emit a special tNL token and start reading the\n # next line as a separate statement.\n #\n # Note: block comments before leading dot are not supported on any version of Ruby.\n emit(:tNL, nil, @newline_s, @newline_s + 1)\n p = p - 1; @cs = 187; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 87 then\n# line 2579 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin emit(:tNL, nil, @newline_s, @newline_s + 1)\n p = p - 1; @cs = 187; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 91 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 181 then\n\tbegin begin p = (( @te))-1; end\n\n if @version < 27\n # Ruby before 2.7 doesn't support comments before leading dot.\n # If a line after \"a\" starts with a comment then \"a\" is a self-contained statement.\n # So in that case we emit a special tNL token and start reading the\n # next line as a separate statement.\n #\n # Note: block comments before leading dot are not supported on any version of Ruby.\n emit(:tNL, nil, @newline_s, @newline_s + 1)\n p = p - 1; @cs = 187; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 185 then\n\tbegin begin p = (( @te))-1; end\n emit(:tNL, nil, @newline_s, @newline_s + 1)\n p = p - 1; @cs = 187; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 519 then\n# line 2589 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit_comment(@eq_begin_s, @te)\n \tbegin\n\t\t @cs = (@cs_before_block_comment)\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 518 then\n# line 2597 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :fatal, :embedded_document, nil,\n range(@eq_begin_s, @eq_begin_s + '=begin'.length)\n end\n\t\tend\n\twhen 106 then\n# line 2607 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin @eq_begin_s = @ts\n \tbegin\n\t\t @cs = 999\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 2 then\n# line 2611 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = pe - 3 end\n\t\tend\n\twhen 98 then\n# line 2614 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin cmd_state = true; p = p - 1; \tbegin\n\t\t @cs = 803\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 99 then\n# line 528 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 100 then\n# line 2604 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 105 then\n# line 2607 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin @eq_begin_s = @ts\n \tbegin\n\t\t @cs = 999\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 104 then\n# line 2614 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin cmd_state = true; p = p - 1; \tbegin\n\t\t @cs = 803\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 1 then\n# line 2614 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin cmd_state = true; p = p - 1; \tbegin\n\t\t @cs = 803\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 67 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n\twhen 110 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 957 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 143 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 957 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 174 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 957 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 180 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 957 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 186 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 957 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 193 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 957 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 196 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 957 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 204 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 957 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 23 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1446 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if @version >= 31\n emit(:tBDOT3, '...'.freeze, @ts, @te - 1)\n emit(:tNL, \"\\n\".freeze, @te - 1, @te)\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n p -= 4;\n p = p - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 275 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1552 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Unlike expr_beg as invoked in the next rule, do not warn\n p = @ts - 1\n \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 266 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1615 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = tm - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 258 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1626 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 358 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1934 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n escape = { \" \" => '\\s', \"\\r\" => '\\r', \"\\n\" => '\\n', \"\\t\" => '\\t',\n \"\\v\" => '\\v', \"\\f\" => '\\f' }[@source_buffer.slice(@ts + 1)]\n diagnostic :warning, :invalid_escape_use, { :escape => escape }, range\n\n p = @ts - 1\n \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 333 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2062 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Here we scan and conditionally emit \"\\n\":\n # + if it's there\n # + and emitted we do nothing\n # + and not emitted we return `p` to \"\\n\" to process it on the next scan\n # + if it's not there we do nothing\n followed_by_nl = @te - 1 == @newline_s\n nl_emitted = false\n dots_te = followed_by_nl ? @te - 1 : @te\n\n if @version >= 30\n if @lambda_stack.any? && @lambda_stack.last + 1 == @paren_nest\n # To reject `->(...)` like `->...`\n emit(:tDOT3, '...'.freeze, @ts, dots_te)\n else\n emit(:tBDOT3, '...'.freeze, @ts, dots_te)\n\n if @version >= 31 && followed_by_nl && @context.in_def_open_args?\n emit(:tNL, @te - 1, @te)\n nl_emitted = true\n end\n end\n elsif @version >= 27\n emit(:tBDOT3, '...'.freeze, @ts, dots_te)\n else\n emit(:tDOT3, '...'.freeze, @ts, dots_te)\n end\n\n if followed_by_nl && !nl_emitted\n # return \"\\n\" to process it on the next scan\n p = p - 1;\n end\n\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 321 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2136 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = @ts - 1\n @cs_before_block_comment = @cs\n \tbegin\n\t\t @cs = 187\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 443 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2490 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if @paren_nest == 0\n diagnostic :warning, :triple_dot_at_eol, nil, range(@ts, @te - 1)\n end\n\n emit(:tDOT3, '...'.freeze, @ts, @te - 1)\n p = p - 1;\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 520 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2589 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit_comment(@eq_begin_s, @te)\n \tbegin\n\t\t @cs = (@cs_before_block_comment)\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 517 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2594 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n\t\tend\n\twhen 107 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2607 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin @eq_begin_s = @ts\n \tbegin\n\t\t @cs = 999\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 3 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2611 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = pe - 3 end\n\t\tend\n\twhen 465 then\n# line 636 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tRATIONAL, Rational(chars)) } \t\tend\n# line 2308 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 463 then\n# line 637 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tIMAGINARY, Complex(0, chars)) } \t\tend\n# line 2308 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 468 then\n# line 638 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tIMAGINARY, Complex(0, Rational(chars))) } \t\tend\n# line 2308 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 466 then\n# line 639 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars, @ts, @te - 2); p -= 2 } \t\tend\n# line 2308 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 464 then\n# line 640 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars, @ts, @te - 2); p -= 2 } \t\tend\n# line 2308 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 467 then\n# line 641 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars, @ts, @te - 6); p -= 6 } \t\tend\n# line 2308 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 456 then\n# line 645 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tIMAGINARY, Complex(0, Float(chars))) } \t\tend\n# line 2367 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 457 then\n# line 646 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tFLOAT, Float(chars), @ts, @te - 2); p -= 2 } \t\tend\n# line 2367 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 458 then\n# line 650 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tRATIONAL, Rational(chars)) } \t\tend\n# line 2367 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 460 then\n# line 651 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tIMAGINARY, Complex(0, Rational(chars))) } \t\tend\n# line 2367 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 459 then\n# line 652 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tFLOAT, Float(chars), @ts, @te - 6); p -= 6 } \t\tend\n# line 2367 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 137 then\n# line 667 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = \"\"\n\n codepoints = tok(@escape_s + 2, p - 1)\n codepoint_s = @escape_s + 2\n\n if @version < 24\n if codepoints.start_with?(\" \") || codepoints.start_with?(\"\\t\")\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(@escape_s + 2, @escape_s + 3)\n end\n\n if spaces_p = codepoints.index(/[ \\t]{2}/)\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(codepoint_s + spaces_p + 1, codepoint_s + spaces_p + 2)\n end\n\n if codepoints.end_with?(\" \") || codepoints.end_with?(\"\\t\")\n diagnostic :fatal, :invalid_unicode_escape, nil, range(p - 1, p)\n end\n end\n\n codepoints.scan(/([0-9a-fA-F]+)|([ \\t]+)/).each do |(codepoint_str, spaces)|\n if spaces\n codepoint_s += spaces.length\n else\n codepoint = codepoint_str.to_i(16)\n\n if codepoint >= 0x110000\n diagnostic :error, :unicode_point_too_large, nil,\n range(codepoint_s, codepoint_s + codepoint_str.length)\n break\n end\n\n @escape += codepoint.chr(Encoding::UTF_8)\n codepoint_s += codepoint_str.length\n end\n end\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 168 then\n# line 667 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = \"\"\n\n codepoints = tok(@escape_s + 2, p - 1)\n codepoint_s = @escape_s + 2\n\n if @version < 24\n if codepoints.start_with?(\" \") || codepoints.start_with?(\"\\t\")\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(@escape_s + 2, @escape_s + 3)\n end\n\n if spaces_p = codepoints.index(/[ \\t]{2}/)\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(codepoint_s + spaces_p + 1, codepoint_s + spaces_p + 2)\n end\n\n if codepoints.end_with?(\" \") || codepoints.end_with?(\"\\t\")\n diagnostic :fatal, :invalid_unicode_escape, nil, range(p - 1, p)\n end\n end\n\n codepoints.scan(/([0-9a-fA-F]+)|([ \\t]+)/).each do |(codepoint_str, spaces)|\n if spaces\n codepoint_s += spaces.length\n else\n codepoint = codepoint_str.to_i(16)\n\n if codepoint >= 0x110000\n diagnostic :error, :unicode_point_too_large, nil,\n range(codepoint_s, codepoint_s + codepoint_str.length)\n break\n end\n\n @escape += codepoint.chr(Encoding::UTF_8)\n codepoint_s += codepoint_str.length\n end\n end\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 382 then\n# line 667 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = \"\"\n\n codepoints = tok(@escape_s + 2, p - 1)\n codepoint_s = @escape_s + 2\n\n if @version < 24\n if codepoints.start_with?(\" \") || codepoints.start_with?(\"\\t\")\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(@escape_s + 2, @escape_s + 3)\n end\n\n if spaces_p = codepoints.index(/[ \\t]{2}/)\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(codepoint_s + spaces_p + 1, codepoint_s + spaces_p + 2)\n end\n\n if codepoints.end_with?(\" \") || codepoints.end_with?(\"\\t\")\n diagnostic :fatal, :invalid_unicode_escape, nil, range(p - 1, p)\n end\n end\n\n codepoints.scan(/([0-9a-fA-F]+)|([ \\t]+)/).each do |(codepoint_str, spaces)|\n if spaces\n codepoint_s += spaces.length\n else\n codepoint = codepoint_str.to_i(16)\n\n if codepoint >= 0x110000\n diagnostic :error, :unicode_point_too_large, nil,\n range(codepoint_s, codepoint_s + codepoint_str.length)\n break\n end\n\n @escape += codepoint.chr(Encoding::UTF_8)\n codepoint_s += codepoint_str.length\n end\n end\n \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 118 then\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n\n if @version >= 30 && (codepoint == 117 || codepoint == 85) # 'u' or 'U'\n diagnostic :fatal, :invalid_escape\n end\n\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 149 then\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n\n if @version >= 30 && (codepoint == 117 || codepoint == 85) # 'u' or 'U'\n diagnostic :fatal, :invalid_escape\n end\n\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 363 then\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n\n if @version >= 30 && (codepoint == 117 || codepoint == 85) # 'u' or 'U'\n diagnostic :fatal, :invalid_escape\n end\n\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 121 then\n# line 719 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_escape\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 152 then\n# line 719 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_escape\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 366 then\n# line 719 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_escape\n \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 123 then\n# line 747 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 154 then\n# line 747 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 368 then\n# line 747 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 120 then\n# line 755 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s, p).to_i(8) % 0x100) \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 151 then\n# line 755 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s, p).to_i(8) % 0x100) \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 365 then\n# line 755 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s, p).to_i(8) % 0x100) \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 140 then\n# line 759 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s + 1, p).to_i(16)) \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 171 then\n# line 759 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s + 1, p).to_i(16)) \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 385 then\n# line 759 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s + 1, p).to_i(16)) \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 139 then\n# line 763 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_hex_escape, nil, range(@escape_s - 1, p + 2)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 170 then\n# line 763 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_hex_escape, nil, range(@escape_s - 1, p + 2)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 384 then\n# line 763 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_hex_escape, nil, range(@escape_s - 1, p + 2)\n \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 134 then\n# line 769 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = tok(@escape_s + 1, p).to_i(16).chr(Encoding::UTF_8) \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 165 then\n# line 769 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = tok(@escape_s + 1, p).to_i(16).chr(Encoding::UTF_8) \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 379 then\n# line 769 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = tok(@escape_s + 1, p).to_i(16).chr(Encoding::UTF_8) \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 133 then\n# line 773 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 164 then\n# line 773 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 378 then\n# line 773 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 138 then\n# line 779 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 169 then\n# line 779 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 383 then\n# line 779 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 135 then\n# line 793 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 166 then\n# line 793 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 380 then\n# line 793 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 119 then\n# line 819 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 150 then\n# line 819 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 364 then\n# line 819 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 177 then\n# line 825 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 182 then\n# line 825 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 58 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 31 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1566 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 33 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1586 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 35 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1614 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 219 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1427 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 238 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1457 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 246 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1489 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 34 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1626 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 277 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1631 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 269 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1637 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 288 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1715 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 300 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1736 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 296 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1739 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 59 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1757 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1; @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 50 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2117 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tIDENTIFIER, ident_tok, ident_ts, ident_te)\n p = ident_te - 1\n\n if !@static_env.nil? && @static_env.declared?(ident_tok) && @version < 25\n @cs = 466;\n else\n @cs = 526;\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 318 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2133 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 402 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2160 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 398 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2163 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @in_kwarg\n p = p - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n else\n \tbegin\n\t\t @cs = 187\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 411 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2191 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 408 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2194 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \tbegin\n\t\t @cs = 187\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 495 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2508 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 427 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2511 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \tbegin\n\t\t @cs = 991\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 101 then\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2604 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 268 then\n# line 1071 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n current_literal = literal\n if current_literal\n current_literal.start_interp_brace\n end\n \t\tend\n# line 1533 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n emit(:tLAMBEG, '{'.freeze, @te - 1, @te)\n else\n emit(:tLCURLY, '{'.freeze, @te - 1, @te)\n end\n @command_start = true\n @paren_nest += 1\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 290 then\n# line 1071 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n current_literal = literal\n if current_literal\n current_literal.start_interp_brace\n end\n \t\tend\n# line 1699 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n emit(:tLAMBEG, '{'.freeze)\n else\n emit(:tLBRACE_ARG, '{'.freeze)\n end\n @paren_nest += 1\n @command_start = true\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 393 then\n# line 1071 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n current_literal = literal\n if current_literal\n current_literal.start_interp_brace\n end\n \t\tend\n# line 1979 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n @command_start = true\n emit(:tLAMBEG, '{'.freeze)\n else\n emit(:tLBRACE, '{'.freeze)\n end\n @paren_nest += 1\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 508 then\n# line 1071 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n current_literal = literal\n if current_literal\n current_literal.start_interp_brace\n end\n \t\tend\n# line 2216 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n\n if tok == '{'.freeze\n emit(:tLAMBEG, '{'.freeze)\n else # 'do'\n emit(:kDO_LAMBDA, 'do'.freeze)\n end\n else\n if tok == '{'.freeze\n emit(:tLCURLY, '{'.freeze)\n else # 'do'\n emit_do\n end\n end\n if tok == '{'.freeze\n @paren_nest += 1\n end\n @command_start = true\n\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 509 then\n# line 1080 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n current_literal = literal\n if current_literal\n if current_literal.end_interp_brace_and_try_closing\n if version?(18, 19)\n emit(:tRCURLY, '}'.freeze, p - 1, p)\n @cond.lexpop\n @cmdarg.lexpop\n else\n emit(:tSTRING_DEND, '}'.freeze, p - 1, p)\n end\n\n if current_literal.saved_herebody_s\n @herebody_s = current_literal.saved_herebody_s\n end\n\n\n p = p - 1;\n @cs = (next_state_for_literal(current_literal));\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\n @paren_nest -= 1\n \t\tend\n# line 2453 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit_table(PUNCTUATION)\n\n if @version < 24\n @cond.lexpop\n @cmdarg.lexpop\n else\n @cond.pop\n @cmdarg.pop\n end\n\n if tok == '}'.freeze || tok == ']'.freeze\n if @version >= 25\n @cs = 811;\n else\n @cs = 532;\n end\n else # )\n # fnext expr_endfn; ?\n end\n\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 61 then\n# line 1229 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n\twhen 65 then\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 222 then\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1427 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 237 then\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1457 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 249 then\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1489 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 271 then\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1634 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 286 then\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1715 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 298 then\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1736 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 324 then\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2133 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 400 then\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2160 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 410 then\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2191 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 431 then\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2508 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 103 then\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2604 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 243 then\n# line 1273 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1479 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tFID, tok(@ts, tm), @ts, tm)\n @cs = (arg_or_cmdarg(cmd_state)); p = tm - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 338 then\n# line 1273 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1885 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 309 then\n# line 1273 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 2106 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 424 then\n# line 1273 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 145 then\n\tbegin begin p = (( @te))-1; end\n\n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n\n if tok == '{'.freeze\n emit(:tLAMBEG, '{'.freeze)\n else # 'do'\n emit(:kDO_LAMBDA, 'do'.freeze)\n end\n else\n if tok == '{'.freeze\n emit(:tLCURLY, '{'.freeze)\n else # 'do'\n emit_do\n end\n end\n if tok == '{'.freeze\n @paren_nest += 1\n end\n @command_start = true\n\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 146 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 353; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 147 then\n\tbegin begin p = (( @te))-1; end\n emit(:kCLASS, 'class'.freeze, @ts, @ts + 5)\n emit(:tLSHFT, '<<'.freeze, @te - 2, @te)\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 148 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 149 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @command_start = true\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 150 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 540; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 151 then\n\tbegin begin p = (( @te))-1; end\n\n emit_table(KEYWORDS)\n\n if version?(18) && tok == 'not'.freeze\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = 495; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 152 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18)\n emit(:tIDENTIFIER)\n\n unless !@static_env.nil? && @static_env.declared?(tok)\n @cs = (arg_or_cmdarg(cmd_state));\n end\n else\n emit(:k__ENCODING__, '__ENCODING__'.freeze)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 153 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 154 then\n\tbegin begin p = (( @te))-1; end\n\n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 156 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18, 19, 20)\n diagnostic :error,\n :trailing_in_number, { :character => tok(@te - 1, @te) },\n range(@te - 1, @te)\n else\n emit(:tINTEGER, tok(@ts, @te - 1).to_i, @ts, @te - 1)\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 157 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18, 19, 20)\n diagnostic :error,\n :trailing_in_number, { :character => tok(@te - 1, @te) },\n range(@te - 1, @te)\n else\n emit(:tFLOAT, tok(@ts, @te - 1).to_f, @ts, @te - 1)\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 158 then\n\tbegin begin p = (( @te))-1; end\n\n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 160 then\n\tbegin begin p = (( @te))-1; end\n emit(:tCONSTANT)\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 164 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 165 then\n\tbegin begin p = (( @te))-1; end\n\n if tm == @te\n # Suffix was consumed, e.g. foo!\n emit(:tFID)\n else\n # Suffix was not consumed, e.g. foo!=\n emit(:tIDENTIFIER, tok(@ts, tm), @ts, tm)\n p = tm - 1\n end\n @cs = 495; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 167 then\n\tbegin begin p = (( @te))-1; end\n\n emit_table(PUNCTUATION);\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 168 then\n\tbegin begin p = (( @te))-1; end\n emit_table(PUNCTUATION)\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 244 then\n# line 1274 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1479 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tFID, tok(@ts, tm), @ts, tm)\n @cs = (arg_or_cmdarg(cmd_state)); p = tm - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 339 then\n# line 1274 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1885 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 311 then\n# line 1274 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 2106 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 425 then\n# line 1274 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 2417 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if tm == @te\n # Suffix was consumed, e.g. foo!\n emit(:tFID)\n else\n # Suffix was not consumed, e.g. foo!=\n emit(:tIDENTIFIER, tok(@ts, tm), @ts, tm)\n p = tm - 1\n end\n @cs = 495; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 340 then\n# line 1279 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1885 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 312 then\n# line 1279 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 2106 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 341 then\n# line 1280 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1885 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 313 then\n# line 1280 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 2106 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 345 then\n# line 1281 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1885 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 316 then\n# line 1281 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 2106 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 344 then\n# line 1282 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1885 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 315 then\n# line 1282 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 99 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1; @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 106 then\n\tbegin begin p = (( @te))-1; end\n\n diagnostic :error, :unterminated_heredoc_id, nil, range(@ts, @ts + 1)\n end\n\twhen 117 then\n\tbegin begin p = (( @te))-1; end\n\n if @version >= 27\n emit(:tPIPE, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1;\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n p -= 2\n \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n end\n\twhen 121 then\n\tbegin begin p = (( @te))-1; end\n emit_table(PUNCTUATION_BEGIN)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 122 then\n\tbegin begin p = (( @te))-1; end\n emit(:kRESCUE, 'rescue'.freeze, @ts, tm)\n p = tm - 1\n @cs = 540; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 123 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS_BEGIN)\n @command_start = true\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 127 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1\n \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\twhen 128 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg(cmd_state)); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 132 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1; \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 342 then\n# line 1283 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 3 \t\tend\n# line 1885 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 314 then\n# line 1283 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 3 \t\tend\n# line 2106 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 343 then\n# line 1288 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1885 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 490 then\n# line 1293 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 2399 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tCONSTANT, tok(@ts, tm), @ts, tm)\n p = tm - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 267 then\n# line 1299 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n \t\tend\n# line 1527 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tLBRACK, '['.freeze, @te - 1, @te)\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 386 then\n# line 1299 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n \t\tend\n# line 1993 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tLBRACK, '['.freeze)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 493 then\n# line 1299 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n \t\tend\n# line 2486 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tLBRACK2, '['.freeze)\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 496 then\n# line 1305 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @paren_nest -= 1\n \t\tend\n# line 2453 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit_table(PUNCTUATION)\n\n if @version < 24\n @cond.lexpop\n @cmdarg.lexpop\n else\n @cond.pop\n @cmdarg.pop\n end\n\n if tok == '}'.freeze || tok == ']'.freeze\n if @version >= 25\n @cs = 811;\n else\n @cs = 532;\n end\n else # )\n # fnext expr_endfn; ?\n end\n\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 259 then\n# line 1312 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n\n if version?(18)\n @command_start = true\n end\n \t\tend\n# line 1508 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if version?(18)\n emit(:tLPAREN2, '('.freeze, @te - 1, @te)\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n emit(:tLPAREN_ARG, '('.freeze, @te - 1, @te)\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 272 then\n# line 1312 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n\n if version?(18)\n @command_start = true\n end\n \t\tend\n# line 1521 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tLPAREN2, '('.freeze)\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 280 then\n# line 1312 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n\n if version?(18)\n @command_start = true\n end\n \t\tend\n# line 1653 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tLPAREN_ARG, '('.freeze, @te - 1, @te)\n if version?(18)\n @cs = 803; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 328 then\n# line 1312 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n\n if version?(18)\n @command_start = true\n end\n \t\tend\n# line 1998 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tLPAREN, '('.freeze)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 437 then\n# line 1312 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n\n if version?(18)\n @command_start = true\n end\n \t\tend\n# line 2449 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 438 then\n# line 1322 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @paren_nest -= 1\n \t\tend\n# line 2453 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit_table(PUNCTUATION)\n\n if @version < 24\n @cond.lexpop\n @cmdarg.lexpop\n else\n @cond.pop\n @cmdarg.pop\n end\n\n if tok == '}'.freeze || tok == ']'.freeze\n if @version >= 25\n @cs = 811;\n else\n @cs = 532;\n end\n else # )\n # fnext expr_endfn; ?\n end\n\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 72 then\n# line 1806 \"lib/parser/lexer.rl\"\n\t\tbegin\n heredoc_e = p \t\tend\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 353 then\n# line 1807 \"lib/parser/lexer.rl\"\n\t\tbegin\n new_herebody_s = p \t\tend\n# line 1808 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n tok(@ts, heredoc_e) =~ /^<<(-?)(~?)([\"'`]?)(.*)\\3$/m\n\n indent = !$1.empty? || !$2.empty?\n dedent_body = !$2.empty?\n type = $3.empty? ? '<<\"'.freeze : ('<<'.freeze + $3)\n delimiter = $4\n\n if @version >= 27\n if delimiter.count(\"\\n\") > 0 || delimiter.count(\"\\r\") > 0\n diagnostic :error, :unterminated_heredoc_id, nil, range(@ts, @ts + 1)\n end\n elsif @version >= 24\n if delimiter.count(\"\\n\") > 0\n if delimiter.end_with?(\"\\n\")\n diagnostic :warning, :heredoc_id_ends_with_nl, nil, range(@ts, @ts + 1)\n delimiter = delimiter.rstrip\n else\n diagnostic :fatal, :heredoc_id_has_newline, nil, range(@ts, @ts + 1)\n end\n end\n end\n\n if dedent_body && version?(18, 19, 20, 21, 22)\n emit(:tLSHFT, '<<'.freeze, @ts, @ts + 2)\n p = @ts + 1\n @cs = 564; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (push_literal(type, delimiter, @ts, heredoc_e, indent, dedent_body));\n\n @herebody_s ||= new_herebody_s\n p = @herebody_s - 1\n end\n end\n\t\tend\n\twhen 348 then\n# line 1898 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 1; diag_msg = :ivar_name \t\tend\n# line 1901 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @version >= 27\n diagnostic :error, diag_msg, { name: tok(tm, @te) }, range(tm, @te)\n else\n emit(:tCOLON, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = @ts\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 351 then\n# line 1899 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2; diag_msg = :cvar_name \t\tend\n# line 1901 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @version >= 27\n diagnostic :error, diag_msg, { name: tok(tm, @te) }, range(tm, @te)\n else\n emit(:tCOLON, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = @ts\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 359 then\n# line 1919 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = nil \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 389 then\n# line 2008 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 2009 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:kRESCUE, 'rescue'.freeze, @ts, tm)\n p = tm - 1\n @cs = 540; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 480 then\n# line 2301 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 16; @num_digits_s = p \t\tend\n# line 2307 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 474 then\n# line 2302 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = p \t\tend\n# line 2307 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 477 then\n# line 2303 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = p \t\tend\n# line 2307 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 471 then\n# line 2304 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 2; @num_digits_s = p \t\tend\n# line 2307 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 486 then\n# line 2305 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 2307 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 449 then\n# line 2306 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n# line 2307 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 487 then\n# line 2307 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 635 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n\twhen 8 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 453 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2365 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 228 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1386 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 43;\t\tend\n\twhen 215 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1390 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 44;\t\tend\n\twhen 211 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1394 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 45;\t\tend\n\twhen 27 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1570 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 72;\t\tend\n\twhen 261 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1587 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 73;\t\tend\n\twhen 28 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1626 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 78;\t\tend\n\twhen 254 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1631 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 79;\t\tend\n\twhen 281 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1663 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 85;\t\tend\n\twhen 46 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1676 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 86;\t\tend\n\twhen 302 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1730 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 93;\t\tend\n\twhen 291 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1734 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 94;\t\tend\n\twhen 70 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1854 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 106;\t\tend\n\twhen 394 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1962 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 117;\t\tend\n\twhen 305 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2003 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 121;\t\tend\n\twhen 388 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2009 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 122;\t\tend\n\twhen 387 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2015 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 123;\t\tend\n\twhen 75 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2106 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 127;\t\tend\n\twhen 303 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1327 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 128;\t\tend\n\twhen 306 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2152 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 132;\t\tend\n\twhen 504 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2216 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 145;\t\tend\n\twhen 499 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2245 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 146;\t\tend\n\twhen 507 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2255 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 148;\t\tend\n\twhen 500 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2260 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 149;\t\tend\n\twhen 501 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2265 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 150;\t\tend\n\twhen 506 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2269 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 151;\t\tend\n\twhen 498 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2280 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 152;\t\tend\n\twhen 492 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2294 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 153;\t\tend\n\twhen 418 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2308 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 154;\t\tend\n\twhen 451 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2352 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 157;\t\tend\n\twhen 82 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2367 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 158;\t\tend\n\twhen 421 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2395 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 160;\t\tend\n\twhen 412 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1327 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 164;\t\tend\n\twhen 423 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2417 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 165;\t\tend\n\twhen 416 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2443 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 167;\t\tend\n\twhen 422 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2449 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 168;\t\tend\n\twhen 88 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2540 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 181;\t\tend\n\twhen 511 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2579 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 185;\t\tend\n\twhen 183 then\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 957 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n# line 825 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n\twhen 124 then\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n\n if @version >= 30 && (codepoint == 117 || codepoint == 85) # 'u' or 'U'\n diagnostic :fatal, :invalid_escape\n end\n\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 731 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 155 then\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n\n if @version >= 30 && (codepoint == 117 || codepoint == 85) # 'u' or 'U'\n diagnostic :fatal, :invalid_escape\n end\n\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 731 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 369 then\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n\n if @version >= 30 && (codepoint == 117 || codepoint == 85) # 'u' or 'U'\n diagnostic :fatal, :invalid_escape\n end\n\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 731 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 131 then\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n\n if @version >= 30 && (codepoint == 117 || codepoint == 85) # 'u' or 'U'\n diagnostic :fatal, :invalid_escape\n end\n\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 735 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 162 then\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n\n if @version >= 30 && (codepoint == 117 || codepoint == 85) # 'u' or 'U'\n diagnostic :fatal, :invalid_escape\n end\n\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 735 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 376 then\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n\n if @version >= 30 && (codepoint == 117 || codepoint == 85) # 'u' or 'U'\n diagnostic :fatal, :invalid_escape\n end\n\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 735 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 122 then\n# line 723 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = @source_buffer.slice(p - 1).chr\n\n if @version >= 27 && ((0..8).include?(@escape.ord) || (14..31).include?(@escape.ord))\n diagnostic :fatal, :invalid_escape\n end\n \t\tend\n# line 731 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 153 then\n# line 723 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = @source_buffer.slice(p - 1).chr\n\n if @version >= 27 && ((0..8).include?(@escape.ord) || (14..31).include?(@escape.ord))\n diagnostic :fatal, :invalid_escape\n end\n \t\tend\n# line 731 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 367 then\n# line 723 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = @source_buffer.slice(p - 1).chr\n\n if @version >= 27 && ((0..8).include?(@escape.ord) || (14..31).include?(@escape.ord))\n diagnostic :fatal, :invalid_escape\n end\n \t\tend\n# line 731 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 130 then\n# line 723 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = @source_buffer.slice(p - 1).chr\n\n if @version >= 27 && ((0..8).include?(@escape.ord) || (14..31).include?(@escape.ord))\n diagnostic :fatal, :invalid_escape\n end\n \t\tend\n# line 735 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 161 then\n# line 723 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = @source_buffer.slice(p - 1).chr\n\n if @version >= 27 && ((0..8).include?(@escape.ord) || (14..31).include?(@escape.ord))\n diagnostic :fatal, :invalid_escape\n end\n \t\tend\n# line 735 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 375 then\n# line 723 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = @source_buffer.slice(p - 1).chr\n\n if @version >= 27 && ((0..8).include?(@escape.ord) || (14..31).include?(@escape.ord))\n diagnostic :fatal, :invalid_escape\n end\n \t\tend\n# line 735 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 126 then\n# line 747 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 735 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 157 then\n# line 747 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 735 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 371 then\n# line 747 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 735 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 129 then\n# line 748 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(p - 2, p).to_i(16)) \t\tend\n# line 731 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 160 then\n# line 748 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(p - 2, p).to_i(16)) \t\tend\n# line 731 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 374 then\n# line 748 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(p - 2, p).to_i(16)) \t\tend\n# line 731 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 136 then\n# line 779 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 793 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 167 then\n# line 779 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 793 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 381 then\n# line 779 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 793 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 116 then\n# line 825 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 819 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 148 then\n# line 825 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 819 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 362 then\n# line 825 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 819 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 62 then\n# line 1229 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 221 then\n# line 1229 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1427 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 236 then\n# line 1229 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1457 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 248 then\n# line 1229 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1489 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 270 then\n# line 1229 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1634 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \tbegin\n\t\t @cs = 811\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 285 then\n# line 1229 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1715 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 297 then\n# line 1229 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1736 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 323 then\n# line 1229 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2133 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 399 then\n# line 1229 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2160 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 409 then\n# line 1229 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2191 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 430 then\n# line 1229 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2508 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 102 then\n# line 1229 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2604 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 482 then\n# line 2305 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 2307 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 635 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n\twhen 446 then\n# line 2306 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n# line 2307 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 635 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n\twhen 461 then\n# line 2307 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 635 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2308 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 454 then\n# line 2364 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 644 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tFLOAT, Float(chars)) } \t\tend\n# line 2367 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 450 then\n# line 2365 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 644 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tFLOAT, Float(chars)) } \t\tend\n# line 2367 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 276 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 501 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1631 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 79;\t\tend\n\twhen 36 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1626 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 78;\t\tend\n\twhen 47 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1676 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 86;\t\tend\n\twhen 94 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2540 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 181;\t\tend\n\twhen 66 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1757 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 99;\t\tend\n\twhen 85 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2249 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 147;\t\tend\n\twhen 93 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2540 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 181;\t\tend\n\twhen 38 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1586 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1587 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 73;\t\tend\n\twhen 391 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2008 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 2106 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 127;\t\tend\n\twhen 390 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2008 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1327 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 128;\t\tend\n\twhen 483 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2305 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 2308 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 154;\t\tend\n\twhen 127 then\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n\n if @version >= 30 && (codepoint == 117 || codepoint == 85) # 'u' or 'U'\n diagnostic :fatal, :invalid_escape\n end\n\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 731 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 735 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 158 then\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n\n if @version >= 30 && (codepoint == 117 || codepoint == 85) # 'u' or 'U'\n diagnostic :fatal, :invalid_escape\n end\n\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 731 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 735 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 372 then\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n\n if @version >= 30 && (codepoint == 117 || codepoint == 85) # 'u' or 'U'\n diagnostic :fatal, :invalid_escape\n end\n\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 731 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 735 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 125 then\n# line 723 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = @source_buffer.slice(p - 1).chr\n\n if @version >= 27 && ((0..8).include?(@escape.ord) || (14..31).include?(@escape.ord))\n diagnostic :fatal, :invalid_escape\n end\n \t\tend\n# line 731 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 735 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 156 then\n# line 723 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = @source_buffer.slice(p - 1).chr\n\n if @version >= 27 && ((0..8).include?(@escape.ord) || (14..31).include?(@escape.ord))\n diagnostic :fatal, :invalid_escape\n end\n \t\tend\n# line 731 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 735 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 370 then\n# line 723 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = @source_buffer.slice(p - 1).chr\n\n if @version >= 27 && ((0..8).include?(@escape.ord) || (14..31).include?(@escape.ord))\n diagnostic :fatal, :invalid_escape\n end\n \t\tend\n# line 731 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 735 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 132 then\n# line 741 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(p - 2, p).to_i(16)) \t\tend\n# line 731 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 735 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 163 then\n# line 741 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(p - 2, p).to_i(16)) \t\tend\n# line 731 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 735 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 377 then\n# line 741 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(p - 2, p).to_i(16)) \t\tend\n# line 731 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 735 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 128 then\n# line 748 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(p - 2, p).to_i(16)) \t\tend\n# line 731 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 735 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 159 then\n# line 748 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(p - 2, p).to_i(16)) \t\tend\n# line 731 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 735 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 898 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp? && @version >= 31 && %w[c C m M].include?(escaped_char)\n # Ruby >= 3.1 escapes \\c- and \\m chars, that's the only escape sequence\n # supported by regexes so far, so it needs a separate branch.\n current_literal.extend_string(@escape, @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 373 then\n# line 748 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(p - 2, p).to_i(16)) \t\tend\n# line 731 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 735 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 811; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 478 then\n# line 2301 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 16; @num_digits_s = p \t\tend\n# line 2307 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 635 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2308 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 472 then\n# line 2302 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = p \t\tend\n# line 2307 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 635 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2308 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 475 then\n# line 2303 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = p \t\tend\n# line 2307 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 635 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2308 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 469 then\n# line 2304 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 2; @num_digits_s = p \t\tend\n# line 2307 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 635 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2308 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 481 then\n# line 2305 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 2307 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 635 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2308 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 445 then\n# line 2306 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n# line 2307 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 635 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2308 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 32 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 865 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1586 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1587 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 73;\t\tend\n\twhen 63 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1229 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1757 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 99;\t\tend\n\twhen 92 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1229 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1232 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2540 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 181;\t\tend\n\twhen 488 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2307 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 635 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2340 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 156;\t\tend\n\twhen 484 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2305 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 2307 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 635 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2340 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 156;\t\tend\n\twhen 448 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2306 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n# line 2307 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 635 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2340 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 156;\t\tend\n# line 24782 \"lib/parser/lexer.rb\"\n\tend\n\tend\n\tend\n\tif _goto_level <= _again\n\tcase _lex_to_state_actions[ @cs] \n\twhen 96 then\n# line 1 \"NONE\"\n\t\tbegin\n @ts = nil;\t\tend\n# line 24792 \"lib/parser/lexer.rb\"\n\tend\n\n\tif @cs == 0\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\tp += 1\n\tif p != pe\n\t\t_goto_level = _resume\n\t\tnext\n\tend\n\tend\n\tif _goto_level <= _test_eof\n\tif p == eof\n\tif _lex_eof_trans[ @cs] > 0\n\t\t_trans = _lex_eof_trans[ @cs] - 1;\n\t\t_goto_level = _eof_trans\n\t\tnext;\n\tend\n\tend\n\n\tend\n\tif _goto_level <= _out\n\t\tbreak\n\tend\nend\n\tend\n\n# line 286 \"lib/parser/lexer.rl\"\n # %\n\n # Ragel creates a local variable called `testEof` but it doesn't use\n # it in any assignment. This dead code is here to swallow the warning.\n # It has no runtime cost because Ruby doesn't produce any instructions from it.\n if false\n testEof\n end\n\n @p = p\n\n if @token_queue.any?\n @token_queue.shift\n elsif @cs == klass.lex_error\n [ false, [ '$error'.freeze, range(p - 1, p) ] ]\n else\n eof = @source_pts.size\n [ false, [ '$eof'.freeze, range(eof, eof) ] ]\n end\n end", "def advance\n if @token_queue.any?\n return @token_queue.shift\n end\n\n # Ugly, but dependent on Ragel output. Consider refactoring it somehow.\n klass = self.class\n _lex_trans_keys = klass.send :_lex_trans_keys\n _lex_key_spans = klass.send :_lex_key_spans\n _lex_index_offsets = klass.send :_lex_index_offsets\n _lex_indicies = klass.send :_lex_indicies\n _lex_trans_targs = klass.send :_lex_trans_targs\n _lex_trans_actions = klass.send :_lex_trans_actions\n _lex_to_state_actions = klass.send :_lex_to_state_actions\n _lex_from_state_actions = klass.send :_lex_from_state_actions\n _lex_eof_trans = klass.send :_lex_eof_trans\n\n pe = @source_pts.size + 2\n p, eof = @p, pe\n\n @command_state = (@cs == klass.lex_en_expr_value ||\n @cs == klass.lex_en_line_begin)\n\n \n# line 10834 \"lib/parser/lexer.rb\"\nbegin\n\ttestEof = false\n\t_slen, _trans, _keys, _inds, _acts, _nacts = nil\n\t_goto_level = 0\n\t_resume = 10\n\t_eof_trans = 15\n\t_again = 20\n\t_test_eof = 30\n\t_out = 40\n\twhile true\n\tif _goto_level <= 0\n\tif p == pe\n\t\t_goto_level = _test_eof\n\t\tnext\n\tend\n\tif @cs == 0\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\tend\n\tif _goto_level <= _resume\n\tcase _lex_from_state_actions[ @cs] \n\twhen 89 then\n# line 1 \"NONE\"\n\t\tbegin\n @ts = p\n\t\tend\n# line 10862 \"lib/parser/lexer.rb\"\n\tend\n\t_keys = @cs << 1\n\t_inds = _lex_index_offsets[ @cs]\n\t_slen = _lex_key_spans[ @cs]\n\t_wide = ( (@source_pts[p] || 0))\n\t_trans = if ( _slen > 0 && \n\t\t\t_lex_trans_keys[_keys] <= _wide && \n\t\t\t_wide <= _lex_trans_keys[_keys + 1] \n\t\t ) then\n\t\t\t_lex_indicies[ _inds + _wide - _lex_trans_keys[_keys] ] \n\t\t else \n\t\t\t_lex_indicies[ _inds + _slen ]\n\t\t end\n\tend\n\tif _goto_level <= _eof_trans\n\t @cs = _lex_trans_targs[_trans]\n\tif _lex_trans_actions[_trans] != 0\n\tcase _lex_trans_actions[_trans]\n\twhen 28 then\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 108 then\n# line 799 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n\twhen 29 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n\twhen 59 then\n# line 1183 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n\twhen 63 then\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n\twhen 292 then\n# line 1227 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 36 then\n# line 1496 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 38 then\n# line 1512 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 40 then\n# line 1540 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 69 then\n# line 1730 \"lib/parser/lexer.rl\"\n\t\tbegin\n heredoc_e = p \t\tend\n\twhen 334 then\n# line 1810 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = nil \t\tend\n\twhen 363 then\n# line 1879 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 290 then\n# line 1934 \"lib/parser/lexer.rl\"\n\t\tbegin\n ident_tok = tok; ident_ts = @ts; ident_te = @te; \t\tend\n\twhen 449 then\n# line 2115 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 16; @num_digits_s = p \t\tend\n\twhen 443 then\n# line 2116 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = p \t\tend\n\twhen 446 then\n# line 2117 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = p \t\tend\n\twhen 440 then\n# line 2118 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 2; @num_digits_s = p \t\tend\n\twhen 455 then\n# line 2119 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n\twhen 417 then\n# line 2120 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n\twhen 432 then\n# line 2121 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 425 then\n# line 2178 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 422 then\n# line 2179 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 85 then\n# line 2337 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 7 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n\twhen 105 then\n# line 1065 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DBEG, '#{'.freeze)\n\n if current_literal.heredoc?\n current_literal.saved_herebody_s = @herebody_s\n @herebody_s = nil\n end\n\n current_literal.start_interp_brace\n @cs = 759;\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 5 then\n# line 1002 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 320\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 101 then\n# line 927 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 100 then\n# line 848 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 752;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 106 then\n# line 1002 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 320\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 103 then\n# line 989 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n literal.extend_space @ts, @te\n end\n\t\tend\n\twhen 104 then\n# line 848 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 752;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 6 then\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 4 then\n# line 848 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 752;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 133 then\n# line 1065 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DBEG, '#{'.freeze)\n\n if current_literal.heredoc?\n current_literal.saved_herebody_s = @herebody_s\n @herebody_s = nil\n end\n\n current_literal.start_interp_brace\n @cs = 759;\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 10 then\n# line 1002 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 320\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 130 then\n# line 927 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 129 then\n# line 848 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 752;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 134 then\n# line 1002 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 320\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 132 then\n# line 848 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 752;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 11 then\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 9 then\n# line 848 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 752;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 157 then\n# line 927 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 156 then\n# line 848 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 752;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 159 then\n# line 989 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n literal.extend_space @ts, @te\n end\n\t\tend\n\twhen 160 then\n# line 848 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 752;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 163 then\n# line 927 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 162 then\n# line 848 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 752;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 165 then\n# line 848 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 752;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 172 then\n# line 1065 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DBEG, '#{'.freeze)\n\n if current_literal.heredoc?\n current_literal.saved_herebody_s = @herebody_s\n @herebody_s = nil\n end\n\n current_literal.start_interp_brace\n @cs = 759;\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 13 then\n# line 1002 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 320\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 169 then\n# line 927 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 168 then\n# line 848 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 752;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 173 then\n# line 1002 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 320\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 171 then\n# line 848 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 752;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 12 then\n# line 848 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 752;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 175 then\n# line 927 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 174 then\n# line 848 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 752;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 182 then\n# line 1065 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DBEG, '#{'.freeze)\n\n if current_literal.heredoc?\n current_literal.saved_herebody_s = @herebody_s\n @herebody_s = nil\n end\n\n current_literal.start_interp_brace\n @cs = 759;\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 15 then\n# line 1002 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 320\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 178 then\n# line 927 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 177 then\n# line 848 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 752;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 183 then\n# line 1002 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 320\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 180 then\n# line 989 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n literal.extend_space @ts, @te\n end\n\t\tend\n\twhen 181 then\n# line 848 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 752;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 14 then\n# line 848 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 752;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 185 then\n# line 927 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 184 then\n# line 848 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 752;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 187 then\n# line 989 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n literal.extend_space @ts, @te\n end\n\t\tend\n\twhen 188 then\n# line 1157 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tREGEXP_OPT, tok(@ts, @te - 1), @ts, @te - 1)\n p = p - 1;\n \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 189 then\n# line 1144 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n unknown_options = tok.scan(/[^imxouesn]/)\n if unknown_options.any?\n diagnostic :error, :regexp_options,\n { :options => unknown_options.join }\n end\n\n emit(:tREGEXP_OPT)\n @cs = 767;\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 16 then\n# line 1286 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if tok =~ /^\\$([1-9][0-9]*)$/\n emit(:tNTH_REF, tok(@ts + 1).to_i)\n elsif tok =~ /^\\$([&`'+])$/\n emit(:tBACK_REF)\n else\n emit(:tGVAR)\n end\n\n @cs = (stack_pop); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 190 then\n# line 1286 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if tok =~ /^\\$([1-9][0-9]*)$/\n emit(:tNTH_REF, tok(@ts + 1).to_i)\n elsif tok =~ /^\\$([&`'+])$/\n emit(:tBACK_REF)\n else\n emit(:tGVAR)\n end\n\n @cs = (stack_pop); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 192 then\n# line 1299 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if tok =~ /^@@[0-9]/\n diagnostic :error, :cvar_name, { :name => tok }\n end\n\n emit(:tCVAR)\n @cs = (stack_pop); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 191 then\n# line 1309 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if tok =~ /^@[0-9]/\n diagnostic :error, :ivar_name, { :name => tok }\n end\n\n emit(:tIVAR)\n @cs = (stack_pop); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 213 then\n# line 1330 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(KEYWORDS_BEGIN);\n @cs = 438; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 199 then\n# line 1338 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tIDENTIFIER)\n @cs = 438; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 18 then\n# line 1342 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1\n @cs = 767; \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 320\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 196 then\n# line 1351 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 438; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 208 then\n# line 1355 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; p = p - 1; \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 20 then\n# line 1361 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if version?(23)\n type, delimiter = tok[0..-2], tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n else\n p = @ts - 1\n \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 195 then\n# line 1374 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 194 then\n# line 517 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 212 then\n# line 1330 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(KEYWORDS_BEGIN);\n @cs = 438; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 209 then\n# line 1334 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tCONSTANT)\n @cs = 438; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 211 then\n# line 1338 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tIDENTIFIER)\n @cs = 438; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 206 then\n# line 1342 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n @cs = 767; \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 320\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 202 then\n# line 1351 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 438; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 207 then\n# line 1358 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 535\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 200 then\n# line 1371 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 205 then\n# line 1374 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 19 then\n# line 1351 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin emit_table(PUNCTUATION)\n @cs = 438; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 17 then\n# line 1374 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = p - 1; \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 198 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 39 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS_BEGIN);\n @cs = 438; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 40 then\n\tbegin begin p = (( @te))-1; end\n emit(:tCONSTANT)\n @cs = 438; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 41 then\n\tbegin begin p = (( @te))-1; end\n emit(:tIDENTIFIER)\n @cs = 438; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 22 then\n# line 1386 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tLABEL, tok(@ts, @te - 2), @ts, @te - 1)\n p = p - 1; @cs = 752; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 215 then\n# line 1392 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 214 then\n# line 517 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 217 then\n# line 1389 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 216 then\n# line 1392 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 21 then\n# line 1392 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = p - 1; \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 223 then\n# line 1418 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 222 then\n# line 1424 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 221 then\n# line 517 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 233 then\n# line 1403 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tCONSTANT)\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 224 then\n# line 1407 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tIDENTIFIER)\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 229 then\n# line 1418 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 227 then\n# line 1421 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 232 then\n# line 1424 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 256 then\n# line 1482 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Unlike expr_beg as invoked in the next rule, do not warn\n p = @ts - 1\n \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 239 then\n# line 1500 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if tok(tm, tm + 1) == '/'.freeze\n # Ambiguous regexp literal.\n diagnostic :warning, :ambiguous_literal, nil, range(tm, tm + 1)\n end\n\n p = tm - 1\n \tbegin\n\t\t @cs = 535\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 245 then\n# line 1524 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; p = p - 1; \tbegin\n\t\t @cs = 535\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 24 then\n# line 1532 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1; \tbegin\n\t\t @cs = 535\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 247 then\n# line 1541 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = tm - 1; \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 39 then\n# line 1552 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 234 then\n# line 1566 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 535\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 235 then\n# line 517 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 246 then\n# line 1491 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 535\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 242 then\n# line 1513 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :warning, :ambiguous_prefix, { :prefix => tok(tm, @te) },\n range(tm, @te)\n\n p = tm - 1\n \tbegin\n\t\t @cs = 535\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 244 then\n# line 1529 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 535\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 238 then\n# line 1552 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 237 then\n# line 1557 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 255 then\n# line 1566 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 535\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 25 then\n# line 1557 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n\t\tend\n\twhen 41 then\n# line 1566 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = p - 1; \tbegin\n\t\t @cs = 535\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 23 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 67 then\n\tbegin begin p = (( @te))-1; end\n\n if tok(tm, tm + 1) == '/'.freeze\n # Ambiguous regexp literal.\n diagnostic :warning, :ambiguous_literal, nil, range(tm, tm + 1)\n end\n\n p = tm - 1\n \tbegin\n\t\t @cs = 535\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\twhen 68 then\n\tbegin begin p = (( @te))-1; end\n\n diagnostic :warning, :ambiguous_prefix, { :prefix => tok(tm, @te) },\n range(tm, @te)\n\n p = tm - 1\n \tbegin\n\t\t @cs = 535\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\twhen 73 then\n\tbegin begin p = (( @te))-1; end\n\n p = @ts - 1\n \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\telse\n\tbegin begin p = (( @te))-1; end\nend\nend \n\t\t\tend\n\twhen 43 then\n# line 1602 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1\n \tbegin\n\t\t @cs = 466\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 260 then\n# line 517 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 261 then\n# line 1602 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 466\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 44 then\n# line 1602 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = @ts - 1\n \tbegin\n\t\t @cs = 466\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 42 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 80 then\n\tbegin begin p = (( @te))-1; end\n\n if @cond.active?\n emit(:kDO_COND, 'do'.freeze, @te - 2, @te)\n else\n emit(:kDO, 'do'.freeze, @te - 2, @te)\n end\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 81 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1\n \tbegin\n\t\t @cs = 466\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 271 then\n# line 1636 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_do(true)\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 264 then\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 265 then\n# line 517 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 266 then\n# line 1639 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 269 then\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 275 then\n# line 1666 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 535\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 274 then\n# line 517 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 283 then\n# line 1658 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1; \tbegin\n\t\t @cs = 535\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 277 then\n# line 1660 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 281 then\n# line 1666 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 535\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 276 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 88 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 535; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 89 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1; \tbegin\n\t\t @cs = 535\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 56 then\n# line 1681 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1; @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 314 then\n# line 1698 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type = delimiter = tok[0].chr\n p = p - 1; \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 308 then\n# line 1705 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type, delimiter = @source_buffer.slice(@ts).chr, tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 54 then\n# line 1712 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type, delimiter = tok[0..-2], tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 327 then\n# line 1768 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = p - 1; p = p - 1;\n emit(:tSYMBEG, tok(@ts, @ts + 1), @ts, @ts + 1)\n \tbegin\n\t\t @cs = 325\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 315 then\n# line 1776 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type, delimiter = tok, tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 326 then\n# line 1784 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tSYMBOL, tok(@ts + 1, @ts + 2))\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 68 then\n# line 1798 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tSYMBOL, tok(@ts + 1), @ts)\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 331 then\n# line 1825 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n escape = { \" \" => '\\s', \"\\r\" => '\\r', \"\\n\" => '\\n', \"\\t\" => '\\t',\n \"\\v\" => '\\v', \"\\f\" => '\\f' }[@source_buffer.slice(@ts + 1)]\n diagnostic :warning, :invalid_escape_use, { :escape => escape }, range\n\n p = @ts - 1\n \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 330 then\n# line 1835 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n diagnostic :fatal, :incomplete_escape, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 316 then\n# line 1874 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION_BEGIN)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 51 then\n# line 1894 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = p - 1;\n\n if version?(18)\n ident = tok(@ts, @te - 2)\n\n emit((@source_buffer.slice(@ts) =~ /[A-Z]/) ? :tCONSTANT : :tIDENTIFIER,\n ident, @ts, @te - 2)\n p = p - 1; # continue as a symbol\n\n if !@static_env.nil? && @static_env.declared?(ident)\n @cs = 767;\n else\n @cs = (arg_or_cmdarg);\n end\n else\n emit(:tLABEL, tok(@ts, @te - 2), @ts, @te - 1)\n @cs = 752;\n end\n\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 48 then\n# line 1936 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tIDENTIFIER, ident_tok, ident_ts, ident_te)\n p = ident_te - 1\n\n if !@static_env.nil? && @static_env.declared?(ident_tok) && @version < 25\n @cs = 438;\n else\n @cs = 497;\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 302 then\n# line 1955 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = @ts - 1\n @cs_before_block_comment = @cs\n \tbegin\n\t\t @cs = 181\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 55 then\n# line 1971 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1; \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 286 then\n# line 517 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 313 then\n# line 1681 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1; @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 312 then\n# line 1688 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tSTAR, '*'.freeze)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 309 then\n# line 1712 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n type, delimiter = tok[0..-2], tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 307 then\n# line 1718 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :fatal, :string_eof, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 317 then\n# line 1798 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1), @ts)\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 329 then\n# line 1835 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :fatal, :incomplete_escape, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 335 then\n# line 1841 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 310 then\n# line 1874 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION_BEGIN)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 289 then\n# line 1271 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 438; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 299 then\n# line 1952 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 301 then\n# line 1955 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n p = @ts - 1\n @cs_before_block_comment = @cs\n \tbegin\n\t\t @cs = 181\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 304 then\n# line 1971 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1; \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 53 then\n# line 1718 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n diagnostic :fatal, :string_eof, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 71 then\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 47 then\n# line 1271 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 438; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 52 then\n# line 1952 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n\t\tend\n\twhen 67 then\n# line 1971 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = @ts - 1; \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 50 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 94 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1; @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 113 then\n\tbegin begin p = (( @te))-1; end\n emit_table(PUNCTUATION_BEGIN)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 114 then\n\tbegin begin p = (( @te))-1; end\n emit(:kRESCUE, 'rescue'.freeze, @ts, tm)\n p = tm - 1\n @cs = 511; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 115 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS_BEGIN)\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 117 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1\n \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\twhen 118 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 438; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 122 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1; \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 365 then\n# line 1991 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 535\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 366 then\n# line 517 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 367 then\n# line 1979 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 371 then\n# line 1991 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 535\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 74 then\n# line 2001 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1\n \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 375 then\n# line 2006 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n \tbegin\n\t\t @cs = (push_literal(tok, tok, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 374 then\n# line 2016 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 535\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 373 then\n# line 517 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 377 then\n# line 2010 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 376 then\n# line 2016 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 535\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 73 then\n# line 2016 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = p - 1; \tbegin\n\t\t @cs = 535\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 411 then\n# line 2027 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tLAMBDA, '->'.freeze, @ts, @ts + 2)\n\n @lambda_stack.push @paren_nest\n @cs = 438; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 83 then\n# line 2064 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:kCLASS, 'class'.freeze, @ts, @ts + 5)\n emit(:tLSHFT, '<<'.freeze, @te - 2, @te)\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 385 then\n# line 2199 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type, delimiter = tok, tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts, nil, false, false, true))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 76 then\n# line 2217 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1; \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 320\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 407 then\n# line 2224 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 445; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 459 then\n# line 2248 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit_table(PUNCTUATION)\n \tbegin\n\t\t @cs = 759\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 400 then\n# line 2257 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit_table(PUNCTUATION);\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 392 then\n# line 2267 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit_table(PUNCTUATION)\n\n if @version < 24\n @cond.lexpop\n @cmdarg.lexpop\n else\n @cond.pop\n @cmdarg.pop\n end\n\n if tok == '}'.freeze || tok == ']'.freeze\n if @version >= 25\n @cs = 767;\n else\n @cs = 503;\n end\n else # )\n # fnext expr_endfn; ?\n end\n\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 405 then\n# line 2292 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tOP_ASGN, tok(@ts, @te - 1))\n @cs = 535; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 390 then\n# line 2296 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tEH, '?'.freeze)\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 387 then\n# line 2304 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 535; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 389 then\n# line 2317 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tSEMI, ';'.freeze)\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 464 then\n# line 2320 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n diagnostic :error, :bare_backslash, nil, range(@ts, @ts + 1)\n p = p - 1;\n end\n\t\tend\n\twhen 384 then\n# line 2326 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n diagnostic :fatal, :unexpected, { :character => tok.inspect[1..-2] }\n end\n\t\tend\n\twhen 383 then\n# line 517 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 474 then\n# line 2060 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(KEYWORDS)\n @cs = 325; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 472 then\n# line 2064 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:kCLASS, 'class'.freeze, @ts, @ts + 5)\n emit(:tLSHFT, '<<'.freeze, @te - 2, @te)\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 471 then\n# line 2075 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(KEYWORDS)\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 414 then\n# line 2149 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :error, :no_dot_digit_literal\n end\n\t\tend\n\twhen 461 then\n# line 2209 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tCONSTANT)\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 404 then\n# line 2217 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1; \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 320\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 412 then\n# line 2224 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 445; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 466 then\n# line 1271 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 438; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 410 then\n# line 2248 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit_table(PUNCTUATION)\n \tbegin\n\t\t @cs = 759\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 406 then\n# line 2257 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit_table(PUNCTUATION);\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 399 then\n# line 2263 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 535; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 413 then\n# line 2304 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 535; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 397 then\n# line 2311 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 403 then\n# line 2326 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :fatal, :unexpected, { :character => tok.inspect[1..-2] }\n end\n\t\tend\n\twhen 81 then\n# line 2122 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 77 then\n# line 2149 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n diagnostic :error, :no_dot_digit_literal\n end\n\t\tend\n\twhen 80 then\n# line 2181 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 75 then\n# line 2326 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n diagnostic :fatal, :unexpected, { :character => tok.inspect[1..-2] }\n end\n\t\tend\n\twhen 78 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 135 then\n\tbegin begin p = (( @te))-1; end\n\n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n\n if tok == '{'.freeze\n emit(:tLAMBEG, '{'.freeze)\n else # 'do'\n emit(:kDO_LAMBDA, 'do'.freeze)\n end\n else\n if tok == '{'.freeze\n emit(:tLCURLY, '{'.freeze)\n else # 'do'\n emit_do\n end\n end\n\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 136 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 325; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 137 then\n\tbegin begin p = (( @te))-1; end\n emit(:kCLASS, 'class'.freeze, @ts, @ts + 5)\n emit(:tLSHFT, '<<'.freeze, @te - 2, @te)\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 138 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 535; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 139 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 140 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 511; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 141 then\n\tbegin begin p = (( @te))-1; end\n\n emit_table(KEYWORDS)\n\n if version?(18) && tok == 'not'.freeze\n @cs = 535; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 142 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18)\n emit(:tIDENTIFIER)\n\n unless !@static_env.nil? && @static_env.declared?(tok)\n @cs = (arg_or_cmdarg);\n end\n else\n emit(:k__ENCODING__, '__ENCODING__'.freeze)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 143 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 144 then\n\tbegin begin p = (( @te))-1; end\n\n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 146 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18, 19, 20)\n diagnostic :error,\n :trailing_in_number, { :character => tok(@te - 1, @te) },\n range(@te - 1, @te)\n else\n emit(:tINTEGER, tok(@ts, @te - 1).to_i, @ts, @te - 1)\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 147 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18, 19, 20)\n diagnostic :error,\n :trailing_in_number, { :character => tok(@te - 1, @te) },\n range(@te - 1, @te)\n else\n emit(:tFLOAT, tok(@ts, @te - 1).to_f, @ts, @te - 1)\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 148 then\n\tbegin begin p = (( @te))-1; end\n\n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 150 then\n\tbegin begin p = (( @te))-1; end\n emit(:tCONSTANT)\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 154 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 438; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 155 then\n\tbegin begin p = (( @te))-1; end\n\n if tm == @te\n # Suffix was consumed, e.g. foo!\n emit(:tFID)\n else\n # Suffix was not consumed, e.g. foo!=\n emit(:tIDENTIFIER, tok(@ts, tm), @ts, tm)\n p = tm - 1\n end\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 157 then\n\tbegin begin p = (( @te))-1; end\n\n emit_table(PUNCTUATION);\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 158 then\n\tbegin begin p = (( @te))-1; end\n emit_table(PUNCTUATION)\n @cs = 535; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 87 then\n# line 2338 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = tm - 1; \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 479 then\n# line 2341 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tNL, nil, @newline_s, @newline_s + 1)\n p = p - 1; @cs = 181; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 480 then\n# line 2341 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tNL, nil, @newline_s, @newline_s + 1)\n p = p - 1; @cs = 181; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 84 then\n# line 2341 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin emit(:tNL, nil, @newline_s, @newline_s + 1)\n p = p - 1; @cs = 181; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 483 then\n# line 2351 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit_comment(@eq_begin_s, @te)\n \tbegin\n\t\t @cs = (@cs_before_block_comment)\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 482 then\n# line 2359 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :fatal, :embedded_document, nil,\n range(@eq_begin_s, @eq_begin_s + '=begin'.length)\n end\n\t\tend\n\twhen 98 then\n# line 2369 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin @eq_begin_s = @ts\n \tbegin\n\t\t @cs = 948\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 2 then\n# line 2373 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = pe - 3 end\n\t\tend\n\twhen 90 then\n# line 2376 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 759\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 91 then\n# line 517 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 92 then\n# line 2366 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 97 then\n# line 2369 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin @eq_begin_s = @ts\n \tbegin\n\t\t @cs = 948\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 96 then\n# line 2376 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 759\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 1 then\n# line 2376 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = p - 1; \tbegin\n\t\t @cs = 759\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 66 then\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n\twhen 102 then\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 927 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 131 then\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 927 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 158 then\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 927 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 164 then\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 927 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 170 then\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 927 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 176 then\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 927 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 179 then\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 927 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 186 then\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 927 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 257 then\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1482 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Unlike expr_beg as invoked in the next rule, do not warn\n p = @ts - 1\n \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 248 then\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1541 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = tm - 1; \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 240 then\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1552 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 332 then\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1825 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n escape = { \" \" => '\\s', \"\\r\" => '\\r', \"\\n\" => '\\n', \"\\t\" => '\\t',\n \"\\v\" => '\\v', \"\\f\" => '\\f' }[@source_buffer.slice(@ts + 1)]\n diagnostic :warning, :invalid_escape_use, { :escape => escape }, range\n\n p = @ts - 1\n \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 303 then\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1955 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = @ts - 1\n @cs_before_block_comment = @cs\n \tbegin\n\t\t @cs = 181\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 484 then\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2351 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit_comment(@eq_begin_s, @te)\n \tbegin\n\t\t @cs = (@cs_before_block_comment)\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 481 then\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2356 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n\t\tend\n\twhen 99 then\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2369 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin @eq_begin_s = @ts\n \tbegin\n\t\t @cs = 948\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 3 then\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2373 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = pe - 3 end\n\t\tend\n\twhen 435 then\n# line 625 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tRATIONAL, Rational(chars)) } \t\tend\n# line 2122 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 433 then\n# line 626 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tIMAGINARY, Complex(0, chars)) } \t\tend\n# line 2122 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 438 then\n# line 627 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tIMAGINARY, Complex(0, Rational(chars))) } \t\tend\n# line 2122 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 436 then\n# line 628 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars, @ts, @te - 2); p -= 2 } \t\tend\n# line 2122 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 434 then\n# line 629 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars, @ts, @te - 2); p -= 2 } \t\tend\n# line 2122 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 437 then\n# line 630 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars, @ts, @te - 6); p -= 6 } \t\tend\n# line 2122 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 426 then\n# line 634 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tIMAGINARY, Complex(0, Float(chars))) } \t\tend\n# line 2181 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 427 then\n# line 635 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tFLOAT, Float(chars), @ts, @te - 2); p -= 2 } \t\tend\n# line 2181 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 428 then\n# line 639 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tRATIONAL, Rational(chars)) } \t\tend\n# line 2181 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 430 then\n# line 640 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tIMAGINARY, Complex(0, Rational(chars))) } \t\tend\n# line 2181 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 429 then\n# line 641 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tFLOAT, Float(chars), @ts, @te - 6); p -= 6 } \t\tend\n# line 2181 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 125 then\n# line 656 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = \"\"\n\n codepoints = tok(@escape_s + 2, p - 1)\n codepoint_s = @escape_s + 2\n\n if @version < 24\n if codepoints.start_with?(\" \") || codepoints.start_with?(\"\\t\")\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(@escape_s + 2, @escape_s + 3)\n end\n\n if spaces_p = codepoints.index(/[ \\t]{2}/)\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(codepoint_s + spaces_p + 1, codepoint_s + spaces_p + 2)\n end\n\n if codepoints.end_with?(\" \") || codepoints.end_with?(\"\\t\")\n diagnostic :fatal, :invalid_unicode_escape, nil, range(p - 1, p)\n end\n end\n\n codepoints.scan(/([0-9a-fA-F]+)|([ \\t]+)/).each do |(codepoint_str, spaces)|\n if spaces\n codepoint_s += spaces.length\n else\n codepoint = codepoint_str.to_i(16)\n\n if codepoint >= 0x110000\n diagnostic :error, :unicode_point_too_large, nil,\n range(codepoint_s, codepoint_s + codepoint_str.length)\n break\n end\n\n @escape += codepoint.chr(Encoding::UTF_8)\n codepoint_s += codepoint_str.length\n end\n end\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 152 then\n# line 656 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = \"\"\n\n codepoints = tok(@escape_s + 2, p - 1)\n codepoint_s = @escape_s + 2\n\n if @version < 24\n if codepoints.start_with?(\" \") || codepoints.start_with?(\"\\t\")\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(@escape_s + 2, @escape_s + 3)\n end\n\n if spaces_p = codepoints.index(/[ \\t]{2}/)\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(codepoint_s + spaces_p + 1, codepoint_s + spaces_p + 2)\n end\n\n if codepoints.end_with?(\" \") || codepoints.end_with?(\"\\t\")\n diagnostic :fatal, :invalid_unicode_escape, nil, range(p - 1, p)\n end\n end\n\n codepoints.scan(/([0-9a-fA-F]+)|([ \\t]+)/).each do |(codepoint_str, spaces)|\n if spaces\n codepoint_s += spaces.length\n else\n codepoint = codepoint_str.to_i(16)\n\n if codepoint >= 0x110000\n diagnostic :error, :unicode_point_too_large, nil,\n range(codepoint_s, codepoint_s + codepoint_str.length)\n break\n end\n\n @escape += codepoint.chr(Encoding::UTF_8)\n codepoint_s += codepoint_str.length\n end\n end\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 353 then\n# line 656 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = \"\"\n\n codepoints = tok(@escape_s + 2, p - 1)\n codepoint_s = @escape_s + 2\n\n if @version < 24\n if codepoints.start_with?(\" \") || codepoints.start_with?(\"\\t\")\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(@escape_s + 2, @escape_s + 3)\n end\n\n if spaces_p = codepoints.index(/[ \\t]{2}/)\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(codepoint_s + spaces_p + 1, codepoint_s + spaces_p + 2)\n end\n\n if codepoints.end_with?(\" \") || codepoints.end_with?(\"\\t\")\n diagnostic :fatal, :invalid_unicode_escape, nil, range(p - 1, p)\n end\n end\n\n codepoints.scan(/([0-9a-fA-F]+)|([ \\t]+)/).each do |(codepoint_str, spaces)|\n if spaces\n codepoint_s += spaces.length\n else\n codepoint = codepoint_str.to_i(16)\n\n if codepoint >= 0x110000\n diagnostic :error, :unicode_point_too_large, nil,\n range(codepoint_s, codepoint_s + codepoint_str.length)\n break\n end\n\n @escape += codepoint.chr(Encoding::UTF_8)\n codepoint_s += codepoint_str.length\n end\n end\n \t\tend\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 109 then\n# line 696 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 136 then\n# line 696 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 337 then\n# line 696 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 112 then\n# line 703 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_escape\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 139 then\n# line 703 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_escape\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 340 then\n# line 703 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_escape\n \t\tend\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 114 then\n# line 722 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 141 then\n# line 722 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 342 then\n# line 722 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 111 then\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s, p).to_i(8) % 0x100) \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 138 then\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s, p).to_i(8) % 0x100) \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 339 then\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s, p).to_i(8) % 0x100) \t\tend\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 128 then\n# line 733 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s + 1, p).to_i(16)) \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 155 then\n# line 733 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s + 1, p).to_i(16)) \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 356 then\n# line 733 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s + 1, p).to_i(16)) \t\tend\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 127 then\n# line 737 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_hex_escape, nil, range(@escape_s - 1, p + 2)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 154 then\n# line 737 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_hex_escape, nil, range(@escape_s - 1, p + 2)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 355 then\n# line 737 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_hex_escape, nil, range(@escape_s - 1, p + 2)\n \t\tend\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 122 then\n# line 743 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = tok(@escape_s + 1, p).to_i(16).chr(Encoding::UTF_8) \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 149 then\n# line 743 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = tok(@escape_s + 1, p).to_i(16).chr(Encoding::UTF_8) \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 350 then\n# line 743 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = tok(@escape_s + 1, p).to_i(16).chr(Encoding::UTF_8) \t\tend\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 121 then\n# line 747 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 148 then\n# line 747 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 349 then\n# line 747 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 126 then\n# line 753 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 153 then\n# line 753 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 354 then\n# line 753 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 123 then\n# line 767 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 150 then\n# line 767 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 351 then\n# line 767 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 110 then\n# line 793 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 137 then\n# line 793 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 338 then\n# line 793 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 161 then\n# line 799 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 166 then\n# line 799 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 57 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 30 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1496 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 32 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1512 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 34 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1540 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 201 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1371 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 220 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1389 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 228 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1421 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 33 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1552 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 259 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1557 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 251 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1563 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 270 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1639 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 282 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1660 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 278 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1663 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 58 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1681 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1; @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 49 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1936 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tIDENTIFIER, ident_tok, ident_ts, ident_te)\n p = ident_te - 1\n\n if !@static_env.nil? && @static_env.declared?(ident_tok) && @version < 25\n @cs = 438;\n else\n @cs = 497;\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 300 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1952 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 372 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1979 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 368 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1982 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @in_kwarg\n p = p - 1; \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n else\n \tbegin\n\t\t @cs = 181\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 381 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2010 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 378 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2013 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \tbegin\n\t\t @cs = 181\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 465 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2311 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 398 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2314 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \tbegin\n\t\t @cs = 945\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 93 then\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2366 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 250 then\n# line 1027 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n current_literal = literal\n if current_literal\n current_literal.start_interp_brace\n end\n \t\tend\n# line 1465 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n emit(:tLAMBEG, '{'.freeze, @te - 1, @te)\n else\n emit(:tLCURLY, '{'.freeze, @te - 1, @te)\n end\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 272 then\n# line 1027 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n current_literal = literal\n if current_literal\n current_literal.start_interp_brace\n end\n \t\tend\n# line 1625 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n emit(:tLAMBEG, '{'.freeze)\n else\n emit(:tLBRACE_ARG, '{'.freeze)\n end\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 364 then\n# line 1027 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n current_literal = literal\n if current_literal\n current_literal.start_interp_brace\n end\n \t\tend\n# line 1852 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n emit(:tLAMBEG, '{'.freeze)\n else\n emit(:tLBRACE, '{'.freeze)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 477 then\n# line 1027 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n current_literal = literal\n if current_literal\n current_literal.start_interp_brace\n end\n \t\tend\n# line 2035 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n\n if tok == '{'.freeze\n emit(:tLAMBEG, '{'.freeze)\n else # 'do'\n emit(:kDO_LAMBDA, 'do'.freeze)\n end\n else\n if tok == '{'.freeze\n emit(:tLCURLY, '{'.freeze)\n else # 'do'\n emit_do\n end\n end\n\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 478 then\n# line 1036 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n current_literal = literal\n if current_literal\n if current_literal.end_interp_brace_and_try_closing\n if version?(18, 19)\n emit(:tRCURLY, '}'.freeze, p - 1, p)\n if @version < 24\n @cond.lexpop\n @cmdarg.lexpop\n else\n @cond.pop\n @cmdarg.pop\n end\n else\n emit(:tSTRING_DEND, '}'.freeze, p - 1, p)\n end\n\n if current_literal.saved_herebody_s\n @herebody_s = current_literal.saved_herebody_s\n end\n\n\n p = p - 1;\n @cs = (next_state_for_literal(current_literal));\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n \t\tend\n# line 2267 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit_table(PUNCTUATION)\n\n if @version < 24\n @cond.lexpop\n @cmdarg.lexpop\n else\n @cond.pop\n @cmdarg.pop\n end\n\n if tok == '}'.freeze || tok == ']'.freeze\n if @version >= 25\n @cs = 767;\n else\n @cs = 503;\n end\n else # )\n # fnext expr_endfn; ?\n end\n\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 60 then\n# line 1183 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n\twhen 64 then\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 204 then\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1371 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 219 then\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1389 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 231 then\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1421 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 253 then\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1560 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 268 then\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1639 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 280 then\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1660 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 306 then\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1952 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 370 then\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1979 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 380 then\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2010 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 402 then\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2311 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 95 then\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2366 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 225 then\n# line 1227 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1411 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tFID, tok(@ts, tm), @ts, tm)\n @cs = (arg_or_cmdarg); p = tm - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 318 then\n# line 1227 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1790 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 291 then\n# line 1227 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1925 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 395 then\n# line 1227 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 135 then\n\tbegin begin p = (( @te))-1; end\n\n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n\n if tok == '{'.freeze\n emit(:tLAMBEG, '{'.freeze)\n else # 'do'\n emit(:kDO_LAMBDA, 'do'.freeze)\n end\n else\n if tok == '{'.freeze\n emit(:tLCURLY, '{'.freeze)\n else # 'do'\n emit_do\n end\n end\n\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 136 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 325; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 137 then\n\tbegin begin p = (( @te))-1; end\n emit(:kCLASS, 'class'.freeze, @ts, @ts + 5)\n emit(:tLSHFT, '<<'.freeze, @te - 2, @te)\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 138 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 535; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 139 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 140 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 511; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 141 then\n\tbegin begin p = (( @te))-1; end\n\n emit_table(KEYWORDS)\n\n if version?(18) && tok == 'not'.freeze\n @cs = 535; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 142 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18)\n emit(:tIDENTIFIER)\n\n unless !@static_env.nil? && @static_env.declared?(tok)\n @cs = (arg_or_cmdarg);\n end\n else\n emit(:k__ENCODING__, '__ENCODING__'.freeze)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 143 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 144 then\n\tbegin begin p = (( @te))-1; end\n\n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 146 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18, 19, 20)\n diagnostic :error,\n :trailing_in_number, { :character => tok(@te - 1, @te) },\n range(@te - 1, @te)\n else\n emit(:tINTEGER, tok(@ts, @te - 1).to_i, @ts, @te - 1)\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 147 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18, 19, 20)\n diagnostic :error,\n :trailing_in_number, { :character => tok(@te - 1, @te) },\n range(@te - 1, @te)\n else\n emit(:tFLOAT, tok(@ts, @te - 1).to_f, @ts, @te - 1)\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 148 then\n\tbegin begin p = (( @te))-1; end\n\n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 150 then\n\tbegin begin p = (( @te))-1; end\n emit(:tCONSTANT)\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 154 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 438; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 155 then\n\tbegin begin p = (( @te))-1; end\n\n if tm == @te\n # Suffix was consumed, e.g. foo!\n emit(:tFID)\n else\n # Suffix was not consumed, e.g. foo!=\n emit(:tIDENTIFIER, tok(@ts, tm), @ts, tm)\n p = tm - 1\n end\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 157 then\n\tbegin begin p = (( @te))-1; end\n\n emit_table(PUNCTUATION);\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 158 then\n\tbegin begin p = (( @te))-1; end\n emit_table(PUNCTUATION)\n @cs = 535; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 226 then\n# line 1228 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1411 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tFID, tok(@ts, tm), @ts, tm)\n @cs = (arg_or_cmdarg); p = tm - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 319 then\n# line 1228 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1790 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 293 then\n# line 1228 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1925 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 396 then\n# line 1228 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 2231 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if tm == @te\n # Suffix was consumed, e.g. foo!\n emit(:tFID)\n else\n # Suffix was not consumed, e.g. foo!=\n emit(:tIDENTIFIER, tok(@ts, tm), @ts, tm)\n p = tm - 1\n end\n @cs = 466; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 320 then\n# line 1233 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1790 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 294 then\n# line 1233 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1925 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 321 then\n# line 1234 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1790 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 295 then\n# line 1234 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1925 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 325 then\n# line 1235 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1790 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 298 then\n# line 1235 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1925 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 324 then\n# line 1236 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1790 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 297 then\n# line 1236 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 94 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1; @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 113 then\n\tbegin begin p = (( @te))-1; end\n emit_table(PUNCTUATION_BEGIN)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 114 then\n\tbegin begin p = (( @te))-1; end\n emit(:kRESCUE, 'rescue'.freeze, @ts, tm)\n p = tm - 1\n @cs = 511; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 115 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS_BEGIN)\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 117 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1\n \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\twhen 118 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 438; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 122 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1; \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 322 then\n# line 1237 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 3 \t\tend\n# line 1790 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 296 then\n# line 1237 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 3 \t\tend\n# line 1925 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 323 then\n# line 1242 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1790 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 460 then\n# line 1247 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 2213 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tCONSTANT, tok(@ts, tm), @ts, tm)\n p = tm - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 249 then\n# line 1253 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n \t\tend\n# line 1459 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tLBRACK, '['.freeze, @te - 1, @te)\n @cs = 535; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 357 then\n# line 1253 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n \t\tend\n# line 1864 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tLBRACK, '['.freeze)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 463 then\n# line 1253 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n \t\tend\n# line 2300 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tLBRACK2, '['.freeze)\n @cs = 535; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 241 then\n# line 1260 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n \t\tend\n# line 1440 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if version?(18)\n emit(:tLPAREN2, '('.freeze, @te - 1, @te)\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n emit(:tLPAREN_ARG, '('.freeze, @te - 1, @te)\n @cs = 535; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 254 then\n# line 1260 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n \t\tend\n# line 1453 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tLPAREN2, '('.freeze)\n @cs = 535; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 262 then\n# line 1260 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n \t\tend\n# line 1579 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tLPAREN_ARG, '('.freeze, @te - 1, @te)\n if version?(18)\n @cs = 759; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = 535; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 311 then\n# line 1260 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n \t\tend\n# line 1869 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tLPAREN, '('.freeze)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 408 then\n# line 1260 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n \t\tend\n# line 2263 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 535; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 409 then\n# line 1266 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @paren_nest -= 1\n \t\tend\n# line 2267 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit_table(PUNCTUATION)\n\n if @version < 24\n @cond.lexpop\n @cmdarg.lexpop\n else\n @cond.pop\n @cmdarg.pop\n end\n\n if tok == '}'.freeze || tok == ']'.freeze\n if @version >= 25\n @cs = 767;\n else\n @cs = 503;\n end\n else # )\n # fnext expr_endfn; ?\n end\n\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 70 then\n# line 1730 \"lib/parser/lexer.rl\"\n\t\tbegin\n heredoc_e = p \t\tend\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 328 then\n# line 1731 \"lib/parser/lexer.rl\"\n\t\tbegin\n new_herebody_s = p \t\tend\n# line 1732 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n tok(@ts, heredoc_e) =~ /^<<(-?)(~?)([\"'`]?)(.*)\\3$/m\n\n indent = !$1.empty? || !$2.empty?\n dedent_body = !$2.empty?\n type = $3.empty? ? '<<\"'.freeze : ('<<'.freeze + $3)\n delimiter = $4\n\n if @version >= 24\n if delimiter.count(\"\\n\") > 0\n if delimiter.end_with?(\"\\n\")\n diagnostic :warning, :heredoc_id_ends_with_nl, nil, range(@ts, @ts + 1)\n delimiter = delimiter.rstrip\n else\n diagnostic :fatal, :heredoc_id_has_newline, nil, range(@ts, @ts + 1)\n end\n end\n end\n\n if dedent_body && version?(18, 19, 20, 21, 22)\n emit(:tLSHFT, '<<'.freeze, @ts, @ts + 2)\n p = @ts + 1\n @cs = 535; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (push_literal(type, delimiter, @ts, heredoc_e, indent, dedent_body));\n\n @herebody_s ||= new_herebody_s\n p = @herebody_s - 1\n end\n end\n\t\tend\n\twhen 333 then\n# line 1810 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = nil \t\tend\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 360 then\n# line 1879 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1880 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:kRESCUE, 'rescue'.freeze, @ts, tm)\n p = tm - 1\n @cs = 511; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 450 then\n# line 2115 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 16; @num_digits_s = p \t\tend\n# line 2121 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 444 then\n# line 2116 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = p \t\tend\n# line 2121 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 447 then\n# line 2117 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = p \t\tend\n# line 2121 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 441 then\n# line 2118 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 2; @num_digits_s = p \t\tend\n# line 2121 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 456 then\n# line 2119 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 2121 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 419 then\n# line 2120 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n# line 2121 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 457 then\n# line 2121 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 624 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n\twhen 86 then\n# line 2337 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 2338 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = tm - 1; \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 8 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 423 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2179 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 210 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1330 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 39;\t\tend\n\twhen 197 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1334 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 40;\t\tend\n\twhen 193 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1338 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 41;\t\tend\n\twhen 26 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1500 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 67;\t\tend\n\twhen 243 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1513 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 68;\t\tend\n\twhen 27 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1552 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 73;\t\tend\n\twhen 236 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1557 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 74;\t\tend\n\twhen 263 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1589 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 80;\t\tend\n\twhen 45 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1602 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 81;\t\tend\n\twhen 284 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1654 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 88;\t\tend\n\twhen 273 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1658 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 89;\t\tend\n\twhen 287 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1874 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 113;\t\tend\n\twhen 359 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1880 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 114;\t\tend\n\twhen 358 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1886 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 115;\t\tend\n\twhen 72 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1925 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 117;\t\tend\n\twhen 285 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1271 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 118;\t\tend\n\twhen 288 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1971 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 122;\t\tend\n\twhen 473 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2035 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 135;\t\tend\n\twhen 468 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2060 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 136;\t\tend\n\twhen 476 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2070 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 138;\t\tend\n\twhen 469 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2075 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 139;\t\tend\n\twhen 470 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2079 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 140;\t\tend\n\twhen 475 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2083 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 141;\t\tend\n\twhen 467 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2094 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 142;\t\tend\n\twhen 462 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2108 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 143;\t\tend\n\twhen 388 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2122 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 144;\t\tend\n\twhen 421 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2166 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 147;\t\tend\n\twhen 79 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2181 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 148;\t\tend\n\twhen 391 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2209 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 150;\t\tend\n\twhen 382 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1271 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 154;\t\tend\n\twhen 394 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2231 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 155;\t\tend\n\twhen 386 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2257 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 157;\t\tend\n\twhen 393 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2263 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 158;\t\tend\n\twhen 167 then\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 927 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n# line 799 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n\twhen 115 then\n# line 696 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 142 then\n# line 696 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 343 then\n# line 696 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 120 then\n# line 696 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 711 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 147 then\n# line 696 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 711 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 348 then\n# line 696 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 711 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 119 then\n# line 717 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source_buffer.slice(p - 1).chr \t\tend\n# line 711 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 146 then\n# line 717 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source_buffer.slice(p - 1).chr \t\tend\n# line 711 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 347 then\n# line 717 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source_buffer.slice(p - 1).chr \t\tend\n# line 711 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 117 then\n# line 722 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 711 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 144 then\n# line 722 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 711 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 345 then\n# line 722 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 711 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 113 then\n# line 723 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source_buffer.slice(p - 1).chr \t\tend\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 140 then\n# line 723 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source_buffer.slice(p - 1).chr \t\tend\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 341 then\n# line 723 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source_buffer.slice(p - 1).chr \t\tend\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 124 then\n# line 753 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 767 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 151 then\n# line 753 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 767 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 352 then\n# line 753 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 767 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 107 then\n# line 799 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 793 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 135 then\n# line 799 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 793 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 336 then\n# line 799 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 793 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 61 then\n# line 1183 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 203 then\n# line 1183 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1371 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 218 then\n# line 1183 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1389 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 230 then\n# line 1183 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1421 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 252 then\n# line 1183 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1560 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \tbegin\n\t\t @cs = 767\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 267 then\n# line 1183 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1639 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 279 then\n# line 1183 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1660 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 305 then\n# line 1183 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1952 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 369 then\n# line 1183 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1979 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 379 then\n# line 1183 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2010 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 401 then\n# line 1183 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2311 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 94 then\n# line 1183 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2366 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 452 then\n# line 2119 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 2121 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 624 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n\twhen 416 then\n# line 2120 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n# line 2121 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 624 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n\twhen 431 then\n# line 2121 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 624 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2122 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 424 then\n# line 2178 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 633 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tFLOAT, Float(chars)) } \t\tend\n# line 2181 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 420 then\n# line 2179 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 633 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tFLOAT, Float(chars)) } \t\tend\n# line 2181 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 258 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 491 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1557 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 74;\t\tend\n\twhen 35 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1552 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 73;\t\tend\n\twhen 46 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1602 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 81;\t\tend\n\twhen 65 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1681 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 94;\t\tend\n\twhen 82 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2064 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 137;\t\tend\n\twhen 37 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1512 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1513 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 68;\t\tend\n\twhen 362 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1879 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1925 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 117;\t\tend\n\twhen 361 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1879 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1271 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 118;\t\tend\n\twhen 453 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2119 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 2122 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 144;\t\tend\n\twhen 118 then\n# line 696 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 711 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 145 then\n# line 696 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 711 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 346 then\n# line 696 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 711 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 116 then\n# line 723 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source_buffer.slice(p - 1).chr \t\tend\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 711 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 143 then\n# line 723 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source_buffer.slice(p - 1).chr \t\tend\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 711 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 872 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.squiggly_heredoc? && escaped_char == \"\\n\".freeze\n # Squiggly heredocs like\n # <<~-HERE\n # 1\\\n # 2\n # HERE\n # treat '\\' as a line continuation, but still dedent the body, so the heredoc above becomes \"12\\n\".\n # This information is emitted as is, without escaping,\n # later this escape sequence (\\\\\\n) gets handled manually in the Lexer::Dedenter\n current_literal.extend_string(tok, @ts, @te)\n elsif current_literal.supports_line_continuation_via_slash? && escaped_char == \"\\n\".freeze\n # Heredocs, regexp and a few other types of literals support line\n # continuation via \\\\\\n sequence. The code like\n # \"a\\\n # b\"\n # must be parsed as \"ab\"\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n elsif current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed (in cases like \"\\\\C-\\\\\\n\\\\M-x\")\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 344 then\n# line 723 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source_buffer.slice(p - 1).chr \t\tend\n# line 707 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 711 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value.getbyte(0))\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 767; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 448 then\n# line 2115 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 16; @num_digits_s = p \t\tend\n# line 2121 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 624 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2122 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 442 then\n# line 2116 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = p \t\tend\n# line 2121 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 624 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2122 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 445 then\n# line 2117 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = p \t\tend\n# line 2121 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 624 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2122 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 439 then\n# line 2118 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 2; @num_digits_s = p \t\tend\n# line 2121 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 624 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2122 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 451 then\n# line 2119 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 2121 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 624 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2122 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 415 then\n# line 2120 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n# line 2121 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 624 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2122 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 31 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 839 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1512 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1513 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 68;\t\tend\n\twhen 62 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1183 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1186 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1681 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 94;\t\tend\n\twhen 458 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2121 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 624 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2154 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 146;\t\tend\n\twhen 454 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2119 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 2121 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 624 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2154 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 146;\t\tend\n\twhen 418 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2120 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n# line 2121 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 624 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2154 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 146;\t\tend\n# line 22832 \"lib/parser/lexer.rb\"\n\tend\n\tend\n\tend\n\tif _goto_level <= _again\n\tcase _lex_to_state_actions[ @cs] \n\twhen 88 then\n# line 1 \"NONE\"\n\t\tbegin\n @ts = nil;\t\tend\n# line 22842 \"lib/parser/lexer.rb\"\n\tend\n\n\tif @cs == 0\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\tp += 1\n\tif p != pe\n\t\t_goto_level = _resume\n\t\tnext\n\tend\n\tend\n\tif _goto_level <= _test_eof\n\tif p == eof\n\tif _lex_eof_trans[ @cs] > 0\n\t\t_trans = _lex_eof_trans[ @cs] - 1;\n\t\t_goto_level = _eof_trans\n\t\tnext;\n\tend\n\tend\n\n\tend\n\tif _goto_level <= _out\n\t\tbreak\n\tend\nend\n\tend\n\n# line 283 \"lib/parser/lexer.rl\"\n # %\n\n @p = p\n\n if @token_queue.any?\n @token_queue.shift\n elsif @cs == klass.lex_error\n [ false, [ '$error'.freeze, range(p - 1, p) ] ]\n else\n eof = @source_pts.size\n [ false, [ '$eof'.freeze, range(eof, eof) ] ]\n end\n end", "def advance\n if @token_queue.any?\n return @token_queue.shift\n end\n\n # Ugly, but dependent on Ragel output. Consider refactoring it somehow.\n klass = self.class\n _lex_trans_keys = klass.send :_lex_trans_keys\n _lex_key_spans = klass.send :_lex_key_spans\n _lex_index_offsets = klass.send :_lex_index_offsets\n _lex_indicies = klass.send :_lex_indicies\n _lex_trans_targs = klass.send :_lex_trans_targs\n _lex_trans_actions = klass.send :_lex_trans_actions\n _lex_to_state_actions = klass.send :_lex_to_state_actions\n _lex_from_state_actions = klass.send :_lex_from_state_actions\n _lex_eof_trans = klass.send :_lex_eof_trans\n\n pe = @source_pts.size + 2\n p, eof = @p, pe\n\n @command_state = (@cs == klass.lex_en_expr_value ||\n @cs == klass.lex_en_line_begin)\n\n \n# line 11015 \"lib/parser/lexer.rb\"\nbegin\n\ttestEof = false\n\t_slen, _trans, _keys, _inds, _acts, _nacts = nil\n\t_goto_level = 0\n\t_resume = 10\n\t_eof_trans = 15\n\t_again = 20\n\t_test_eof = 30\n\t_out = 40\n\twhile true\n\tif _goto_level <= 0\n\tif p == pe\n\t\t_goto_level = _test_eof\n\t\tnext\n\tend\n\tif @cs == 0\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\tend\n\tif _goto_level <= _resume\n\tcase _lex_from_state_actions[ @cs] \n\twhen 84 then\n# line 1 \"NONE\"\n\t\tbegin\n @ts = p\n\t\tend\n# line 11043 \"lib/parser/lexer.rb\"\n\tend\n\t_keys = @cs << 1\n\t_inds = _lex_index_offsets[ @cs]\n\t_slen = _lex_key_spans[ @cs]\n\t_wide = ( (@source_pts[p] || 0))\n\t_trans = if ( _slen > 0 && \n\t\t\t_lex_trans_keys[_keys] <= _wide && \n\t\t\t_wide <= _lex_trans_keys[_keys + 1] \n\t\t ) then\n\t\t\t_lex_indicies[ _inds + _wide - _lex_trans_keys[_keys] ] \n\t\t else \n\t\t\t_lex_indicies[ _inds + _slen ]\n\t\t end\n\tend\n\tif _goto_level <= _eof_trans\n\t @cs = _lex_trans_targs[_trans]\n\tif _lex_trans_actions[_trans] != 0\n\tcase _lex_trans_actions[_trans]\n\twhen 28 then\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 103 then\n# line 772 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n\twhen 29 then\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n\twhen 56 then\n# line 1128 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n\twhen 60 then\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n\twhen 283 then\n# line 1172 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 36 then\n# line 1441 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 38 then\n# line 1457 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 40 then\n# line 1485 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 66 then\n# line 1675 \"lib/parser/lexer.rl\"\n\t\tbegin\n heredoc_e = p \t\tend\n\twhen 323 then\n# line 1729 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = nil \t\tend\n\twhen 352 then\n# line 1802 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 428 then\n# line 2020 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 16; @num_digits_s = p \t\tend\n\twhen 422 then\n# line 2021 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = p \t\tend\n\twhen 425 then\n# line 2022 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = p \t\tend\n\twhen 419 then\n# line 2023 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 2; @num_digits_s = p \t\tend\n\twhen 434 then\n# line 2024 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n\twhen 402 then\n# line 2025 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n\twhen 414 then\n# line 2026 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 409 then\n# line 2083 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 407 then\n# line 2084 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 80 then\n# line 2219 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 7 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n\twhen 100 then\n# line 1013 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DBEG, '#{'.freeze)\n\n if current_literal.heredoc?\n current_literal.saved_herebody_s = @herebody_s\n @herebody_s = nil\n end\n\n current_literal.start_interp_brace\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 765\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 5 then\n# line 958 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 96 then\n# line 883 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 95 then\n# line 821 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 758;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 101 then\n# line 958 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 98 then\n# line 945 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n literal.extend_space @ts, @te\n end\n\t\tend\n\twhen 99 then\n# line 821 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 758;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 6 then\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 4 then\n# line 821 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 758;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 127 then\n# line 1013 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DBEG, '#{'.freeze)\n\n if current_literal.heredoc?\n current_literal.saved_herebody_s = @herebody_s\n @herebody_s = nil\n end\n\n current_literal.start_interp_brace\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 765\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 10 then\n# line 958 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 124 then\n# line 883 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 123 then\n# line 821 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 758;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 128 then\n# line 958 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 126 then\n# line 821 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 758;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 11 then\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 9 then\n# line 821 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 758;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 150 then\n# line 883 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 149 then\n# line 821 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 758;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 152 then\n# line 945 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n literal.extend_space @ts, @te\n end\n\t\tend\n\twhen 153 then\n# line 821 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 758;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 156 then\n# line 883 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 155 then\n# line 821 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 758;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 158 then\n# line 821 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 758;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 165 then\n# line 1013 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DBEG, '#{'.freeze)\n\n if current_literal.heredoc?\n current_literal.saved_herebody_s = @herebody_s\n @herebody_s = nil\n end\n\n current_literal.start_interp_brace\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 765\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 13 then\n# line 958 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 162 then\n# line 883 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 161 then\n# line 821 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 758;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 166 then\n# line 958 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 164 then\n# line 821 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 758;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 12 then\n# line 821 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 758;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 168 then\n# line 883 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 167 then\n# line 821 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 758;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 175 then\n# line 1013 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DBEG, '#{'.freeze)\n\n if current_literal.heredoc?\n current_literal.saved_herebody_s = @herebody_s\n @herebody_s = nil\n end\n\n current_literal.start_interp_brace\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 765\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 15 then\n# line 958 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 171 then\n# line 883 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 170 then\n# line 821 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 758;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 176 then\n# line 958 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n current_literal.flush_string\n current_literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 173 then\n# line 945 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n literal.extend_space @ts, @te\n end\n\t\tend\n\twhen 174 then\n# line 821 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 758;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 14 then\n# line 821 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 758;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 178 then\n# line 883 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 177 then\n# line 821 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = tok\n\n # tLABEL_END is only possible in non-cond context on >= 2.2\n if @version >= 22 && [email protected]?\n lookahead = @source_buffer.slice(@te...@te+2)\n end\n\n current_literal = literal\n if !current_literal.heredoc? &&\n (token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))\n if token[0] == :tLABEL_END\n p += 1\n pop_literal\n @cs = 758;\n else\n @cs = (pop_literal);\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n current_literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 180 then\n# line 945 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n literal.extend_space @ts, @te\n end\n\t\tend\n\twhen 181 then\n# line 1103 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tREGEXP_OPT, tok(@ts, @te - 1), @ts, @te - 1)\n p = p - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 182 then\n# line 1091 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n unknown_options = tok.scan(/[^imxouesn]/)\n if unknown_options.any?\n diagnostic :error, :regexp_options,\n { :options => unknown_options.join }\n end\n\n emit(:tREGEXP_OPT)\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 16 then\n# line 1231 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if tok =~ /^\\$([1-9][0-9]*)$/\n emit(:tNTH_REF, tok(@ts + 1).to_i)\n elsif tok =~ /^\\$([&`'+])$/\n emit(:tBACK_REF)\n else\n emit(:tGVAR)\n end\n\n @cs = (stack_pop); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 183 then\n# line 1231 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if tok =~ /^\\$([1-9][0-9]*)$/\n emit(:tNTH_REF, tok(@ts + 1).to_i)\n elsif tok =~ /^\\$([&`'+])$/\n emit(:tBACK_REF)\n else\n emit(:tGVAR)\n end\n\n @cs = (stack_pop); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 185 then\n# line 1244 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if tok =~ /^@@[0-9]/\n diagnostic :error, :cvar_name, { :name => tok }\n end\n\n emit(:tCVAR)\n @cs = (stack_pop); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 184 then\n# line 1254 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if tok =~ /^@[0-9]/\n diagnostic :error, :ivar_name, { :name => tok }\n end\n\n emit(:tIVAR)\n @cs = (stack_pop); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 206 then\n# line 1275 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(KEYWORDS_BEGIN);\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 192 then\n# line 1283 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tIDENTIFIER)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 18 then\n# line 1287 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1\n @cs = 773; \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 189 then\n# line 1296 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 201 then\n# line 1300 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; p = p - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 20 then\n# line 1306 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if version?(23)\n type, delimiter = tok[0..-2], tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n else\n p = @ts - 1\n \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 188 then\n# line 1319 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 187 then\n# line 518 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 205 then\n# line 1275 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(KEYWORDS_BEGIN);\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 202 then\n# line 1279 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tCONSTANT)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 204 then\n# line 1283 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tIDENTIFIER)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 199 then\n# line 1287 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n @cs = 773; \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 195 then\n# line 1296 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 200 then\n# line 1303 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 193 then\n# line 1316 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 198 then\n# line 1319 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 19 then\n# line 1296 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin emit_table(PUNCTUATION)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 17 then\n# line 1319 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = p - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 191 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 39 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS_BEGIN);\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 40 then\n\tbegin begin p = (( @te))-1; end\n emit(:tCONSTANT)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 41 then\n\tbegin begin p = (( @te))-1; end\n emit(:tIDENTIFIER)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 22 then\n# line 1331 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tLABEL, tok(@ts, @te - 2), @ts, @te - 1)\n p = p - 1; @cs = 758; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 208 then\n# line 1337 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 207 then\n# line 518 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 210 then\n# line 1334 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 209 then\n# line 1337 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 21 then\n# line 1337 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = p - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 216 then\n# line 1363 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 474; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 215 then\n# line 1369 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 214 then\n# line 518 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 226 then\n# line 1348 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tCONSTANT)\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 217 then\n# line 1352 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tIDENTIFIER)\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 222 then\n# line 1363 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 474; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 220 then\n# line 1366 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 225 then\n# line 1369 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 249 then\n# line 1427 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Unlike expr_beg as invoked in the next rule, do not warn\n p = @ts - 1\n \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 232 then\n# line 1445 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if tok(tm, tm + 1) == '/'.freeze\n # Ambiguous regexp literal.\n diagnostic :warning, :ambiguous_literal, nil, range(tm, tm + 1)\n end\n\n p = tm - 1\n \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 238 then\n# line 1469 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 24 then\n# line 1477 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 240 then\n# line 1486 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = tm - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 39 then\n# line 1497 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 227 then\n# line 1511 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 228 then\n# line 518 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 239 then\n# line 1436 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 235 then\n# line 1458 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :warning, :ambiguous_prefix, { :prefix => tok(tm, @te) },\n range(tm, @te)\n\n p = tm - 1\n \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 237 then\n# line 1474 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 231 then\n# line 1497 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 230 then\n# line 1502 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 248 then\n# line 1511 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 25 then\n# line 1502 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n\t\tend\n\twhen 41 then\n# line 1511 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 23 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 67 then\n\tbegin begin p = (( @te))-1; end\n\n if tok(tm, tm + 1) == '/'.freeze\n # Ambiguous regexp literal.\n diagnostic :warning, :ambiguous_literal, nil, range(tm, tm + 1)\n end\n\n p = tm - 1\n \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\twhen 68 then\n\tbegin begin p = (( @te))-1; end\n\n diagnostic :warning, :ambiguous_prefix, { :prefix => tok(tm, @te) },\n range(tm, @te)\n\n p = tm - 1\n \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\twhen 73 then\n\tbegin begin p = (( @te))-1; end\n\n p = @ts - 1\n \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\telse\n\tbegin begin p = (( @te))-1; end\nend\nend \n\t\t\tend\n\twhen 43 then\n# line 1547 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1\n \tbegin\n\t\t @cs = 474\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 253 then\n# line 518 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 254 then\n# line 1547 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 474\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 44 then\n# line 1547 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = @ts - 1\n \tbegin\n\t\t @cs = 474\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 42 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 80 then\n\tbegin begin p = (( @te))-1; end\n\n if @cond.active?\n emit(:kDO_COND, 'do'.freeze, @te - 2, @te)\n else\n emit(:kDO, 'do'.freeze, @te - 2, @te)\n end\n @cs = 765; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 81 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1\n \tbegin\n\t\t @cs = 474\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 264 then\n# line 1581 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_do(true)\n @cs = 765; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 257 then\n# line 1587 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 258 then\n# line 518 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 259 then\n# line 1584 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 262 then\n# line 1587 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 268 then\n# line 1611 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 267 then\n# line 518 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 276 then\n# line 1603 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 270 then\n# line 1605 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 274 then\n# line 1611 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 269 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 88 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 89 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 53 then\n# line 1626 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1; @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 305 then\n# line 1643 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type = delimiter = tok[0].chr\n p = p - 1; \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 299 then\n# line 1650 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type, delimiter = @source_buffer.slice(@ts).chr, tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 51 then\n# line 1657 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type, delimiter = tok[0..-2], tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 306 then\n# line 1703 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type, delimiter = tok, tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 65 then\n# line 1717 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tSYMBOL, tok(@ts + 1), @ts)\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 320 then\n# line 1748 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n escape = { \" \" => '\\s', \"\\r\" => '\\r', \"\\n\" => '\\n', \"\\t\" => '\\t',\n \"\\v\" => '\\v', \"\\f\" => '\\f' }[@source_buffer.slice(@ts + 1)]\n diagnostic :warning, :invalid_escape_use, { :escape => escape }, range\n\n p = @ts - 1\n \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 319 then\n# line 1758 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n diagnostic :fatal, :incomplete_escape, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 307 then\n# line 1797 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION_BEGIN)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 48 then\n# line 1817 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = p - 1;\n\n if version?(18)\n ident = tok(@ts, @te - 2)\n\n emit((@source_buffer.slice(@ts) =~ /[A-Z]/) ? :tCONSTANT : :tIDENTIFIER,\n ident, @ts, @te - 2)\n p = p - 1; # continue as a symbol\n\n if !@static_env.nil? && @static_env.declared?(ident)\n @cs = 773;\n else\n @cs = (arg_or_cmdarg);\n end\n else\n emit(:tLABEL, tok(@ts, @te - 2), @ts, @te - 1)\n @cs = 758;\n end\n\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 293 then\n# line 1863 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1\n \tbegin\n\t\t @cs = 171\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 52 then\n# line 1876 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 279 then\n# line 518 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 304 then\n# line 1626 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1; @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 303 then\n# line 1633 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tSTAR, '*'.freeze)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 300 then\n# line 1657 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n type, delimiter = tok[0..-2], tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 298 then\n# line 1663 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :fatal, :string_eof, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 308 then\n# line 1717 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1), @ts)\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 318 then\n# line 1758 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :fatal, :incomplete_escape, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 324 then\n# line 1764 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 301 then\n# line 1797 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION_BEGIN)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 346 then\n# line 1216 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 290 then\n# line 1860 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 292 then\n# line 1863 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 171\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 295 then\n# line 1876 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 50 then\n# line 1663 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n diagnostic :fatal, :string_eof, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 68 then\n# line 1731 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n if defined?(Encoding)\n emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)\n else\n emit(:tINTEGER, value[0].ord)\n end\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 49 then\n# line 1860 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n\t\tend\n\twhen 64 then\n# line 1876 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = @ts - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 47 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 94 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1; @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 111 then\n\tbegin begin p = (( @te))-1; end\n emit_table(PUNCTUATION_BEGIN)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 112 then\n\tbegin begin p = (( @te))-1; end\n emit(:kRESCUE, 'rescue'.freeze, @ts, tm)\n p = tm - 1\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 113 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS_BEGIN)\n @cs = 765; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 115 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1\n \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\twhen 116 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 119 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 354 then\n# line 1896 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 355 then\n# line 518 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 356 then\n# line 1884 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 360 then\n# line 1896 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 71 then\n# line 1906 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1\n \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 364 then\n# line 1911 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n \tbegin\n\t\t @cs = (push_literal(tok, tok, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 363 then\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 362 then\n# line 518 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 366 then\n# line 1915 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 365 then\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 70 then\n# line 1921 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = p - 1; \tbegin\n\t\t @cs = 543\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 396 then\n# line 1932 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tLAMBDA, '->'.freeze, @ts, @ts + 2)\n\n @lambda_stack.push @paren_nest\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 78 then\n# line 1969 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:kCLASS, 'class'.freeze, @ts, @ts + 5)\n emit(:tLSHFT, '<<'.freeze, @te - 2, @te)\n @cs = 765; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 374 then\n# line 2104 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type, delimiter = tok, tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts, nil, false, false, true))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 73 then\n# line 2122 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1; \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 393 then\n# line 2129 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 453; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 387 then\n# line 2156 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 380 then\n# line 2160 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit_table(PUNCTUATION)\n @cond.lexpop; @cmdarg.lexpop\n\n if RBRACE_OR_RBRACK.include?(tok)\n @cs = 511;\n else # )\n # fnext expr_endfn; ?\n end\n\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 392 then\n# line 2174 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tOP_ASGN, tok(@ts, @te - 1))\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 378 then\n# line 2178 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tEH, '?'.freeze)\n @cs = 765; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 375 then\n# line 2186 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 377 then\n# line 2199 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tSEMI, ';'.freeze)\n @cs = 765; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 442 then\n# line 2202 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n diagnostic :error, :bare_backslash, nil, range(@ts, @ts + 1)\n p = p - 1;\n end\n\t\tend\n\twhen 373 then\n# line 2208 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n diagnostic :fatal, :unexpected, { :character => tok.inspect[1..-2] }\n end\n\t\tend\n\twhen 372 then\n# line 518 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 452 then\n# line 1965 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(KEYWORDS)\n @cs = 333; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 450 then\n# line 1969 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:kCLASS, 'class'.freeze, @ts, @ts + 5)\n emit(:tLSHFT, '<<'.freeze, @te - 2, @te)\n @cs = 765; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 449 then\n# line 1980 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(KEYWORDS)\n @cs = 765; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 399 then\n# line 2054 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :error, :no_dot_digit_literal\n end\n\t\tend\n\twhen 439 then\n# line 2114 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tCONSTANT)\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 391 then\n# line 2122 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1; \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 328\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 397 then\n# line 2129 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 453; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 444 then\n# line 1216 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 386 then\n# line 2156 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 398 then\n# line 2186 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 384 then\n# line 2193 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 390 then\n# line 2208 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :fatal, :unexpected, { :character => tok.inspect[1..-2] }\n end\n\t\tend\n\twhen 74 then\n# line 2054 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n diagnostic :error, :no_dot_digit_literal\n end\n\t\tend\n\twhen 72 then\n# line 2208 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n diagnostic :fatal, :unexpected, { :character => tok.inspect[1..-2] }\n end\n\t\tend\n\twhen 75 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 132 then\n\tbegin begin p = (( @te))-1; end\n\n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n\n if tok == '{'.freeze\n emit(:tLAMBEG, '{'.freeze)\n else # 'do'\n emit(:kDO_LAMBDA, 'do'.freeze)\n end\n else\n if tok == '{'.freeze\n emit(:tLCURLY, '{'.freeze)\n else # 'do'\n emit_do\n end\n end\n\n @cs = 765; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 133 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 333; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 134 then\n\tbegin begin p = (( @te))-1; end\n emit(:kCLASS, 'class'.freeze, @ts, @ts + 5)\n emit(:tLSHFT, '<<'.freeze, @te - 2, @te)\n @cs = 765; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 135 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 136 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 765; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 137 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 138 then\n\tbegin begin p = (( @te))-1; end\n\n emit_table(KEYWORDS)\n\n if version?(18) && tok == 'not'.freeze\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = 474; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 139 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18)\n emit(:tIDENTIFIER)\n\n unless !@static_env.nil? && @static_env.declared?(tok)\n @cs = (arg_or_cmdarg);\n end\n else\n emit(:k__ENCODING__, '__ENCODING__'.freeze)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 140 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 141 then\n\tbegin begin p = (( @te))-1; end\n\n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 143 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18, 19, 20)\n diagnostic :error,\n :trailing_in_number, { :character => tok(@te - 1, @te) },\n range(@te - 1, @te)\n else\n emit(:tINTEGER, tok(@ts, @te - 1).to_i, @ts, @te - 1)\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 144 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18, 19, 20)\n diagnostic :error,\n :trailing_in_number, { :character => tok(@te - 1, @te) },\n range(@te - 1, @te)\n else\n emit(:tFLOAT, tok(@ts, @te - 1).to_f, @ts, @te - 1)\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 145 then\n\tbegin begin p = (( @te))-1; end\n\n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 147 then\n\tbegin begin p = (( @te))-1; end\n emit(:tCONSTANT)\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 151 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 152 then\n\tbegin begin p = (( @te))-1; end\n\n if tm == @te\n # Suffix was consumed, e.g. foo!\n emit(:tFID)\n else\n # Suffix was not consumed, e.g. foo!=\n emit(:tIDENTIFIER, tok(@ts, tm), @ts, tm)\n p = tm - 1\n end\n @cs = 474; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\nend \n\t\t\tend\n\twhen 82 then\n# line 2220 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = tm - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 457 then\n# line 2223 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tNL, nil, @newline_s, @newline_s + 1)\n p = p - 1; @cs = 171; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 458 then\n# line 2223 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tNL, nil, @newline_s, @newline_s + 1)\n p = p - 1; @cs = 171; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 79 then\n# line 2223 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin emit(:tNL, nil, @newline_s, @newline_s + 1)\n p = p - 1; @cs = 171; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 461 then\n# line 2233 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit_comment(@eq_begin_s, @te)\n \tbegin\n\t\t @cs = 171\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 460 then\n# line 2241 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :fatal, :embedded_document, nil,\n range(@eq_begin_s, @eq_begin_s + '=begin'.length)\n end\n\t\tend\n\twhen 93 then\n# line 2251 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin @eq_begin_s = @ts\n \tbegin\n\t\t @cs = 949\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 2 then\n# line 2255 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = pe - 3 end\n\t\tend\n\twhen 85 then\n# line 2258 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 765\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 86 then\n# line 518 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 87 then\n# line 2248 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 92 then\n# line 2251 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin @eq_begin_s = @ts\n \tbegin\n\t\t @cs = 949\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 91 then\n# line 2258 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 765\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 1 then\n# line 2258 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = p - 1; \tbegin\n\t\t @cs = 765\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 63 then\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n\twhen 97 then\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 883 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 125 then\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 883 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 151 then\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 883 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 157 then\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 883 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 163 then\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 883 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 169 then\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 883 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 172 then\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 883 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 179 then\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 883 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n\twhen 250 then\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1427 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Unlike expr_beg as invoked in the next rule, do not warn\n p = @ts - 1\n \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 241 then\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1486 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = tm - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 233 then\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1497 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 321 then\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1748 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n escape = { \" \" => '\\s', \"\\r\" => '\\r', \"\\n\" => '\\n', \"\\t\" => '\\t',\n \"\\v\" => '\\v', \"\\f\" => '\\f' }[@source_buffer.slice(@ts + 1)]\n diagnostic :warning, :invalid_escape_use, { :escape => escape }, range\n\n p = @ts - 1\n \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 294 then\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1863 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1\n \tbegin\n\t\t @cs = 171\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 462 then\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2233 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit_comment(@eq_begin_s, @te)\n \tbegin\n\t\t @cs = 171\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 459 then\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2238 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n\t\tend\n\twhen 94 then\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2251 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin @eq_begin_s = @ts\n \tbegin\n\t\t @cs = 949\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 3 then\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2255 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = pe - 3 end\n\t\tend\n\twhen 416 then\n# line 626 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tRATIONAL, Rational(chars)) } \t\tend\n# line 2027 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 415 then\n# line 627 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tIMAGINARY, Complex(0, chars)) } \t\tend\n# line 2027 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 417 then\n# line 628 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tIMAGINARY, Complex(0, Rational(chars))) } \t\tend\n# line 2027 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 410 then\n# line 632 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tIMAGINARY, Complex(0, Float(chars))) } \t\tend\n# line 2086 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 411 then\n# line 636 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tRATIONAL, Rational(chars)) } \t\tend\n# line 2086 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 412 then\n# line 637 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tIMAGINARY, Complex(0, Rational(chars))) } \t\tend\n# line 2086 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 120 then\n# line 652 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = \"\"\n\n codepoints = tok(@escape_s + 2, p - 1)\n codepoint_s = @escape_s + 2\n\n codepoints.split(/[ \\t]/).each do |codepoint_str|\n codepoint = codepoint_str.to_i(16)\n\n if codepoint >= 0x110000\n diagnostic :error, :unicode_point_too_large, nil,\n range(codepoint_s, codepoint_s + codepoint_str.length)\n break\n end\n\n @escape += codepoint.chr(Encoding::UTF_8)\n codepoint_s += codepoint_str.length + 1\n end\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 146 then\n# line 652 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = \"\"\n\n codepoints = tok(@escape_s + 2, p - 1)\n codepoint_s = @escape_s + 2\n\n codepoints.split(/[ \\t]/).each do |codepoint_str|\n codepoint = codepoint_str.to_i(16)\n\n if codepoint >= 0x110000\n diagnostic :error, :unicode_point_too_large, nil,\n range(codepoint_s, codepoint_s + codepoint_str.length)\n break\n end\n\n @escape += codepoint.chr(Encoding::UTF_8)\n codepoint_s += codepoint_str.length + 1\n end\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 342 then\n# line 652 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = \"\"\n\n codepoints = tok(@escape_s + 2, p - 1)\n codepoint_s = @escape_s + 2\n\n codepoints.split(/[ \\t]/).each do |codepoint_str|\n codepoint = codepoint_str.to_i(16)\n\n if codepoint >= 0x110000\n diagnostic :error, :unicode_point_too_large, nil,\n range(codepoint_s, codepoint_s + codepoint_str.length)\n break\n end\n\n @escape += codepoint.chr(Encoding::UTF_8)\n codepoint_s += codepoint_str.length + 1\n end\n \t\tend\n# line 1731 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n if defined?(Encoding)\n emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)\n else\n emit(:tINTEGER, value[0].ord)\n end\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 104 then\n# line 672 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 130 then\n# line 672 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 326 then\n# line 672 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 1731 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n if defined?(Encoding)\n emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)\n else\n emit(:tINTEGER, value[0].ord)\n end\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 107 then\n# line 679 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_escape\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 133 then\n# line 679 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_escape\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 329 then\n# line 679 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_escape\n \t\tend\n# line 1731 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n if defined?(Encoding)\n emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)\n else\n emit(:tINTEGER, value[0].ord)\n end\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 109 then\n# line 698 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 135 then\n# line 698 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 331 then\n# line 698 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 1731 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n if defined?(Encoding)\n emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)\n else\n emit(:tINTEGER, value[0].ord)\n end\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 106 then\n# line 705 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s, p).to_i(8) % 0x100) \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 132 then\n# line 705 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s, p).to_i(8) % 0x100) \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 328 then\n# line 705 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s, p).to_i(8) % 0x100) \t\tend\n# line 1731 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n if defined?(Encoding)\n emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)\n else\n emit(:tINTEGER, value[0].ord)\n end\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 122 then\n# line 709 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s + 1, p).to_i(16)) \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 148 then\n# line 709 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s + 1, p).to_i(16)) \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 344 then\n# line 709 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s + 1, p).to_i(16)) \t\tend\n# line 1731 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n if defined?(Encoding)\n emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)\n else\n emit(:tINTEGER, value[0].ord)\n end\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 117 then\n# line 713 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = tok(@escape_s + 1, p).to_i(16).chr(Encoding::UTF_8) \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 143 then\n# line 713 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = tok(@escape_s + 1, p).to_i(16).chr(Encoding::UTF_8) \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 339 then\n# line 713 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = tok(@escape_s + 1, p).to_i(16).chr(Encoding::UTF_8) \t\tend\n# line 1731 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n if defined?(Encoding)\n emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)\n else\n emit(:tINTEGER, value[0].ord)\n end\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 121 then\n# line 717 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_hex_escape, nil, range(@escape_s - 1, p + 2)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 147 then\n# line 717 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_hex_escape, nil, range(@escape_s - 1, p + 2)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 343 then\n# line 717 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_hex_escape, nil, range(@escape_s - 1, p + 2)\n \t\tend\n# line 1731 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n if defined?(Encoding)\n emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)\n else\n emit(:tINTEGER, value[0].ord)\n end\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 116 then\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 142 then\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 338 then\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 1731 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n if defined?(Encoding)\n emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)\n else\n emit(:tINTEGER, value[0].ord)\n end\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 119 then\n# line 740 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 145 then\n# line 740 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 341 then\n# line 740 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 1731 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n if defined?(Encoding)\n emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)\n else\n emit(:tINTEGER, value[0].ord)\n end\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 105 then\n# line 766 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 131 then\n# line 766 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 327 then\n# line 766 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 1731 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n if defined?(Encoding)\n emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)\n else\n emit(:tINTEGER, value[0].ord)\n end\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 154 then\n# line 772 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 159 then\n# line 772 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 54 then\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 30 then\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1441 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 32 then\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1457 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 34 then\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1485 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 194 then\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1316 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 213 then\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1334 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 221 then\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1366 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 33 then\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1497 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 252 then\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1502 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 244 then\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1508 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 263 then\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1584 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 275 then\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1605 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 271 then\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1608 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 55 then\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1626 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1; @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 291 then\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1860 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 361 then\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1884 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 357 then\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1887 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @in_kwarg\n p = p - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n else\n \tbegin\n\t\t @cs = 171\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 370 then\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1915 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 367 then\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1918 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \tbegin\n\t\t @cs = 171\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 443 then\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2193 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 385 then\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2196 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \tbegin\n\t\t @cs = 946\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 88 then\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2248 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 243 then\n# line 983 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n current_literal = literal\n if current_literal\n current_literal.start_interp_brace\n end\n \t\tend\n# line 1410 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @lambda_stack.last == @paren_nest\n p = @ts - 1\n \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n else\n emit(:tLCURLY, '{'.freeze, @te - 1, @te)\n @cs = 765; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 265 then\n# line 983 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n current_literal = literal\n if current_literal\n current_literal.start_interp_brace\n end\n \t\tend\n# line 1570 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n emit(:tLAMBEG, '{'.freeze)\n else\n emit(:tLBRACE_ARG, '{'.freeze)\n end\n @cs = 765;\n end\n\t\tend\n\twhen 353 then\n# line 983 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n current_literal = literal\n if current_literal\n current_literal.start_interp_brace\n end\n \t\tend\n# line 1775 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n emit(:tLAMBEG, '{'.freeze)\n else\n emit(:tLBRACE, '{'.freeze)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 455 then\n# line 983 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n current_literal = literal\n if current_literal\n current_literal.start_interp_brace\n end\n \t\tend\n# line 1940 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n\n if tok == '{'.freeze\n emit(:tLAMBEG, '{'.freeze)\n else # 'do'\n emit(:kDO_LAMBDA, 'do'.freeze)\n end\n else\n if tok == '{'.freeze\n emit(:tLCURLY, '{'.freeze)\n else # 'do'\n emit_do\n end\n end\n\n @cs = 765; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 456 then\n# line 992 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n current_literal = literal\n if current_literal\n if current_literal.end_interp_brace_and_try_closing\n if version?(18, 19)\n emit(:tRCURLY, '}'.freeze, p - 1, p)\n else\n emit(:tSTRING_DEND, '}'.freeze, p - 1, p)\n end\n\n if current_literal.saved_herebody_s\n @herebody_s = current_literal.saved_herebody_s\n end\n\n p = p - 1;\n @cs = (stack_pop);\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n \t\tend\n# line 2160 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit_table(PUNCTUATION)\n @cond.lexpop; @cmdarg.lexpop\n\n if RBRACE_OR_RBRACK.include?(tok)\n @cs = 511;\n else # )\n # fnext expr_endfn; ?\n end\n\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 57 then\n# line 1128 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n\twhen 61 then\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 197 then\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1316 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 212 then\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1334 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 224 then\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1366 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 246 then\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1505 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 261 then\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1584 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 273 then\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1605 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 297 then\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1860 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 359 then\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1884 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 369 then\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1915 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 389 then\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2193 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 90 then\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2248 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 218 then\n# line 1172 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1356 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tFID, tok(@ts, tm), @ts, tm)\n @cs = (arg_or_cmdarg); p = tm - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 309 then\n# line 1172 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1709 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 282 then\n# line 1172 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1848 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 382 then\n# line 1172 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 132 then\n\tbegin begin p = (( @te))-1; end\n\n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n\n if tok == '{'.freeze\n emit(:tLAMBEG, '{'.freeze)\n else # 'do'\n emit(:kDO_LAMBDA, 'do'.freeze)\n end\n else\n if tok == '{'.freeze\n emit(:tLCURLY, '{'.freeze)\n else # 'do'\n emit_do\n end\n end\n\n @cs = 765; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 133 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 333; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 134 then\n\tbegin begin p = (( @te))-1; end\n emit(:kCLASS, 'class'.freeze, @ts, @ts + 5)\n emit(:tLSHFT, '<<'.freeze, @te - 2, @te)\n @cs = 765; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 135 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 136 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 765; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 137 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 138 then\n\tbegin begin p = (( @te))-1; end\n\n emit_table(KEYWORDS)\n\n if version?(18) && tok == 'not'.freeze\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = 474; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 139 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18)\n emit(:tIDENTIFIER)\n\n unless !@static_env.nil? && @static_env.declared?(tok)\n @cs = (arg_or_cmdarg);\n end\n else\n emit(:k__ENCODING__, '__ENCODING__'.freeze)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 140 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 141 then\n\tbegin begin p = (( @te))-1; end\n\n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 143 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18, 19, 20)\n diagnostic :error,\n :trailing_in_number, { :character => tok(@te - 1, @te) },\n range(@te - 1, @te)\n else\n emit(:tINTEGER, tok(@ts, @te - 1).to_i, @ts, @te - 1)\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 144 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18, 19, 20)\n diagnostic :error,\n :trailing_in_number, { :character => tok(@te - 1, @te) },\n range(@te - 1, @te)\n else\n emit(:tFLOAT, tok(@ts, @te - 1).to_f, @ts, @te - 1)\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 145 then\n\tbegin begin p = (( @te))-1; end\n\n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 147 then\n\tbegin begin p = (( @te))-1; end\n emit(:tCONSTANT)\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 151 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 152 then\n\tbegin begin p = (( @te))-1; end\n\n if tm == @te\n # Suffix was consumed, e.g. foo!\n emit(:tFID)\n else\n # Suffix was not consumed, e.g. foo!=\n emit(:tIDENTIFIER, tok(@ts, tm), @ts, tm)\n p = tm - 1\n end\n @cs = 474; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\nend \n\t\t\tend\n\twhen 219 then\n# line 1173 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1356 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tFID, tok(@ts, tm), @ts, tm)\n @cs = (arg_or_cmdarg); p = tm - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 310 then\n# line 1173 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1709 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 284 then\n# line 1173 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1848 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 383 then\n# line 1173 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 2136 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if tm == @te\n # Suffix was consumed, e.g. foo!\n emit(:tFID)\n else\n # Suffix was not consumed, e.g. foo!=\n emit(:tIDENTIFIER, tok(@ts, tm), @ts, tm)\n p = tm - 1\n end\n @cs = 474; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 311 then\n# line 1178 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1709 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 285 then\n# line 1178 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1848 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 312 then\n# line 1179 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1709 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 286 then\n# line 1179 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1848 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 316 then\n# line 1180 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1709 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 289 then\n# line 1180 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1848 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 315 then\n# line 1181 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1709 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 288 then\n# line 1181 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 94 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)\n p = p - 1; @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 111 then\n\tbegin begin p = (( @te))-1; end\n emit_table(PUNCTUATION_BEGIN)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 112 then\n\tbegin begin p = (( @te))-1; end\n emit(:kRESCUE, 'rescue'.freeze, @ts, tm)\n p = tm - 1\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 113 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS_BEGIN)\n @cs = 765; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 115 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1\n \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\twhen 116 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 446; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 119 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 313 then\n# line 1182 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 3 \t\tend\n# line 1709 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 287 then\n# line 1182 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 3 \t\tend\n# line 1848 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 314 then\n# line 1187 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1709 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 438 then\n# line 1192 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 2118 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tCONSTANT, tok(@ts, tm), @ts, tm)\n p = tm - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 242 then\n# line 1198 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n \t\tend\n# line 1404 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tLBRACK, '['.freeze, @te - 1, @te)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 345 then\n# line 1198 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n \t\tend\n# line 1787 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tLBRACK, '['.freeze)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 441 then\n# line 1198 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n \t\tend\n# line 2182 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tLBRACK2, '['.freeze)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 234 then\n# line 1205 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n \t\tend\n# line 1385 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if version?(18)\n emit(:tLPAREN2, '('.freeze, @te - 1, @te)\n @cs = 765; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n emit(:tLPAREN_ARG, '('.freeze, @te - 1, @te)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 247 then\n# line 1205 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n \t\tend\n# line 1398 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tLPAREN2, '('.freeze)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 255 then\n# line 1205 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n \t\tend\n# line 1524 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tLPAREN_ARG, '('.freeze, @te - 1, @te)\n if version?(18)\n @cs = 765; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 302 then\n# line 1205 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n \t\tend\n# line 1792 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tLPAREN, '('.freeze)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 394 then\n# line 1205 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n \t\tend\n# line 2156 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 395 then\n# line 1211 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @paren_nest -= 1\n \t\tend\n# line 2160 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit_table(PUNCTUATION)\n @cond.lexpop; @cmdarg.lexpop\n\n if RBRACE_OR_RBRACK.include?(tok)\n @cs = 511;\n else # )\n # fnext expr_endfn; ?\n end\n\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 67 then\n# line 1675 \"lib/parser/lexer.rl\"\n\t\tbegin\n heredoc_e = p \t\tend\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 317 then\n# line 1676 \"lib/parser/lexer.rl\"\n\t\tbegin\n new_herebody_s = p \t\tend\n# line 1677 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n tok(@ts, heredoc_e) =~ /^<<(-?)(~?)([\"'`]?)(.*)\\3$/\n\n indent = !$1.empty? || !$2.empty?\n dedent_body = !$2.empty?\n type = $3.empty? ? '<<\"'.freeze : ('<<'.freeze + $3)\n delimiter = $4\n\n if dedent_body && version?(18, 19, 20, 21, 22)\n emit(:tLSHFT, '<<'.freeze, @ts, @ts + 2)\n p = @ts + 1\n @cs = 543; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (push_literal(type, delimiter, @ts, heredoc_e, indent, dedent_body));\n\n @herebody_s ||= new_herebody_s\n p = @herebody_s - 1\n end\n end\n\t\tend\n\twhen 322 then\n# line 1729 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = nil \t\tend\n# line 1731 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n if defined?(Encoding)\n emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)\n else\n emit(:tINTEGER, value[0].ord)\n end\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 349 then\n# line 1802 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1803 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:kRESCUE, 'rescue'.freeze, @ts, tm)\n p = tm - 1\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 429 then\n# line 2020 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 16; @num_digits_s = p \t\tend\n# line 2026 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 423 then\n# line 2021 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = p \t\tend\n# line 2026 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 426 then\n# line 2022 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = p \t\tend\n# line 2026 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 420 then\n# line 2023 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 2; @num_digits_s = p \t\tend\n# line 2026 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 435 then\n# line 2024 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 2026 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 404 then\n# line 2025 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n# line 2026 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 436 then\n# line 2026 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 625 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n\twhen 81 then\n# line 2219 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 2220 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = tm - 1; \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 8 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 203 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1275 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 39;\t\tend\n\twhen 190 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1279 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 40;\t\tend\n\twhen 186 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1283 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 41;\t\tend\n\twhen 26 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1445 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 67;\t\tend\n\twhen 236 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1458 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 68;\t\tend\n\twhen 27 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1497 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 73;\t\tend\n\twhen 229 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1502 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 74;\t\tend\n\twhen 256 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1534 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 80;\t\tend\n\twhen 45 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1547 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 81;\t\tend\n\twhen 277 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1599 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 88;\t\tend\n\twhen 266 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1603 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 89;\t\tend\n\twhen 280 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1797 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 111;\t\tend\n\twhen 348 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1803 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 112;\t\tend\n\twhen 347 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1809 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 113;\t\tend\n\twhen 69 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1848 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 115;\t\tend\n\twhen 278 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1216 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 116;\t\tend\n\twhen 281 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1876 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 119;\t\tend\n\twhen 451 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1940 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 132;\t\tend\n\twhen 446 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1965 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 133;\t\tend\n\twhen 454 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1975 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 135;\t\tend\n\twhen 447 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1980 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 136;\t\tend\n\twhen 448 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1984 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 137;\t\tend\n\twhen 453 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1988 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 138;\t\tend\n\twhen 445 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1999 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 139;\t\tend\n\twhen 440 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2013 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 140;\t\tend\n\twhen 376 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2027 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 141;\t\tend\n\twhen 406 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2071 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 144;\t\tend\n\twhen 76 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2086 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 145;\t\tend\n\twhen 379 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2114 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 147;\t\tend\n\twhen 371 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1216 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 151;\t\tend\n\twhen 381 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2136 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 152;\t\tend\n\twhen 160 then\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 883 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n current_literal = literal\n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(current_literal.str_s, current_literal.str_s + 1)\n end\n\n if current_literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, ''.freeze)\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, ''.freeze)\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if current_literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = current_literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Calculate indentation level for <<~HEREDOCs.\n current_literal.infer_indent_level(line)\n\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if current_literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n1\\n2\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if current_literal.words? && !eof_codepoint?(@source_pts[p])\n current_literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n current_literal.extend_string tok, @ts, @te\n current_literal.flush_string\n end\n end\n\t\tend\n# line 772 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n\twhen 110 then\n# line 672 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 683 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 136 then\n# line 672 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 683 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 332 then\n# line 672 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 683 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 1731 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n if defined?(Encoding)\n emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)\n else\n emit(:tINTEGER, value[0].ord)\n end\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 115 then\n# line 672 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 687 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 141 then\n# line 672 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 687 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 337 then\n# line 672 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 687 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1731 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n if defined?(Encoding)\n emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)\n else\n emit(:tINTEGER, value[0].ord)\n end\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 114 then\n# line 693 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source_buffer.slice(p - 1).chr \t\tend\n# line 687 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 140 then\n# line 693 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source_buffer.slice(p - 1).chr \t\tend\n# line 687 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 336 then\n# line 693 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source_buffer.slice(p - 1).chr \t\tend\n# line 687 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1731 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n if defined?(Encoding)\n emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)\n else\n emit(:tINTEGER, value[0].ord)\n end\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 112 then\n# line 698 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 687 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 138 then\n# line 698 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 687 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 334 then\n# line 698 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 687 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1731 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n if defined?(Encoding)\n emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)\n else\n emit(:tINTEGER, value[0].ord)\n end\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 108 then\n# line 699 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source_buffer.slice(p - 1).chr \t\tend\n# line 683 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 134 then\n# line 699 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source_buffer.slice(p - 1).chr \t\tend\n# line 683 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 330 then\n# line 699 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source_buffer.slice(p - 1).chr \t\tend\n# line 683 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 1731 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n if defined?(Encoding)\n emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)\n else\n emit(:tINTEGER, value[0].ord)\n end\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 118 then\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 740 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 144 then\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 740 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 340 then\n# line 729 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)\n \t\tend\n# line 740 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)\n \t\tend\n# line 1731 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n if defined?(Encoding)\n emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)\n else\n emit(:tINTEGER, value[0].ord)\n end\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 102 then\n# line 772 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 766 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 129 then\n# line 772 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 766 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 325 then\n# line 772 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 766 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 1731 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n if defined?(Encoding)\n emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)\n else\n emit(:tINTEGER, value[0].ord)\n end\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 58 then\n# line 1128 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 196 then\n# line 1128 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1316 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 211 then\n# line 1128 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1334 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 223 then\n# line 1128 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1366 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 245 then\n# line 1128 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1505 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \tbegin\n\t\t @cs = 773\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 260 then\n# line 1128 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1584 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 272 then\n# line 1128 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1605 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 296 then\n# line 1128 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1860 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 358 then\n# line 1128 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1884 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 368 then\n# line 1128 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1915 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 388 then\n# line 1128 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2193 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 89 then\n# line 1128 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2248 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 431 then\n# line 2024 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 2026 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 625 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n\twhen 401 then\n# line 2025 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n# line 2026 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 625 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n\twhen 413 then\n# line 2026 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 625 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2027 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 408 then\n# line 2083 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 631 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tFLOAT, Float(chars)) } \t\tend\n# line 2086 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 405 then\n# line 2084 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 631 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tFLOAT, Float(chars)) } \t\tend\n# line 2086 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 251 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 492 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1502 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 74;\t\tend\n\twhen 35 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1497 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 73;\t\tend\n\twhen 46 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1547 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 81;\t\tend\n\twhen 62 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1626 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 94;\t\tend\n\twhen 77 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1969 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 134;\t\tend\n\twhen 37 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1457 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1458 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 68;\t\tend\n\twhen 351 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1802 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1848 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 115;\t\tend\n\twhen 350 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1802 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1216 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 116;\t\tend\n\twhen 432 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2024 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 2027 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 141;\t\tend\n\twhen 113 then\n# line 672 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 683 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 687 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 139 then\n# line 672 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 683 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 687 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 335 then\n# line 672 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n codepoint = @source_pts[p - 1]\n if (@escape = ESCAPES[codepoint]).nil?\n @escape = encode_escape(@source_buffer.slice(p - 1))\n end\n \t\tend\n# line 683 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 687 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1731 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n if defined?(Encoding)\n emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)\n else\n emit(:tINTEGER, value[0].ord)\n end\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 111 then\n# line 699 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source_buffer.slice(p - 1).chr \t\tend\n# line 683 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 687 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 137 then\n# line 699 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source_buffer.slice(p - 1).chr \t\tend\n# line 683 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 687 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n current_literal = literal\n # Get the first character after the backslash.\n escaped_char = @source_buffer.slice(@escape_s).chr\n\n if current_literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)\n # Regular expressions should include escaped delimiters in their\n # escaped form, except when the escaped character is\n # a closing delimiter but not a regexp metacharacter.\n #\n # The backslash itself cannot be used as a closing delimiter\n # at the same time as an escape symbol, but it is always munged,\n # so this branch also executes for the non-closing-delimiter case\n # for the backslash.\n current_literal.extend_string(tok, @ts, @te)\n else\n current_literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n if current_literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n current_literal.extend_string(tok.gsub(\"\\\\\\n\".freeze, ''.freeze), @ts, @te)\n else\n current_literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n\t\tend\n\twhen 333 then\n# line 699 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source_buffer.slice(p - 1).chr \t\tend\n# line 683 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 687 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1731 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n value = @escape || tok(@ts + 1)\n\n if version?(18)\n if defined?(Encoding)\n emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)\n else\n emit(:tINTEGER, value[0].ord)\n end\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 773; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 427 then\n# line 2020 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 16; @num_digits_s = p \t\tend\n# line 2026 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 625 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2027 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 421 then\n# line 2021 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = p \t\tend\n# line 2026 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 625 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2027 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 424 then\n# line 2022 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = p \t\tend\n# line 2026 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 625 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2027 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 418 then\n# line 2023 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 2; @num_digits_s = p \t\tend\n# line 2026 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 625 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2027 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 430 then\n# line 2024 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 2026 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 625 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2027 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 400 then\n# line 2025 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n# line 2026 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 625 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2027 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'.freeze\n diagnostic :error, :trailing_in_number, { :character => '_'.freeze },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = '0'.freeze\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 31 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 812 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1457 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1458 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 68;\t\tend\n\twhen 59 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1128 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1131 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1626 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 94;\t\tend\n\twhen 437 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2026 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 625 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2059 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 143;\t\tend\n\twhen 433 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2024 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 2026 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 625 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2059 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 143;\t\tend\n\twhen 403 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2025 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n# line 2026 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 625 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } \t\tend\n# line 2059 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 143;\t\tend\n# line 21651 \"lib/parser/lexer.rb\"\n\tend\n\tend\n\tend\n\tif _goto_level <= _again\n\tcase _lex_to_state_actions[ @cs] \n\twhen 83 then\n# line 1 \"NONE\"\n\t\tbegin\n @ts = nil;\t\tend\n# line 21661 \"lib/parser/lexer.rb\"\n\tend\n\n\tif @cs == 0\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\tp += 1\n\tif p != pe\n\t\t_goto_level = _resume\n\t\tnext\n\tend\n\tend\n\tif _goto_level <= _test_eof\n\tif p == eof\n\tif _lex_eof_trans[ @cs] > 0\n\t\t_trans = _lex_eof_trans[ @cs] - 1;\n\t\t_goto_level = _eof_trans\n\t\tnext;\n\tend\n\tend\n\n\tend\n\tif _goto_level <= _out\n\t\tbreak\n\tend\nend\n\tend\n\n# line 282 \"lib/parser/lexer.rl\"\n # %\n\n @p = p\n\n if @token_queue.any?\n @token_queue.shift\n elsif @cs == klass.lex_error\n [ false, [ '$error'.freeze, range(p - 1, p) ] ]\n else\n eof = @source_pts.size\n [ false, [ '$eof'.freeze, range(eof, eof) ] ]\n end\n end", "def lookahead(input: $input)\n $lookahead = input.getc\nend", "def lookahead(input: $input)\n $lookahead = input.getc\nend", "def rbrack!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 14 )\n\n type = RBRACK\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 135:10: ']'\n match( 0x5d )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 14 )\n\n end", "def rewrite_tree_element\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 36)\n return_value = RewriteTreeElementReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n rewrite_tree_atom156 = nil\n rewrite_tree_atom157 = nil\n ebnf_suffix158 = nil\n rewrite_tree159 = nil\n ebnf_suffix160 = nil\n rewrite_tree_ebnf161 = nil\n\n stream_rewrite_tree = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule rewrite_tree\")\n stream_rewrite_tree_atom = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule rewrite_tree_atom\")\n stream_ebnf_suffix = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule ebnf_suffix\")\n begin\n # at line 375:2: ( rewrite_tree_atom | rewrite_tree_atom ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] rewrite_tree_atom EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | rewrite_tree ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] rewrite_tree EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> rewrite_tree ) | rewrite_tree_ebnf )\n alt_76 = 4\n alt_76 = @dfa76.predict(@input)\n case alt_76\n when 1\n root_0 = @adaptor.create_flat_list!\n\n\n # at line 375:4: rewrite_tree_atom\n @state.following.push(TOKENS_FOLLOWING_rewrite_tree_atom_IN_rewrite_tree_element_2662)\n rewrite_tree_atom156 = rewrite_tree_atom\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child(root_0, rewrite_tree_atom156.tree)\n end\n\n when 2\n # at line 376:4: rewrite_tree_atom ebnf_suffix\n @state.following.push(TOKENS_FOLLOWING_rewrite_tree_atom_IN_rewrite_tree_element_2667)\n rewrite_tree_atom157 = rewrite_tree_atom\n @state.following.pop\n if @state.backtracking == 0\n stream_rewrite_tree_atom.add(rewrite_tree_atom157.tree)\n end\n @state.following.push(TOKENS_FOLLOWING_ebnf_suffix_IN_rewrite_tree_element_2669)\n ebnf_suffix158 = ebnf_suffix\n @state.following.pop\n if @state.backtracking == 0\n stream_ebnf_suffix.add(ebnf_suffix158.tree)\n end\n # AST Rewrite\n # elements: ebnf_suffix, rewrite_tree_atom\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 377:3: -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] rewrite_tree_atom EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n # at line 377:6: ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] rewrite_tree_atom EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(stream_ebnf_suffix.next_node(), root_1)\n\n # at line 377:21: ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] rewrite_tree_atom EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] )\n root_2 = @adaptor.create_flat_list!\n root_2 = @adaptor.become_root(@adaptor.create!(BLOCK, \"BLOCK\"), root_2)\n\n # at line 377:38: ^( ALT[\\\"ALT\\\"] rewrite_tree_atom EOA[\\\"EOA\\\"] )\n root_3 = @adaptor.create_flat_list!\n root_3 = @adaptor.become_root(@adaptor.create!(ALT, \"ALT\"), root_3)\n\n @adaptor.add_child(root_3, stream_rewrite_tree_atom.next_tree)\n @adaptor.add_child(root_3, @adaptor.create!(EOA, \"EOA\"))\n\n @adaptor.add_child(root_2, root_3)\n @adaptor.add_child(root_2, @adaptor.create!(EOB, \"EOB\"))\n\n @adaptor.add_child(root_1, root_2)\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end\n when 3\n # at line 378:6: rewrite_tree ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] rewrite_tree EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> rewrite_tree )\n @state.following.push(TOKENS_FOLLOWING_rewrite_tree_IN_rewrite_tree_element_2703)\n rewrite_tree159 = rewrite_tree\n @state.following.pop\n if @state.backtracking == 0\n stream_rewrite_tree.add(rewrite_tree159.tree)\n end\n # at line 379:3: ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] rewrite_tree EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> rewrite_tree )\n alt_75 = 2\n look_75_0 = @input.peek(1)\n\n if (look_75_0 == T__74 || look_75_0.between?(T__91, T__92)) \n alt_75 = 1\n elsif (look_75_0 == EOF || look_75_0 == TREE_BEGIN || look_75_0 == REWRITE || look_75_0.between?(TOKEN_REF, ACTION) || look_75_0 == RULE_REF || look_75_0 == T__71 || look_75_0.between?(T__81, T__83) || look_75_0 == T__93) \n alt_75 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 75, 0)\n raise nvae\n end\n case alt_75\n when 1\n # at line 379:5: ebnf_suffix\n @state.following.push(TOKENS_FOLLOWING_ebnf_suffix_IN_rewrite_tree_element_2709)\n ebnf_suffix160 = ebnf_suffix\n @state.following.pop\n if @state.backtracking == 0\n stream_ebnf_suffix.add(ebnf_suffix160.tree)\n end\n # AST Rewrite\n # elements: rewrite_tree, ebnf_suffix\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 380:4: -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] rewrite_tree EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n # at line 380:7: ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] rewrite_tree EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(stream_ebnf_suffix.next_node(), root_1)\n\n # at line 380:21: ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] rewrite_tree EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] )\n root_2 = @adaptor.create_flat_list!\n root_2 = @adaptor.become_root(@adaptor.create!(BLOCK, \"BLOCK\"), root_2)\n\n # at line 380:38: ^( ALT[\\\"ALT\\\"] rewrite_tree EOA[\\\"EOA\\\"] )\n root_3 = @adaptor.create_flat_list!\n root_3 = @adaptor.become_root(@adaptor.create!(ALT, \"ALT\"), root_3)\n\n @adaptor.add_child(root_3, stream_rewrite_tree.next_tree)\n @adaptor.add_child(root_3, @adaptor.create!(EOA, \"EOA\"))\n\n @adaptor.add_child(root_2, root_3)\n @adaptor.add_child(root_2, @adaptor.create!(EOB, \"EOB\"))\n\n @adaptor.add_child(root_1, root_2)\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n # at line 381:5: \n # AST Rewrite\n # elements: rewrite_tree\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 381:5: -> rewrite_tree\n @adaptor.add_child(root_0, stream_rewrite_tree.next_tree)\n\n\n\n return_value.tree = root_0\n\n end\n end\n\n when 4\n root_0 = @adaptor.create_flat_list!\n\n\n # at line 383:6: rewrite_tree_ebnf\n @state.following.push(TOKENS_FOLLOWING_rewrite_tree_ebnf_IN_rewrite_tree_element_2755)\n rewrite_tree_ebnf161 = rewrite_tree_ebnf\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child(root_0, rewrite_tree_ebnf161.tree)\n end\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look(-1)\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing(root_0)\n @adaptor.set_token_boundaries(return_value.tree, return_value.start, return_value.stop)\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node!(@input, return_value.start, @input.look(-1), re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 36)\n\n end\n \n return return_value\n end", "def read( start_position )\n pos = start_position.adjusted_stream_position\n line_number = column_number = 0\n\n if @source.at_eof?(stream_position) then\n line_number = @source.eof_line_number\n column_number = @source.eof_column_number\n else\n line_number = @source.line_number(stream_position)\n column_number = @source.column_number(stream_position)\n end\n \n characters = []\n states = [ start_position.state ]\n\n forever do\n c = readc(pos)\n action = states[-1].action_for( c )\n \n case action\n \n #\n # Read a single character and prepare to move on.\n \n when Plan::Actions::Read\n characters << c\n states << action.to_state\n pos += 1\n \n \n #\n # Group several characters for further processing. Unlike in the Parser, we\n # perform the Shift here directly. We don't move the pos, because nothing was\n # used.\n \n when Plan::Actions::Group\n length = action.by_production.length\n group = characters.slice!(-length..-1)\n states.slice!(-length..-1)\n states << states[-1].action_for(action.by_production.name).to_state\n characters << group\n\n\n #\n # Tokenize ends the read() operation. We set our answer into the start_position\n # and return.\n \n when Plan::Actions::Tokenize\n length = action.by_production.length\n if characters.length == length then\n start_position.determinant = Nodes::Token.new( characters.flatten, action.by_production.name, start_position.adjusted_stream_position, line_number, column_number, @source )\n break\n else\n nyi( \"error handling for too short Tokenize\" )\n end\n \n \n #\n # For lexical stuff, all Attempt actions will be of the same type. For Group\n # actions, we want the longest match (always), so we need to try all branches\n # and find the longest Token produced. For Tokenize, we need to interact with\n # the Parser's BranchInfo system.\n \n when Plan::Actions::Attempt\n case action.actions[0]\n when Plan::Actions::Group\n nyi()\n when Plan::Actions::Tokenize\n nyi()\n else\n nyi( \"attempt support for #{action.actions[0].class.name}\" )\n end\n \n \n #\n # If there is no action, we've got an error.\n \n when NilClass\n nyi( \"error\" )\n \n else\n nyi( \"not supported\", action )\n end\n end\n end", "def rewrite(source_buffer, ast); end", "def rewrite(source_buffer, ast); end", "def rewrite(source_buffer, ast); end", "def refrigerator\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 35 )\n refrigerator_start_index = @input.index\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return \n end\n # at line 315:5: ( 'R' | 'r' ) ( 'E' | 'e' ) ( 'F' | 'f' ) ( 'R' | 'r' ) ( 'I' | 'i' ) ( 'G' | 'g' ) ( 'E' | 'e' ) ( 'R' | 'r' ) ( 'A' | 'a' ) ( 'T' | 't' ) ( 'O' | 'o' ) ( 'R' | 'r' )\n if @input.peek( 1 ).between?( T__20, T__21 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__28, T__29 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__30, T__31 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__20, T__21 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__24, T__25 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__56, T__57 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__28, T__29 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__20, T__21 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__48, T__49 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__16, T__17 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__18, T__19 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__20, T__21 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 35 )\n memoize( __method__, refrigerator_start_index, success ) if @state.backtracking > 0\n\n end\n \n return \n end", "def token_buffer_stash(buf)\n @buffers.push(buf)\n end", "def lbrack!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 31 )\n\n type = LBRACK\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 152:10: '['\n match( 0x5b )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 31 )\n\n end", "def rewrite_tree_element\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 36 )\n return_value = RewriteTreeElementReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n rewrite_tree_atom156 = nil\n rewrite_tree_atom157 = nil\n ebnf_suffix158 = nil\n rewrite_tree159 = nil\n ebnf_suffix160 = nil\n rewrite_tree_ebnf161 = nil\n\n stream_rewrite_tree = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule rewrite_tree\" )\n stream_rewrite_tree_atom = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule rewrite_tree_atom\" )\n stream_ebnf_suffix = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule ebnf_suffix\" )\n begin\n # at line 366:2: ( rewrite_tree_atom | rewrite_tree_atom ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] rewrite_tree_atom EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | rewrite_tree ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] rewrite_tree EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> rewrite_tree ) | rewrite_tree_ebnf )\n alt_76 = 4\n alt_76 = @dfa76.predict( @input )\n case alt_76\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 366:4: rewrite_tree_atom\n @state.following.push( TOKENS_FOLLOWING_rewrite_tree_atom_IN_rewrite_tree_element_2657 )\n rewrite_tree_atom156 = rewrite_tree_atom\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, rewrite_tree_atom156.tree )\n end\n\n when 2\n # at line 367:4: rewrite_tree_atom ebnf_suffix\n @state.following.push( TOKENS_FOLLOWING_rewrite_tree_atom_IN_rewrite_tree_element_2662 )\n rewrite_tree_atom157 = rewrite_tree_atom\n @state.following.pop\n if @state.backtracking == 0\n stream_rewrite_tree_atom.add( rewrite_tree_atom157.tree )\n end\n @state.following.push( TOKENS_FOLLOWING_ebnf_suffix_IN_rewrite_tree_element_2664 )\n ebnf_suffix158 = ebnf_suffix\n @state.following.pop\n if @state.backtracking == 0\n stream_ebnf_suffix.add( ebnf_suffix158.tree )\n end\n # AST Rewrite\n # elements: ebnf_suffix, rewrite_tree_atom\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 368:3: -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] rewrite_tree_atom EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n # at line 368:6: ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] rewrite_tree_atom EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_ebnf_suffix.next_node, root_1 )\n\n # at line 368:21: ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] rewrite_tree_atom EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] )\n root_2 = @adaptor.create_flat_list\n root_2 = @adaptor.become_root( @adaptor.create( BLOCK, \"BLOCK\" ), root_2 )\n\n # at line 368:38: ^( ALT[\\\"ALT\\\"] rewrite_tree_atom EOA[\\\"EOA\\\"] )\n root_3 = @adaptor.create_flat_list\n root_3 = @adaptor.become_root( @adaptor.create( ALT, \"ALT\" ), root_3 )\n\n @adaptor.add_child( root_3, stream_rewrite_tree_atom.next_tree )\n @adaptor.add_child( root_3, @adaptor.create( EOA, \"EOA\" ) )\n\n @adaptor.add_child( root_2, root_3 )\n @adaptor.add_child( root_2, @adaptor.create( EOB, \"EOB\" ) )\n\n @adaptor.add_child( root_1, root_2 )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end\n when 3\n # at line 369:6: rewrite_tree ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] rewrite_tree EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> rewrite_tree )\n @state.following.push( TOKENS_FOLLOWING_rewrite_tree_IN_rewrite_tree_element_2698 )\n rewrite_tree159 = rewrite_tree\n @state.following.pop\n if @state.backtracking == 0\n stream_rewrite_tree.add( rewrite_tree159.tree )\n end\n # at line 370:3: ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] rewrite_tree EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> rewrite_tree )\n alt_75 = 2\n look_75_0 = @input.peek( 1 )\n\n if ( look_75_0 == T__74 || look_75_0.between?( T__91, T__92 ) )\n alt_75 = 1\n elsif ( look_75_0 == EOF || look_75_0 == TREE_BEGIN || look_75_0 == REWRITE || look_75_0.between?( TOKEN_REF, ACTION ) || look_75_0 == RULE_REF || look_75_0 == T__71 || look_75_0.between?( T__81, T__83 ) || look_75_0 == T__93 )\n alt_75 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 75, 0 )\n end\n case alt_75\n when 1\n # at line 370:5: ebnf_suffix\n @state.following.push( TOKENS_FOLLOWING_ebnf_suffix_IN_rewrite_tree_element_2704 )\n ebnf_suffix160 = ebnf_suffix\n @state.following.pop\n if @state.backtracking == 0\n stream_ebnf_suffix.add( ebnf_suffix160.tree )\n end\n # AST Rewrite\n # elements: ebnf_suffix, rewrite_tree\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 371:4: -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] rewrite_tree EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n # at line 371:7: ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] rewrite_tree EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_ebnf_suffix.next_node, root_1 )\n\n # at line 371:21: ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] rewrite_tree EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] )\n root_2 = @adaptor.create_flat_list\n root_2 = @adaptor.become_root( @adaptor.create( BLOCK, \"BLOCK\" ), root_2 )\n\n # at line 371:38: ^( ALT[\\\"ALT\\\"] rewrite_tree EOA[\\\"EOA\\\"] )\n root_3 = @adaptor.create_flat_list\n root_3 = @adaptor.become_root( @adaptor.create( ALT, \"ALT\" ), root_3 )\n\n @adaptor.add_child( root_3, stream_rewrite_tree.next_tree )\n @adaptor.add_child( root_3, @adaptor.create( EOA, \"EOA\" ) )\n\n @adaptor.add_child( root_2, root_3 )\n @adaptor.add_child( root_2, @adaptor.create( EOB, \"EOB\" ) )\n\n @adaptor.add_child( root_1, root_2 )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n # at line 372:5: \n # AST Rewrite\n # elements: rewrite_tree\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 372:5: -> rewrite_tree\n @adaptor.add_child( root_0, stream_rewrite_tree.next_tree )\n\n\n\n return_value.tree = root_0\n\n end\n end\n\n when 4\n root_0 = @adaptor.create_flat_list\n\n\n # at line 374:6: rewrite_tree_ebnf\n @state.following.push( TOKENS_FOLLOWING_rewrite_tree_ebnf_IN_rewrite_tree_element_2750 )\n rewrite_tree_ebnf161 = rewrite_tree_ebnf\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, rewrite_tree_ebnf161.tree )\n end\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 36 )\n\n end\n \n return return_value\n end", "def prepare_token(token)\n case token\n when Fast::FindWithCapture\n token.previous_captures = find_captures\n end\n end", "def create_lookahead(elements, *args)\n return elements unless elements.size > 1\n [Node[:with_look_ahead].new(elements, *args, start: elements.first.start, stop: elements.last.stop)]\n end", "def advance\n if @token_queue.any?\n return @token_queue.shift\n end\n\n # Ugly, but dependent on Ragel output. Consider refactoring it somehow.\n _lex_trans_keys = self.class.send :_lex_trans_keys\n _lex_key_spans = self.class.send :_lex_key_spans\n _lex_index_offsets = self.class.send :_lex_index_offsets\n _lex_indicies = self.class.send :_lex_indicies\n _lex_trans_targs = self.class.send :_lex_trans_targs\n _lex_trans_actions = self.class.send :_lex_trans_actions\n _lex_to_state_actions = self.class.send :_lex_to_state_actions\n _lex_from_state_actions = self.class.send :_lex_from_state_actions\n _lex_eof_trans = self.class.send :_lex_eof_trans\n\n p, pe, eof = @p, @source.length + 1, @source.length + 1\n\n @command_state = (@cs == self.class.lex_en_expr_value ||\n @cs == self.class.lex_en_line_begin)\n\n \n# line 10604 \"lib/parser/lexer.rb\"\nbegin\n\ttestEof = false\n\t_slen, _trans, _keys, _inds, _acts, _nacts = nil\n\t_goto_level = 0\n\t_resume = 10\n\t_eof_trans = 15\n\t_again = 20\n\t_test_eof = 30\n\t_out = 40\n\twhile true\n\tif _goto_level <= 0\n\tif p == pe\n\t\t_goto_level = _test_eof\n\t\tnext\n\tend\n\tif @cs == 0\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\tend\n\tif _goto_level <= _resume\n\tcase _lex_from_state_actions[ @cs] \n\twhen 74 then\n# line 1 \"NONE\"\n\t\tbegin\n @ts = p\n\t\tend\n# line 10632 \"lib/parser/lexer.rb\"\n\tend\n\t_keys = @cs << 1\n\t_inds = _lex_index_offsets[ @cs]\n\t_slen = _lex_key_spans[ @cs]\n\t_trans = if ( _slen > 0 && \n\t\t\t_lex_trans_keys[_keys] <= ( (@source_pts[p] || 0)) && \n\t\t\t( (@source_pts[p] || 0)) <= _lex_trans_keys[_keys + 1] \n\t\t ) then\n\t\t\t_lex_indicies[ _inds + ( (@source_pts[p] || 0)) - _lex_trans_keys[_keys] ] \n\t\t else \n\t\t\t_lex_indicies[ _inds + _slen ]\n\t\t end\n\tend\n\tif _goto_level <= _eof_trans\n\t @cs = _lex_trans_targs[_trans]\n\tif _lex_trans_actions[_trans] != 0\n\tcase _lex_trans_actions[_trans]\n\twhen 22 then\n# line 460 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 52 then\n# line 752 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n\twhen 23 then\n# line 792 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n\twhen 63 then\n# line 1071 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n\twhen 66 then\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n\twhen 253 then\n# line 1115 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 30 then\n# line 1364 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 32 then\n# line 1380 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 34 then\n# line 1408 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 49 then\n# line 1592 \"lib/parser/lexer.rl\"\n\t\tbegin\n @heredoc_e = p \t\tend\n\twhen 322 then\n# line 1709 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 389 then\n# line 1902 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 16; @num_digits_s = p \t\tend\n\twhen 383 then\n# line 1903 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = p \t\tend\n\twhen 386 then\n# line 1904 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = p \t\tend\n\twhen 380 then\n# line 1905 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 2; @num_digits_s = p \t\tend\n\twhen 395 then\n# line 1906 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n\twhen 363 then\n# line 1907 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n\twhen 375 then\n# line 1908 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 370 then\n# line 1965 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 368 then\n# line 1966 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 7 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n\twhen 90 then\n# line 983 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n literal.flush_string\n literal.extend_content\n\n emit(:tSTRING_DBEG, '#{')\n\n if literal.heredoc?\n literal.saved_herebody_s = @herebody_s\n @herebody_s = nil\n end\n\n literal.start_interp_brace\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 731\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 5 then\n# line 931 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n literal.flush_string\n literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 305\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 86 then\n# line 860 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(literal.str_s, literal.str_s + 1)\n end\n\n if literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, '')\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, '')\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n12\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if literal.words? && !eof_codepoint?(@source_pts[p])\n literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n literal.extend_string tok, @ts, @te\n literal.flush_string\n end\n end\n\t\tend\n\twhen 85 then\n# line 801 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = @source[@ts...@te]\n\n if !literal.heredoc? && literal.nest_and_try_closing(string, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 91 then\n# line 931 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n literal.flush_string\n literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 305\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 88 then\n# line 918 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n literal.extend_space @ts, @te\n end\n\t\tend\n\twhen 89 then\n# line 801 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = @source[@ts...@te]\n\n if !literal.heredoc? && literal.nest_and_try_closing(string, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 6 then\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 4 then\n# line 801 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n string = @source[@ts...@te]\n\n if !literal.heredoc? && literal.nest_and_try_closing(string, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 117 then\n# line 983 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n literal.flush_string\n literal.extend_content\n\n emit(:tSTRING_DBEG, '#{')\n\n if literal.heredoc?\n literal.saved_herebody_s = @herebody_s\n @herebody_s = nil\n end\n\n literal.start_interp_brace\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 731\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 10 then\n# line 931 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n literal.flush_string\n literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 305\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 114 then\n# line 860 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(literal.str_s, literal.str_s + 1)\n end\n\n if literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, '')\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, '')\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n12\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if literal.words? && !eof_codepoint?(@source_pts[p])\n literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n literal.extend_string tok, @ts, @te\n literal.flush_string\n end\n end\n\t\tend\n\twhen 113 then\n# line 801 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = @source[@ts...@te]\n\n if !literal.heredoc? && literal.nest_and_try_closing(string, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 118 then\n# line 931 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n literal.flush_string\n literal.extend_content\n\n emit(:tSTRING_DVAR, nil, @ts, @ts + 1)\n\n p = @ts\n \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 305\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 116 then\n# line 801 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = @source[@ts...@te]\n\n if !literal.heredoc? && literal.nest_and_try_closing(string, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 11 then\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 9 then\n# line 801 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n string = @source[@ts...@te]\n\n if !literal.heredoc? && literal.nest_and_try_closing(string, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 141 then\n# line 860 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(literal.str_s, literal.str_s + 1)\n end\n\n if literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, '')\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, '')\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n12\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if literal.words? && !eof_codepoint?(@source_pts[p])\n literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n literal.extend_string tok, @ts, @te\n literal.flush_string\n end\n end\n\t\tend\n\twhen 140 then\n# line 801 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = @source[@ts...@te]\n\n if !literal.heredoc? && literal.nest_and_try_closing(string, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 143 then\n# line 918 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n literal.extend_space @ts, @te\n end\n\t\tend\n\twhen 144 then\n# line 801 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = @source[@ts...@te]\n\n if !literal.heredoc? && literal.nest_and_try_closing(string, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 147 then\n# line 860 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(literal.str_s, literal.str_s + 1)\n end\n\n if literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, '')\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, '')\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n12\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if literal.words? && !eof_codepoint?(@source_pts[p])\n literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n literal.extend_string tok, @ts, @te\n literal.flush_string\n end\n end\n\t\tend\n\twhen 146 then\n# line 801 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n string = @source[@ts...@te]\n\n if !literal.heredoc? && literal.nest_and_try_closing(string, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 149 then\n# line 801 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n string = @source[@ts...@te]\n\n if !literal.heredoc? && literal.nest_and_try_closing(string, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n literal.extend_string(string, @ts, @te)\n end\n end\n\t\tend\n\twhen 152 then\n# line 1046 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tREGEXP_OPT, tok(@ts, @te - 1), @ts, @te - 1)\n p = p - 1; \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 153 then\n# line 1034 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n unknown_options = tok.scan(/[^imxouesn]/)\n if unknown_options.any?\n diagnostic :error, :regexp_options,\n { :options => unknown_options.join }\n end\n\n emit(:tREGEXP_OPT)\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 12 then\n# line 1174 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if tok =~ /^\\$([1-9][0-9]*)$/\n emit(:tNTH_REF, tok(@ts + 1).to_i)\n elsif tok =~ /^\\$([&`'+])$/\n emit(:tBACK_REF)\n else\n emit(:tGVAR)\n end\n\n @cs = (stack_pop); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 154 then\n# line 1174 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if tok =~ /^\\$([1-9][0-9]*)$/\n emit(:tNTH_REF, tok(@ts + 1).to_i)\n elsif tok =~ /^\\$([&`'+])$/\n emit(:tBACK_REF)\n else\n emit(:tGVAR)\n end\n\n @cs = (stack_pop); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 156 then\n# line 1187 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if tok =~ /^@@[0-9]/\n diagnostic :error, :cvar_name, { :name => tok }\n end\n\n emit(:tCVAR)\n @cs = (stack_pop); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 155 then\n# line 1197 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if tok =~ /^@[0-9]/\n diagnostic :error, :ivar_name, { :name => tok }\n end\n\n emit(:tIVAR)\n @cs = (stack_pop); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 177 then\n# line 1218 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(KEYWORDS_BEGIN[tok]);\n @cs = 422; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 163 then\n# line 1226 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tIDENTIFIER)\n @cs = 422; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 14 then\n# line 1230 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1\n @cs = 739; \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 305\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 160 then\n# line 1239 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 422; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 172 then\n# line 1243 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; p = p - 1; \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 159 then\n# line 1251 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 158 then\n# line 486 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 176 then\n# line 1218 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(KEYWORDS_BEGIN[tok]);\n @cs = 422; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 173 then\n# line 1222 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tCONSTANT)\n @cs = 422; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 175 then\n# line 1226 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tIDENTIFIER)\n @cs = 422; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 170 then\n# line 1230 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n @cs = 739; \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 305\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 166 then\n# line 1239 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 422; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 171 then\n# line 1246 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 519\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 164 then\n# line 1248 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 169 then\n# line 1251 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 13 then\n# line 1251 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = p - 1; \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 162 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 25 then\n\tbegin begin p = (( @te))-1; end\n emit(KEYWORDS_BEGIN[tok]);\n @cs = 422; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 26 then\n\tbegin begin p = (( @te))-1; end\n emit(:tCONSTANT)\n @cs = 422; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 27 then\n\tbegin begin p = (( @te))-1; end\n emit(:tIDENTIFIER)\n @cs = 422; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 16 then\n# line 1263 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tLABEL, tok(@ts, @te - 1))\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 179 then\n# line 1269 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 178 then\n# line 486 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 181 then\n# line 1266 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 180 then\n# line 1269 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 15 then\n# line 1269 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = p - 1; \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 187 then\n# line 1295 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 451; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 186 then\n# line 1301 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 185 then\n# line 486 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 197 then\n# line 1280 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tCONSTANT)\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 188 then\n# line 1284 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tIDENTIFIER)\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 193 then\n# line 1295 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 451; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 191 then\n# line 1298 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 196 then\n# line 1301 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 201 then\n# line 1359 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 519\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 204 then\n# line 1368 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if tok(tm, tm + 1) == '/'\n # Ambiguous regexp literal.\n diagnostic :warning, :ambiguous_literal, nil, range(tm, tm + 1)\n end\n\n p = tm - 1\n \tbegin\n\t\t @cs = 519\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 210 then\n# line 1392 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; p = p - 1; \tbegin\n\t\t @cs = 519\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 18 then\n# line 1400 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1; \tbegin\n\t\t @cs = 519\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 212 then\n# line 1409 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = tm - 1; \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 33 then\n# line 1418 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 198 then\n# line 1432 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 519\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 199 then\n# line 486 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 211 then\n# line 1359 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 519\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 207 then\n# line 1381 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :warning, :ambiguous_prefix, { :prefix => tok(tm, @te) },\n range(tm, @te)\n\n p = tm - 1\n \tbegin\n\t\t @cs = 519\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 209 then\n# line 1397 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 519\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 203 then\n# line 1418 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 202 then\n# line 1423 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 220 then\n# line 1432 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 519\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 19 then\n# line 1423 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n\t\tend\n\twhen 35 then\n# line 1432 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = p - 1; \tbegin\n\t\t @cs = 519\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 17 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 51 then\n\tbegin begin p = (( @te))-1; end\n\n if tok(tm, tm + 1) == '/'\n # Ambiguous regexp literal.\n diagnostic :warning, :ambiguous_literal, nil, range(tm, tm + 1)\n end\n\n p = tm - 1\n \tbegin\n\t\t @cs = 519\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\twhen 52 then\n\tbegin begin p = (( @te))-1; end\n\n diagnostic :warning, :ambiguous_prefix, { :prefix => tok(tm, @te) },\n range(tm, @te)\n\n p = tm - 1\n \tbegin\n\t\t @cs = 519\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\twhen 57 then\n\tbegin begin p = (( @te))-1; end\n\n p = @ts - 1\n \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\telse\n\tbegin begin p = (( @te))-1; end\nend\nend \n\t\t\tend\n\twhen 37 then\n# line 1468 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1\n \tbegin\n\t\t @cs = 451\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 223 then\n# line 486 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 224 then\n# line 1468 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 451\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 38 then\n# line 1468 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = @ts - 1\n \tbegin\n\t\t @cs = 451\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 36 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 64 then\n\tbegin begin p = (( @te))-1; end\n\n if @cond.active?\n emit(:kDO_COND, 'do', @te - 2, @te)\n else\n emit(:kDO, 'do', @te - 2, @te)\n end\n @cs = 731; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 65 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1\n \tbegin\n\t\t @cs = 451\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 234 then\n# line 1495 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_do(true)\n @cs = 731; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 227 then\n# line 1501 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 228 then\n# line 486 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 229 then\n# line 1498 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 232 then\n# line 1501 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 238 then\n# line 1525 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 519\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 237 then\n# line 486 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 246 then\n# line 1517 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1; \tbegin\n\t\t @cs = 519\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 240 then\n# line 1519 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 244 then\n# line 1525 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 519\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 239 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 72 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 73 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1; \tbegin\n\t\t @cs = 519\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 274 then\n# line 1542 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = p - 1;\n if tok.start_with? '-'\n emit(:tUMINUS_NUM, '-', @ts, @ts + 1)\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 275 then\n# line 1562 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type = delimiter = tok[0].chr\n p = p - 1; \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 269 then\n# line 1569 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type, delimiter = tok[0].chr, tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 45 then\n# line 1576 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type, delimiter = tok[0..-2], tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 276 then\n# line 1616 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type, delimiter = tok, tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 48 then\n# line 1630 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit(:tSYMBOL, tok(@ts + 1), @ts)\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 289 then\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Show an error if memorized.\n @escape.call if @escape.respond_to? :call\n\n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value[0].ord)\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 291 then\n# line 1658 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n escape = { \" \" => '\\s', \"\\r\" => '\\r', \"\\n\" => '\\n', \"\\t\" => '\\t',\n \"\\v\" => '\\v', \"\\f\" => '\\f' }[tok[1]]\n diagnostic :warning, :invalid_escape_use, { :escape => escape }, range\n\n p = @ts - 1\n \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 290 then\n# line 1668 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n diagnostic :fatal, :incomplete_escape, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 277 then\n# line 1704 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION_BEGIN)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 42 then\n# line 1724 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = p - 1;\n\n if version?(18)\n ident = tok(@ts, @te - 2)\n\n emit((tok[0] =~ /[A-Z]/) ? :tCONSTANT : :tIDENTIFIER,\n ident, @ts, @te - 2)\n p = p - 1; # continue as a symbol\n\n if !@static_env.nil? && @static_env.declared?(ident)\n @cs = 739;\n else\n @cs = (arg_or_cmdarg);\n end\n else\n emit(:tLABEL, tok(@ts, @te - 2), @ts, @te - 1)\n end\n\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 263 then\n# line 1769 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1\n \tbegin\n\t\t @cs = 156\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 46 then\n# line 1782 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1; \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 249 then\n# line 486 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 273 then\n# line 1552 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tSTAR)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 270 then\n# line 1576 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n type, delimiter = tok[0..-2], tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 268 then\n# line 1582 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :fatal, :string_eof, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 278 then\n# line 1630 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1), @ts)\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 293 then\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n # Show an error if memorized.\n @escape.call if @escape.respond_to? :call\n\n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value[0].ord)\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 288 then\n# line 1668 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :fatal, :incomplete_escape, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 294 then\n# line 1674 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 271 then\n# line 1704 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION_BEGIN)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 316 then\n# line 1159 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 260 then\n# line 1766 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 262 then\n# line 1769 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 156\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 265 then\n# line 1782 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1; \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 44 then\n# line 1582 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n diagnostic :fatal, :string_eof, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 53 then\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n # Show an error if memorized.\n @escape.call if @escape.respond_to? :call\n\n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value[0].ord)\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 51 then\n# line 1668 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n diagnostic :fatal, :incomplete_escape, nil, range(@ts, @ts + 1)\n end\n\t\tend\n\twhen 43 then\n# line 1766 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n\t\tend\n\twhen 47 then\n# line 1782 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = @ts - 1; \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 41 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 94 then\n\tbegin begin p = (( @te))-1; end\n emit_table(PUNCTUATION_BEGIN)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 95 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS_BEGIN, @ts, tm)\n p = tm - 1\n @cs = 495; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 96 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS_BEGIN)\n @cs = 731; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 98 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1\n \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\twhen 99 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 102 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1; \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 56 then\n# line 1792 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1\n \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 325 then\n# line 1801 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 519\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 324 then\n# line 486 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 327 then\n# line 1795 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 326 then\n# line 1801 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 519\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 55 then\n# line 1801 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = p - 1; \tbegin\n\t\t @cs = 519\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 357 then\n# line 1812 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit_table(PUNCTUATION, @ts, @ts + 2)\n\n @lambda_stack.push @paren_nest\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 70 then\n# line 1849 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:kCLASS, 'class', @ts, @ts + 5)\n emit(:tLSHFT, '<<', @te - 2, @te)\n @cs = 731; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 335 then\n# line 1986 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n type, delimiter = tok, tok[-1].chr\n \tbegin\n\t\t @cs = (push_literal(type, delimiter, @ts))\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 58 then\n# line 2004 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1; \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 305\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 399 then\n# line 2011 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 429; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 349 then\n# line 2038 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 341 then\n# line 2042 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit_table(PUNCTUATION)\n @cond.lexpop; @cmdarg.lexpop\n\n if %w\"} ]\".include?(tok)\n @cs = 487;\n else # )\n # fnext expr_endfn; ?\n end\n\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 354 then\n# line 2056 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tOP_ASGN, tok(@ts, @te - 1))\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 339 then\n# line 2060 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 731; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 336 then\n# line 2068 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 338 then\n# line 2081 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit_table(PUNCTUATION)\n @cs = 731; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 404 then\n# line 2084 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n diagnostic :error, :bare_backslash, nil, range(@ts, @ts + 1)\n p = p - 1;\n end\n\t\tend\n\twhen 334 then\n# line 2090 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n diagnostic :fatal, :unexpected, { :character => tok.inspect[1..-2] }\n end\n\t\tend\n\twhen 333 then\n# line 486 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 414 then\n# line 1845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(KEYWORDS)\n @cs = 310; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 412 then\n# line 1849 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:kCLASS, 'class', @ts, @ts + 5)\n emit(:tLSHFT, '<<', @te - 2, @te)\n @cs = 731; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 411 then\n# line 1860 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(KEYWORDS)\n @cs = 731; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 360 then\n# line 1936 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :error, :no_dot_digit_literal\n end\n\t\tend\n\twhen 401 then\n# line 1996 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tCONSTANT)\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 353 then\n# line 2004 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1; \tbegin\n\t\t @stack[ @top] = @cs\n\t\t @top+= 1\n\t\t @cs = 305\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 358 then\n# line 2011 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 429; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 406 then\n# line 1159 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 348 then\n# line 2038 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 359 then\n# line 2068 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 346 then\n# line 2075 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 352 then\n# line 2090 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :fatal, :unexpected, { :character => tok.inspect[1..-2] }\n end\n\t\tend\n\twhen 59 then\n# line 1936 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n diagnostic :error, :no_dot_digit_literal\n end\n\t\tend\n\twhen 57 then\n# line 2090 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin \n diagnostic :fatal, :unexpected, { :character => tok.inspect[1..-2] }\n end\n\t\tend\n\twhen 60 then\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 110 then\n\tbegin begin p = (( @te))-1; end\n\n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n\n if tok == '{'\n emit(:tLAMBEG)\n else # 'do'\n emit(:kDO_LAMBDA)\n end\n else\n if tok == '{'\n emit_table(PUNCTUATION)\n else # 'do'\n emit_do\n end\n end\n\n @cs = 731; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 111 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 310; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 112 then\n\tbegin begin p = (( @te))-1; end\n emit(:kCLASS, 'class', @ts, @ts + 5)\n emit(:tLSHFT, '<<', @te - 2, @te)\n @cs = 731; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 113 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 114 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 731; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 115 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 495; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 116 then\n\tbegin begin p = (( @te))-1; end\n\n emit_table(KEYWORDS)\n\n if version?(18) && tok == 'not'\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = 451; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 117 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18)\n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 739;\n else\n @cs = (arg_or_cmdarg);\n end\n else\n emit_table(KEYWORDS)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 118 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 119 then\n\tbegin begin p = (( @te))-1; end\n\n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'\n diagnostic :error, :trailing_in_number, { :character => '_' },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = \"0\"\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base))\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 121 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18, 19, 20)\n diagnostic :error,\n :trailing_in_number, { :character => tok(@te - 1, @te) },\n range(@te - 1, @te)\n else\n emit(:tINTEGER, tok(@ts, @te - 1).to_i)\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 122 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18, 19, 20)\n diagnostic :error,\n :trailing_in_number, { :character => tok(@te - 1, @te) },\n range(@te - 1, @te)\n else\n emit(:tFLOAT, tok(@ts, @te - 1).to_f)\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 123 then\n\tbegin begin p = (( @te))-1; end\n\n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits))\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 125 then\n\tbegin begin p = (( @te))-1; end\n emit(:tCONSTANT)\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 129 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 130 then\n\tbegin begin p = (( @te))-1; end\n\n if tm == @te\n # Suffix was consumed, e.g. foo!\n emit(:tFID)\n else\n # Suffix was not consumed, e.g. foo!=\n emit(:tIDENTIFIER, tok(@ts, tm), @ts, tm)\n p = tm - 1\n end\n @cs = 451; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\nend \n\t\t\tend\n\twhen 72 then\n# line 2102 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; p = p - 1;\n \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 419 then\n# line 2106 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin emit(:tNL, nil, @newline_s, @newline_s + 1)\n p = p - 1; @cs = 156; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 420 then\n# line 2106 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tNL, nil, @newline_s, @newline_s + 1)\n p = p - 1; @cs = 156; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 71 then\n# line 2106 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin emit(:tNL, nil, @newline_s, @newline_s + 1)\n p = p - 1; @cs = 156; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 423 then\n# line 2116 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit_comment(@eq_begin_s, @te)\n \tbegin\n\t\t @cs = 156\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 422 then\n# line 2124 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n diagnostic :fatal, :embedded_document, nil,\n range(@eq_begin_s, @eq_begin_s + '=begin'.length)\n end\n\t\tend\n\twhen 83 then\n# line 2134 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin @eq_begin_s = @ts\n \tbegin\n\t\t @cs = 916\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 2 then\n# line 2138 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = pe - 3 end\n\t\tend\n\twhen 75 then\n# line 2141 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = p - 1; \tbegin\n\t\t @cs = 731\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 76 then\n# line 486 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n # Sit at EOF indefinitely. #advance would return $eof each time.\n # This allows to feed the lexer more data if needed; this is only used\n # in tests.\n #\n # Note that this action is not embedded into e_eof like e_heredoc_nl and e_bs\n # below. This is due to the fact that scanner state at EOF is observed\n # by tests, and encapsulating it in a rule would break the introspection.\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 77 then\n# line 2131 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 82 then\n# line 2134 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin @eq_begin_s = @ts\n \tbegin\n\t\t @cs = 916\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 81 then\n# line 2141 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 731\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 1 then\n# line 2141 \"lib/parser/lexer.rl\"\n\t\tbegin\n begin p = (( @te))-1; end\n begin p = p - 1; \tbegin\n\t\t @cs = 731\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 69 then\n# line 460 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n\twhen 87 then\n# line 460 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 860 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(literal.str_s, literal.str_s + 1)\n end\n\n if literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, '')\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, '')\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n12\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if literal.words? && !eof_codepoint?(@source_pts[p])\n literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n literal.extend_string tok, @ts, @te\n literal.flush_string\n end\n end\n\t\tend\n\twhen 115 then\n# line 460 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 860 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(literal.str_s, literal.str_s + 1)\n end\n\n if literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, '')\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, '')\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n12\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if literal.words? && !eof_codepoint?(@source_pts[p])\n literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n literal.extend_string tok, @ts, @te\n literal.flush_string\n end\n end\n\t\tend\n\twhen 142 then\n# line 460 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 860 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(literal.str_s, literal.str_s + 1)\n end\n\n if literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, '')\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, '')\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n12\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if literal.words? && !eof_codepoint?(@source_pts[p])\n literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n literal.extend_string tok, @ts, @te\n literal.flush_string\n end\n end\n\t\tend\n\twhen 148 then\n# line 460 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 860 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(literal.str_s, literal.str_s + 1)\n end\n\n if literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, '')\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, '')\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n12\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if literal.words? && !eof_codepoint?(@source_pts[p])\n literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n literal.extend_string tok, @ts, @te\n literal.flush_string\n end\n end\n\t\tend\n\twhen 213 then\n# line 460 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1409 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = tm - 1; \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 205 then\n# line 460 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1418 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 292 then\n# line 460 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1658 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n escape = { \" \" => '\\s', \"\\r\" => '\\r', \"\\n\" => '\\n', \"\\t\" => '\\t',\n \"\\v\" => '\\v', \"\\f\" => '\\f' }[tok[1]]\n diagnostic :warning, :invalid_escape_use, { :escape => escape }, range\n\n p = @ts - 1\n \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 264 then\n# line 460 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1769 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = @ts - 1\n \tbegin\n\t\t @cs = 156\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 424 then\n# line 460 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2116 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n emit_comment(@eq_begin_s, @te)\n \tbegin\n\t\t @cs = 156\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 421 then\n# line 460 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2121 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n\t\tend\n\twhen 84 then\n# line 460 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2134 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin @eq_begin_s = @ts\n \tbegin\n\t\t @cs = 916\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 3 then\n# line 460 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 2138 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin p = pe - 3 end\n\t\tend\n\twhen 377 then\n# line 594 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |value| emit(:tRATIONAL, Rational(value)) } \t\tend\n# line 1909 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'\n diagnostic :error, :trailing_in_number, { :character => '_' },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = \"0\"\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base))\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 376 then\n# line 595 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |value| emit(:tIMAGINARY, Complex(0, value)) } \t\tend\n# line 1909 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'\n diagnostic :error, :trailing_in_number, { :character => '_' },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = \"0\"\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base))\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 378 then\n# line 596 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |value| emit(:tIMAGINARY, Complex(0, Rational(value))) } \t\tend\n# line 1909 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'\n diagnostic :error, :trailing_in_number, { :character => '_' },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = \"0\"\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base))\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 371 then\n# line 600 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |digits| emit(:tIMAGINARY, Complex(0, Float(digits))) } \t\tend\n# line 1968 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits))\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 372 then\n# line 604 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |digits| emit(:tRATIONAL, Rational(digits)) } \t\tend\n# line 1968 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits))\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 373 then\n# line 605 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |digits| emit(:tIMAGINARY, Complex(0, Rational(digits))) } \t\tend\n# line 1968 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits))\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 109 then\n# line 620 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = \"\"\n\n codepoints = tok(@escape_s + 2, p - 1)\n codepoint_s = @escape_s + 2\n\n codepoints.split(/[ \\t]/).each do |codepoint_str|\n codepoint = codepoint_str.to_i(16)\n\n if codepoint >= 0x110000\n @escape = lambda do\n diagnostic :error, :unicode_point_too_large, nil,\n range(codepoint_s, codepoint_s + codepoint_str.length)\n end\n\n break\n end\n\n @escape += codepoint.chr(Encoding::UTF_8)\n codepoint_s += codepoint_str.length + 1\n end\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 136 then\n# line 620 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = \"\"\n\n codepoints = tok(@escape_s + 2, p - 1)\n codepoint_s = @escape_s + 2\n\n codepoints.split(/[ \\t]/).each do |codepoint_str|\n codepoint = codepoint_str.to_i(16)\n\n if codepoint >= 0x110000\n @escape = lambda do\n diagnostic :error, :unicode_point_too_large, nil,\n range(codepoint_s, codepoint_s + codepoint_str.length)\n end\n\n break\n end\n\n @escape += codepoint.chr(Encoding::UTF_8)\n codepoint_s += codepoint_str.length + 1\n end\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 311 then\n# line 620 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = \"\"\n\n codepoints = tok(@escape_s + 2, p - 1)\n codepoint_s = @escape_s + 2\n\n codepoints.split(/[ \\t]/).each do |codepoint_str|\n codepoint = codepoint_str.to_i(16)\n\n if codepoint >= 0x110000\n @escape = lambda do\n diagnostic :error, :unicode_point_too_large, nil,\n range(codepoint_s, codepoint_s + codepoint_str.length)\n end\n\n break\n end\n\n @escape += codepoint.chr(Encoding::UTF_8)\n codepoint_s += codepoint_str.length + 1\n end\n \t\tend\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n # Show an error if memorized.\n @escape.call if @escape.respond_to? :call\n\n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value[0].ord)\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 93 then\n# line 643 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n char = @source[p - 1].chr\n @escape = ESCAPES.fetch(char, char)\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 120 then\n# line 643 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n char = @source[p - 1].chr\n @escape = ESCAPES.fetch(char, char)\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 295 then\n# line 643 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n char = @source[p - 1].chr\n @escape = ESCAPES.fetch(char, char)\n \t\tend\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n # Show an error if memorized.\n @escape.call if @escape.respond_to? :call\n\n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value[0].ord)\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 96 then\n# line 648 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = lambda do\n diagnostic :fatal, :invalid_escape\n end\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 123 then\n# line 648 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = lambda do\n diagnostic :fatal, :invalid_escape\n end\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 298 then\n# line 648 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = lambda do\n diagnostic :fatal, :invalid_escape\n end\n \t\tend\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n # Show an error if memorized.\n @escape.call if @escape.respond_to? :call\n\n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value[0].ord)\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 98 then\n# line 669 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 125 then\n# line 669 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 300 then\n# line 669 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n # Show an error if memorized.\n @escape.call if @escape.respond_to? :call\n\n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value[0].ord)\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 95 then\n# line 676 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s, p).to_i(8) % 0x100) \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 122 then\n# line 676 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s, p).to_i(8) % 0x100) \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 297 then\n# line 676 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s, p).to_i(8) % 0x100) \t\tend\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n # Show an error if memorized.\n @escape.call if @escape.respond_to? :call\n\n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value[0].ord)\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 112 then\n# line 680 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s + 1, p).to_i(16)) \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 139 then\n# line 680 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s + 1, p).to_i(16)) \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 314 then\n# line 680 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = encode_escape(tok(@escape_s + 1, p).to_i(16)) \t\tend\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n # Show an error if memorized.\n @escape.call if @escape.respond_to? :call\n\n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value[0].ord)\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 106 then\n# line 683 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = tok(@escape_s + 1, p).to_i(16).chr(Encoding::UTF_8) \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 133 then\n# line 683 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = tok(@escape_s + 1, p).to_i(16).chr(Encoding::UTF_8) \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 308 then\n# line 683 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = tok(@escape_s + 1, p).to_i(16).chr(Encoding::UTF_8) \t\tend\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n # Show an error if memorized.\n @escape.call if @escape.respond_to? :call\n\n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value[0].ord)\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 111 then\n# line 688 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = lambda do\n diagnostic :fatal, :invalid_hex_escape, nil,\n range(@escape_s - 1, p + 2)\n end\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 138 then\n# line 688 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = lambda do\n diagnostic :fatal, :invalid_hex_escape, nil,\n range(@escape_s - 1, p + 2)\n end\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 313 then\n# line 688 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = lambda do\n diagnostic :fatal, :invalid_hex_escape, nil,\n range(@escape_s - 1, p + 2)\n end\n \t\tend\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n # Show an error if memorized.\n @escape.call if @escape.respond_to? :call\n\n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value[0].ord)\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 105 then\n# line 703 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = lambda do\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(@escape_s - 1, p)\n end\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 132 then\n# line 703 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = lambda do\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(@escape_s - 1, p)\n end\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 307 then\n# line 703 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = lambda do\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(@escape_s - 1, p)\n end\n \t\tend\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n # Show an error if memorized.\n @escape.call if @escape.respond_to? :call\n\n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value[0].ord)\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 108 then\n# line 717 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = lambda do\n diagnostic :fatal, :unterminated_unicode, nil,\n range(p - 1, p)\n end\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 135 then\n# line 717 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = lambda do\n diagnostic :fatal, :unterminated_unicode, nil,\n range(p - 1, p)\n end\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 310 then\n# line 717 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = lambda do\n diagnostic :fatal, :unterminated_unicode, nil,\n range(p - 1, p)\n end\n \t\tend\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n # Show an error if memorized.\n @escape.call if @escape.respond_to? :call\n\n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value[0].ord)\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 94 then\n# line 746 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 121 then\n# line 746 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 296 then\n# line 746 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n # Show an error if memorized.\n @escape.call if @escape.respond_to? :call\n\n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value[0].ord)\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 145 then\n# line 752 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 150 then\n# line 752 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 62 then\n# line 792 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 460 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 24 then\n# line 792 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1364 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 26 then\n# line 792 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1380 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 28 then\n# line 792 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1408 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n\twhen 165 then\n# line 792 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1248 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 184 then\n# line 792 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1266 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 192 then\n# line 792 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1298 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 27 then\n# line 792 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1418 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n p = @ts - 1\n \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 222 then\n# line 792 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1423 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 216 then\n# line 792 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1429 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 233 then\n# line 792 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1498 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 245 then\n# line 792 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1519 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 241 then\n# line 792 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1522 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = p - 1; \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 261 then\n# line 792 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1766 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 331 then\n# line 792 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1795 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 328 then\n# line 792 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1798 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \tbegin\n\t\t @cs = 156\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 405 then\n# line 792 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2075 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 347 then\n# line 792 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2078 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \tbegin\n\t\t @cs = 913\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 78 then\n# line 792 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 2131 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 215 then\n# line 955 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n if literal\n literal.start_interp_brace\n end\n \t\tend\n# line 1342 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @lambda_stack.last == @paren_nest\n p = @ts - 1\n \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n\n else\n emit(:tLCURLY, '{', @te - 1, @te)\n @cs = 731; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 235 then\n# line 955 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n if literal\n literal.start_interp_brace\n end\n \t\tend\n# line 1491 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tLBRACE_ARG)\n @cs = 731; end\n\t\tend\n\twhen 323 then\n# line 955 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n if literal\n literal.start_interp_brace\n end\n \t\tend\n# line 1685 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n emit(:tLAMBEG)\n else\n emit_table(PUNCTUATION_BEGIN)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 417 then\n# line 955 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n if literal\n literal.start_interp_brace\n end\n \t\tend\n# line 1820 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n\n if tok == '{'\n emit(:tLAMBEG)\n else # 'do'\n emit(:kDO_LAMBDA)\n end\n else\n if tok == '{'\n emit_table(PUNCTUATION)\n else # 'do'\n emit_do\n end\n end\n\n @cs = 731; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 418 then\n# line 963 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n if literal\n if literal.end_interp_brace_and_try_closing\n if version?(18, 19)\n emit(:tRCURLY, '}', p - 1, p)\n else\n emit(:tSTRING_DEND, '}', p - 1, p)\n end\n\n if literal.saved_herebody_s\n @herebody_s = literal.saved_herebody_s\n end\n\n p = p - 1;\n @cs = (stack_pop);\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n \t\tend\n# line 2042 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit_table(PUNCTUATION)\n @cond.lexpop; @cmdarg.lexpop\n\n if %w\"} ]\".include?(tok)\n @cs = 487;\n else # )\n # fnext expr_endfn; ?\n end\n\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 64 then\n# line 1071 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n\twhen 67 then\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 460 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 168 then\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1248 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 183 then\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1266 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 195 then\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1298 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 218 then\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1426 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 231 then\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1498 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 243 then\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1519 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 267 then\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1766 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 330 then\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1795 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 351 then\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2075 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 80 then\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2131 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 189 then\n# line 1115 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1288 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tFID, tok(@ts, tm), @ts, tm)\n @cs = (arg_or_cmdarg); p = tm - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 279 then\n# line 1115 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1622 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 252 then\n# line 1115 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1754 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 343 then\n# line 1115 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 2018 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if tm == @te\n # Suffix was consumed, e.g. foo!\n emit(:tFID)\n else\n # Suffix was not consumed, e.g. foo!=\n emit(:tIDENTIFIER, tok(@ts, tm), @ts, tm)\n p = tm - 1\n end\n @cs = 451; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 345 then\n# line 1115 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 110 then\n\tbegin begin p = (( @te))-1; end\n\n if @lambda_stack.last == @paren_nest\n @lambda_stack.pop\n\n if tok == '{'\n emit(:tLAMBEG)\n else # 'do'\n emit(:kDO_LAMBDA)\n end\n else\n if tok == '{'\n emit_table(PUNCTUATION)\n else # 'do'\n emit_do\n end\n end\n\n @cs = 731; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 111 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 310; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 112 then\n\tbegin begin p = (( @te))-1; end\n emit(:kCLASS, 'class', @ts, @ts + 5)\n emit(:tLSHFT, '<<', @te - 2, @te)\n @cs = 731; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 113 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 114 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 731; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 115 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n @cs = 495; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 116 then\n\tbegin begin p = (( @te))-1; end\n\n emit_table(KEYWORDS)\n\n if version?(18) && tok == 'not'\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = 451; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 117 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18)\n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 739;\n else\n @cs = (arg_or_cmdarg);\n end\n else\n emit_table(KEYWORDS)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 118 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 119 then\n\tbegin begin p = (( @te))-1; end\n\n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'\n diagnostic :error, :trailing_in_number, { :character => '_' },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = \"0\"\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base))\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 121 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18, 19, 20)\n diagnostic :error,\n :trailing_in_number, { :character => tok(@te - 1, @te) },\n range(@te - 1, @te)\n else\n emit(:tINTEGER, tok(@ts, @te - 1).to_i)\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 122 then\n\tbegin begin p = (( @te))-1; end\n\n if version?(18, 19, 20)\n diagnostic :error,\n :trailing_in_number, { :character => tok(@te - 1, @te) },\n range(@te - 1, @te)\n else\n emit(:tFLOAT, tok(@ts, @te - 1).to_f)\n p = p - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 123 then\n\tbegin begin p = (( @te))-1; end\n\n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits))\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\twhen 125 then\n\tbegin begin p = (( @te))-1; end\n emit(:tCONSTANT)\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 129 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 130 then\n\tbegin begin p = (( @te))-1; end\n\n if tm == @te\n # Suffix was consumed, e.g. foo!\n emit(:tFID)\n else\n # Suffix was not consumed, e.g. foo!=\n emit(:tIDENTIFIER, tok(@ts, tm), @ts, tm)\n p = tm - 1\n end\n @cs = 451; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\nend \n\t\t\tend\n\twhen 190 then\n# line 1116 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1288 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tFID, tok(@ts, tm), @ts, tm)\n @cs = (arg_or_cmdarg); p = tm - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 280 then\n# line 1116 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1622 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 254 then\n# line 1116 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1754 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 344 then\n# line 1116 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 2018 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if tm == @te\n # Suffix was consumed, e.g. foo!\n emit(:tFID)\n else\n # Suffix was not consumed, e.g. foo!=\n emit(:tIDENTIFIER, tok(@ts, tm), @ts, tm)\n p = tm - 1\n end\n @cs = 451; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 281 then\n# line 1121 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1622 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 255 then\n# line 1121 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1754 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 282 then\n# line 1122 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1622 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 256 then\n# line 1122 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1754 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 286 then\n# line 1123 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1622 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 259 then\n# line 1123 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1754 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 285 then\n# line 1124 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1622 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 258 then\n# line 1124 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1 \"NONE\"\n\t\tbegin\n\tcase @act\n\twhen 94 then\n\tbegin begin p = (( @te))-1; end\n emit_table(PUNCTUATION_BEGIN)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 95 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS_BEGIN, @ts, tm)\n p = tm - 1\n @cs = 495; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 96 then\n\tbegin begin p = (( @te))-1; end\n emit_table(KEYWORDS_BEGIN)\n @cs = 731; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\twhen 98 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1\n \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\twhen 99 then\n\tbegin begin p = (( @te))-1; end\n\n emit(:tIDENTIFIER)\n\n if !@static_env.nil? && @static_env.declared?(tok)\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = (arg_or_cmdarg); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\twhen 102 then\n\tbegin begin p = (( @te))-1; end\n p = @ts - 1; \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\nend \n\t\t\tend\n\twhen 283 then\n# line 1125 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 3 \t\tend\n# line 1622 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 257 then\n# line 1125 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 3 \t\tend\n# line 1754 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin p = @ts - 1\n \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 284 then\n# line 1130 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 1622 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)\n p = tm - 1\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 400 then\n# line 1135 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p - 2 \t\tend\n# line 2000 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tCONSTANT, tok(@ts, tm), @ts, tm)\n p = tm - 1; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 214 then\n# line 1141 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n \t\tend\n# line 1336 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tLBRACK, '[', @te - 1, @te)\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 315 then\n# line 1141 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n \t\tend\n# line 1699 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION_BEGIN)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 403 then\n# line 1141 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n \t\tend\n# line 2064 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 206 then\n# line 1148 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n \t\tend\n# line 1317 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if version?(18)\n emit(:tLPAREN2, '(', @te - 1, @te)\n @cs = 731; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n emit(:tLPAREN_ARG, '(', @te - 1, @te)\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 219 then\n# line 1148 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n \t\tend\n# line 1330 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit(:tLPAREN2)\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 225 then\n# line 1148 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n \t\tend\n# line 1445 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit(:tLPAREN_ARG, '(', @te - 1, @te)\n if version?(18)\n @cs = 731; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n end\n\t\tend\n\twhen 272 then\n# line 1148 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n \t\tend\n# line 1699 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION_BEGIN)\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 355 then\n# line 1148 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @cond.push(false); @cmdarg.push(false)\n\n @paren_nest += 1\n \t\tend\n# line 2038 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(PUNCTUATION)\n @cs = 519; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 356 then\n# line 1154 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @paren_nest -= 1\n \t\tend\n# line 2042 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n emit_table(PUNCTUATION)\n @cond.lexpop; @cmdarg.lexpop\n\n if %w\"} ]\".include?(tok)\n @cs = 487;\n else # )\n # fnext expr_endfn; ?\n end\n\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 50 then\n# line 1592 \"lib/parser/lexer.rl\"\n\t\tbegin\n @heredoc_e = p \t\tend\n# line 460 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 287 then\n# line 1593 \"lib/parser/lexer.rl\"\n\t\tbegin\n new_herebody_s = p \t\tend\n# line 1594 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n tok(@ts, @heredoc_e) =~ /^<<(-?)([\"'`]?)(.*)\\2$/\n\n indent = !$1.empty?\n type = '<<' + ($2.empty? ? '\"' : $2)\n delimiter = $3\n\n @cs = (push_literal(type, delimiter, @ts, @heredoc_e, indent));\n\n if @herebody_s.nil?\n @herebody_s = new_herebody_s\n end\n\n p = @herebody_s - 1\n end\n\t\tend\n\twhen 319 then\n# line 1709 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1710 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin emit_table(KEYWORDS_BEGIN, @ts, tm)\n p = tm - 1\n @cs = 495; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 390 then\n# line 1902 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 16; @num_digits_s = p \t\tend\n# line 1908 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 384 then\n# line 1903 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = p \t\tend\n# line 1908 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 387 then\n# line 1904 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = p \t\tend\n# line 1908 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 381 then\n# line 1905 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 2; @num_digits_s = p \t\tend\n# line 1908 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 396 then\n# line 1906 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 1908 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 365 then\n# line 1907 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n# line 1908 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n\twhen 397 then\n# line 1908 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 593 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |value| emit(:tINTEGER, value) } \t\tend\n\twhen 8 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 460 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 174 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1218 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 25;\t\tend\n\twhen 161 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1222 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 26;\t\tend\n\twhen 157 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1226 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 27;\t\tend\n\twhen 20 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1368 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 51;\t\tend\n\twhen 208 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1381 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 52;\t\tend\n\twhen 21 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1418 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 57;\t\tend\n\twhen 200 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1423 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 58;\t\tend\n\twhen 226 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1455 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 64;\t\tend\n\twhen 39 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1468 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 65;\t\tend\n\twhen 247 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1513 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 72;\t\tend\n\twhen 236 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1517 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 73;\t\tend\n\twhen 250 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1704 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 94;\t\tend\n\twhen 318 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1710 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 95;\t\tend\n\twhen 317 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1716 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 96;\t\tend\n\twhen 54 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1754 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 98;\t\tend\n\twhen 248 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1159 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 99;\t\tend\n\twhen 251 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1782 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 102;\t\tend\n\twhen 413 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1820 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 110;\t\tend\n\twhen 408 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1845 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 111;\t\tend\n\twhen 416 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1855 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 113;\t\tend\n\twhen 409 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1860 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 114;\t\tend\n\twhen 410 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1864 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 115;\t\tend\n\twhen 415 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1868 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 116;\t\tend\n\twhen 407 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1879 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 117;\t\tend\n\twhen 402 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1895 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 118;\t\tend\n\twhen 337 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1909 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 119;\t\tend\n\twhen 367 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1953 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 122;\t\tend\n\twhen 61 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1968 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 123;\t\tend\n\twhen 340 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1996 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 125;\t\tend\n\twhen 332 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1159 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 129;\t\tend\n\twhen 342 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 2018 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 130;\t\tend\n\twhen 151 then\n# line 460 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 860 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p+1\n begin \n if @te == pe\n diagnostic :fatal, :string_eof, nil,\n range(literal.str_s, literal.str_s + 1)\n end\n\n if literal.heredoc?\n line = tok(@herebody_s, @ts).gsub(/\\r+$/, '')\n\n if version?(18, 19, 20)\n # See ruby:c48b4209c\n line = line.gsub(/\\r.*$/, '')\n end\n\n # Try ending the heredoc with the complete most recently\n # scanned line. @herebody_s always refers to the start of such line.\n if literal.nest_and_try_closing(line, @herebody_s, @ts)\n # Adjust @herebody_s to point to the next line.\n @herebody_s = @te\n\n # Continue regular lexing after the heredoc reference (<<END).\n p = literal.heredoc_e - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Ditto.\n @herebody_s = @te\n end\n else\n # Try ending the literal with a newline.\n if literal.nest_and_try_closing(tok, @ts, @te)\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\n if @herebody_s\n # This is a regular literal intertwined with a heredoc. Like:\n #\n # p <<-foo+\"1\n # bar\n # foo\n # 2\"\n #\n # which, incidentally, evaluates to \"bar\\n12\".\n p = @herebody_s - 1\n @herebody_s = nil\n end\n end\n\n if literal.words? && !eof_codepoint?(@source_pts[p])\n literal.extend_space @ts, @te\n else\n # A literal newline is appended if the heredoc was _not_ closed\n # this time (see fbreak above). See also Literal#nest_and_try_closing\n # for rationale of calling #flush_string here.\n literal.extend_string tok, @ts, @te\n literal.flush_string\n end\n end\n\t\tend\n# line 752 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n\twhen 99 then\n# line 643 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n char = @source[p - 1].chr\n @escape = ESCAPES.fetch(char, char)\n \t\tend\n# line 654 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 126 then\n# line 643 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n char = @source[p - 1].chr\n @escape = ESCAPES.fetch(char, char)\n \t\tend\n# line 654 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 301 then\n# line 643 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n char = @source[p - 1].chr\n @escape = ESCAPES.fetch(char, char)\n \t\tend\n# line 654 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n # Show an error if memorized.\n @escape.call if @escape.respond_to? :call\n\n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value[0].ord)\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 104 then\n# line 643 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n char = @source[p - 1].chr\n @escape = ESCAPES.fetch(char, char)\n \t\tend\n# line 658 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 131 then\n# line 643 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n char = @source[p - 1].chr\n @escape = ESCAPES.fetch(char, char)\n \t\tend\n# line 658 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 306 then\n# line 643 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n char = @source[p - 1].chr\n @escape = ESCAPES.fetch(char, char)\n \t\tend\n# line 658 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n # Show an error if memorized.\n @escape.call if @escape.respond_to? :call\n\n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value[0].ord)\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 103 then\n# line 664 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source[p - 1].chr \t\tend\n# line 658 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 130 then\n# line 664 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source[p - 1].chr \t\tend\n# line 658 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 305 then\n# line 664 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source[p - 1].chr \t\tend\n# line 658 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n # Show an error if memorized.\n @escape.call if @escape.respond_to? :call\n\n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value[0].ord)\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 101 then\n# line 669 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 658 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 128 then\n# line 669 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 658 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 303 then\n# line 669 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = \"\\x7f\" \t\tend\n# line 658 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n # Show an error if memorized.\n @escape.call if @escape.respond_to? :call\n\n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value[0].ord)\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 97 then\n# line 670 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source[p - 1].chr \t\tend\n# line 654 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 124 then\n# line 670 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source[p - 1].chr \t\tend\n# line 654 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 299 then\n# line 670 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source[p - 1].chr \t\tend\n# line 654 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n # Show an error if memorized.\n @escape.call if @escape.respond_to? :call\n\n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value[0].ord)\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 110 then\n# line 703 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = lambda do\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(@escape_s - 1, p)\n end\n \t\tend\n# line 620 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = \"\"\n\n codepoints = tok(@escape_s + 2, p - 1)\n codepoint_s = @escape_s + 2\n\n codepoints.split(/[ \\t]/).each do |codepoint_str|\n codepoint = codepoint_str.to_i(16)\n\n if codepoint >= 0x110000\n @escape = lambda do\n diagnostic :error, :unicode_point_too_large, nil,\n range(codepoint_s, codepoint_s + codepoint_str.length)\n end\n\n break\n end\n\n @escape += codepoint.chr(Encoding::UTF_8)\n codepoint_s += codepoint_str.length + 1\n end\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 137 then\n# line 703 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = lambda do\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(@escape_s - 1, p)\n end\n \t\tend\n# line 620 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = \"\"\n\n codepoints = tok(@escape_s + 2, p - 1)\n codepoint_s = @escape_s + 2\n\n codepoints.split(/[ \\t]/).each do |codepoint_str|\n codepoint = codepoint_str.to_i(16)\n\n if codepoint >= 0x110000\n @escape = lambda do\n diagnostic :error, :unicode_point_too_large, nil,\n range(codepoint_s, codepoint_s + codepoint_str.length)\n end\n\n break\n end\n\n @escape += codepoint.chr(Encoding::UTF_8)\n codepoint_s += codepoint_str.length + 1\n end\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 312 then\n# line 703 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = lambda do\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(@escape_s - 1, p)\n end\n \t\tend\n# line 620 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = \"\"\n\n codepoints = tok(@escape_s + 2, p - 1)\n codepoint_s = @escape_s + 2\n\n codepoints.split(/[ \\t]/).each do |codepoint_str|\n codepoint = codepoint_str.to_i(16)\n\n if codepoint >= 0x110000\n @escape = lambda do\n diagnostic :error, :unicode_point_too_large, nil,\n range(codepoint_s, codepoint_s + codepoint_str.length)\n end\n\n break\n end\n\n @escape += codepoint.chr(Encoding::UTF_8)\n codepoint_s += codepoint_str.length + 1\n end\n \t\tend\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n # Show an error if memorized.\n @escape.call if @escape.respond_to? :call\n\n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value[0].ord)\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 107 then\n# line 703 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = lambda do\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(@escape_s - 1, p)\n end\n \t\tend\n# line 717 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = lambda do\n diagnostic :fatal, :unterminated_unicode, nil,\n range(p - 1, p)\n end\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 134 then\n# line 703 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = lambda do\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(@escape_s - 1, p)\n end\n \t\tend\n# line 717 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = lambda do\n diagnostic :fatal, :unterminated_unicode, nil,\n range(p - 1, p)\n end\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 309 then\n# line 703 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = lambda do\n diagnostic :fatal, :invalid_unicode_escape, nil,\n range(@escape_s - 1, p)\n end\n \t\tend\n# line 717 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = lambda do\n diagnostic :fatal, :unterminated_unicode, nil,\n range(p - 1, p)\n end\n \t\tend\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n # Show an error if memorized.\n @escape.call if @escape.respond_to? :call\n\n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value[0].ord)\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 92 then\n# line 752 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 746 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 119 then\n# line 752 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape_s = p\n @escape = nil\n \t\tend\n# line 746 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n diagnostic :fatal, :escape_eof, nil, range(p - 1, p)\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 65 then\n# line 1071 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 460 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n\twhen 167 then\n# line 1071 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1248 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 182 then\n# line 1071 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1266 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 194 then\n# line 1071 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1298 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 217 then\n# line 1071 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1426 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \tbegin\n\t\t @cs = 739\n\t\t_goto_level = _again\n\t\tnext\n\tend\n end\n\t\tend\n\twhen 230 then\n# line 1071 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1498 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 242 then\n# line 1071 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1519 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 266 then\n# line 1071 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1766 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 329 then\n# line 1071 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1795 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 350 then\n# line 1071 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2075 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 79 then\n# line 1071 \"lib/parser/lexer.rl\"\n\t\tbegin\n @sharp_s = p - 1 \t\tend\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 2131 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1;\t\tend\n\twhen 392 then\n# line 1906 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 1908 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 593 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |value| emit(:tINTEGER, value) } \t\tend\n\twhen 362 then\n# line 1907 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n# line 1908 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 593 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |value| emit(:tINTEGER, value) } \t\tend\n\twhen 374 then\n# line 1908 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 593 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |value| emit(:tINTEGER, value) } \t\tend\n# line 1909 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'\n diagnostic :error, :trailing_in_number, { :character => '_' },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = \"0\"\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base))\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 369 then\n# line 1965 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 599 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |digits| emit(:tFLOAT, Float(digits)) } \t\tend\n# line 1968 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits))\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 366 then\n# line 1966 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 599 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |digits| emit(:tFLOAT, Float(digits)) } \t\tend\n# line 1968 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@ts, @num_suffix_s)\n\n if version?(18, 19, 20)\n emit(:tFLOAT, Float(digits))\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits)\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 221 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 460 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # Record position of a newline for precise location reporting on tNL\n # tokens.\n #\n # This action is embedded directly into c_nl, as it is idempotent and\n # there are no cases when we need to skip it.\n @newline_s = p\n \t\tend\n# line 1423 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 58;\t\tend\n\twhen 29 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 792 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1418 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 57;\t\tend\n\twhen 40 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 792 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1468 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 65;\t\tend\n\twhen 68 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1074 \"lib/parser/lexer.rl\"\n\t\tbegin\n emit_comment(@sharp_s, p == pe ? p - 2 : p) \t\tend\n# line 1849 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 112;\t\tend\n\twhen 31 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1380 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1381 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 52;\t\tend\n\twhen 321 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1709 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1754 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 98;\t\tend\n\twhen 320 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1709 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1159 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 99;\t\tend\n\twhen 393 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1906 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 1909 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 119;\t\tend\n\twhen 102 then\n# line 643 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n char = @source[p - 1].chr\n @escape = ESCAPES.fetch(char, char)\n \t\tend\n# line 654 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 658 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 129 then\n# line 643 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n char = @source[p - 1].chr\n @escape = ESCAPES.fetch(char, char)\n \t\tend\n# line 654 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 658 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 304 then\n# line 643 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n char = @source[p - 1].chr\n @escape = ESCAPES.fetch(char, char)\n \t\tend\n# line 654 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 658 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n # Show an error if memorized.\n @escape.call if @escape.respond_to? :call\n\n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value[0].ord)\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 100 then\n# line 670 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source[p - 1].chr \t\tend\n# line 654 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 658 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 127 then\n# line 670 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source[p - 1].chr \t\tend\n# line 654 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 658 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 811 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n if literal.nest_and_try_closing('\\\\', @ts, @ts + 1)\n # If the literal is actually closed by the backslash,\n # rewind the input prior to consuming the escape sequence.\n p = @escape_s - 1\n @cs = (pop_literal); \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n else\n # Get the first character after the backslash.\n escaped_char = @source[@escape_s].chr\n\n if literal.munge_escape? escaped_char\n # If this particular literal uses this character as an opening\n # or closing delimiter, it is an escape sequence for that\n # particular character. Write it without the backslash.\n\n if literal.regexp? && escaped_char == '\\\\'\n # Regular expressions should include backslashes in their escaped\n # form.\n literal.extend_string(tok, @ts, @te)\n else\n literal.extend_string(escaped_char, @ts, @te)\n end\n else\n # It does not. So this is an actual escape sequence, yay!\n # Two things to consider here.\n #\n # 1. The `escape' rule should be pure and so won't raise any\n # errors by itself. Instead, it stores them in lambdas.\n #\n # 2. Non-interpolated literals do not go through the aforementioned\n # rule. As \\\\ and \\' (and variants) are munged, the full token\n # should always be written for such literals.\n\n @escape.call if @escape.respond_to? :call\n\n if literal.regexp?\n # Regular expressions should include escape sequences in their\n # escaped form. On the other hand, escaped newlines are removed.\n literal.extend_string(tok.gsub(\"\\\\\\n\", ''), @ts, @te)\n else\n literal.extend_string(@escape || tok, @ts, @te)\n end\n end\n end\n end\n\t\tend\n\twhen 302 then\n# line 670 \"lib/parser/lexer.rl\"\n\t\tbegin\n @escape = @source[p - 1].chr \t\tend\n# line 654 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord & 0x9f)\n \t\tend\n# line 658 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n @escape = encode_escape(@escape[0].ord | 0x80)\n \t\tend\n# line 1642 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n # Show an error if memorized.\n @escape.call if @escape.respond_to? :call\n\n value = @escape || tok(@ts + 1)\n\n if version?(18)\n emit(:tINTEGER, value[0].ord)\n else\n emit(:tCHARACTER, value)\n end\n\n @cs = 739; \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 388 then\n# line 1902 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 16; @num_digits_s = p \t\tend\n# line 1908 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 593 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |value| emit(:tINTEGER, value) } \t\tend\n# line 1909 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'\n diagnostic :error, :trailing_in_number, { :character => '_' },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = \"0\"\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base))\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 382 then\n# line 1903 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = p \t\tend\n# line 1908 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 593 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |value| emit(:tINTEGER, value) } \t\tend\n# line 1909 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'\n diagnostic :error, :trailing_in_number, { :character => '_' },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = \"0\"\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base))\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 385 then\n# line 1904 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = p \t\tend\n# line 1908 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 593 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |value| emit(:tINTEGER, value) } \t\tend\n# line 1909 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'\n diagnostic :error, :trailing_in_number, { :character => '_' },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = \"0\"\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base))\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 379 then\n# line 1905 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 2; @num_digits_s = p \t\tend\n# line 1908 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 593 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |value| emit(:tINTEGER, value) } \t\tend\n# line 1909 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'\n diagnostic :error, :trailing_in_number, { :character => '_' },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = \"0\"\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base))\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 391 then\n# line 1906 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 1908 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 593 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |value| emit(:tINTEGER, value) } \t\tend\n# line 1909 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'\n diagnostic :error, :trailing_in_number, { :character => '_' },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = \"0\"\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base))\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 361 then\n# line 1907 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n# line 1908 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 593 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |value| emit(:tINTEGER, value) } \t\tend\n# line 1909 \"lib/parser/lexer.rl\"\n\t\tbegin\n @te = p\np = p - 1; begin \n digits = tok(@num_digits_s, @num_suffix_s)\n\n if digits.end_with? '_'\n diagnostic :error, :trailing_in_number, { :character => '_' },\n range(@te - 1, @te)\n elsif digits.empty? && @num_base == 8 && version?(18)\n # 1.8 did not raise an error on 0o.\n digits = \"0\"\n elsif digits.empty?\n diagnostic :error, :empty_numeric\n elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))\n invalid_s = @num_digits_s + invalid_idx\n diagnostic :error, :invalid_octal, nil,\n range(invalid_s, invalid_s + 1)\n end\n\n if version?(18, 19, 20)\n emit(:tINTEGER, digits.to_i(@num_base))\n p = @num_suffix_s - 1\n else\n @num_xfrm.call(digits.to_i(@num_base))\n end\n \tbegin\n\t\tp += 1\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\n end\n\t\tend\n\twhen 25 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 792 \"lib/parser/lexer.rl\"\n\t\tbegin\n\n # After every heredoc was parsed, @herebody_s contains the\n # position of next token after all heredocs.\n if @herebody_s\n p = @herebody_s\n @herebody_s = nil\n end\n \t\tend\n# line 1380 \"lib/parser/lexer.rl\"\n\t\tbegin\n tm = p \t\tend\n# line 1381 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 52;\t\tend\n\twhen 398 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1908 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 593 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |value| emit(:tINTEGER, value) } \t\tend\n# line 1941 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 121;\t\tend\n\twhen 394 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1906 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 10; @num_digits_s = @ts \t\tend\n# line 1908 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 593 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |value| emit(:tINTEGER, value) } \t\tend\n# line 1941 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 121;\t\tend\n\twhen 364 then\n# line 1 \"NONE\"\n\t\tbegin\n @te = p+1\n\t\tend\n# line 1907 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_base = 8; @num_digits_s = @ts \t\tend\n# line 1908 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_suffix_s = p \t\tend\n# line 593 \"lib/parser/lexer.rl\"\n\t\tbegin\n @num_xfrm = lambda { |value| emit(:tINTEGER, value) } \t\tend\n# line 1941 \"lib/parser/lexer.rl\"\n\t\tbegin\n @act = 121;\t\tend\n# line 20641 \"lib/parser/lexer.rb\"\n\tend\n\tend\n\tend\n\tif _goto_level <= _again\n\tcase _lex_to_state_actions[ @cs] \n\twhen 73 then\n# line 1 \"NONE\"\n\t\tbegin\n @ts = nil;\t\tend\n# line 20651 \"lib/parser/lexer.rb\"\n\tend\n\n\tif @cs == 0\n\t\t_goto_level = _out\n\t\tnext\n\tend\n\tp += 1\n\tif p != pe\n\t\t_goto_level = _resume\n\t\tnext\n\tend\n\tend\n\tif _goto_level <= _test_eof\n\tif p == eof\n\tif _lex_eof_trans[ @cs] > 0\n\t\t_trans = _lex_eof_trans[ @cs] - 1;\n\t\t_goto_level = _eof_trans\n\t\tnext;\n\tend\n\tend\n\n\tend\n\tif _goto_level <= _out\n\t\tbreak\n\tend\nend\n\tend\n\n# line 261 \"lib/parser/lexer.rl\"\n # %\n\n @p = p\n\n if @token_queue.any?\n @token_queue.shift\n elsif @cs == self.class.lex_error\n [ false, [ '$error', range(p - 1, p) ] ]\n else\n [ false, [ '$eof', range(p, p) ] ]\n end\n end", "def from\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 27 )\n from_start_index = @input.index\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return \n end\n # at line 306:7: ( 'F' | 'f' ) ( 'R' | 'r' ) ( 'O' | 'o' ) ( 'M' | 'm' )\n if @input.peek( 1 ).between?( T__30, T__31 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__20, T__21 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__18, T__19 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__40, T__41 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 27 )\n memoize( __method__, from_start_index, success ) if @state.backtracking > 0\n\n end\n \n return \n end", "def rewrite_tree\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 39)\n return_value = RewriteTreeReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal171 = nil\n char_literal174 = nil\n rewrite_tree_atom172 = nil\n rewrite_tree_element173 = nil\n\n tree_for_string_literal171 = nil\n tree_for_char_literal174 = nil\n stream_T__83 = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token T__83\")\n stream_TREE_BEGIN = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token TREE_BEGIN\")\n stream_rewrite_tree_element = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule rewrite_tree_element\")\n stream_rewrite_tree_atom = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule rewrite_tree_atom\")\n begin\n # at line 407:4: '^(' rewrite_tree_atom ( rewrite_tree_element )* ')'\n string_literal171 = match(TREE_BEGIN, TOKENS_FOLLOWING_TREE_BEGIN_IN_rewrite_tree_2871) \n if @state.backtracking == 0\n stream_TREE_BEGIN.add(string_literal171)\n end\n @state.following.push(TOKENS_FOLLOWING_rewrite_tree_atom_IN_rewrite_tree_2873)\n rewrite_tree_atom172 = rewrite_tree_atom\n @state.following.pop\n if @state.backtracking == 0\n stream_rewrite_tree_atom.add(rewrite_tree_atom172.tree)\n end\n # at line 407:27: ( rewrite_tree_element )*\n loop do #loop 79\n alt_79 = 2\n look_79_0 = @input.peek(1)\n\n if (look_79_0 == TREE_BEGIN || look_79_0.between?(TOKEN_REF, ACTION) || look_79_0 == RULE_REF || look_79_0 == T__81 || look_79_0 == T__93) \n alt_79 = 1\n\n end\n case alt_79\n when 1\n # at line 407:27: rewrite_tree_element\n @state.following.push(TOKENS_FOLLOWING_rewrite_tree_element_IN_rewrite_tree_2875)\n rewrite_tree_element173 = rewrite_tree_element\n @state.following.pop\n if @state.backtracking == 0\n stream_rewrite_tree_element.add(rewrite_tree_element173.tree)\n end\n\n else\n break #loop 79\n end\n end\n char_literal174 = match(T__83, TOKENS_FOLLOWING_T__83_IN_rewrite_tree_2878) \n if @state.backtracking == 0\n stream_T__83.add(char_literal174)\n end\n # AST Rewrite\n # elements: rewrite_tree_element, rewrite_tree_atom\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 408:3: -> ^( TREE_BEGIN rewrite_tree_atom ( rewrite_tree_element )* )\n # at line 408:6: ^( TREE_BEGIN rewrite_tree_atom ( rewrite_tree_element )* )\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(@adaptor.create_from_type!(TREE_BEGIN, \"TREE_BEGIN\"), root_1)\n\n @adaptor.add_child(root_1, stream_rewrite_tree_atom.next_tree)\n # at line 408:37: ( rewrite_tree_element )*\n while stream_rewrite_tree_element.has_next?\n @adaptor.add_child(root_1, stream_rewrite_tree_element.next_tree)\n\n end\n\n stream_rewrite_tree_element.reset();\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look(-1)\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing(root_0)\n @adaptor.set_token_boundaries(return_value.tree, return_value.start, return_value.stop)\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node!(@input, return_value.start, @input.look(-1), re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 39)\n\n end\n \n return return_value\n end", "def receiver\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 64 )\n return_value = ReceiverReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n __EJS312__ = nil\n string_literal313 = nil\n primary310 = nil\n function311 = nil\n new_target314 = nil\n arguments315 = nil\n\n tree_for_EJS312 = nil\n tree_for_string_literal313 = nil\n stream_NEW = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token NEW\" )\n stream_EJS = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token EJS\" )\n stream_arguments = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule arguments\" )\n stream_primary = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule primary\" )\n stream_new_target = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule new_target\" )\n stream_function = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule function\" )\n begin\n # at line 677:3: ( primary -> primary | function -> function | EJS -> EJS | ( 'new' new_target ( arguments )? )=> 'new' new_target ( arguments )? -> ^( 'new' new_target ( arguments )? ) )\n alt_74 = 4\n look_74_0 = @input.peek( 1 )\n\n if ( look_74_0 == GENERAL || look_74_0 == GET || look_74_0 == REGEX || look_74_0 == LBRACE || look_74_0 == LBRACK || look_74_0 == SET || look_74_0 == DDOC || look_74_0 == LPAREN || look_74_0.between?( DGENERAL, MACRO ) || look_74_0 == THIS || look_74_0 == TRUE || look_74_0 == DSTRING || look_74_0 == EACH || look_74_0 == UNDEFINED || look_74_0 == NULL || look_74_0 == FALSE || look_74_0.between?( POUND, OBJECT_DEF ) || look_74_0.between?( ID, DOC ) || look_74_0.between?( T__148, T__150 ) )\n alt_74 = 1\n elsif ( look_74_0 == ARROW || look_74_0 == FUNCTION )\n alt_74 = 2\n elsif ( look_74_0 == EJS )\n alt_74 = 3\n elsif ( look_74_0 == NEW ) and ( syntactic_predicate?( :synpred9_Jejune ) )\n alt_74 = 4\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 74, 0 )\n end\n case alt_74\n when 1\n # at line 677:5: primary\n @state.following.push( TOKENS_FOLLOWING_primary_IN_receiver_4774 )\n primary310 = primary\n @state.following.pop\n if @state.backtracking == 0\n stream_primary.add( primary310.tree )\n end\n # AST Rewrite\n # elements: primary\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 677:14: -> primary\n @adaptor.add_child( root_0, stream_primary.next_tree )\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n # at line 678:5: function\n @state.following.push( TOKENS_FOLLOWING_function_IN_receiver_4785 )\n function311 = function\n @state.following.pop\n if @state.backtracking == 0\n stream_function.add( function311.tree )\n end\n # AST Rewrite\n # elements: function\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 678:14: -> function\n @adaptor.add_child( root_0, stream_function.next_tree )\n\n\n\n return_value.tree = root_0\n\n end\n when 3\n # at line 679:5: EJS\n __EJS312__ = match( EJS, TOKENS_FOLLOWING_EJS_IN_receiver_4795 )\n if @state.backtracking == 0\n stream_EJS.add( __EJS312__ )\n end\n # AST Rewrite\n # elements: EJS\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 679:14: -> EJS\n @adaptor.add_child( root_0, stream_EJS.next_node )\n\n\n\n return_value.tree = root_0\n\n end\n when 4\n # at line 680:5: ( 'new' new_target ( arguments )? )=> 'new' new_target ( arguments )?\n string_literal313 = match( NEW, TOKENS_FOLLOWING_NEW_IN_receiver_4828 )\n if @state.backtracking == 0\n stream_NEW.add( string_literal313 )\n end\n @state.following.push( TOKENS_FOLLOWING_new_target_IN_receiver_4830 )\n new_target314 = new_target\n @state.following.pop\n if @state.backtracking == 0\n stream_new_target.add( new_target314.tree )\n end\n # at line 681:24: ( arguments )?\n alt_73 = 2\n look_73_0 = @input.peek( 1 )\n\n if ( look_73_0 == LPAREN )\n alt_73 = 1\n end\n case alt_73\n when 1\n # at line 681:24: arguments\n @state.following.push( TOKENS_FOLLOWING_arguments_IN_receiver_4832 )\n arguments315 = arguments\n @state.following.pop\n if @state.backtracking == 0\n stream_arguments.add( arguments315.tree )\n end\n\n end\n # AST Rewrite\n # elements: new_target, arguments, NEW\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 681:35: -> ^( 'new' new_target ( arguments )? )\n # at line 681:38: ^( 'new' new_target ( arguments )? )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_NEW.next_node, root_1 )\n\n @adaptor.add_child( root_1, stream_new_target.next_tree )\n # at line 681:58: ( arguments )?\n if stream_arguments.has_next?\n @adaptor.add_child( root_1, stream_arguments.next_tree )\n\n end\n\n stream_arguments.reset();\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 64 )\n\n end\n \n return return_value\n end", "def peek(src)\n ctx = src.is_a?(Context) ? src : Context.new(src)\n starting_pos = ctx.bio.pos\n begin\n parse ctx\n ensure\n ctx.bio.restore_to starting_pos\n end\n end", "def rewrite_tree_block\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 34 )\n return_value = RewriteTreeBlockReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n lp = nil\n char_literal154 = nil\n rewrite_tree_alternative153 = nil\n\n tree_for_lp = nil\n tree_for_char_literal154 = nil\n stream_T__81 = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token T__81\" )\n stream_T__83 = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token T__83\" )\n stream_rewrite_tree_alternative = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule rewrite_tree_alternative\" )\n begin\n # at line 357:9: lp= '(' rewrite_tree_alternative ')'\n lp = match( T__81, TOKENS_FOLLOWING_T__81_IN_rewrite_tree_block_2591 )\n if @state.backtracking == 0\n stream_T__81.add( lp )\n end\n @state.following.push( TOKENS_FOLLOWING_rewrite_tree_alternative_IN_rewrite_tree_block_2593 )\n rewrite_tree_alternative153 = rewrite_tree_alternative\n @state.following.pop\n if @state.backtracking == 0\n stream_rewrite_tree_alternative.add( rewrite_tree_alternative153.tree )\n end\n char_literal154 = match( T__83, TOKENS_FOLLOWING_T__83_IN_rewrite_tree_block_2595 )\n if @state.backtracking == 0\n stream_T__83.add( char_literal154 )\n end\n # AST Rewrite\n # elements: rewrite_tree_alternative\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 358:6: -> ^( BLOCK[$lp,\\\"BLOCK\\\"] rewrite_tree_alternative EOB[$lp,\\\"EOB\\\"] )\n # at line 358:9: ^( BLOCK[$lp,\\\"BLOCK\\\"] rewrite_tree_alternative EOB[$lp,\\\"EOB\\\"] )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( @adaptor.create( BLOCK, lp, \"BLOCK\" ), root_1 )\n\n @adaptor.add_child( root_1, stream_rewrite_tree_alternative.next_tree )\n @adaptor.add_child( root_1, @adaptor.create( EOB, lp, \"EOB\" ) )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 34 )\n\n end\n \n return return_value\n end", "def test_goto_position_backwards\n @buffer = Buffer.new 'hellow world'\n @buffer.fin\n @buffer.goto_position 5\n assert_eq @buffer.position, 5\n assert_eq @buffer.at, 'w'\n end", "def consume()\n la(1)\n return @lookahead.shift\n end", "def rewrite_indirect_template_head\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 42)\n return_value = RewriteIndirectTemplateHeadReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n lp = nil\n __ACTION184__ = nil\n char_literal185 = nil\n char_literal186 = nil\n char_literal188 = nil\n rewrite_template_args187 = nil\n\n tree_for_lp = nil\n tree_for_ACTION184 = nil\n tree_for_char_literal185 = nil\n tree_for_char_literal186 = nil\n tree_for_char_literal188 = nil\n stream_T__81 = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token T__81\")\n stream_T__83 = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token T__83\")\n stream_ACTION = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token ACTION\")\n stream_rewrite_template_args = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule rewrite_template_args\")\n begin\n # at line 446:4: lp= '(' ACTION ')' '(' rewrite_template_args ')'\n lp = match(T__81, TOKENS_FOLLOWING_T__81_IN_rewrite_indirect_template_head_3026) \n if @state.backtracking == 0\n stream_T__81.add(lp)\n end\n __ACTION184__ = match(ACTION, TOKENS_FOLLOWING_ACTION_IN_rewrite_indirect_template_head_3028) \n if @state.backtracking == 0\n stream_ACTION.add(__ACTION184__)\n end\n char_literal185 = match(T__83, TOKENS_FOLLOWING_T__83_IN_rewrite_indirect_template_head_3030) \n if @state.backtracking == 0\n stream_T__83.add(char_literal185)\n end\n char_literal186 = match(T__81, TOKENS_FOLLOWING_T__81_IN_rewrite_indirect_template_head_3032) \n if @state.backtracking == 0\n stream_T__81.add(char_literal186)\n end\n @state.following.push(TOKENS_FOLLOWING_rewrite_template_args_IN_rewrite_indirect_template_head_3034)\n rewrite_template_args187 = rewrite_template_args\n @state.following.pop\n if @state.backtracking == 0\n stream_rewrite_template_args.add(rewrite_template_args187.tree)\n end\n char_literal188 = match(T__83, TOKENS_FOLLOWING_T__83_IN_rewrite_indirect_template_head_3036) \n if @state.backtracking == 0\n stream_T__83.add(char_literal188)\n end\n # AST Rewrite\n # elements: ACTION, rewrite_template_args\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 447:3: -> ^( TEMPLATE[$lp,\\\"TEMPLATE\\\"] ACTION rewrite_template_args )\n # at line 447:6: ^( TEMPLATE[$lp,\\\"TEMPLATE\\\"] ACTION rewrite_template_args )\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(@adaptor.create!(TEMPLATE, lp, \"TEMPLATE\"), root_1)\n\n @adaptor.add_child(root_1, stream_ACTION.next_node)\n @adaptor.add_child(root_1, stream_rewrite_template_args.next_tree)\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look(-1)\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing(root_0)\n @adaptor.set_token_boundaries(return_value.tree, return_value.start, return_value.stop)\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node!(@input, return_value.start, @input.look(-1), re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 42)\n\n end\n \n return return_value\n end", "def unshift(token); end", "def next_token; @stack.shift; end", "def rewrite_tree_block\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 34)\n return_value = RewriteTreeBlockReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n lp = nil\n char_literal154 = nil\n rewrite_tree_alternative153 = nil\n\n tree_for_lp = nil\n tree_for_char_literal154 = nil\n stream_T__81 = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token T__81\")\n stream_T__83 = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token T__83\")\n stream_rewrite_tree_alternative = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule rewrite_tree_alternative\")\n begin\n # at line 366:9: lp= '(' rewrite_tree_alternative ')'\n lp = match(T__81, TOKENS_FOLLOWING_T__81_IN_rewrite_tree_block_2596) \n if @state.backtracking == 0\n stream_T__81.add(lp)\n end\n @state.following.push(TOKENS_FOLLOWING_rewrite_tree_alternative_IN_rewrite_tree_block_2598)\n rewrite_tree_alternative153 = rewrite_tree_alternative\n @state.following.pop\n if @state.backtracking == 0\n stream_rewrite_tree_alternative.add(rewrite_tree_alternative153.tree)\n end\n char_literal154 = match(T__83, TOKENS_FOLLOWING_T__83_IN_rewrite_tree_block_2600) \n if @state.backtracking == 0\n stream_T__83.add(char_literal154)\n end\n # AST Rewrite\n # elements: rewrite_tree_alternative\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 367:6: -> ^( BLOCK[$lp,\\\"BLOCK\\\"] rewrite_tree_alternative EOB[$lp,\\\"EOB\\\"] )\n # at line 367:9: ^( BLOCK[$lp,\\\"BLOCK\\\"] rewrite_tree_alternative EOB[$lp,\\\"EOB\\\"] )\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(@adaptor.create!(BLOCK, lp, \"BLOCK\"), root_1)\n\n @adaptor.add_child(root_1, stream_rewrite_tree_alternative.next_tree)\n @adaptor.add_child(root_1, @adaptor.create!(EOB, lp, \"EOB\"))\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look(-1)\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing(root_0)\n @adaptor.set_token_boundaries(return_value.tree, return_value.start, return_value.stop)\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node!(@input, return_value.start, @input.look(-1), re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 34)\n\n end\n \n return return_value\n end", "def track(element)\n return list_for(element) << element if lookahead_buffer.empty?\n return lookahead_buffer << element if lookahead? element\n\n lookahead = lookahead_buffer.dup\n lookahead = create_lookahead(lookahead, false) if element.is_a? Node[:separator]\n lookahead_buffer.clear\n\n payload.concat(lookahead) << element\n end", "def track(element)\n return list_for(element) << element if lookahead_buffer.empty?\n return lookahead_buffer << element if lookahead? element\n\n lookahead = lookahead_buffer.dup\n lookahead = create_lookahead(lookahead, false) if element.is_a? Node[:separator]\n lookahead_buffer.clear\n\n payload.concat(lookahead) << element\n end", "def into\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 22 )\n into_start_index = @input.index\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return \n end\n # at line 301:7: ( 'I' | 'i' ) ( 'N' | 'n' ) ( 'T' | 't' ) ( 'O' | 'o' )\n if @input.peek( 1 ).between?( T__24, T__25 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__34, T__35 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__16, T__17 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__18, T__19 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 22 )\n memoize( __method__, into_start_index, success ) if @state.backtracking > 0\n\n end\n \n return \n end", "def rewrite_tree\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 39 )\n return_value = RewriteTreeReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal171 = nil\n char_literal174 = nil\n rewrite_tree_atom172 = nil\n rewrite_tree_element173 = nil\n\n tree_for_string_literal171 = nil\n tree_for_char_literal174 = nil\n stream_T__83 = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token T__83\" )\n stream_TREE_BEGIN = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token TREE_BEGIN\" )\n stream_rewrite_tree_element = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule rewrite_tree_element\" )\n stream_rewrite_tree_atom = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule rewrite_tree_atom\" )\n begin\n # at line 398:4: '^(' rewrite_tree_atom ( rewrite_tree_element )* ')'\n string_literal171 = match( TREE_BEGIN, TOKENS_FOLLOWING_TREE_BEGIN_IN_rewrite_tree_2866 )\n if @state.backtracking == 0\n stream_TREE_BEGIN.add( string_literal171 )\n end\n @state.following.push( TOKENS_FOLLOWING_rewrite_tree_atom_IN_rewrite_tree_2868 )\n rewrite_tree_atom172 = rewrite_tree_atom\n @state.following.pop\n if @state.backtracking == 0\n stream_rewrite_tree_atom.add( rewrite_tree_atom172.tree )\n end\n # at line 398:27: ( rewrite_tree_element )*\n while true # decision 79\n alt_79 = 2\n look_79_0 = @input.peek( 1 )\n\n if ( look_79_0 == TREE_BEGIN || look_79_0.between?( TOKEN_REF, ACTION ) || look_79_0 == RULE_REF || look_79_0 == T__81 || look_79_0 == T__93 )\n alt_79 = 1\n\n end\n case alt_79\n when 1\n # at line 398:27: rewrite_tree_element\n @state.following.push( TOKENS_FOLLOWING_rewrite_tree_element_IN_rewrite_tree_2870 )\n rewrite_tree_element173 = rewrite_tree_element\n @state.following.pop\n if @state.backtracking == 0\n stream_rewrite_tree_element.add( rewrite_tree_element173.tree )\n end\n\n else\n break # out of loop for decision 79\n end\n end # loop for decision 79\n char_literal174 = match( T__83, TOKENS_FOLLOWING_T__83_IN_rewrite_tree_2873 )\n if @state.backtracking == 0\n stream_T__83.add( char_literal174 )\n end\n # AST Rewrite\n # elements: rewrite_tree_atom, rewrite_tree_element\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 399:3: -> ^( TREE_BEGIN rewrite_tree_atom ( rewrite_tree_element )* )\n # at line 399:6: ^( TREE_BEGIN rewrite_tree_atom ( rewrite_tree_element )* )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( @adaptor.create_from_type( TREE_BEGIN, \"TREE_BEGIN\" ), root_1 )\n\n @adaptor.add_child( root_1, stream_rewrite_tree_atom.next_tree )\n # at line 399:37: ( rewrite_tree_element )*\n while stream_rewrite_tree_element.has_next?\n @adaptor.add_child( root_1, stream_rewrite_tree_element.next_tree )\n\n end\n\n stream_rewrite_tree_element.reset();\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 39 )\n\n end\n \n return return_value\n end", "def process_node_bookmark(xn)\n pull_node(xn)\n flag_match_found\n end", "def parse(buffer = :begin)\n buffer = [buffer]\n saved = save\n eat_ws_and_comments\n until eof?\n t = term\n break if t == :\"\"\n buffer += [t]\n end\n buffer = flatten_begin buffer\n A(*saved, *buffer)\n end", "def test_srch_back_for_nonexist_pattern\n @buffer = Buffer.new 'Now is the time for all good men to come to the aid of their country'\n @buffer.fin\n @buffer.srch_back 'xxyyzz'\n assert_eq '', @buffer.at\n end", "def forward(offset = 1)\n self[offset]\n @buffer.slice!(0, offset)\n end", "def fwd_after_peek\n @pos = @head_pos\n end", "def rewrite_tree_atom\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 37)\n return_value = RewriteTreeAtomReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n d = nil\n __CHAR_LITERAL162__ = nil\n __TOKEN_REF163__ = nil\n __ARG_ACTION164__ = nil\n __RULE_REF165__ = nil\n __STRING_LITERAL166__ = nil\n __ACTION168__ = nil\n id167 = nil\n\n tree_for_d = nil\n tree_for_CHAR_LITERAL162 = nil\n tree_for_TOKEN_REF163 = nil\n tree_for_ARG_ACTION164 = nil\n tree_for_RULE_REF165 = nil\n tree_for_STRING_LITERAL166 = nil\n tree_for_ACTION168 = nil\n stream_T__93 = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token T__93\")\n stream_TOKEN_REF = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token TOKEN_REF\")\n stream_ARG_ACTION = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token ARG_ACTION\")\n stream_id = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule id\")\n begin\n # at line 387:5: ( CHAR_LITERAL | TOKEN_REF ( ARG_ACTION )? -> ^( TOKEN_REF ( ARG_ACTION )? ) | RULE_REF | STRING_LITERAL | d= '$' id -> LABEL[$d,$id.text] | ACTION )\n alt_78 = 6\n case look_78 = @input.peek(1)\n when CHAR_LITERAL then alt_78 = 1\n when TOKEN_REF then alt_78 = 2\n when RULE_REF then alt_78 = 3\n when STRING_LITERAL then alt_78 = 4\n when T__93 then alt_78 = 5\n when ACTION then alt_78 = 6\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n\n nvae = NoViableAlternative(\"\", 78, 0)\n raise nvae\n end\n case alt_78\n when 1\n root_0 = @adaptor.create_flat_list!\n\n\n # at line 387:9: CHAR_LITERAL\n __CHAR_LITERAL162__ = match(CHAR_LITERAL, TOKENS_FOLLOWING_CHAR_LITERAL_IN_rewrite_tree_atom_2771)\n if @state.backtracking == 0\n\n tree_for_CHAR_LITERAL162 = @adaptor.create_with_payload!(__CHAR_LITERAL162__)\n @adaptor.add_child(root_0, tree_for_CHAR_LITERAL162)\n\n end\n\n when 2\n # at line 388:6: TOKEN_REF ( ARG_ACTION )?\n __TOKEN_REF163__ = match(TOKEN_REF, TOKENS_FOLLOWING_TOKEN_REF_IN_rewrite_tree_atom_2778) \n if @state.backtracking == 0\n stream_TOKEN_REF.add(__TOKEN_REF163__)\n end\n # at line 388:16: ( ARG_ACTION )?\n alt_77 = 2\n look_77_0 = @input.peek(1)\n\n if (look_77_0 == ARG_ACTION) \n alt_77 = 1\n end\n case alt_77\n when 1\n # at line 388:16: ARG_ACTION\n __ARG_ACTION164__ = match(ARG_ACTION, TOKENS_FOLLOWING_ARG_ACTION_IN_rewrite_tree_atom_2780) \n if @state.backtracking == 0\n stream_ARG_ACTION.add(__ARG_ACTION164__)\n end\n\n end\n # AST Rewrite\n # elements: TOKEN_REF, ARG_ACTION\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 388:28: -> ^( TOKEN_REF ( ARG_ACTION )? )\n # at line 388:31: ^( TOKEN_REF ( ARG_ACTION )? )\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(stream_TOKEN_REF.next_node, root_1)\n\n # at line 388:43: ( ARG_ACTION )?\n if stream_ARG_ACTION.has_next?\n @adaptor.add_child(root_1, stream_ARG_ACTION.next_node)\n\n end\n\n stream_ARG_ACTION.reset();\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end\n when 3\n root_0 = @adaptor.create_flat_list!\n\n\n # at line 389:7: RULE_REF\n __RULE_REF165__ = match(RULE_REF, TOKENS_FOLLOWING_RULE_REF_IN_rewrite_tree_atom_2799)\n if @state.backtracking == 0\n\n tree_for_RULE_REF165 = @adaptor.create_with_payload!(__RULE_REF165__)\n @adaptor.add_child(root_0, tree_for_RULE_REF165)\n\n end\n\n when 4\n root_0 = @adaptor.create_flat_list!\n\n\n # at line 390:6: STRING_LITERAL\n __STRING_LITERAL166__ = match(STRING_LITERAL, TOKENS_FOLLOWING_STRING_LITERAL_IN_rewrite_tree_atom_2806)\n if @state.backtracking == 0\n\n tree_for_STRING_LITERAL166 = @adaptor.create_with_payload!(__STRING_LITERAL166__)\n @adaptor.add_child(root_0, tree_for_STRING_LITERAL166)\n\n end\n\n when 5\n # at line 391:6: d= '$' id\n d = match(T__93, TOKENS_FOLLOWING_T__93_IN_rewrite_tree_atom_2815) \n if @state.backtracking == 0\n stream_T__93.add(d)\n end\n @state.following.push(TOKENS_FOLLOWING_id_IN_rewrite_tree_atom_2817)\n id167 = id\n @state.following.pop\n if @state.backtracking == 0\n stream_id.add(id167.tree)\n end\n # AST Rewrite\n # elements: \n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 391:15: -> LABEL[$d,$id.text]\n @adaptor.add_child(root_0, @adaptor.create!(LABEL, d, (id167.nil? ? nil : @input.to_s(id167.start,id167.stop))))\n\n\n\n return_value.tree = root_0\n\n end\n when 6\n root_0 = @adaptor.create_flat_list!\n\n\n # at line 392:4: ACTION\n __ACTION168__ = match(ACTION, TOKENS_FOLLOWING_ACTION_IN_rewrite_tree_atom_2828)\n if @state.backtracking == 0\n\n tree_for_ACTION168 = @adaptor.create_with_payload!(__ACTION168__)\n @adaptor.add_child(root_0, tree_for_ACTION168)\n\n end\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look(-1)\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing(root_0)\n @adaptor.set_token_boundaries(return_value.tree, return_value.start, return_value.stop)\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node!(@input, return_value.start, @input.look(-1), re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 37)\n\n end\n \n return return_value\n end", "def rewrite_indirect_template_head\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 42 )\n return_value = RewriteIndirectTemplateHeadReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n lp = nil\n __ACTION184__ = nil\n char_literal185 = nil\n char_literal186 = nil\n char_literal188 = nil\n rewrite_template_args187 = nil\n\n tree_for_lp = nil\n tree_for_ACTION184 = nil\n tree_for_char_literal185 = nil\n tree_for_char_literal186 = nil\n tree_for_char_literal188 = nil\n stream_T__81 = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token T__81\" )\n stream_T__83 = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token T__83\" )\n stream_ACTION = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token ACTION\" )\n stream_rewrite_template_args = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule rewrite_template_args\" )\n begin\n # at line 437:4: lp= '(' ACTION ')' '(' rewrite_template_args ')'\n lp = match( T__81, TOKENS_FOLLOWING_T__81_IN_rewrite_indirect_template_head_3021 )\n if @state.backtracking == 0\n stream_T__81.add( lp )\n end\n __ACTION184__ = match( ACTION, TOKENS_FOLLOWING_ACTION_IN_rewrite_indirect_template_head_3023 )\n if @state.backtracking == 0\n stream_ACTION.add( __ACTION184__ )\n end\n char_literal185 = match( T__83, TOKENS_FOLLOWING_T__83_IN_rewrite_indirect_template_head_3025 )\n if @state.backtracking == 0\n stream_T__83.add( char_literal185 )\n end\n char_literal186 = match( T__81, TOKENS_FOLLOWING_T__81_IN_rewrite_indirect_template_head_3027 )\n if @state.backtracking == 0\n stream_T__81.add( char_literal186 )\n end\n @state.following.push( TOKENS_FOLLOWING_rewrite_template_args_IN_rewrite_indirect_template_head_3029 )\n rewrite_template_args187 = rewrite_template_args\n @state.following.pop\n if @state.backtracking == 0\n stream_rewrite_template_args.add( rewrite_template_args187.tree )\n end\n char_literal188 = match( T__83, TOKENS_FOLLOWING_T__83_IN_rewrite_indirect_template_head_3031 )\n if @state.backtracking == 0\n stream_T__83.add( char_literal188 )\n end\n # AST Rewrite\n # elements: rewrite_template_args, ACTION\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 438:3: -> ^( TEMPLATE[$lp,\\\"TEMPLATE\\\"] ACTION rewrite_template_args )\n # at line 438:6: ^( TEMPLATE[$lp,\\\"TEMPLATE\\\"] ACTION rewrite_template_args )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( @adaptor.create( TEMPLATE, lp, \"TEMPLATE\" ), root_1 )\n\n @adaptor.add_child( root_1, stream_ACTION.next_node )\n @adaptor.add_child( root_1, stream_rewrite_template_args.next_tree )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 42 )\n\n end\n \n return return_value\n end", "def rewrite_tree_atom\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 37 )\n return_value = RewriteTreeAtomReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n d = nil\n __CHAR_LITERAL162__ = nil\n __TOKEN_REF163__ = nil\n __ARG_ACTION164__ = nil\n __RULE_REF165__ = nil\n __STRING_LITERAL166__ = nil\n __ACTION168__ = nil\n id167 = nil\n\n tree_for_d = nil\n tree_for_CHAR_LITERAL162 = nil\n tree_for_TOKEN_REF163 = nil\n tree_for_ARG_ACTION164 = nil\n tree_for_RULE_REF165 = nil\n tree_for_STRING_LITERAL166 = nil\n tree_for_ACTION168 = nil\n stream_T__93 = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token T__93\" )\n stream_TOKEN_REF = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token TOKEN_REF\" )\n stream_ARG_ACTION = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token ARG_ACTION\" )\n stream_id = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule id\" )\n begin\n # at line 378:5: ( CHAR_LITERAL | TOKEN_REF ( ARG_ACTION )? -> ^( TOKEN_REF ( ARG_ACTION )? ) | RULE_REF | STRING_LITERAL | d= '$' id -> LABEL[$d,$id.text] | ACTION )\n alt_78 = 6\n case look_78 = @input.peek( 1 )\n when CHAR_LITERAL then alt_78 = 1\n when TOKEN_REF then alt_78 = 2\n when RULE_REF then alt_78 = 3\n when STRING_LITERAL then alt_78 = 4\n when T__93 then alt_78 = 5\n when ACTION then alt_78 = 6\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 78, 0 )\n end\n case alt_78\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 378:9: CHAR_LITERAL\n __CHAR_LITERAL162__ = match( CHAR_LITERAL, TOKENS_FOLLOWING_CHAR_LITERAL_IN_rewrite_tree_atom_2766 )\n if @state.backtracking == 0\n\n tree_for_CHAR_LITERAL162 = @adaptor.create_with_payload( __CHAR_LITERAL162__ )\n @adaptor.add_child( root_0, tree_for_CHAR_LITERAL162 )\n\n end\n\n when 2\n # at line 379:6: TOKEN_REF ( ARG_ACTION )?\n __TOKEN_REF163__ = match( TOKEN_REF, TOKENS_FOLLOWING_TOKEN_REF_IN_rewrite_tree_atom_2773 )\n if @state.backtracking == 0\n stream_TOKEN_REF.add( __TOKEN_REF163__ )\n end\n # at line 379:16: ( ARG_ACTION )?\n alt_77 = 2\n look_77_0 = @input.peek( 1 )\n\n if ( look_77_0 == ARG_ACTION )\n alt_77 = 1\n end\n case alt_77\n when 1\n # at line 379:16: ARG_ACTION\n __ARG_ACTION164__ = match( ARG_ACTION, TOKENS_FOLLOWING_ARG_ACTION_IN_rewrite_tree_atom_2775 )\n if @state.backtracking == 0\n stream_ARG_ACTION.add( __ARG_ACTION164__ )\n end\n\n end\n # AST Rewrite\n # elements: ARG_ACTION, TOKEN_REF\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 379:28: -> ^( TOKEN_REF ( ARG_ACTION )? )\n # at line 379:31: ^( TOKEN_REF ( ARG_ACTION )? )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_TOKEN_REF.next_node, root_1 )\n\n # at line 379:43: ( ARG_ACTION )?\n if stream_ARG_ACTION.has_next?\n @adaptor.add_child( root_1, stream_ARG_ACTION.next_node )\n\n end\n\n stream_ARG_ACTION.reset();\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end\n when 3\n root_0 = @adaptor.create_flat_list\n\n\n # at line 380:7: RULE_REF\n __RULE_REF165__ = match( RULE_REF, TOKENS_FOLLOWING_RULE_REF_IN_rewrite_tree_atom_2794 )\n if @state.backtracking == 0\n\n tree_for_RULE_REF165 = @adaptor.create_with_payload( __RULE_REF165__ )\n @adaptor.add_child( root_0, tree_for_RULE_REF165 )\n\n end\n\n when 4\n root_0 = @adaptor.create_flat_list\n\n\n # at line 381:6: STRING_LITERAL\n __STRING_LITERAL166__ = match( STRING_LITERAL, TOKENS_FOLLOWING_STRING_LITERAL_IN_rewrite_tree_atom_2801 )\n if @state.backtracking == 0\n\n tree_for_STRING_LITERAL166 = @adaptor.create_with_payload( __STRING_LITERAL166__ )\n @adaptor.add_child( root_0, tree_for_STRING_LITERAL166 )\n\n end\n\n when 5\n # at line 382:6: d= '$' id\n d = match( T__93, TOKENS_FOLLOWING_T__93_IN_rewrite_tree_atom_2810 )\n if @state.backtracking == 0\n stream_T__93.add( d )\n end\n @state.following.push( TOKENS_FOLLOWING_id_IN_rewrite_tree_atom_2812 )\n id167 = id\n @state.following.pop\n if @state.backtracking == 0\n stream_id.add( id167.tree )\n end\n # AST Rewrite\n # elements: \n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 382:15: -> LABEL[$d,$id.text]\n @adaptor.add_child( root_0, @adaptor.create( LABEL, d, ( id167 && @input.to_s( id167.start, id167.stop ) ) ) )\n\n\n\n return_value.tree = root_0\n\n end\n when 6\n root_0 = @adaptor.create_flat_list\n\n\n # at line 383:4: ACTION\n __ACTION168__ = match( ACTION, TOKENS_FOLLOWING_ACTION_IN_rewrite_tree_atom_2823 )\n if @state.backtracking == 0\n\n tree_for_ACTION168 = @adaptor.create_with_payload( __ACTION168__ )\n @adaptor.add_child( root_0, tree_for_ACTION168 )\n\n end\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 37 )\n\n end\n \n return return_value\n end", "def chunk!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 8 )\n\n type = CHUNK\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 47:3: ( ( '-' )+ ( CHUNK_CHAR )* | ( CHUNK_CHAR )+ )\n alt_16 = 2\n look_16_0 = @input.peek( 1 )\n\n if ( look_16_0 == 0x2d )\n alt_16 = 1\n elsif ( look_16_0.between?( 0x0, 0x8 ) || look_16_0.between?( 0xb, 0xc ) || look_16_0.between?( 0xe, 0x1f ) || look_16_0 == 0x21 || look_16_0.between?( 0x25, 0x26 ) || look_16_0.between?( 0x2b, 0x2c ) || look_16_0.between?( 0x2e, 0x3a ) || look_16_0 == 0x3d || look_16_0.between?( 0x40, 0x5f ) || look_16_0.between?( 0x61, 0x7a ) || look_16_0.between?( 0x7f, 0xffff ) )\n alt_16 = 2\n else\n raise NoViableAlternative( \"\", 16, 0 )\n end\n case alt_16\n when 1\n # at line 47:5: ( '-' )+ ( CHUNK_CHAR )*\n # at file 47:5: ( '-' )+\n match_count_13 = 0\n while true\n alt_13 = 2\n look_13_0 = @input.peek( 1 )\n\n if ( look_13_0 == 0x2d )\n alt_13 = 1\n\n end\n case alt_13\n when 1\n # at line 47:5: '-'\n match( 0x2d )\n\n else\n match_count_13 > 0 and break\n eee = EarlyExit(13)\n\n\n raise eee\n end\n match_count_13 += 1\n end\n\n # at line 47:10: ( CHUNK_CHAR )*\n while true # decision 14\n alt_14 = 2\n look_14_0 = @input.peek( 1 )\n\n if ( look_14_0.between?( 0x0, 0x8 ) || look_14_0.between?( 0xb, 0xc ) || look_14_0.between?( 0xe, 0x1f ) || look_14_0 == 0x21 || look_14_0.between?( 0x25, 0x26 ) || look_14_0.between?( 0x2b, 0x3a ) || look_14_0 == 0x3d || look_14_0.between?( 0x40, 0x5f ) || look_14_0.between?( 0x61, 0x7a ) || look_14_0.between?( 0x7f, 0xffff ) )\n alt_14 = 1\n\n end\n case alt_14\n when 1\n # at line 47:10: CHUNK_CHAR\n chunk_char!\n\n else\n break # out of loop for decision 14\n end\n end # loop for decision 14\n # --> action\n type = SWITCH \n # <-- action\n\n when 2\n # at line 48:5: ( CHUNK_CHAR )+\n # at file 48:5: ( CHUNK_CHAR )+\n match_count_15 = 0\n while true\n alt_15 = 2\n look_15_0 = @input.peek( 1 )\n\n if ( look_15_0.between?( 0x0, 0x8 ) || look_15_0.between?( 0xb, 0xc ) || look_15_0.between?( 0xe, 0x1f ) || look_15_0 == 0x21 || look_15_0.between?( 0x25, 0x26 ) || look_15_0.between?( 0x2b, 0x3a ) || look_15_0 == 0x3d || look_15_0.between?( 0x40, 0x5f ) || look_15_0.between?( 0x61, 0x7a ) || look_15_0.between?( 0x7f, 0xffff ) )\n alt_15 = 1\n\n end\n case alt_15\n when 1\n # at line 48:5: CHUNK_CHAR\n chunk_char!\n\n else\n match_count_15 > 0 and break\n eee = EarlyExit(15)\n\n\n raise eee\n end\n match_count_15 += 1\n end\n\n # --> action\n @cmd_start and type = COMMAND_NAME \n # <-- action\n\n end\n \n @state.type = type\n @state.channel = channel\n # --> action\n @cmd_start = false \n # <-- action\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 8 )\n\n end", "def id\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 46 )\n return_value = IdReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n __TOKEN_REF198__ = nil\n __RULE_REF199__ = nil\n\n tree_for_TOKEN_REF198 = nil\n tree_for_RULE_REF199 = nil\n stream_RULE_REF = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token RULE_REF\" )\n stream_TOKEN_REF = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token TOKEN_REF\" )\n\n begin\n # at line 453:4: ( TOKEN_REF -> ID[$TOKEN_REF] | RULE_REF -> ID[$RULE_REF] )\n alt_85 = 2\n look_85_0 = @input.peek( 1 )\n\n if ( look_85_0 == TOKEN_REF )\n alt_85 = 1\n elsif ( look_85_0 == RULE_REF )\n alt_85 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 85, 0 )\n end\n case alt_85\n when 1\n # at line 454:4: TOKEN_REF\n __TOKEN_REF198__ = match( TOKEN_REF, TOKENS_FOLLOWING_TOKEN_REF_IN_id_3139 )\n if @state.backtracking == 0\n stream_TOKEN_REF.add( __TOKEN_REF198__ )\n end\n # AST Rewrite\n # elements: \n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 454:14: -> ID[$TOKEN_REF]\n @adaptor.add_child( root_0, @adaptor.create( ID, __TOKEN_REF198__ ) )\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n # at line 455:4: RULE_REF\n __RULE_REF199__ = match( RULE_REF, TOKENS_FOLLOWING_RULE_REF_IN_id_3149 )\n if @state.backtracking == 0\n stream_RULE_REF.add( __RULE_REF199__ )\n end\n # AST Rewrite\n # elements: \n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 455:14: -> ID[$RULE_REF]\n @adaptor.add_child( root_0, @adaptor.create( ID, __RULE_REF199__ ) )\n\n\n\n return_value.tree = root_0\n\n end\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 46 )\n\n end\n \n return return_value\n end", "def peek()\n \n end", "def scan_for_on(token); end", "def to\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 45 )\n to_start_index = @input.index\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return \n end\n # at line 332:5: ( 'T' | 't' ) ( 'O' | 'o' )\n if @input.peek( 1 ).between?( T__16, T__17 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__18, T__19 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 45 )\n memoize( __method__, to_start_index, success ) if @state.backtracking > 0\n\n end\n \n return \n end", "def atom\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 22)\n return_value = AtomReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n op = nil\n __RULE_REF110__ = nil\n __ARG_ACTION111__ = nil\n terminal107 = nil\n range108 = nil\n not_set109 = nil\n\n tree_for_op = nil\n tree_for_RULE_REF110 = nil\n tree_for_ARG_ACTION111 = nil\n stream_BANG = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token BANG\")\n stream_ROOT = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token ROOT\")\n stream_RULE_REF = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token RULE_REF\")\n stream_ARG_ACTION = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token ARG_ACTION\")\n stream_range = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule range\")\n stream_not_set = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule not_set\")\n begin\n # at line 254:5: ( terminal | range ( (op= '^' | op= '!' ) -> ^( $op range ) | -> range ) | not_set ( (op= '^' | op= '!' ) -> ^( $op not_set ) | -> not_set ) | RULE_REF ( ARG_ACTION )? ( (op= '^' | op= '!' ) -> ^( $op RULE_REF ( ARG_ACTION )? ) | -> ^( RULE_REF ( ARG_ACTION )? ) ) )\n alt_54 = 4\n case look_54 = @input.peek(1)\n when CHAR_LITERAL then look_54_1 = @input.peek(2)\n\n if (look_54_1 == RANGE) \n alt_54 = 2\n elsif (look_54_1 == SEMPRED || look_54_1.between?(TREE_BEGIN, REWRITE) || look_54_1.between?(TOKEN_REF, ACTION) || look_54_1 == RULE_REF || look_54_1 == T__71 || look_54_1 == T__74 || look_54_1.between?(T__81, T__83) || look_54_1.between?(T__87, T__88) || look_54_1.between?(T__90, T__92)) \n alt_54 = 1\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 54, 1)\n raise nvae\n end\n when TOKEN_REF, STRING_LITERAL, T__90 then alt_54 = 1\n when T__87 then alt_54 = 3\n when RULE_REF then alt_54 = 4\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n\n nvae = NoViableAlternative(\"\", 54, 0)\n raise nvae\n end\n case alt_54\n when 1\n root_0 = @adaptor.create_flat_list!\n\n\n # at line 254:9: terminal\n @state.following.push(TOKENS_FOLLOWING_terminal_IN_atom_1703)\n terminal107 = terminal\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child(root_0, terminal107.tree)\n end\n\n when 2\n # at line 255:4: range ( (op= '^' | op= '!' ) -> ^( $op range ) | -> range )\n @state.following.push(TOKENS_FOLLOWING_range_IN_atom_1708)\n range108 = range\n @state.following.pop\n if @state.backtracking == 0\n stream_range.add(range108.tree)\n end\n # at line 256:3: ( (op= '^' | op= '!' ) -> ^( $op range ) | -> range )\n alt_48 = 2\n look_48_0 = @input.peek(1)\n\n if (look_48_0.between?(ROOT, BANG)) \n alt_48 = 1\n elsif (look_48_0 == SEMPRED || look_48_0 == TREE_BEGIN || look_48_0 == REWRITE || look_48_0.between?(TOKEN_REF, ACTION) || look_48_0 == RULE_REF || look_48_0 == T__71 || look_48_0 == T__74 || look_48_0.between?(T__81, T__83) || look_48_0 == T__87 || look_48_0.between?(T__90, T__92)) \n alt_48 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 48, 0)\n raise nvae\n end\n case alt_48\n when 1\n # at line 256:5: (op= '^' | op= '!' )\n # at line 256:5: (op= '^' | op= '!' )\n alt_47 = 2\n look_47_0 = @input.peek(1)\n\n if (look_47_0 == ROOT) \n alt_47 = 1\n elsif (look_47_0 == BANG) \n alt_47 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 47, 0)\n raise nvae\n end\n case alt_47\n when 1\n # at line 256:6: op= '^'\n op = match(ROOT, TOKENS_FOLLOWING_ROOT_IN_atom_1718) \n if @state.backtracking == 0\n stream_ROOT.add(op)\n end\n\n when 2\n # at line 256:13: op= '!'\n op = match(BANG, TOKENS_FOLLOWING_BANG_IN_atom_1722) \n if @state.backtracking == 0\n stream_BANG.add(op)\n end\n\n end\n # AST Rewrite\n # elements: op, range\n # token labels: op\n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_op = token_stream(\"token op\", op)\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 256:21: -> ^( $op range )\n # at line 256:24: ^( $op range )\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(stream_op.next_node, root_1)\n\n @adaptor.add_child(root_1, stream_range.next_tree)\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n # at line 257:9: \n # AST Rewrite\n # elements: range\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 257:9: -> range\n @adaptor.add_child(root_0, stream_range.next_tree)\n\n\n\n return_value.tree = root_0\n\n end\n end\n\n when 3\n # at line 259:7: not_set ( (op= '^' | op= '!' ) -> ^( $op not_set ) | -> not_set )\n @state.following.push(TOKENS_FOLLOWING_not_set_IN_atom_1756)\n not_set109 = not_set\n @state.following.pop\n if @state.backtracking == 0\n stream_not_set.add(not_set109.tree)\n end\n # at line 260:3: ( (op= '^' | op= '!' ) -> ^( $op not_set ) | -> not_set )\n alt_50 = 2\n look_50_0 = @input.peek(1)\n\n if (look_50_0.between?(ROOT, BANG)) \n alt_50 = 1\n elsif (look_50_0 == SEMPRED || look_50_0 == TREE_BEGIN || look_50_0 == REWRITE || look_50_0.between?(TOKEN_REF, ACTION) || look_50_0 == RULE_REF || look_50_0 == T__71 || look_50_0 == T__74 || look_50_0.between?(T__81, T__83) || look_50_0 == T__87 || look_50_0.between?(T__90, T__92)) \n alt_50 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 50, 0)\n raise nvae\n end\n case alt_50\n when 1\n # at line 260:5: (op= '^' | op= '!' )\n # at line 260:5: (op= '^' | op= '!' )\n alt_49 = 2\n look_49_0 = @input.peek(1)\n\n if (look_49_0 == ROOT) \n alt_49 = 1\n elsif (look_49_0 == BANG) \n alt_49 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 49, 0)\n raise nvae\n end\n case alt_49\n when 1\n # at line 260:6: op= '^'\n op = match(ROOT, TOKENS_FOLLOWING_ROOT_IN_atom_1765) \n if @state.backtracking == 0\n stream_ROOT.add(op)\n end\n\n when 2\n # at line 260:13: op= '!'\n op = match(BANG, TOKENS_FOLLOWING_BANG_IN_atom_1769) \n if @state.backtracking == 0\n stream_BANG.add(op)\n end\n\n end\n # AST Rewrite\n # elements: not_set, op\n # token labels: op\n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_op = token_stream(\"token op\", op)\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 260:21: -> ^( $op not_set )\n # at line 260:24: ^( $op not_set )\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(stream_op.next_node, root_1)\n\n @adaptor.add_child(root_1, stream_not_set.next_tree)\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n # at line 261:9: \n # AST Rewrite\n # elements: not_set\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 261:9: -> not_set\n @adaptor.add_child(root_0, stream_not_set.next_tree)\n\n\n\n return_value.tree = root_0\n\n end\n end\n\n when 4\n # at line 263:9: RULE_REF ( ARG_ACTION )? ( (op= '^' | op= '!' ) -> ^( $op RULE_REF ( ARG_ACTION )? ) | -> ^( RULE_REF ( ARG_ACTION )? ) )\n __RULE_REF110__ = match(RULE_REF, TOKENS_FOLLOWING_RULE_REF_IN_atom_1805) \n if @state.backtracking == 0\n stream_RULE_REF.add(__RULE_REF110__)\n end\n # at line 263:18: ( ARG_ACTION )?\n alt_51 = 2\n look_51_0 = @input.peek(1)\n\n if (look_51_0 == ARG_ACTION) \n alt_51 = 1\n end\n case alt_51\n when 1\n # at line 263:18: ARG_ACTION\n __ARG_ACTION111__ = match(ARG_ACTION, TOKENS_FOLLOWING_ARG_ACTION_IN_atom_1807) \n if @state.backtracking == 0\n stream_ARG_ACTION.add(__ARG_ACTION111__)\n end\n\n end\n # at line 264:3: ( (op= '^' | op= '!' ) -> ^( $op RULE_REF ( ARG_ACTION )? ) | -> ^( RULE_REF ( ARG_ACTION )? ) )\n alt_53 = 2\n look_53_0 = @input.peek(1)\n\n if (look_53_0.between?(ROOT, BANG)) \n alt_53 = 1\n elsif (look_53_0 == SEMPRED || look_53_0 == TREE_BEGIN || look_53_0 == REWRITE || look_53_0.between?(TOKEN_REF, ACTION) || look_53_0 == RULE_REF || look_53_0 == T__71 || look_53_0 == T__74 || look_53_0.between?(T__81, T__83) || look_53_0 == T__87 || look_53_0.between?(T__90, T__92)) \n alt_53 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 53, 0)\n raise nvae\n end\n case alt_53\n when 1\n # at line 264:5: (op= '^' | op= '!' )\n # at line 264:5: (op= '^' | op= '!' )\n alt_52 = 2\n look_52_0 = @input.peek(1)\n\n if (look_52_0 == ROOT) \n alt_52 = 1\n elsif (look_52_0 == BANG) \n alt_52 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 52, 0)\n raise nvae\n end\n case alt_52\n when 1\n # at line 264:6: op= '^'\n op = match(ROOT, TOKENS_FOLLOWING_ROOT_IN_atom_1817) \n if @state.backtracking == 0\n stream_ROOT.add(op)\n end\n\n when 2\n # at line 264:13: op= '!'\n op = match(BANG, TOKENS_FOLLOWING_BANG_IN_atom_1821) \n if @state.backtracking == 0\n stream_BANG.add(op)\n end\n\n end\n # AST Rewrite\n # elements: op, ARG_ACTION, RULE_REF\n # token labels: op\n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_op = token_stream(\"token op\", op)\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 264:21: -> ^( $op RULE_REF ( ARG_ACTION )? )\n # at line 264:24: ^( $op RULE_REF ( ARG_ACTION )? )\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(stream_op.next_node, root_1)\n\n @adaptor.add_child(root_1, stream_RULE_REF.next_node)\n # at line 264:39: ( ARG_ACTION )?\n if stream_ARG_ACTION.has_next?\n @adaptor.add_child(root_1, stream_ARG_ACTION.next_node)\n\n end\n\n stream_ARG_ACTION.reset();\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n # at line 265:9: \n # AST Rewrite\n # elements: ARG_ACTION, RULE_REF\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 265:9: -> ^( RULE_REF ( ARG_ACTION )? )\n # at line 265:12: ^( RULE_REF ( ARG_ACTION )? )\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(stream_RULE_REF.next_node, root_1)\n\n # at line 265:23: ( ARG_ACTION )?\n if stream_ARG_ACTION.has_next?\n @adaptor.add_child(root_1, stream_ARG_ACTION.next_node)\n\n end\n\n stream_ARG_ACTION.reset();\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end\n end\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look(-1)\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing(root_0)\n @adaptor.set_token_boundaries(return_value.tree, return_value.start, return_value.stop)\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node!(@input, return_value.start, @input.look(-1), re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 22)\n\n end\n \n return return_value\n end", "def shift\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 57 )\n return_value = ShiftReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal259 = nil\n string_literal260 = nil\n string_literal261 = nil\n add258 = nil\n add262 = nil\n\n tree_for_string_literal259 = nil\n tree_for_string_literal260 = nil\n tree_for_string_literal261 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 622:5: add ( ( '<<' | '>>' | '>>>' ) add )*\n @state.following.push( TOKENS_FOLLOWING_add_IN_shift_4106 )\n add258 = add\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, add258.tree )\n end\n # at line 622:9: ( ( '<<' | '>>' | '>>>' ) add )*\n while true # decision 62\n alt_62 = 2\n look_62_0 = @input.peek( 1 )\n\n if ( look_62_0 == RSHIFT || look_62_0 == RSHIFT3 || look_62_0 == LSHIFT )\n alt_62 = 1\n\n end\n case alt_62\n when 1\n # at line 622:12: ( '<<' | '>>' | '>>>' ) add\n # at line 622:12: ( '<<' | '>>' | '>>>' )\n alt_61 = 3\n case look_61 = @input.peek( 1 )\n when LSHIFT then alt_61 = 1\n when RSHIFT then alt_61 = 2\n when RSHIFT3 then alt_61 = 3\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 61, 0 )\n end\n case alt_61\n when 1\n # at line 622:14: '<<'\n string_literal259 = match( LSHIFT, TOKENS_FOLLOWING_LSHIFT_IN_shift_4113 )\n if @state.backtracking == 0\n\n tree_for_string_literal259 = @adaptor.create_with_payload( string_literal259 )\n root_0 = @adaptor.become_root( tree_for_string_literal259, root_0 )\n\n end\n\n when 2\n # at line 622:22: '>>'\n string_literal260 = match( RSHIFT, TOKENS_FOLLOWING_RSHIFT_IN_shift_4118 )\n if @state.backtracking == 0\n\n tree_for_string_literal260 = @adaptor.create_with_payload( string_literal260 )\n root_0 = @adaptor.become_root( tree_for_string_literal260, root_0 )\n\n end\n\n when 3\n # at line 622:30: '>>>'\n string_literal261 = match( RSHIFT3, TOKENS_FOLLOWING_RSHIFT3_IN_shift_4123 )\n if @state.backtracking == 0\n\n tree_for_string_literal261 = @adaptor.create_with_payload( string_literal261 )\n root_0 = @adaptor.become_root( tree_for_string_literal261, root_0 )\n\n end\n\n end\n @state.following.push( TOKENS_FOLLOWING_add_IN_shift_4129 )\n add262 = add\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, add262.tree )\n end\n\n else\n break # out of loop for decision 62\n end\n end # loop for decision 62\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 57 )\n\n end\n \n return return_value\n end", "def match(nodes, offset)\n if offset >= nodes.length\n return min_repeats.zero? ? offset : nil\n end\n\n count = 0\n nodes[offset...nodes.length].each_with_index do |n, i|\n next if n.ignorable?\n\n return returnable(nodes, i + offset + 1) if count == max_repeats\n\n if n.traversible? && n.name == seeking\n count += 1\n return returnable(nodes, i + offset + 1) if count == max_repeats\n\n next\n end\n\n return count >= min_repeats ? returnable(nodes, i + offset) : nil\n end\n count < min_repeats ? nil : returnable(nodes, nodes.length) # all nodes were consumed\n end", "def next_token; end", "def peek\r\n @peek_buffer ||= get unless eoln?\r\n end", "def id\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 46)\n return_value = IdReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n __TOKEN_REF198__ = nil\n __RULE_REF199__ = nil\n\n tree_for_TOKEN_REF198 = nil\n tree_for_RULE_REF199 = nil\n stream_RULE_REF = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token RULE_REF\")\n stream_TOKEN_REF = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token TOKEN_REF\")\n\n begin\n # at line 462:4: ( TOKEN_REF -> ID[$TOKEN_REF] | RULE_REF -> ID[$RULE_REF] )\n alt_85 = 2\n look_85_0 = @input.peek(1)\n\n if (look_85_0 == TOKEN_REF) \n alt_85 = 1\n elsif (look_85_0 == RULE_REF) \n alt_85 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 85, 0)\n raise nvae\n end\n case alt_85\n when 1\n # at line 463:4: TOKEN_REF\n __TOKEN_REF198__ = match(TOKEN_REF, TOKENS_FOLLOWING_TOKEN_REF_IN_id_3144) \n if @state.backtracking == 0\n stream_TOKEN_REF.add(__TOKEN_REF198__)\n end\n # AST Rewrite\n # elements: \n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 463:14: -> ID[$TOKEN_REF]\n @adaptor.add_child(root_0, @adaptor.create!(ID, __TOKEN_REF198__))\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n # at line 464:4: RULE_REF\n __RULE_REF199__ = match(RULE_REF, TOKENS_FOLLOWING_RULE_REF_IN_id_3154) \n if @state.backtracking == 0\n stream_RULE_REF.add(__RULE_REF199__)\n end\n # AST Rewrite\n # elements: \n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 464:14: -> ID[$RULE_REF]\n @adaptor.add_child(root_0, @adaptor.create!(ID, __RULE_REF199__))\n\n\n\n return_value.tree = root_0\n\n end\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look(-1)\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing(root_0)\n @adaptor.set_token_boundaries(return_value.tree, return_value.start, return_value.stop)\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node!(@input, return_value.start, @input.look(-1), re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 46)\n\n end\n \n return return_value\n end", "def on_match_pattern_p(node); end", "def sl_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 39)\n\n type = SL_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 470:5: '//' ( ' $ANTLR ' SRC | (~ ( '\\\\r' | '\\\\n' ) )* ) ( '\\\\r' )? '\\\\n'\n match(\"//\")\n # at line 471:5: ( ' $ANTLR ' SRC | (~ ( '\\\\r' | '\\\\n' ) )* )\n alt_2 = 2\n alt_2 = @dfa2.predict(@input)\n case alt_2\n when 1\n # at line 471:7: ' $ANTLR ' SRC\n match(\" $ANTLR \")\n src!\n\n when 2\n # at line 472:6: (~ ( '\\\\r' | '\\\\n' ) )*\n # at line 472:6: (~ ( '\\\\r' | '\\\\n' ) )*\n loop do #loop 1\n alt_1 = 2\n look_1_0 = @input.peek(1)\n\n if (look_1_0.between?(0x0000, ?\\t) || look_1_0.between?(0x000B, ?\\f) || look_1_0.between?(0x000E, 0xFFFF)) \n alt_1 = 1\n\n end\n case alt_1\n when 1\n # at line 472:6: ~ ( '\\\\r' | '\\\\n' )\n if @input.peek(1).between?(0x0000, ?\\t) || @input.peek(1).between?(0x000B, ?\\f) || @input.peek(1).between?(0x000E, 0x00FF)\n @input.consume\n else\n mse = MismatchedSet(nil)\n recover(mse)\n raise mse\n end\n\n\n\n else\n break #loop 1\n end\n end\n\n end\n # at line 474:3: ( '\\\\r' )?\n alt_3 = 2\n look_3_0 = @input.peek(1)\n\n if (look_3_0 == ?\\r) \n alt_3 = 1\n end\n case alt_3\n when 1\n # at line 474:3: '\\\\r'\n match(?\\r)\n\n end\n match(?\\n)\n # --> action\n channel=HIDDEN;\n # <-- action\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 39)\n\n end", "def head!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 2 )\n\n type = HEAD\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 321:7: 'head'\n match( \"head\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 2 )\n\n end", "def element\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 21)\n return_value = ElementReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n labelOp = nil\n g = nil\n __ACTION103__ = nil\n __SEMPRED104__ = nil\n id94 = nil\n atom95 = nil\n ebnf_suffix96 = nil\n id97 = nil\n block98 = nil\n ebnf_suffix99 = nil\n atom100 = nil\n ebnf_suffix101 = nil\n ebnf102 = nil\n tree_spec105 = nil\n ebnf_suffix106 = nil\n\n tree_for_labelOp = nil\n tree_for_g = nil\n tree_for_ACTION103 = nil\n tree_for_SEMPRED104 = nil\n stream_LIST_LABEL_ASSIGN = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token LIST_LABEL_ASSIGN\")\n stream_LABEL_ASSIGN = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token LABEL_ASSIGN\")\n stream_SEMPRED = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token SEMPRED\")\n stream_T__86 = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token T__86\")\n stream_tree_spec = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule tree_spec\")\n stream_id = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule id\")\n stream_atom = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule atom\")\n stream_block = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule block\")\n stream_ebnf_suffix = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule ebnf_suffix\")\n begin\n # at line 233:2: ( id (labelOp= '=' | labelOp= '+=' ) atom ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id atom ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> ^( $labelOp id atom ) ) | id (labelOp= '=' | labelOp= '+=' ) block ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id block ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> ^( $labelOp id block ) ) | atom ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] atom EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> atom ) | ebnf | ACTION | SEMPRED (g= '=>' -> GATED_SEMPRED[$g] | -> SEMPRED ) | tree_spec ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] tree_spec EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> tree_spec ) )\n alt_46 = 7\n alt_46 = @dfa46.predict(@input)\n case alt_46\n when 1\n # at line 233:4: id (labelOp= '=' | labelOp= '+=' ) atom ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id atom ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> ^( $labelOp id atom ) )\n @state.following.push(TOKENS_FOLLOWING_id_IN_element_1399)\n id94 = id\n @state.following.pop\n if @state.backtracking == 0\n stream_id.add(id94.tree)\n end\n # at line 233:7: (labelOp= '=' | labelOp= '+=' )\n alt_39 = 2\n look_39_0 = @input.peek(1)\n\n if (look_39_0 == LABEL_ASSIGN) \n alt_39 = 1\n elsif (look_39_0 == LIST_LABEL_ASSIGN) \n alt_39 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 39, 0)\n raise nvae\n end\n case alt_39\n when 1\n # at line 233:8: labelOp= '='\n labelOp = match(LABEL_ASSIGN, TOKENS_FOLLOWING_LABEL_ASSIGN_IN_element_1404) \n if @state.backtracking == 0\n stream_LABEL_ASSIGN.add(labelOp)\n end\n\n when 2\n # at line 233:20: labelOp= '+='\n labelOp = match(LIST_LABEL_ASSIGN, TOKENS_FOLLOWING_LIST_LABEL_ASSIGN_IN_element_1408) \n if @state.backtracking == 0\n stream_LIST_LABEL_ASSIGN.add(labelOp)\n end\n\n end\n @state.following.push(TOKENS_FOLLOWING_atom_IN_element_1411)\n atom95 = atom\n @state.following.pop\n if @state.backtracking == 0\n stream_atom.add(atom95.tree)\n end\n # at line 234:3: ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id atom ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> ^( $labelOp id atom ) )\n alt_40 = 2\n look_40_0 = @input.peek(1)\n\n if (look_40_0 == T__74 || look_40_0.between?(T__91, T__92)) \n alt_40 = 1\n elsif (look_40_0 == SEMPRED || look_40_0 == TREE_BEGIN || look_40_0 == REWRITE || look_40_0.between?(TOKEN_REF, ACTION) || look_40_0 == RULE_REF || look_40_0 == T__71 || look_40_0.between?(T__81, T__83) || look_40_0 == T__87 || look_40_0 == T__90) \n alt_40 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 40, 0)\n raise nvae\n end\n case alt_40\n when 1\n # at line 234:5: ebnf_suffix\n @state.following.push(TOKENS_FOLLOWING_ebnf_suffix_IN_element_1417)\n ebnf_suffix96 = ebnf_suffix\n @state.following.pop\n if @state.backtracking == 0\n stream_ebnf_suffix.add(ebnf_suffix96.tree)\n end\n # AST Rewrite\n # elements: atom, ebnf_suffix, id, labelOp\n # token labels: labelOp\n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_labelOp = token_stream(\"token labelOp\", labelOp)\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 234:17: -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id atom ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n # at line 234:20: ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id atom ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(stream_ebnf_suffix.next_node(), root_1)\n\n # at line 234:35: ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id atom ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] )\n root_2 = @adaptor.create_flat_list!\n root_2 = @adaptor.become_root(@adaptor.create!(BLOCK, \"BLOCK\"), root_2)\n\n # at line 234:52: ^( ALT[\\\"ALT\\\"] ^( $labelOp id atom ) EOA[\\\"EOA\\\"] )\n root_3 = @adaptor.create_flat_list!\n root_3 = @adaptor.become_root(@adaptor.create!(ALT, \"ALT\"), root_3)\n\n # at line 234:65: ^( $labelOp id atom )\n root_4 = @adaptor.create_flat_list!\n root_4 = @adaptor.become_root(stream_labelOp.next_node, root_4)\n\n @adaptor.add_child(root_4, stream_id.next_tree)\n @adaptor.add_child(root_4, stream_atom.next_tree)\n\n @adaptor.add_child(root_3, root_4)\n @adaptor.add_child(root_3, @adaptor.create!(EOA, \"EOA\"))\n\n @adaptor.add_child(root_2, root_3)\n @adaptor.add_child(root_2, @adaptor.create!(EOB, \"EOB\"))\n\n @adaptor.add_child(root_1, root_2)\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n # at line 235:8: \n # AST Rewrite\n # elements: labelOp, atom, id\n # token labels: labelOp\n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_labelOp = token_stream(\"token labelOp\", labelOp)\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 235:8: -> ^( $labelOp id atom )\n # at line 235:11: ^( $labelOp id atom )\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(stream_labelOp.next_node, root_1)\n\n @adaptor.add_child(root_1, stream_id.next_tree)\n @adaptor.add_child(root_1, stream_atom.next_tree)\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end\n end\n\n when 2\n # at line 237:4: id (labelOp= '=' | labelOp= '+=' ) block ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id block ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> ^( $labelOp id block ) )\n @state.following.push(TOKENS_FOLLOWING_id_IN_element_1476)\n id97 = id\n @state.following.pop\n if @state.backtracking == 0\n stream_id.add(id97.tree)\n end\n # at line 237:7: (labelOp= '=' | labelOp= '+=' )\n alt_41 = 2\n look_41_0 = @input.peek(1)\n\n if (look_41_0 == LABEL_ASSIGN) \n alt_41 = 1\n elsif (look_41_0 == LIST_LABEL_ASSIGN) \n alt_41 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 41, 0)\n raise nvae\n end\n case alt_41\n when 1\n # at line 237:8: labelOp= '='\n labelOp = match(LABEL_ASSIGN, TOKENS_FOLLOWING_LABEL_ASSIGN_IN_element_1481) \n if @state.backtracking == 0\n stream_LABEL_ASSIGN.add(labelOp)\n end\n\n when 2\n # at line 237:20: labelOp= '+='\n labelOp = match(LIST_LABEL_ASSIGN, TOKENS_FOLLOWING_LIST_LABEL_ASSIGN_IN_element_1485) \n if @state.backtracking == 0\n stream_LIST_LABEL_ASSIGN.add(labelOp)\n end\n\n end\n @state.following.push(TOKENS_FOLLOWING_block_IN_element_1488)\n block98 = block\n @state.following.pop\n if @state.backtracking == 0\n stream_block.add(block98.tree)\n end\n # at line 238:3: ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id block ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> ^( $labelOp id block ) )\n alt_42 = 2\n look_42_0 = @input.peek(1)\n\n if (look_42_0 == T__74 || look_42_0.between?(T__91, T__92)) \n alt_42 = 1\n elsif (look_42_0 == SEMPRED || look_42_0 == TREE_BEGIN || look_42_0 == REWRITE || look_42_0.between?(TOKEN_REF, ACTION) || look_42_0 == RULE_REF || look_42_0 == T__71 || look_42_0.between?(T__81, T__83) || look_42_0 == T__87 || look_42_0 == T__90) \n alt_42 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 42, 0)\n raise nvae\n end\n case alt_42\n when 1\n # at line 238:5: ebnf_suffix\n @state.following.push(TOKENS_FOLLOWING_ebnf_suffix_IN_element_1494)\n ebnf_suffix99 = ebnf_suffix\n @state.following.pop\n if @state.backtracking == 0\n stream_ebnf_suffix.add(ebnf_suffix99.tree)\n end\n # AST Rewrite\n # elements: labelOp, id, ebnf_suffix, block\n # token labels: labelOp\n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_labelOp = token_stream(\"token labelOp\", labelOp)\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 238:17: -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id block ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n # at line 238:20: ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id block ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(stream_ebnf_suffix.next_node(), root_1)\n\n # at line 238:35: ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id block ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] )\n root_2 = @adaptor.create_flat_list!\n root_2 = @adaptor.become_root(@adaptor.create!(BLOCK, \"BLOCK\"), root_2)\n\n # at line 238:52: ^( ALT[\\\"ALT\\\"] ^( $labelOp id block ) EOA[\\\"EOA\\\"] )\n root_3 = @adaptor.create_flat_list!\n root_3 = @adaptor.become_root(@adaptor.create!(ALT, \"ALT\"), root_3)\n\n # at line 238:65: ^( $labelOp id block )\n root_4 = @adaptor.create_flat_list!\n root_4 = @adaptor.become_root(stream_labelOp.next_node, root_4)\n\n @adaptor.add_child(root_4, stream_id.next_tree)\n @adaptor.add_child(root_4, stream_block.next_tree)\n\n @adaptor.add_child(root_3, root_4)\n @adaptor.add_child(root_3, @adaptor.create!(EOA, \"EOA\"))\n\n @adaptor.add_child(root_2, root_3)\n @adaptor.add_child(root_2, @adaptor.create!(EOB, \"EOB\"))\n\n @adaptor.add_child(root_1, root_2)\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n # at line 239:8: \n # AST Rewrite\n # elements: block, labelOp, id\n # token labels: labelOp\n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_labelOp = token_stream(\"token labelOp\", labelOp)\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 239:8: -> ^( $labelOp id block )\n # at line 239:11: ^( $labelOp id block )\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(stream_labelOp.next_node, root_1)\n\n @adaptor.add_child(root_1, stream_id.next_tree)\n @adaptor.add_child(root_1, stream_block.next_tree)\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end\n end\n\n when 3\n # at line 241:4: atom ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] atom EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> atom )\n @state.following.push(TOKENS_FOLLOWING_atom_IN_element_1553)\n atom100 = atom\n @state.following.pop\n if @state.backtracking == 0\n stream_atom.add(atom100.tree)\n end\n # at line 242:3: ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] atom EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> atom )\n alt_43 = 2\n look_43_0 = @input.peek(1)\n\n if (look_43_0 == T__74 || look_43_0.between?(T__91, T__92)) \n alt_43 = 1\n elsif (look_43_0 == SEMPRED || look_43_0 == TREE_BEGIN || look_43_0 == REWRITE || look_43_0.between?(TOKEN_REF, ACTION) || look_43_0 == RULE_REF || look_43_0 == T__71 || look_43_0.between?(T__81, T__83) || look_43_0 == T__87 || look_43_0 == T__90) \n alt_43 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 43, 0)\n raise nvae\n end\n case alt_43\n when 1\n # at line 242:5: ebnf_suffix\n @state.following.push(TOKENS_FOLLOWING_ebnf_suffix_IN_element_1559)\n ebnf_suffix101 = ebnf_suffix\n @state.following.pop\n if @state.backtracking == 0\n stream_ebnf_suffix.add(ebnf_suffix101.tree)\n end\n # AST Rewrite\n # elements: ebnf_suffix, atom\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 242:17: -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] atom EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n # at line 242:20: ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] atom EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(stream_ebnf_suffix.next_node(), root_1)\n\n # at line 242:35: ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] atom EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] )\n root_2 = @adaptor.create_flat_list!\n root_2 = @adaptor.become_root(@adaptor.create!(BLOCK, \"BLOCK\"), root_2)\n\n # at line 242:52: ^( ALT[\\\"ALT\\\"] atom EOA[\\\"EOA\\\"] )\n root_3 = @adaptor.create_flat_list!\n root_3 = @adaptor.become_root(@adaptor.create!(ALT, \"ALT\"), root_3)\n\n @adaptor.add_child(root_3, stream_atom.next_tree)\n @adaptor.add_child(root_3, @adaptor.create!(EOA, \"EOA\"))\n\n @adaptor.add_child(root_2, root_3)\n @adaptor.add_child(root_2, @adaptor.create!(EOB, \"EOB\"))\n\n @adaptor.add_child(root_1, root_2)\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n # at line 243:8: \n # AST Rewrite\n # elements: atom\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 243:8: -> atom\n @adaptor.add_child(root_0, stream_atom.next_tree)\n\n\n\n return_value.tree = root_0\n\n end\n end\n\n when 4\n root_0 = @adaptor.create_flat_list!\n\n\n # at line 245:4: ebnf\n @state.following.push(TOKENS_FOLLOWING_ebnf_IN_element_1605)\n ebnf102 = ebnf\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child(root_0, ebnf102.tree)\n end\n\n when 5\n root_0 = @adaptor.create_flat_list!\n\n\n # at line 246:6: ACTION\n __ACTION103__ = match(ACTION, TOKENS_FOLLOWING_ACTION_IN_element_1612)\n if @state.backtracking == 0\n\n tree_for_ACTION103 = @adaptor.create_with_payload!(__ACTION103__)\n @adaptor.add_child(root_0, tree_for_ACTION103)\n\n end\n\n when 6\n # at line 247:6: SEMPRED (g= '=>' -> GATED_SEMPRED[$g] | -> SEMPRED )\n __SEMPRED104__ = match(SEMPRED, TOKENS_FOLLOWING_SEMPRED_IN_element_1619) \n if @state.backtracking == 0\n stream_SEMPRED.add(__SEMPRED104__)\n end\n # at line 247:14: (g= '=>' -> GATED_SEMPRED[$g] | -> SEMPRED )\n alt_44 = 2\n look_44_0 = @input.peek(1)\n\n if (look_44_0 == T__86) \n alt_44 = 1\n elsif (look_44_0 == SEMPRED || look_44_0 == TREE_BEGIN || look_44_0 == REWRITE || look_44_0.between?(TOKEN_REF, ACTION) || look_44_0 == RULE_REF || look_44_0 == T__71 || look_44_0.between?(T__81, T__83) || look_44_0 == T__87 || look_44_0 == T__90) \n alt_44 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 44, 0)\n raise nvae\n end\n case alt_44\n when 1\n # at line 247:16: g= '=>'\n g = match(T__86, TOKENS_FOLLOWING_T__86_IN_element_1625) \n if @state.backtracking == 0\n stream_T__86.add(g)\n end\n # AST Rewrite\n # elements: \n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 247:23: -> GATED_SEMPRED[$g]\n @adaptor.add_child(root_0, @adaptor.create!(GATED_SEMPRED, g))\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n # at line 247:46: \n # AST Rewrite\n # elements: SEMPRED\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 247:46: -> SEMPRED\n @adaptor.add_child(root_0, stream_SEMPRED.next_node)\n\n\n\n return_value.tree = root_0\n\n end\n end\n\n when 7\n # at line 248:6: tree_spec ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] tree_spec EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> tree_spec )\n @state.following.push(TOKENS_FOLLOWING_tree_spec_IN_element_1645)\n tree_spec105 = tree_spec\n @state.following.pop\n if @state.backtracking == 0\n stream_tree_spec.add(tree_spec105.tree)\n end\n # at line 249:3: ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] tree_spec EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> tree_spec )\n alt_45 = 2\n look_45_0 = @input.peek(1)\n\n if (look_45_0 == T__74 || look_45_0.between?(T__91, T__92)) \n alt_45 = 1\n elsif (look_45_0 == SEMPRED || look_45_0 == TREE_BEGIN || look_45_0 == REWRITE || look_45_0.between?(TOKEN_REF, ACTION) || look_45_0 == RULE_REF || look_45_0 == T__71 || look_45_0.between?(T__81, T__83) || look_45_0 == T__87 || look_45_0 == T__90) \n alt_45 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 45, 0)\n raise nvae\n end\n case alt_45\n when 1\n # at line 249:5: ebnf_suffix\n @state.following.push(TOKENS_FOLLOWING_ebnf_suffix_IN_element_1651)\n ebnf_suffix106 = ebnf_suffix\n @state.following.pop\n if @state.backtracking == 0\n stream_ebnf_suffix.add(ebnf_suffix106.tree)\n end\n # AST Rewrite\n # elements: ebnf_suffix, tree_spec\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 249:17: -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] tree_spec EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n # at line 249:20: ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] tree_spec EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(stream_ebnf_suffix.next_node(), root_1)\n\n # at line 249:35: ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] tree_spec EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] )\n root_2 = @adaptor.create_flat_list!\n root_2 = @adaptor.become_root(@adaptor.create!(BLOCK, \"BLOCK\"), root_2)\n\n # at line 249:52: ^( ALT[\\\"ALT\\\"] tree_spec EOA[\\\"EOA\\\"] )\n root_3 = @adaptor.create_flat_list!\n root_3 = @adaptor.become_root(@adaptor.create!(ALT, \"ALT\"), root_3)\n\n @adaptor.add_child(root_3, stream_tree_spec.next_tree)\n @adaptor.add_child(root_3, @adaptor.create!(EOA, \"EOA\"))\n\n @adaptor.add_child(root_2, root_3)\n @adaptor.add_child(root_2, @adaptor.create!(EOB, \"EOB\"))\n\n @adaptor.add_child(root_1, root_2)\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n # at line 250:8: \n # AST Rewrite\n # elements: tree_spec\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 250:8: -> tree_spec\n @adaptor.add_child(root_0, stream_tree_spec.next_tree)\n\n\n\n return_value.tree = root_0\n\n end\n end\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look(-1)\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing(root_0)\n @adaptor.set_token_boundaries(return_value.tree, return_value.start, return_value.stop)\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node!(@input, return_value.start, @input.look(-1), re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 21)\n\n end\n \n return return_value\n end", "def rshift!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 24 )\n\n type = RSHIFT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 145:10: '>>'\n match( \">>\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 24 )\n\n end", "def find_token\n shift_token || find_regex_token || find_string_token\n end", "def block\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 14)\n return_value = BlockReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n lp = nil\n rp = nil\n char_literal76 = nil\n char_literal78 = nil\n opts = nil\n altpair77 = nil\n altpair79 = nil\n\n tree_for_lp = nil\n tree_for_rp = nil\n tree_for_char_literal76 = nil\n tree_for_char_literal78 = nil\n stream_T__81 = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token T__81\")\n stream_T__82 = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token T__82\")\n stream_T__83 = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token T__83\")\n stream_T__78 = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token T__78\")\n stream_altpair = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule altpair\")\n stream_options_spec = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule options_spec\")\n begin\n # at line 194:9: lp= '(' ( (opts= options_spec )? ':' )? altpair ( '|' altpair )* rp= ')'\n lp = match(T__81, TOKENS_FOLLOWING_T__81_IN_block_1124) \n if @state.backtracking == 0\n stream_T__81.add(lp)\n end\n # at line 195:3: ( (opts= options_spec )? ':' )?\n alt_31 = 2\n look_31_0 = @input.peek(1)\n\n if (look_31_0 == OPTIONS || look_31_0 == T__78) \n alt_31 = 1\n end\n case alt_31\n when 1\n # at line 195:5: (opts= options_spec )? ':'\n # at line 195:5: (opts= options_spec )?\n alt_30 = 2\n look_30_0 = @input.peek(1)\n\n if (look_30_0 == OPTIONS) \n alt_30 = 1\n end\n case alt_30\n when 1\n # at line 195:6: opts= options_spec\n @state.following.push(TOKENS_FOLLOWING_options_spec_IN_block_1133)\n opts = options_spec\n @state.following.pop\n if @state.backtracking == 0\n stream_options_spec.add(opts.tree)\n end\n\n end\n char_literal76 = match(T__78, TOKENS_FOLLOWING_T__78_IN_block_1137) \n if @state.backtracking == 0\n stream_T__78.add(char_literal76)\n end\n\n end\n @state.following.push(TOKENS_FOLLOWING_altpair_IN_block_1144)\n altpair77 = altpair\n @state.following.pop\n if @state.backtracking == 0\n stream_altpair.add(altpair77.tree)\n end\n # at line 196:11: ( '|' altpair )*\n loop do #loop 32\n alt_32 = 2\n look_32_0 = @input.peek(1)\n\n if (look_32_0 == T__82) \n alt_32 = 1\n\n end\n case alt_32\n when 1\n # at line 196:13: '|' altpair\n char_literal78 = match(T__82, TOKENS_FOLLOWING_T__82_IN_block_1148) \n if @state.backtracking == 0\n stream_T__82.add(char_literal78)\n end\n @state.following.push(TOKENS_FOLLOWING_altpair_IN_block_1150)\n altpair79 = altpair\n @state.following.pop\n if @state.backtracking == 0\n stream_altpair.add(altpair79.tree)\n end\n\n else\n break #loop 32\n end\n end\n rp = match(T__83, TOKENS_FOLLOWING_T__83_IN_block_1165) \n if @state.backtracking == 0\n stream_T__83.add(rp)\n end\n # AST Rewrite\n # elements: options_spec, altpair\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 198:9: -> ^( BLOCK[$lp,\\\"BLOCK\\\"] ( options_spec )? ( altpair )+ EOB[$rp,\\\"EOB\\\"] )\n # at line 198:12: ^( BLOCK[$lp,\\\"BLOCK\\\"] ( options_spec )? ( altpair )+ EOB[$rp,\\\"EOB\\\"] )\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(@adaptor.create!(BLOCK, lp, \"BLOCK\"), root_1)\n\n # at line 198:34: ( options_spec )?\n if stream_options_spec.has_next?\n @adaptor.add_child(root_1, stream_options_spec.next_tree)\n\n end\n\n stream_options_spec.reset();\n # at line 198:48: ( altpair )+\n unless stream_altpair.has_next?\n raise ANTLR3::RewriteEarlyExit\n end\n\n while stream_altpair.has_next?\n @adaptor.add_child(root_1, stream_altpair.next_tree)\n\n end\n\n stream_altpair.reset\n @adaptor.add_child(root_1, @adaptor.create!(EOB, rp, \"EOB\"))\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look(-1)\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing(root_0)\n @adaptor.set_token_boundaries(return_value.tree, return_value.start, return_value.stop)\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node!(@input, return_value.start, @input.look(-1), re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 14)\n\n end\n \n return return_value\n end", "def peek\n @tok ||= read_token\n end", "def block\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 14 )\n return_value = BlockReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n lp = nil\n rp = nil\n char_literal76 = nil\n char_literal78 = nil\n opts = nil\n altpair77 = nil\n altpair79 = nil\n\n tree_for_lp = nil\n tree_for_rp = nil\n tree_for_char_literal76 = nil\n tree_for_char_literal78 = nil\n stream_T__81 = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token T__81\" )\n stream_T__82 = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token T__82\" )\n stream_T__83 = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token T__83\" )\n stream_T__78 = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token T__78\" )\n stream_altpair = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule altpair\" )\n stream_options_spec = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule options_spec\" )\n begin\n # at line 185:9: lp= '(' ( (opts= options_spec )? ':' )? altpair ( '|' altpair )* rp= ')'\n lp = match( T__81, TOKENS_FOLLOWING_T__81_IN_block_1119 )\n if @state.backtracking == 0\n stream_T__81.add( lp )\n end\n # at line 186:3: ( (opts= options_spec )? ':' )?\n alt_31 = 2\n look_31_0 = @input.peek( 1 )\n\n if ( look_31_0 == OPTIONS || look_31_0 == T__78 )\n alt_31 = 1\n end\n case alt_31\n when 1\n # at line 186:5: (opts= options_spec )? ':'\n # at line 186:5: (opts= options_spec )?\n alt_30 = 2\n look_30_0 = @input.peek( 1 )\n\n if ( look_30_0 == OPTIONS )\n alt_30 = 1\n end\n case alt_30\n when 1\n # at line 186:6: opts= options_spec\n @state.following.push( TOKENS_FOLLOWING_options_spec_IN_block_1128 )\n opts = options_spec\n @state.following.pop\n if @state.backtracking == 0\n stream_options_spec.add( opts.tree )\n end\n\n end\n char_literal76 = match( T__78, TOKENS_FOLLOWING_T__78_IN_block_1132 )\n if @state.backtracking == 0\n stream_T__78.add( char_literal76 )\n end\n\n end\n @state.following.push( TOKENS_FOLLOWING_altpair_IN_block_1139 )\n altpair77 = altpair\n @state.following.pop\n if @state.backtracking == 0\n stream_altpair.add( altpair77.tree )\n end\n # at line 187:11: ( '|' altpair )*\n while true # decision 32\n alt_32 = 2\n look_32_0 = @input.peek( 1 )\n\n if ( look_32_0 == T__82 )\n alt_32 = 1\n\n end\n case alt_32\n when 1\n # at line 187:13: '|' altpair\n char_literal78 = match( T__82, TOKENS_FOLLOWING_T__82_IN_block_1143 )\n if @state.backtracking == 0\n stream_T__82.add( char_literal78 )\n end\n @state.following.push( TOKENS_FOLLOWING_altpair_IN_block_1145 )\n altpair79 = altpair\n @state.following.pop\n if @state.backtracking == 0\n stream_altpair.add( altpair79.tree )\n end\n\n else\n break # out of loop for decision 32\n end\n end # loop for decision 32\n rp = match( T__83, TOKENS_FOLLOWING_T__83_IN_block_1160 )\n if @state.backtracking == 0\n stream_T__83.add( rp )\n end\n # AST Rewrite\n # elements: altpair, options_spec\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 189:9: -> ^( BLOCK[$lp,\\\"BLOCK\\\"] ( options_spec )? ( altpair )+ EOB[$rp,\\\"EOB\\\"] )\n # at line 189:12: ^( BLOCK[$lp,\\\"BLOCK\\\"] ( options_spec )? ( altpair )+ EOB[$rp,\\\"EOB\\\"] )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( @adaptor.create( BLOCK, lp, \"BLOCK\" ), root_1 )\n\n # at line 189:34: ( options_spec )?\n if stream_options_spec.has_next?\n @adaptor.add_child( root_1, stream_options_spec.next_tree )\n\n end\n\n stream_options_spec.reset();\n # at line 189:48: ( altpair )+\n stream_altpair.has_next? or raise ANTLR3::RewriteEarlyExit\n\n while stream_altpair.has_next?\n @adaptor.add_child( root_1, stream_altpair.next_tree )\n\n end\n stream_altpair.reset\n @adaptor.add_child( root_1, @adaptor.create( EOB, rp, \"EOB\" ) )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 14 )\n\n end\n \n return return_value\n end", "def of\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 43 )\n of_start_index = @input.index\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return \n end\n # at line 330:5: ( 'O' | 'o' ) ( 'F' | 'f' )\n if @input.peek( 1 ).between?( T__18, T__19 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__30, T__31 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 43 )\n memoize( __method__, of_start_index, success ) if @state.backtracking > 0\n\n end\n \n return \n end", "def next(pointer); end", "def next(pointer); end", "def element\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 21 )\n return_value = ElementReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n labelOp = nil\n g = nil\n __ACTION103__ = nil\n __SEMPRED104__ = nil\n id94 = nil\n atom95 = nil\n ebnf_suffix96 = nil\n id97 = nil\n block98 = nil\n ebnf_suffix99 = nil\n atom100 = nil\n ebnf_suffix101 = nil\n ebnf102 = nil\n tree_spec105 = nil\n ebnf_suffix106 = nil\n\n tree_for_labelOp = nil\n tree_for_g = nil\n tree_for_ACTION103 = nil\n tree_for_SEMPRED104 = nil\n stream_LIST_LABEL_ASSIGN = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token LIST_LABEL_ASSIGN\" )\n stream_LABEL_ASSIGN = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token LABEL_ASSIGN\" )\n stream_SEMPRED = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token SEMPRED\" )\n stream_T__86 = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token T__86\" )\n stream_tree_spec = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule tree_spec\" )\n stream_id = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule id\" )\n stream_atom = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule atom\" )\n stream_block = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule block\" )\n stream_ebnf_suffix = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule ebnf_suffix\" )\n begin\n # at line 224:2: ( id (labelOp= '=' | labelOp= '+=' ) atom ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id atom ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> ^( $labelOp id atom ) ) | id (labelOp= '=' | labelOp= '+=' ) block ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id block ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> ^( $labelOp id block ) ) | atom ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] atom EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> atom ) | ebnf | ACTION | SEMPRED (g= '=>' -> GATED_SEMPRED[$g] | -> SEMPRED ) | tree_spec ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] tree_spec EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> tree_spec ) )\n alt_46 = 7\n alt_46 = @dfa46.predict( @input )\n case alt_46\n when 1\n # at line 224:4: id (labelOp= '=' | labelOp= '+=' ) atom ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id atom ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> ^( $labelOp id atom ) )\n @state.following.push( TOKENS_FOLLOWING_id_IN_element_1394 )\n id94 = id\n @state.following.pop\n if @state.backtracking == 0\n stream_id.add( id94.tree )\n end\n # at line 224:7: (labelOp= '=' | labelOp= '+=' )\n alt_39 = 2\n look_39_0 = @input.peek( 1 )\n\n if ( look_39_0 == LABEL_ASSIGN )\n alt_39 = 1\n elsif ( look_39_0 == LIST_LABEL_ASSIGN )\n alt_39 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 39, 0 )\n end\n case alt_39\n when 1\n # at line 224:8: labelOp= '='\n labelOp = match( LABEL_ASSIGN, TOKENS_FOLLOWING_LABEL_ASSIGN_IN_element_1399 )\n if @state.backtracking == 0\n stream_LABEL_ASSIGN.add( labelOp )\n end\n\n when 2\n # at line 224:20: labelOp= '+='\n labelOp = match( LIST_LABEL_ASSIGN, TOKENS_FOLLOWING_LIST_LABEL_ASSIGN_IN_element_1403 )\n if @state.backtracking == 0\n stream_LIST_LABEL_ASSIGN.add( labelOp )\n end\n\n end\n @state.following.push( TOKENS_FOLLOWING_atom_IN_element_1406 )\n atom95 = atom\n @state.following.pop\n if @state.backtracking == 0\n stream_atom.add( atom95.tree )\n end\n # at line 225:3: ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id atom ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> ^( $labelOp id atom ) )\n alt_40 = 2\n look_40_0 = @input.peek( 1 )\n\n if ( look_40_0 == T__74 || look_40_0.between?( T__91, T__92 ) )\n alt_40 = 1\n elsif ( look_40_0 == SEMPRED || look_40_0 == TREE_BEGIN || look_40_0 == REWRITE || look_40_0.between?( TOKEN_REF, ACTION ) || look_40_0 == RULE_REF || look_40_0 == T__71 || look_40_0.between?( T__81, T__83 ) || look_40_0 == T__87 || look_40_0 == T__90 )\n alt_40 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 40, 0 )\n end\n case alt_40\n when 1\n # at line 225:5: ebnf_suffix\n @state.following.push( TOKENS_FOLLOWING_ebnf_suffix_IN_element_1412 )\n ebnf_suffix96 = ebnf_suffix\n @state.following.pop\n if @state.backtracking == 0\n stream_ebnf_suffix.add( ebnf_suffix96.tree )\n end\n # AST Rewrite\n # elements: id, labelOp, ebnf_suffix, atom\n # token labels: labelOp\n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_labelOp = token_stream( \"token labelOp\", labelOp )\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 225:17: -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id atom ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n # at line 225:20: ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id atom ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_ebnf_suffix.next_node, root_1 )\n\n # at line 225:35: ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id atom ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] )\n root_2 = @adaptor.create_flat_list\n root_2 = @adaptor.become_root( @adaptor.create( BLOCK, \"BLOCK\" ), root_2 )\n\n # at line 225:52: ^( ALT[\\\"ALT\\\"] ^( $labelOp id atom ) EOA[\\\"EOA\\\"] )\n root_3 = @adaptor.create_flat_list\n root_3 = @adaptor.become_root( @adaptor.create( ALT, \"ALT\" ), root_3 )\n\n # at line 225:65: ^( $labelOp id atom )\n root_4 = @adaptor.create_flat_list\n root_4 = @adaptor.become_root( stream_labelOp.next_node, root_4 )\n\n @adaptor.add_child( root_4, stream_id.next_tree )\n @adaptor.add_child( root_4, stream_atom.next_tree )\n\n @adaptor.add_child( root_3, root_4 )\n @adaptor.add_child( root_3, @adaptor.create( EOA, \"EOA\" ) )\n\n @adaptor.add_child( root_2, root_3 )\n @adaptor.add_child( root_2, @adaptor.create( EOB, \"EOB\" ) )\n\n @adaptor.add_child( root_1, root_2 )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n # at line 226:8: \n # AST Rewrite\n # elements: atom, id, labelOp\n # token labels: labelOp\n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_labelOp = token_stream( \"token labelOp\", labelOp )\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 226:8: -> ^( $labelOp id atom )\n # at line 226:11: ^( $labelOp id atom )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_labelOp.next_node, root_1 )\n\n @adaptor.add_child( root_1, stream_id.next_tree )\n @adaptor.add_child( root_1, stream_atom.next_tree )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end\n end\n\n when 2\n # at line 228:4: id (labelOp= '=' | labelOp= '+=' ) block ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id block ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> ^( $labelOp id block ) )\n @state.following.push( TOKENS_FOLLOWING_id_IN_element_1471 )\n id97 = id\n @state.following.pop\n if @state.backtracking == 0\n stream_id.add( id97.tree )\n end\n # at line 228:7: (labelOp= '=' | labelOp= '+=' )\n alt_41 = 2\n look_41_0 = @input.peek( 1 )\n\n if ( look_41_0 == LABEL_ASSIGN )\n alt_41 = 1\n elsif ( look_41_0 == LIST_LABEL_ASSIGN )\n alt_41 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 41, 0 )\n end\n case alt_41\n when 1\n # at line 228:8: labelOp= '='\n labelOp = match( LABEL_ASSIGN, TOKENS_FOLLOWING_LABEL_ASSIGN_IN_element_1476 )\n if @state.backtracking == 0\n stream_LABEL_ASSIGN.add( labelOp )\n end\n\n when 2\n # at line 228:20: labelOp= '+='\n labelOp = match( LIST_LABEL_ASSIGN, TOKENS_FOLLOWING_LIST_LABEL_ASSIGN_IN_element_1480 )\n if @state.backtracking == 0\n stream_LIST_LABEL_ASSIGN.add( labelOp )\n end\n\n end\n @state.following.push( TOKENS_FOLLOWING_block_IN_element_1483 )\n block98 = block\n @state.following.pop\n if @state.backtracking == 0\n stream_block.add( block98.tree )\n end\n # at line 229:3: ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id block ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> ^( $labelOp id block ) )\n alt_42 = 2\n look_42_0 = @input.peek( 1 )\n\n if ( look_42_0 == T__74 || look_42_0.between?( T__91, T__92 ) )\n alt_42 = 1\n elsif ( look_42_0 == SEMPRED || look_42_0 == TREE_BEGIN || look_42_0 == REWRITE || look_42_0.between?( TOKEN_REF, ACTION ) || look_42_0 == RULE_REF || look_42_0 == T__71 || look_42_0.between?( T__81, T__83 ) || look_42_0 == T__87 || look_42_0 == T__90 )\n alt_42 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 42, 0 )\n end\n case alt_42\n when 1\n # at line 229:5: ebnf_suffix\n @state.following.push( TOKENS_FOLLOWING_ebnf_suffix_IN_element_1489 )\n ebnf_suffix99 = ebnf_suffix\n @state.following.pop\n if @state.backtracking == 0\n stream_ebnf_suffix.add( ebnf_suffix99.tree )\n end\n # AST Rewrite\n # elements: block, labelOp, id, ebnf_suffix\n # token labels: labelOp\n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_labelOp = token_stream( \"token labelOp\", labelOp )\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 229:17: -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id block ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n # at line 229:20: ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id block ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_ebnf_suffix.next_node, root_1 )\n\n # at line 229:35: ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] ^( $labelOp id block ) EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] )\n root_2 = @adaptor.create_flat_list\n root_2 = @adaptor.become_root( @adaptor.create( BLOCK, \"BLOCK\" ), root_2 )\n\n # at line 229:52: ^( ALT[\\\"ALT\\\"] ^( $labelOp id block ) EOA[\\\"EOA\\\"] )\n root_3 = @adaptor.create_flat_list\n root_3 = @adaptor.become_root( @adaptor.create( ALT, \"ALT\" ), root_3 )\n\n # at line 229:65: ^( $labelOp id block )\n root_4 = @adaptor.create_flat_list\n root_4 = @adaptor.become_root( stream_labelOp.next_node, root_4 )\n\n @adaptor.add_child( root_4, stream_id.next_tree )\n @adaptor.add_child( root_4, stream_block.next_tree )\n\n @adaptor.add_child( root_3, root_4 )\n @adaptor.add_child( root_3, @adaptor.create( EOA, \"EOA\" ) )\n\n @adaptor.add_child( root_2, root_3 )\n @adaptor.add_child( root_2, @adaptor.create( EOB, \"EOB\" ) )\n\n @adaptor.add_child( root_1, root_2 )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n # at line 230:8: \n # AST Rewrite\n # elements: labelOp, id, block\n # token labels: labelOp\n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_labelOp = token_stream( \"token labelOp\", labelOp )\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 230:8: -> ^( $labelOp id block )\n # at line 230:11: ^( $labelOp id block )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_labelOp.next_node, root_1 )\n\n @adaptor.add_child( root_1, stream_id.next_tree )\n @adaptor.add_child( root_1, stream_block.next_tree )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end\n end\n\n when 3\n # at line 232:4: atom ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] atom EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> atom )\n @state.following.push( TOKENS_FOLLOWING_atom_IN_element_1548 )\n atom100 = atom\n @state.following.pop\n if @state.backtracking == 0\n stream_atom.add( atom100.tree )\n end\n # at line 233:3: ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] atom EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> atom )\n alt_43 = 2\n look_43_0 = @input.peek( 1 )\n\n if ( look_43_0 == T__74 || look_43_0.between?( T__91, T__92 ) )\n alt_43 = 1\n elsif ( look_43_0 == SEMPRED || look_43_0 == TREE_BEGIN || look_43_0 == REWRITE || look_43_0.between?( TOKEN_REF, ACTION ) || look_43_0 == RULE_REF || look_43_0 == T__71 || look_43_0.between?( T__81, T__83 ) || look_43_0 == T__87 || look_43_0 == T__90 )\n alt_43 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 43, 0 )\n end\n case alt_43\n when 1\n # at line 233:5: ebnf_suffix\n @state.following.push( TOKENS_FOLLOWING_ebnf_suffix_IN_element_1554 )\n ebnf_suffix101 = ebnf_suffix\n @state.following.pop\n if @state.backtracking == 0\n stream_ebnf_suffix.add( ebnf_suffix101.tree )\n end\n # AST Rewrite\n # elements: atom, ebnf_suffix\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 233:17: -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] atom EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n # at line 233:20: ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] atom EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_ebnf_suffix.next_node, root_1 )\n\n # at line 233:35: ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] atom EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] )\n root_2 = @adaptor.create_flat_list\n root_2 = @adaptor.become_root( @adaptor.create( BLOCK, \"BLOCK\" ), root_2 )\n\n # at line 233:52: ^( ALT[\\\"ALT\\\"] atom EOA[\\\"EOA\\\"] )\n root_3 = @adaptor.create_flat_list\n root_3 = @adaptor.become_root( @adaptor.create( ALT, \"ALT\" ), root_3 )\n\n @adaptor.add_child( root_3, stream_atom.next_tree )\n @adaptor.add_child( root_3, @adaptor.create( EOA, \"EOA\" ) )\n\n @adaptor.add_child( root_2, root_3 )\n @adaptor.add_child( root_2, @adaptor.create( EOB, \"EOB\" ) )\n\n @adaptor.add_child( root_1, root_2 )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n # at line 234:8: \n # AST Rewrite\n # elements: atom\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 234:8: -> atom\n @adaptor.add_child( root_0, stream_atom.next_tree )\n\n\n\n return_value.tree = root_0\n\n end\n end\n\n when 4\n root_0 = @adaptor.create_flat_list\n\n\n # at line 236:4: ebnf\n @state.following.push( TOKENS_FOLLOWING_ebnf_IN_element_1600 )\n ebnf102 = ebnf\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, ebnf102.tree )\n end\n\n when 5\n root_0 = @adaptor.create_flat_list\n\n\n # at line 237:6: ACTION\n __ACTION103__ = match( ACTION, TOKENS_FOLLOWING_ACTION_IN_element_1607 )\n if @state.backtracking == 0\n\n tree_for_ACTION103 = @adaptor.create_with_payload( __ACTION103__ )\n @adaptor.add_child( root_0, tree_for_ACTION103 )\n\n end\n\n when 6\n # at line 238:6: SEMPRED (g= '=>' -> GATED_SEMPRED[$g] | -> SEMPRED )\n __SEMPRED104__ = match( SEMPRED, TOKENS_FOLLOWING_SEMPRED_IN_element_1614 )\n if @state.backtracking == 0\n stream_SEMPRED.add( __SEMPRED104__ )\n end\n # at line 238:14: (g= '=>' -> GATED_SEMPRED[$g] | -> SEMPRED )\n alt_44 = 2\n look_44_0 = @input.peek( 1 )\n\n if ( look_44_0 == T__86 )\n alt_44 = 1\n elsif ( look_44_0 == SEMPRED || look_44_0 == TREE_BEGIN || look_44_0 == REWRITE || look_44_0.between?( TOKEN_REF, ACTION ) || look_44_0 == RULE_REF || look_44_0 == T__71 || look_44_0.between?( T__81, T__83 ) || look_44_0 == T__87 || look_44_0 == T__90 )\n alt_44 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 44, 0 )\n end\n case alt_44\n when 1\n # at line 238:16: g= '=>'\n g = match( T__86, TOKENS_FOLLOWING_T__86_IN_element_1620 )\n if @state.backtracking == 0\n stream_T__86.add( g )\n end\n # AST Rewrite\n # elements: \n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 238:23: -> GATED_SEMPRED[$g]\n @adaptor.add_child( root_0, @adaptor.create( GATED_SEMPRED, g ) )\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n # at line 238:46: \n # AST Rewrite\n # elements: SEMPRED\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 238:46: -> SEMPRED\n @adaptor.add_child( root_0, stream_SEMPRED.next_node )\n\n\n\n return_value.tree = root_0\n\n end\n end\n\n when 7\n # at line 239:6: tree_spec ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] tree_spec EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> tree_spec )\n @state.following.push( TOKENS_FOLLOWING_tree_spec_IN_element_1640 )\n tree_spec105 = tree_spec\n @state.following.pop\n if @state.backtracking == 0\n stream_tree_spec.add( tree_spec105.tree )\n end\n # at line 240:3: ( ebnf_suffix -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] tree_spec EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) ) | -> tree_spec )\n alt_45 = 2\n look_45_0 = @input.peek( 1 )\n\n if ( look_45_0 == T__74 || look_45_0.between?( T__91, T__92 ) )\n alt_45 = 1\n elsif ( look_45_0 == SEMPRED || look_45_0 == TREE_BEGIN || look_45_0 == REWRITE || look_45_0.between?( TOKEN_REF, ACTION ) || look_45_0 == RULE_REF || look_45_0 == T__71 || look_45_0.between?( T__81, T__83 ) || look_45_0 == T__87 || look_45_0 == T__90 )\n alt_45 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 45, 0 )\n end\n case alt_45\n when 1\n # at line 240:5: ebnf_suffix\n @state.following.push( TOKENS_FOLLOWING_ebnf_suffix_IN_element_1646 )\n ebnf_suffix106 = ebnf_suffix\n @state.following.pop\n if @state.backtracking == 0\n stream_ebnf_suffix.add( ebnf_suffix106.tree )\n end\n # AST Rewrite\n # elements: ebnf_suffix, tree_spec\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 240:17: -> ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] tree_spec EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n # at line 240:20: ^( ebnf_suffix ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] tree_spec EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] ) )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_ebnf_suffix.next_node, root_1 )\n\n # at line 240:35: ^( BLOCK[\\\"BLOCK\\\"] ^( ALT[\\\"ALT\\\"] tree_spec EOA[\\\"EOA\\\"] ) EOB[\\\"EOB\\\"] )\n root_2 = @adaptor.create_flat_list\n root_2 = @adaptor.become_root( @adaptor.create( BLOCK, \"BLOCK\" ), root_2 )\n\n # at line 240:52: ^( ALT[\\\"ALT\\\"] tree_spec EOA[\\\"EOA\\\"] )\n root_3 = @adaptor.create_flat_list\n root_3 = @adaptor.become_root( @adaptor.create( ALT, \"ALT\" ), root_3 )\n\n @adaptor.add_child( root_3, stream_tree_spec.next_tree )\n @adaptor.add_child( root_3, @adaptor.create( EOA, \"EOA\" ) )\n\n @adaptor.add_child( root_2, root_3 )\n @adaptor.add_child( root_2, @adaptor.create( EOB, \"EOB\" ) )\n\n @adaptor.add_child( root_1, root_2 )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n # at line 241:8: \n # AST Rewrite\n # elements: tree_spec\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 241:8: -> tree_spec\n @adaptor.add_child( root_0, stream_tree_spec.next_tree )\n\n\n\n return_value.tree = root_0\n\n end\n end\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 21 )\n\n end\n \n return return_value\n end", "def on_match_pattern(node); end", "def new_target\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 65 )\n return_value = NewTargetReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n receiver316 = nil\n accessor317 = nil\n\n stream_receiver = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule receiver\" )\n stream_accessor = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule accessor\" )\n begin\n # at line 685:5: ( receiver -> receiver ) ( accessor ->)*\n # at line 685:5: ( receiver -> receiver )\n # at line 685:7: receiver\n @state.following.push( TOKENS_FOLLOWING_receiver_IN_new_target_4861 )\n receiver316 = receiver\n @state.following.pop\n if @state.backtracking == 0\n stream_receiver.add( receiver316.tree )\n end\n # AST Rewrite\n # elements: receiver\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 685:16: -> receiver\n @adaptor.add_child( root_0, stream_receiver.next_tree )\n\n\n\n return_value.tree = root_0\n\n end\n # at line 686:5: ( accessor ->)*\n while true # decision 75\n alt_75 = 2\n look_75_0 = @input.peek( 1 )\n\n if ( look_75_0 == LBRACK )\n alt_75 = 1\n elsif ( look_75_0 == DOT )\n alt_75 = 1\n\n end\n case alt_75\n when 1\n # at line 686:7: accessor\n @state.following.push( TOKENS_FOLLOWING_accessor_IN_new_target_4875 )\n accessor317 = accessor\n @state.following.pop\n if @state.backtracking == 0\n stream_accessor.add( accessor317.tree )\n end\n # AST Rewrite\n # elements: \n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 686:16: ->\n @adaptor.add_child( root_0, ( prepend_tree( accessor317.tree, return_value.tree ) ) )\n\n\n\n return_value.tree = root_0\n\n end\n else\n break # out of loop for decision 75\n end\n end # loop for decision 75\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 65 )\n\n end\n \n return return_value\n end", "def take_ingredient_from_refrigerator\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 7 )\n value = nil\n take_ingredient_from_refrigerator_start_index = @input.index\n text21 = nil\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return value\n end\n # at line 148:5: take WS text WS from WS refrigerator EOF\n @state.following.push( TOKENS_FOLLOWING_take_IN_take_ingredient_from_refrigerator_502 )\n take\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_take_ingredient_from_refrigerator_504 )\n @state.following.push( TOKENS_FOLLOWING_text_IN_take_ingredient_from_refrigerator_506 )\n text21 = text\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_take_ingredient_from_refrigerator_508 )\n @state.following.push( TOKENS_FOLLOWING_from_IN_take_ingredient_from_refrigerator_510 )\n from\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_take_ingredient_from_refrigerator_512 )\n @state.following.push( TOKENS_FOLLOWING_refrigerator_IN_take_ingredient_from_refrigerator_514 )\n refrigerator\n @state.following.pop\n match( EOF, TOKENS_FOLLOWING_EOF_IN_take_ingredient_from_refrigerator_516 )\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = {\n :cmd => :take_ingredient_from_refrigerator,\n :args => {:ingredient => ( text21.nil? ? nil : text21.value )}\n }\n \n # <-- action\n end\n\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 7 )\n memoize( __method__, take_ingredient_from_refrigerator_start_index, success ) if @state.backtracking > 0\n\n end\n \n return value\n end", "def refrigerate\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 36 )\n refrigerate_start_index = @input.index\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return \n end\n # at line 319:5: ( 'R' | 'r' ) ( 'E' | 'e' ) ( 'F' | 'f' ) ( 'R' | 'r' ) ( 'I' | 'i' ) ( 'G' | 'g' ) ( 'E' | 'e' ) ( 'R' | 'r' ) ( 'A' | 'a' ) ( 'T' | 't' ) ( 'E' | 'e' )\n if @input.peek( 1 ).between?( T__20, T__21 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__28, T__29 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__30, T__31 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__20, T__21 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__24, T__25 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__56, T__57 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__28, T__29 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__20, T__21 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__48, T__49 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__16, T__17 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n if @input.peek( 1 ).between?( T__28, T__29 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 36 )\n memoize( __method__, refrigerate_start_index, success ) if @state.backtracking > 0\n\n end\n \n return \n end", "def rewrite_template_ref\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 41 )\n return_value = RewriteTemplateRefReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n lp = nil\n char_literal183 = nil\n id181 = nil\n rewrite_template_args182 = nil\n\n tree_for_lp = nil\n tree_for_char_literal183 = nil\n stream_T__81 = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token T__81\" )\n stream_T__83 = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token T__83\" )\n stream_id = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule id\" )\n stream_rewrite_template_args = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule rewrite_template_args\" )\n begin\n # at line 431:4: id lp= '(' rewrite_template_args ')'\n @state.following.push( TOKENS_FOLLOWING_id_IN_rewrite_template_ref_2985 )\n id181 = id\n @state.following.pop\n if @state.backtracking == 0\n stream_id.add( id181.tree )\n end\n lp = match( T__81, TOKENS_FOLLOWING_T__81_IN_rewrite_template_ref_2989 )\n if @state.backtracking == 0\n stream_T__81.add( lp )\n end\n @state.following.push( TOKENS_FOLLOWING_rewrite_template_args_IN_rewrite_template_ref_2991 )\n rewrite_template_args182 = rewrite_template_args\n @state.following.pop\n if @state.backtracking == 0\n stream_rewrite_template_args.add( rewrite_template_args182.tree )\n end\n char_literal183 = match( T__83, TOKENS_FOLLOWING_T__83_IN_rewrite_template_ref_2993 )\n if @state.backtracking == 0\n stream_T__83.add( char_literal183 )\n end\n # AST Rewrite\n # elements: rewrite_template_args, id\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 432:3: -> ^( TEMPLATE[$lp,\\\"TEMPLATE\\\"] id rewrite_template_args )\n # at line 432:6: ^( TEMPLATE[$lp,\\\"TEMPLATE\\\"] id rewrite_template_args )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( @adaptor.create( TEMPLATE, lp, \"TEMPLATE\" ), root_1 )\n\n @adaptor.add_child( root_1, stream_id.next_tree )\n @adaptor.add_child( root_1, stream_rewrite_template_args.next_tree )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 41 )\n\n end\n \n return return_value\n end", "def peek_lit_nolt(hint)\n pos0 = @pos\n while lit = next_input_element(hint) and lit.ws?\n end\n @pos = pos0\n lit\n end", "def tree_spec\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 27 )\n return_value = TreeSpecReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal129 = nil\n char_literal132 = nil\n element130 = nil\n element131 = nil\n\n tree_for_string_literal129 = nil\n tree_for_char_literal132 = nil\n stream_T__83 = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token T__83\" )\n stream_TREE_BEGIN = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token TREE_BEGIN\" )\n stream_element = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule element\" )\n begin\n # at line 283:4: '^(' element ( element )+ ')'\n string_literal129 = match( TREE_BEGIN, TOKENS_FOLLOWING_TREE_BEGIN_IN_tree_spec_2023 )\n if @state.backtracking == 0\n stream_TREE_BEGIN.add( string_literal129 )\n end\n @state.following.push( TOKENS_FOLLOWING_element_IN_tree_spec_2025 )\n element130 = element\n @state.following.pop\n if @state.backtracking == 0\n stream_element.add( element130.tree )\n end\n # at file 283:17: ( element )+\n match_count_60 = 0\n while true\n alt_60 = 2\n look_60_0 = @input.peek( 1 )\n\n if ( look_60_0 == SEMPRED || look_60_0 == TREE_BEGIN || look_60_0.between?( TOKEN_REF, ACTION ) || look_60_0 == RULE_REF || look_60_0 == T__81 || look_60_0 == T__87 || look_60_0 == T__90 )\n alt_60 = 1\n\n end\n case alt_60\n when 1\n # at line 283:19: element\n @state.following.push( TOKENS_FOLLOWING_element_IN_tree_spec_2029 )\n element131 = element\n @state.following.pop\n if @state.backtracking == 0\n stream_element.add( element131.tree )\n end\n\n else\n match_count_60 > 0 and break\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n eee = EarlyExit(60)\n\n\n raise eee\n end\n match_count_60 += 1\n end\n\n char_literal132 = match( T__83, TOKENS_FOLLOWING_T__83_IN_tree_spec_2034 )\n if @state.backtracking == 0\n stream_T__83.add( char_literal132 )\n end\n # AST Rewrite\n # elements: element\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 283:34: -> ^( TREE_BEGIN ( element )+ )\n # at line 283:37: ^( TREE_BEGIN ( element )+ )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( @adaptor.create_from_type( TREE_BEGIN, \"TREE_BEGIN\" ), root_1 )\n\n # at line 283:50: ( element )+\n stream_element.has_next? or raise ANTLR3::RewriteEarlyExit\n\n while stream_element.has_next?\n @adaptor.add_child( root_1, stream_element.next_tree )\n\n end\n stream_element.reset\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 27 )\n\n end\n \n return return_value\n end", "def rewind\n @object.rewind if @object.respond_to? :rewind\n @generator.rewind if @generator\n @lookahead = []\n self\n end", "def t__21!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 10 )\n\n type = T__21\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 26:9: 'r'\n match( 0x72 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 10 )\n\n end", "def token_spec\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 3)\n return_value = TokenSpecReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n lit = nil\n __TOKEN_REF16__ = nil\n char_literal17 = nil\n char_literal18 = nil\n\n tree_for_lit = nil\n tree_for_TOKEN_REF16 = nil\n tree_for_char_literal17 = nil\n tree_for_char_literal18 = nil\n stream_STRING_LITERAL = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token STRING_LITERAL\")\n stream_T__71 = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token T__71\")\n stream_CHAR_LITERAL = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token CHAR_LITERAL\")\n stream_LABEL_ASSIGN = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token LABEL_ASSIGN\")\n stream_TOKEN_REF = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token TOKEN_REF\")\n\n begin\n # at line 114:4: TOKEN_REF ( '=' (lit= STRING_LITERAL | lit= CHAR_LITERAL ) -> ^( '=' TOKEN_REF $lit) | -> TOKEN_REF ) ';'\n __TOKEN_REF16__ = match(TOKEN_REF, TOKENS_FOLLOWING_TOKEN_REF_IN_token_spec_492) \n if @state.backtracking == 0\n stream_TOKEN_REF.add(__TOKEN_REF16__)\n end\n # at line 115:3: ( '=' (lit= STRING_LITERAL | lit= CHAR_LITERAL ) -> ^( '=' TOKEN_REF $lit) | -> TOKEN_REF )\n alt_10 = 2\n look_10_0 = @input.peek(1)\n\n if (look_10_0 == LABEL_ASSIGN) \n alt_10 = 1\n elsif (look_10_0 == T__71) \n alt_10 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 10, 0)\n raise nvae\n end\n case alt_10\n when 1\n # at line 115:5: '=' (lit= STRING_LITERAL | lit= CHAR_LITERAL )\n char_literal17 = match(LABEL_ASSIGN, TOKENS_FOLLOWING_LABEL_ASSIGN_IN_token_spec_498) \n if @state.backtracking == 0\n stream_LABEL_ASSIGN.add(char_literal17)\n end\n # at line 115:9: (lit= STRING_LITERAL | lit= CHAR_LITERAL )\n alt_9 = 2\n look_9_0 = @input.peek(1)\n\n if (look_9_0 == STRING_LITERAL) \n alt_9 = 1\n elsif (look_9_0 == CHAR_LITERAL) \n alt_9 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 9, 0)\n raise nvae\n end\n case alt_9\n when 1\n # at line 115:10: lit= STRING_LITERAL\n lit = match(STRING_LITERAL, TOKENS_FOLLOWING_STRING_LITERAL_IN_token_spec_503) \n if @state.backtracking == 0\n stream_STRING_LITERAL.add(lit)\n end\n\n when 2\n # at line 115:29: lit= CHAR_LITERAL\n lit = match(CHAR_LITERAL, TOKENS_FOLLOWING_CHAR_LITERAL_IN_token_spec_507) \n if @state.backtracking == 0\n stream_CHAR_LITERAL.add(lit)\n end\n\n end\n # AST Rewrite\n # elements: lit, LABEL_ASSIGN, TOKEN_REF\n # token labels: lit\n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_lit = token_stream(\"token lit\", lit)\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 115:47: -> ^( '=' TOKEN_REF $lit)\n # at line 115:50: ^( '=' TOKEN_REF $lit)\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(stream_LABEL_ASSIGN.next_node, root_1)\n\n @adaptor.add_child(root_1, stream_TOKEN_REF.next_node)\n @adaptor.add_child(root_1, stream_lit.next_node)\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n # at line 116:16: \n # AST Rewrite\n # elements: TOKEN_REF\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 116:16: -> TOKEN_REF\n @adaptor.add_child(root_0, stream_TOKEN_REF.next_node)\n\n\n\n return_value.tree = root_0\n\n end\n end\n char_literal18 = match(T__71, TOKENS_FOLLOWING_T__71_IN_token_spec_546) \n if @state.backtracking == 0\n stream_T__71.add(char_literal18)\n end\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look(-1)\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing(root_0)\n @adaptor.set_token_boundaries(return_value.tree, return_value.start, return_value.stop)\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node!(@input, return_value.start, @input.look(-1), re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 3)\n\n end\n \n return return_value\n end", "def rewrite_template_ref\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 41)\n return_value = RewriteTemplateRefReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n lp = nil\n char_literal183 = nil\n id181 = nil\n rewrite_template_args182 = nil\n\n tree_for_lp = nil\n tree_for_char_literal183 = nil\n stream_T__81 = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token T__81\")\n stream_T__83 = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token T__83\")\n stream_id = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule id\")\n stream_rewrite_template_args = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule rewrite_template_args\")\n begin\n # at line 440:4: id lp= '(' rewrite_template_args ')'\n @state.following.push(TOKENS_FOLLOWING_id_IN_rewrite_template_ref_2990)\n id181 = id\n @state.following.pop\n if @state.backtracking == 0\n stream_id.add(id181.tree)\n end\n lp = match(T__81, TOKENS_FOLLOWING_T__81_IN_rewrite_template_ref_2994) \n if @state.backtracking == 0\n stream_T__81.add(lp)\n end\n @state.following.push(TOKENS_FOLLOWING_rewrite_template_args_IN_rewrite_template_ref_2996)\n rewrite_template_args182 = rewrite_template_args\n @state.following.pop\n if @state.backtracking == 0\n stream_rewrite_template_args.add(rewrite_template_args182.tree)\n end\n char_literal183 = match(T__83, TOKENS_FOLLOWING_T__83_IN_rewrite_template_ref_2998) \n if @state.backtracking == 0\n stream_T__83.add(char_literal183)\n end\n # AST Rewrite\n # elements: id, rewrite_template_args\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 441:3: -> ^( TEMPLATE[$lp,\\\"TEMPLATE\\\"] id rewrite_template_args )\n # at line 441:6: ^( TEMPLATE[$lp,\\\"TEMPLATE\\\"] id rewrite_template_args )\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(@adaptor.create!(TEMPLATE, lp, \"TEMPLATE\"), root_1)\n\n @adaptor.add_child(root_1, stream_id.next_tree)\n @adaptor.add_child(root_1, stream_rewrite_template_args.next_tree)\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look(-1)\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing(root_0)\n @adaptor.set_token_boundaries(return_value.tree, return_value.start, return_value.stop)\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node!(@input, return_value.start, @input.look(-1), re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 41)\n\n end\n \n return return_value\n end", "def rewrite(source_buffer, ast, **policy); end", "def rewrite(source_buffer, ast, **policy); end", "def rewrite(source_buffer, ast, **policy); end", "def apply_to(tokenstream) \n target=self.class.prepare_tokenstream(tokenstream, @direction)\n cache_check=@@cache[[tokenstream, [@landmarks, @direction, @exhaustive]]]\n if cache_check\n token_locs=cache_check\n else\n token_locs=[]\n while result=seek_landmarks(target)\n token_locs << correct_match_location(tokenstream, result)\n break unless exhaustive?\n end\n @@cache[[tokenstream, [@landmarks, @direction, @exhaustive]]]=token_locs\n end\n if block_given?\n generate_match_data(target, token_locs).each {|md| yield md}\n end\n return token_locs\n end" ]
[ "0.6571995", "0.62932235", "0.6283378", "0.6283378", "0.62363005", "0.5944797", "0.5860652", "0.5851974", "0.5845201", "0.5843893", "0.5835297", "0.5835297", "0.5835297", "0.5824453", "0.56735045", "0.56394064", "0.5632233", "0.5623401", "0.55420375", "0.55302507", "0.55268204", "0.55215603", "0.5518251", "0.5507922", "0.5507922", "0.54899913", "0.5438129", "0.5433108", "0.54293627", "0.54293627", "0.54293627", "0.5400446", "0.539825", "0.5388337", "0.5385089", "0.5384389", "0.5378233", "0.5358695", "0.53432876", "0.5340238", "0.5336081", "0.5321152", "0.52940863", "0.5291924", "0.52908593", "0.5289006", "0.52868503", "0.52865845", "0.52709574", "0.5266641", "0.5266641", "0.5253415", "0.525312", "0.5227169", "0.5225614", "0.52174354", "0.5216463", "0.5210489", "0.52075654", "0.52056456", "0.5184357", "0.5166001", "0.5162316", "0.5159782", "0.5158191", "0.5154613", "0.5140647", "0.5140607", "0.5134419", "0.5133336", "0.51233166", "0.51230943", "0.5118657", "0.5117185", "0.5115296", "0.51081437", "0.5104614", "0.50998163", "0.50977874", "0.5093252", "0.5092087", "0.5087479", "0.50855756", "0.50855756", "0.50827384", "0.50804645", "0.5078054", "0.5077473", "0.50751376", "0.50736004", "0.50692886", "0.50639683", "0.50528556", "0.50479233", "0.5046524", "0.5046327", "0.5043254", "0.5043254", "0.5043254", "0.5034851" ]
0.5525163
21
can the given element be used in a lookahead?
def lookahead?(element, in_lookahead = false) case element when Node[:char] then in_lookahead when Node[:group] then lookahead_payload?(element.payload, in_lookahead) when Node[:optional] then lookahead?(element.payload, true) or expect_lookahead?(element.payload) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lookahead(lookahead = nil) \n @lookahead = lookahead unless lookahead.nil?\n @lookahead\n end", "def expect_lookahead?(element)\n return element.class == Node[:capture] unless element.is_a? Node[:group]\n element.payload.all? { |e| expect_lookahead?(e) }\n end", "def expect_lookahead?(element)\n return element.class == Node[:capture] unless element.is_a? Node[:group]\n element.payload.all? { |e| expect_lookahead?(e) }\n end", "def match(x)\n if $lookahead == x\n lookahead\n else\n expected x\n end\nend", "def match(x)\n if $lookahead == x\n lookahead\n else\n expected x\n end\nend", "def create_lookahead(elements, *args)\n return elements unless elements.size > 1\n [Node[:with_look_ahead].new(elements, *args)]\n end", "def match(x)\n if $lookahead == x\n lookahead\n skip_white\n else\n expected x\n end\nend", "def create_lookahead(elements, *args)\n return elements unless elements.size > 1\n [Node[:with_look_ahead].new(elements, *args, start: elements.first.start, stop: elements.last.stop)]\n end", "def lookahead(input: $input)\n $lookahead = input.getc\nend", "def lookahead(input: $input)\n $lookahead = input.getc\nend", "def lookahead(input: $srcin)\n $lookahead = input.getc\nend", "def lookahead(ll_index = 0)\n retun nil if @current + ll_index >= tokens.size\n tokens[@current + ll_index]\n end", "def look_ahead(kclass, index, char, buffer, classified_sentence, nivel_parentese)\n if @raw[index + 1] && kclass::REGEX.match( \"#{buffer}#{char}#{@raw[index + 1]}\" )\n buffer.concat char\n else\n classified_sentence.push kclass.new(buffer+char)\n buffer.clear\n end\n end", "def element_match(tree, exp, bindings); end", "def lookahead_payload?(payload, in_lookahead)\n return unless payload[0..-2].all? { |e| lookahead?(e, in_lookahead) }\n expect_lookahead?(payload.last) or lookahead?(payload.last, in_lookahead)\n end", "def lookahead_payload?(payload, in_lookahead)\n return unless payload[0..-2].all? { |e| lookahead?(e, in_lookahead) }\n expect_lookahead?(payload.last) or lookahead?(payload.last, in_lookahead)\n end", "def track(element)\n return list_for(element) << element if lookahead_buffer.empty?\n return lookahead_buffer << element if lookahead? element\n\n lookahead = lookahead_buffer.dup\n lookahead = create_lookahead(lookahead, false) if element.is_a? Node[:separator]\n lookahead_buffer.clear\n\n payload.concat(lookahead) << element\n end", "def track(element)\n return list_for(element) << element if lookahead_buffer.empty?\n return lookahead_buffer << element if lookahead? element\n\n lookahead = lookahead_buffer.dup\n lookahead = create_lookahead(lookahead, false) if element.is_a? Node[:separator]\n lookahead_buffer.clear\n\n payload.concat(lookahead) << element\n end", "def advance\n @lookahead = next_token()\n end", "def list_for(element)\n expect_lookahead?(element) ? lookahead_buffer : payload\n end", "def list_for(element)\n expect_lookahead?(element) ? lookahead_buffer : payload\n end", "def address_lookahead\n\tlookahead = []\n\twhile @sym == SYM_ATOM ||\n @sym == SYM_ATOM_NON_ASCII ||\n @sym == SYM_QTEXT ||\n @sym == SYM_PERIOD\n\t lookahead.push([@sym, @lexeme])\n\t get\n\tend\n\tretval = @sym\n\tputback(@sym, @lexeme)\n\tputback_array(lookahead)\n\tget\n\tretval\n end", "def ABCheck(str)\n str.scan(/a...b/) == [] ? false : true # how this method tests 'b' before 'a'? \nend", "def match(p0) end", "def match(p0) end", "def lookahead_rule(aName, aBeforeAction = nil, &aBlock)\n\t\tnew_rule = LookaheadRule.new(aName, aBeforeAction)\n\t\tprocess_rule(new_rule, &aBlock)\n\tend", "def regexp_with_working_captures?(node); end", "def matching_text_element_lines(regex, exclude_nested = T.unsafe(nil)); end", "def consume()\n la(1)\n return @lookahead.shift\n end", "def =~(p0) end", "def =~(p0) end", "def =~(p0) end", "def match(x)\n $look == x or expected(\"#{x}\")\n getChar\n skipWhite\nend", "def test_the_left_most_match_wins\n ## assert_equal __, \"abbccc az\"[/az*/]\n assert_equal \"a\", \"abbccc az\"[/az*/]\n\n # The regex matches starting from left to right\n end", "def pre_match() end", "def lookahead_buffer\n @lookahead_buffer ||= []\n end", "def lookahead_buffer\n @lookahead_buffer ||= []\n end", "def scan_for_and(token); end", "def match_and_value?(expected)\n match?(expected) ? @lookahead.value : nil\n end", "def match_and_both?(expected)\n match?(expected) ? [@lookahead.type, @lookahead.value] : nil\n end", "def submatcher; end", "def submatcher; end", "def pre_match\n m = @match\n @string[0...(@pos - m.to_s.size)] if (not m.equal?(nil))\n end", "def letter?(lookAhead)\n if lookAhead =~ /[[:alpha:]]/\n return true\n else\n return false\n end\nend", "def test_srch_back_for_nonexist_pattern\n @buffer = Buffer.new 'Now is the time for all good men to come to the aid of their country'\n @buffer.fin\n @buffer.srch_back 'xxyyzz'\n assert_eq '', @buffer.at\n end", "def contain_a(elements)\n elements.select do |i|\n has_a = []\n if i.chars.include?\"a\" \n has_a.unshift(i)\n end\n end\nend", "def =~ (re)\n re.match(just_cards)\n end", "def underlying_matcher; end", "def underlying_matcher; end", "def setup_regex(word)\n @exact_rgx = /href='(.*)'>#{word}<\\//\n @partial_rgx = /href='(.*)'>#{word}/\n end", "def require_then?(in_pattern_node); end", "def match?(expected)\n @lookahead = next_token() if @lookahead.nil?\n expected.include?(@lookahead.type)\n end", "def scan_until(pattern); end", "def match_at? rexp, pos = 0\n MatchAt.match_at? self, rexp, pos\n end", "def get_name\n la = $lookahead\n\n return expected(\"Name\") unless is_alpha(la)\n\n lookahead\n\n \"_#{la}\"\nend", "def get_name\n la = $lookahead\n\n return expected(\"Name\") unless is_alpha(la)\n\n lookahead\n\n \"_#{la}\"\nend", "def match_and_type?(expected)\n match?(expected) ? @lookahead.type : nil\n end", "def match_lit?(l, hint = nil)\n lit = peek_lit(hint)\n if lit == l\n fwd_after_peek\n lit\n else\n nil\n end\n end", "def test_the_left_most_match_wins\n assert_equal 'a', \"abbccc az\"[/az*/]\n end", "def capture(element)\n element = remove_command(:capture, element)\n \"(?<#{element}>#{process_element(element)})\"\n end", "def test_the_left_most_match_wins\n assert_equal \"a\", \"abbccc az\"[/az*/]\n end", "def test_the_left_most_match_wins\n assert_equal \"a\", \"abbccc az\"[/az*/]\n end", "def expected_content\n text = '<h1>is the most important headline</h1>\\s*?' +\n '<p>\\s*?' +\n 'This is ordinary paragraph text within the body of the document,' +\n ' where certain words and phrases may be ' +\n '<em>emphasized</em> to mark them as ' +\n '<strong.*>particularly</strong>'\n Regexp.new text\nend", "def letter?(lookAhead)\n lookAhead =~ /[A-Za-z]/\n end", "def matcher; end", "def matcher; end", "def scan_for_at(token); end", "def look_ahead_for_support_either_side\n look_ahead_for_support do |left, right|\n left + right\n end\n end", "def test_failure_of_normal_block_insertion_2\n input = '<a href=\"xxx\">xxx</a>'\n\n Hpricot(input).text_gsub!(/(xxx)/) { assert_nil(Regexp.last_match) }\n end", "def find_exp(input, variable, expression); end", "def matcher=(_arg0); end", "def process_match3(exp)\n right = exp.shift\n left = exp.shift \n return process(s(:call, left, :=~, s(:array, right)))\n end", "def match(pattern); end", "def peek_char(lookahead = 1)\n @string[@current_char_pos + lookahead, 1]\n end", "def on_match_pattern_p(node); end", "def test_parse_set_collating_sequence\n root = RP.parse('[a[.span-ll.]h]', :any)\n exp = root[0]\n\n assert_equal '[.span-ll.]', exp[1].to_s\n end", "def forward_regex regex\n if regex.is_a? Symbol\n regex = @text_patterns[regex]\n raise \"Pattern specified #{regex} does not exist in text_patterns \" unless regex\n end\n $multiplier = 1 if !$multiplier || $multiplier == 0\n line = @current_index\n _arr = _getarray\n buff = _arr[line].to_s\n return unless buff\n pos = @curpos || 0 # list does not have curpos\n $multiplier.times {\n found = buff.index(regex, pos)\n if !found\n # if not found, we've lost a counter\n if line+1 < _arr.length\n line += 1\n else\n return\n end\n pos = 0\n else\n pos = found + 1\n end\n $log.debug \" forward_word: pos #{pos} line #{line} buff: #{buff}\"\n }\n $multiplier = 0\n @current_index = line\n @curpos = pos\n ensure_visible\n @repaint_required = true\n end", "def nested_anon_pattern \n /#<(#<.*>):(.*)>/\n end", "def positional_match_or_nil(source, re, position)\n md = source.match(re)\n matched_substr = md && md[position]\n yield(matched_substr) if matched_substr\n matched_substr\n end", "def match(input); end", "def allow_matcher; end", "def start_re=(_); end", "def match_element_name(element_name)\n match(element, element_name)\n end", "def fwd_lit(hint)\n while lit = next_input_element(hint) and (lit.ws? or lit.lt?)\n end\n lit\n end", "def take_before(node, source_part); end", "def elem\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 16 )\n a = nil\n\n begin\n # at line 56:9: ( ( '-' ) (a= NUMBER | a= FLOAT | a= BOOL | a= STRING | a= ID ) | (a= NUMBER | a= FLOAT | a= BOOL | a= STRING | a= ID ) )\n alt_22 = 2\n look_22_0 = @input.peek( 1 )\n\n if ( look_22_0 == MINUS )\n alt_22 = 1\n elsif ( look_22_0.between?( ID, STRING ) )\n alt_22 = 2\n else\n raise NoViableAlternative( \"\", 22, 0 )\n end\n case alt_22\n when 1\n # at line 56:10: ( '-' ) (a= NUMBER | a= FLOAT | a= BOOL | a= STRING | a= ID )\n # at line 56:10: ( '-' )\n # at line 56:11: '-'\n match( MINUS, TOKENS_FOLLOWING_MINUS_IN_elem_633 )\n # --> action\n agc_1('-1','int',false,true)\n # <-- action\n # --> action\n agc_2('*')\n # <-- action\n\n # at line 56:58: (a= NUMBER | a= FLOAT | a= BOOL | a= STRING | a= ID )\n alt_20 = 5\n case look_20 = @input.peek( 1 )\n when NUMBER then alt_20 = 1\n when FLOAT then alt_20 = 2\n when BOOL then alt_20 = 3\n when STRING then alt_20 = 4\n when ID then alt_20 = 5\n else\n raise NoViableAlternative( \"\", 20, 0 )\n end\n case alt_20\n when 1\n # at line 56:60: a= NUMBER\n a = match( NUMBER, TOKENS_FOLLOWING_NUMBER_IN_elem_642 )\n # --> action\n agc_1(a, 'int',false,true)\n # <-- action\n\n when 2\n # at line 56:99: a= FLOAT\n a = match( FLOAT, TOKENS_FOLLOWING_FLOAT_IN_elem_649 )\n # --> action\n agc_1(a, 'float',false,true)\n # <-- action\n\n when 3\n # at line 56:139: a= BOOL\n a = match( BOOL, TOKENS_FOLLOWING_BOOL_IN_elem_656 )\n # --> action\n agc_1(a, 'boolean',false,true)\n # <-- action\n\n when 4\n # at line 56:180: a= STRING\n a = match( STRING, TOKENS_FOLLOWING_STRING_IN_elem_663 )\n # --> action\n agc_1(a, 'string',false,true)\n # <-- action\n\n when 5\n # at line 56:222: a= ID\n a = match( ID, TOKENS_FOLLOWING_ID_IN_elem_670 )\n # --> action\n agc_1(a)\n # <-- action\n\n end\n # --> action\n agc_3(['*'])\n # <-- action\n\n when 2\n # at line 56:253: (a= NUMBER | a= FLOAT | a= BOOL | a= STRING | a= ID )\n # at line 56:253: (a= NUMBER | a= FLOAT | a= BOOL | a= STRING | a= ID )\n alt_21 = 5\n case look_21 = @input.peek( 1 )\n when NUMBER then alt_21 = 1\n when FLOAT then alt_21 = 2\n when BOOL then alt_21 = 3\n when STRING then alt_21 = 4\n when ID then alt_21 = 5\n else\n raise NoViableAlternative( \"\", 21, 0 )\n end\n case alt_21\n when 1\n # at line 56:255: a= NUMBER\n a = match( NUMBER, TOKENS_FOLLOWING_NUMBER_IN_elem_680 )\n # --> action\n agc_1(a, 'int',false,true)\n # <-- action\n\n when 2\n # at line 56:294: a= FLOAT\n a = match( FLOAT, TOKENS_FOLLOWING_FLOAT_IN_elem_687 )\n # --> action\n agc_1(a, 'float',false,true)\n # <-- action\n\n when 3\n # at line 56:334: a= BOOL\n a = match( BOOL, TOKENS_FOLLOWING_BOOL_IN_elem_694 )\n # --> action\n agc_1(a, 'boolean',false,true)\n # <-- action\n\n when 4\n # at line 56:375: a= STRING\n a = match( STRING, TOKENS_FOLLOWING_STRING_IN_elem_701 )\n # --> action\n agc_1(a, 'string',false,true)\n # <-- action\n\n when 5\n # at line 56:417: a= ID\n a = match( ID, TOKENS_FOLLOWING_ID_IN_elem_708 )\n # --> action\n agc_1(a)\n # <-- action\n\n end\n # --> action\n agc_3(['*'])\n # <-- action\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 16 )\n\n end\n \n return \n end", "def element_match(tree, exp, bindings) \n # p [:elm, tree, exp]\n if tree.is_a?(Hash) && exp.is_a?(Hash)\n return element_match_hash(tree, exp, bindings)\n elsif tree.is_a?(Array) && exp.is_a?(Array)\n return element_match_ary_single(tree, exp, bindings)\n else\n # If elements match exactly, then that is good enough in all cases\n return true if exp === tree\n \n # If exp is a bind variable: Check if the binding matches\n if exp.respond_to?(:can_bind?) && exp.can_bind?(tree)\n return element_match_binding(tree, exp, bindings)\n end\n \n # Otherwise: No match (we don't know anything about the element\n # combination)\n return false\n end\n end", "def test_upper_lower\n assert_equal(\"A\", @target.find_first_non_repeating(\"aaaAaaa\"))\n end", "def must_see(char)\n spaces\n if next_is char\n # All good, input as expected.\n char\n elsif input.eos?\n # Finally, the case we've been waiting for:\n # Input exhausted, but still elements to close.\n append char\n else\n append char\n # The magic trick:\n # We implicitly use the stack to count how many closing tags we have/need.\n # We pair with exception's `ensure` mechanism to actually write them out.\n if debug\n msg = \"Seen so far: %s\" % result.clone\n raise UnexpectedTokenError, msg\n else\n raise UnexpectedTokenError\n end\n end\n end", "def checkTypo(arg,regex)\r\n return !(arg=~regex)\r\nend", "def reduce_if_followed(_production, _range, _tokens, theChildren)\n polarity = theChildren[1] ? :negative : :positive\n Regex::Lookaround.new(theChildren.last, :ahead, polarity)\n end", "def test_word_fwd_no_match\n assert_nil @buffer.word_fwd\n end", "def match_captures; end", "def match(regexp); end", "def pre_match\n nil\n end", "def contain_a(elements)\n elements.select do |element|\n element.include? \"a\"\n end\nend", "def inspect_post_html(id, element, regexp)\n position = find(\"#post_#{id} #{element}\").text =~ regexp\n position.should be_a_kind_of Fixnum\n position.should_not be_nil\nend", "def letter?(lookAhead)\n\t\tlookAhead =~ /[A-Za-z]/\n\tend", "def la( count = 1 )\n until @lookahead.length >= count\n if token = @lexer.next_token( @lexer_state.number ) then\n @lookahead << token\n else\n nyi \"error handling for lexer error\" if @lexer.input_remaining?\n break\n end\n end\n \n return @lookahead[count - 1]\n end" ]
[ "0.7090985", "0.67719847", "0.67719847", "0.6658072", "0.6658072", "0.645582", "0.64471513", "0.6356109", "0.62440825", "0.62440825", "0.60656714", "0.5877403", "0.58204025", "0.58177274", "0.56340057", "0.56340057", "0.5560968", "0.5560968", "0.55575055", "0.5447348", "0.5447348", "0.5411944", "0.540919", "0.5376887", "0.5376887", "0.53641945", "0.53055155", "0.5297903", "0.5274251", "0.5222421", "0.5222421", "0.5222421", "0.520177", "0.519481", "0.5193506", "0.5188192", "0.5188192", "0.5178352", "0.5166104", "0.5110954", "0.5085513", "0.5085513", "0.4989582", "0.49798328", "0.4916103", "0.49100548", "0.48907182", "0.4875109", "0.4875109", "0.48710096", "0.4859092", "0.48457804", "0.48374858", "0.48360798", "0.48172605", "0.48172605", "0.48017907", "0.47849944", "0.47755206", "0.47716987", "0.47590154", "0.47590154", "0.47522885", "0.47469884", "0.47427127", "0.47427127", "0.47273964", "0.47261685", "0.47159916", "0.47073632", "0.4706562", "0.46770787", "0.46756795", "0.46738783", "0.46703002", "0.46650657", "0.46649233", "0.46599793", "0.46588084", "0.4658422", "0.4651443", "0.46491536", "0.46233958", "0.46208528", "0.4608823", "0.459872", "0.45857847", "0.4583246", "0.45812836", "0.4565778", "0.4563669", "0.45571133", "0.45501748", "0.45495138", "0.45486492", "0.45454365", "0.4541221", "0.4534464", "0.45324394" ]
0.6795669
2
does the list of elements look lookaheadish to you?
def lookahead_payload?(payload, in_lookahead) return unless payload[0..-2].all? { |e| lookahead?(e, in_lookahead) } expect_lookahead?(payload.last) or lookahead?(payload.last, in_lookahead) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_for(element)\n expect_lookahead?(element) ? lookahead_buffer : payload\n end", "def list_for(element)\n expect_lookahead?(element) ? lookahead_buffer : payload\n end", "def create_lookahead(elements, *args)\n return elements unless elements.size > 1\n [Node[:with_look_ahead].new(elements, *args)]\n end", "def create_lookahead(elements, *args)\n return elements unless elements.size > 1\n [Node[:with_look_ahead].new(elements, *args, start: elements.first.start, stop: elements.last.stop)]\n end", "def contain_a(elements)\n elements.select do |i|\n has_a = []\n if i.chars.include?\"a\" \n has_a.unshift(i)\n end\n end\nend", "def expect_lookahead?(element)\n return element.class == Node[:capture] unless element.is_a? Node[:group]\n element.payload.all? { |e| expect_lookahead?(e) }\n end", "def expect_lookahead?(element)\n return element.class == Node[:capture] unless element.is_a? Node[:group]\n element.payload.all? { |e| expect_lookahead?(e) }\n end", "def lookahead?(element, in_lookahead = false)\n case element\n when Node[:char] then in_lookahead\n when Node[:group] then lookahead_payload?(element.payload, in_lookahead)\n when Node[:optional] then lookahead?(element.payload, true) or expect_lookahead?(element.payload)\n end\n end", "def lookahead?(element, in_lookahead = false)\n case element\n when Node[:char] then in_lookahead\n when Node[:group] then lookahead_payload?(element.payload, in_lookahead)\n when Node[:optional] then lookahead?(element.payload, true) or expect_lookahead?(element.payload)\n end\n end", "def multi_element_text_check( elements )\n wanted = Array.new\n found = Array.new\n elements.each do |element|\n print \".\"\n e = $driver.find_element(element[0].to_sym, element[1])\n wanted << [ element[1], element[2] ]\n found << [ element[1], e.text ]\n end\n\n found.should == wanted\n end", "def match_maker(opposites_attract, *elements)\n to_return = []\n elements.each_slice 2 do |first, last|\n first = !!first\n last = !!last\n result = if opposites_attract\n first != last\n else\n first == last\n end\n to_return << result\n end\n to_return\n end", "def contain_a(elements)\n elements.select do |element|\n element.include? \"a\"\n end\nend", "def match_maker(opposites_attract, *elements)\n to_return = []\n elements.each_slice 2 do |first, last|\n first = !!first\n last = !!last\n result = if opposites_attract\n first != last\n else\n first == last\n end\n to_return << result\n end\n to_return\nend", "def elements_include_mods?(*elements)\n elements.any? { |n| n =~ /[\\-\\+]/ }\n end", "def elements_include_mods?(*elements)\n elements.any? { |n| n =~ /[\\-\\+]/ }\n end", "def match(*list)\n @match.concat(makelist(list)) unless list.empty?\n @match\n end", "def lookahead(lookahead = nil) \n @lookahead = lookahead unless lookahead.nil?\n @lookahead\n end", "def track(element)\n return list_for(element) << element if lookahead_buffer.empty?\n return lookahead_buffer << element if lookahead? element\n\n lookahead = lookahead_buffer.dup\n lookahead = create_lookahead(lookahead, false) if element.is_a? Node[:separator]\n lookahead_buffer.clear\n\n payload.concat(lookahead) << element\n end", "def track(element)\n return list_for(element) << element if lookahead_buffer.empty?\n return lookahead_buffer << element if lookahead? element\n\n lookahead = lookahead_buffer.dup\n lookahead = create_lookahead(lookahead, false) if element.is_a? Node[:separator]\n lookahead_buffer.clear\n\n payload.concat(lookahead) << element\n end", "def matching_text_element_lines(regex, exclude_nested = T.unsafe(nil)); end", "def saw_begin_list(list); end", "def test_not_all_elements_match\n stream = FromArray.new([2, 4, 5, 6, 8])\n assert(\n stream.all_match { |val| val % 2 == 0 } == false,\n 'Expected false because not all elements are a match!'\n )\n end", "def ABCheck(str)\n str.scan(/a...b/) == [] ? false : true # how this method tests 'b' before 'a'? \nend", "def precedes; [] end", "def test_scan_is_like_find_all\n ##assert_equal __, \"one two-three\".scan(/\\w+/)\n assert_equal [\"one\", \"two\", \"three\"], \"one two-three\".scan(/\\w+/)\n end", "def element_match(tree, exp, bindings); end", "def lookahead_buffer\n @lookahead_buffer ||= []\n end", "def lookahead_buffer\n @lookahead_buffer ||= []\n end", "def is_tagged_list(exp, tag)\n exp.instance_of?(Pair) and exp.first == tag\n end", "def test_all_elements_match\n stream = FromArray.new([2, 4, 6, 8])\n assert(\n stream.all_match { |val| val % 2 == 0 },\n 'All of the stream\\'s elements should be even!'\n )\n end", "def scan_for_and(token); end", "def match(x)\n if $lookahead == x\n lookahead\n skip_white\n else\n expected x\n end\nend", "def lookahead(ll_index = 0)\n retun nil if @current + ll_index >= tokens.size\n tokens[@current + ll_index]\n end", "def build_string_regex(elements)\n\n starting_with = \"\"\n elements.each_with_index do |el, i|\n starting_with += el.starts_with.to_s\n if i < elements.size - 1\n starting_with += \"|\"\n end\n end\n\n string_regex = /\\A[^\\s]+?(?=(#{starting_with}))/\n end", "def array_of_elements_match?(elements:, ids:, expectation:)\n actual = ids.map { |id| elements[id].text }\n actual.should =~ expectation\nend", "def pre_match() end", "def test_scan_is_like_find_all\n assert_equal ['one', 'two', 'three'], \"one two-three\".scan(/\\w+/)\n end", "def _separate args, pattern=nil #/^[a-zA-Z]/ \n tag = nil\n items = []\n args.each do |arg| \n if arg =~ /^[0-9\\.]+$/\n items << arg\n else\n tag = arg\n if pattern\n die \"#{@action}: #{arg} appears invalid.\" if arg !~ pattern\n end\n end\n end\n items = nil if items.empty?\n return tag, items\n end", "def test_scan_is_like_find_all\n assert_equal [\"one\", \"two\", \"three\"], \"one two-three\".scan(/\\w+/)\n end", "def test_scan_is_like_find_all\n assert_equal [\"one\", \"two\", \"three\"], \"one two-three\".scan(/\\w+/)\n end", "def test_many_number_list_with_em_tag\n input = \"1. one\\n2. two\\n3. *three*\\n4. four\\n5. five\"\n expected = \"\\t<li>one</li>\\n\\t<li>two</li>\\n\\t<li><em>three</em></li>\\n\\t<li>four</li>\\n\\t<li>five</li>\\n\"\n output = Lists.new(input)\n assert_equal expected, output.get_other_tags\n end", "def test_xyz_not_in_arr\n refute_includes(list, 'ttt')\n end", "def define_match_any_of\n klass.send(:define_method, :match_any_of) do |tags|\n if tags.empty?\n str(\"\")\n else\n tags.map { |tag| str(tag) }.inject do |tag_chain, tag|\n tag_chain.send :|, tag\n end\n end\n end\n end", "def test_all_match_no_elements\n stream = FromArray.new([])\n assert(\n stream.all_match { |val| val % 2 == 1 },\n 'Expected true because the stream is empty!'\n )\n end", "def educate(elements)\n Rules.inject(elements) do |elems, rule|\n apply_one_rule!(rule, elems)\n end\n end", "def address_lookahead\n\tlookahead = []\n\twhile @sym == SYM_ATOM ||\n @sym == SYM_ATOM_NON_ASCII ||\n @sym == SYM_QTEXT ||\n @sym == SYM_PERIOD\n\t lookahead.push([@sym, @lexeme])\n\t get\n\tend\n\tretval = @sym\n\tputback(@sym, @lexeme)\n\tputback_array(lookahead)\n\tget\n\tretval\n end", "def test_the_left_most_match_wins\n ## assert_equal __, \"abbccc az\"[/az*/]\n assert_equal \"a\", \"abbccc az\"[/az*/]\n\n # The regex matches starting from left to right\n end", "def match_maker(opposites_attract, *elements) #method takes a boolean, and any number of booleans\n to_return = [] #creating an empty array\n elements.each_slice 2 do |first, last| #splits the array into an array of pairs\n first = !!first #conversion to boolean\n last = !! last\n result = if opposites_attract\n first != last #first does not equal last\n else\n first ==last #or they equal\n end\n to_return << result #append result \nend \nto_return\nend", "def test_two_artgs\n assert_true ArrayPatternMatcher.new(1, 2) === [1, 2]\n assert_true ArrayPatternMatcher.new(Integer, 2) === [1, 2]\n assert_true ArrayPatternMatcher.new(/\\s/, 'a') === [' ', 'a']\n assert_false ArrayPatternMatcher.new(/\\s/, 'b') === [' ', 'a']\n assert_false ArrayPatternMatcher.new(/\\s/) === [' ', 'a']\n end", "def multi_element_attr_check( elements )\n wanted = Array.new\n found = Array.new\n elements.each do |element|\n print \".\"\n e = $driver.find_element(element[0].to_sym, element[1])\n wanted << [ element[1], element[2], element[3] ]\n found << [ element[1], element[2], e.attribute(element[2]) ]\n end\n\n found.should == wanted\n end", "def can_contain?(element)\n false\n end", "def list?\n element_names == %w[list] and text_children.all?(&:blank?)\n end", "def multi_element_attr_match( elements )\n elements.each do |element|\n print \".\"\n wait_for_element(element[0].to_sym, element[1])\n check_attribute_match(element[0].to_sym, element[1], element[2], element[3])\n end\n end", "def f6; return *['a','b'] &['a','Y','Z'] end", "def match_list start_stream, list_of_specs, token=nil, context={}\n if token.is_a?(Hash)\n token, context = nil, token\n end\n scanner = start_stream\n children = []\n end_stream = start_stream\n # Individual elements get the same context as the list as a whole, except for the list-processing options\n distributed_context = context.except :checklist, :repeating, :or, :optional\n case\n when context[:checklist] # All elements must be matched, but the order is unimportant\n list_of_specs.each do |spec|\n scanner = start_stream\n best_guess = nil\n while scanner.more? && !(child = match_specification scanner, spec, distributed_context).success? do\n best_guess = child if child.enclose? # Save the last child to enclose\n scanner = child.next # Skip past what the child rejected\n end\n return best_guess if best_guess&.hard_fail?\n next unless child\n children << child.if_succeeded\n end_stream = child.tail_stream if child.tail_stream.pos > end_stream.pos # We'll set the scan after the last item\n end\n when context[:repeating] # The list will be matched repeatedly until the end of input\n # Note: If there's no bound, the list will consume the entire stream\n while end_stream.more? do\n child = match_list end_stream, list_of_specs, context.except(:repeating)\n children << child.if_succeeded\n end_stream = child.tail_stream # next\n end\n when context[:or] # The list is taken as an ordered set of alternatives, any of which will match the list\n list_of_specs.each do |spec|\n child = match_specification start_stream, spec, token, distributed_context\n if child.success?\n return (token.nil? || child.token == token) ? child : Seeker.new(start_stream, child.tail_stream, token, [child])\n end\n end\n return Seeker.failed(start_stream, token, context) # TODO: not retaining children discarded along the way\n else # The default case: an ordered list of items to match\n list_of_specs.each do |spec|\n child = match_specification end_stream, spec, distributed_context\n children << child.if_retain\n end_stream = child.tail_stream\n if child.hard_fail? && !child.enclose?\n return Seeker.failed((children.first || child).head_stream,\n end_stream,\n token,\n child.retain? ? context.merge(children: children.keep_if(&:'retain?')+[child]) : context)\n end\n end\n end\n # If there's only a single child and no token, just return that child\n children.compact!\n (children.count == 1 && token.nil?) ?\n children.first :\n Seeker.new(start_stream, end_stream, token, children)\n end", "def test_any_match_all\n stream = FromArray.new([2, 4, 6, 8])\n assert(\n stream.any_match { |val| val %2 == 0 },\n 'All elements are even, it should match!'\n )\n end", "def test_match_sets_discard\n assert_not_equal(nil, @exp.expect(/null/))\n assert_not_equal('', @exp.discard)\n end", "def match_maker(determine, *elements)\n # Create a new array\n return_array = []\n # Loop through each item in the elements array, slicing into two\n elements.each_slice 2 do | first, last |\n # Create a variable that checks if the element is the opposite\n first = !!first\n last = !!last\n result = determine ? first != last : first == last\n # Push the result to the array\n return_array << result\n end\n # Return the array\n return_array\nend", "def real_words(permutations, wordlist)\n validwords = []\n wordlist = wordlist.to_set\n permutations.each { |x| validwords << x if wordlist.include?(x) }\n validwords\nend", "def expression_list\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 45 )\n return_value = ExpressionListReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal218 = nil\n expression217 = nil\n expression219 = nil\n\n tree_for_char_literal218 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 552:5: expression ( ',' expression )*\n @state.following.push( TOKENS_FOLLOWING_expression_IN_expression_list_3667 )\n expression217 = expression\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, expression217.tree )\n end\n # at line 552:16: ( ',' expression )*\n while true # decision 49\n alt_49 = 2\n alt_49 = @dfa49.predict( @input )\n case alt_49\n when 1\n # at line 552:18: ',' expression\n char_literal218 = match( COMMA, TOKENS_FOLLOWING_COMMA_IN_expression_list_3671 )\n if @state.backtracking == 0\n\n tree_for_char_literal218 = @adaptor.create_with_payload( char_literal218 )\n root_0 = @adaptor.become_root( tree_for_char_literal218, root_0 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_expression_IN_expression_list_3674 )\n expression219 = expression\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, expression219.tree )\n end\n\n else\n break # out of loop for decision 49\n end\n end # loop for decision 49\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 45 )\n\n end\n \n return return_value\n end", "def include?(el)\n list.include?(el)\n end", "def test_any_element_matches\n stream = FromArray.new([2, 4, 6, 8])\n assert(\n stream.any_match { |val| val == 4 },\n 'Stream contains element 4, it should match!'\n )\n end", "def filter_pipelines(list,to_skip)\n list.reject{ |e| to_skip.any? { |re| re =~ e } }\nend", "def test_nested_list\n items = [\n 'Item 1',\n 'Item 1a',\n 'Item 1a1',\n 'Item 1a1a',\n 'Item 1a1a1',\n 'Item 1a1a1a',\n 'Item 1a1a1a1',\n 'Item 1a1a1a1a',\n 'Item 1a1a1a1a1',\n 'Item 1a1a1a1a1a'\n ]\n\n pre = -3\n markdown = items.inject('') do |md, item|\n pre += 3\n md.concat(' '*pre + '+ ' + item + \"\\n\")\n end\n\n html = GitHub::Markdown.render(markdown)\n parsed = Nokogiri::HTML::DocumentFragment.parse(html)\n\n items.inject(parsed) do |node, expected_item|\n child = node.xpath('.//ul/li')\n child_item = child.children.detect{|e| e.text?}.text.strip\n assert_equal expected_item, child_item\n node = child\n end\n end", "def bubble_up_exact_matches(affil_list:, term:)\n matches_at_beginning = []\n matches_within = []\n other_items = []\n match_term = term.downcase\n affil_list.each do |affil_item|\n name = affil_item[:name].downcase\n if name.start_with?(match_term)\n matches_at_beginning << affil_item\n elsif name.include?(match_term)\n matches_within << affil_item\n else\n other_items << affil_item\n end\n end\n matches_at_beginning + matches_within + other_items\n end", "def got_three?(el)\n count = 0\n \n while count < el.length \n char = el[count]\n num = 0\n el.each {|x| num +=1 if x == char}\n if num >= 3\n three = true\n char2 = char\n end\n count +=1\n \n end\n if three == true\n el.each_cons 3 do |a, b, c|\n if a == b && b == c\n return true\n end\n end\n end\n false\n end", "def match(x)\n if $lookahead == x\n lookahead\n else\n expected x\n end\nend", "def match(x)\n if $lookahead == x\n lookahead\n else\n expected x\n end\nend", "def match_maker(*el)\n\nnewEl = []\nel.each do |x|\n x == true ? x : x == false ? x : x.nil? == true ? x = false : x = true\n newEl << x\nend\n\ndefiningBool = newEl.shift\n\nresult = []\nnewEl.each_slice(2) { |a,b| result << [a,b]}\n\nif definingBool == false\n\nresult.each_with_index do |arr, index|\nresult[index] = (arr[0] == arr[1] )\nend\n\nelse\n result.each_with_index do |arr, index|\n result[index] = !(arr[0] == arr[1])\nend\n\nend\nresult\n\nend", "def test_one_arg\n assert_true ArrayPatternMatcher.new(1) === [1]\n assert_true ArrayPatternMatcher.new(Integer) === [1]\n assert_true ArrayPatternMatcher.new(/\\s/) === [' ']\n assert_true ArrayPatternMatcher.new(String) === [' ']\n assert_false ArrayPatternMatcher.new(Integer) === []\n assert_false ArrayPatternMatcher.new(Integer) === [' ']\n assert_false ArrayPatternMatcher.new(String) === ' '\n assert_false ArrayPatternMatcher.new(Array) === ' '\n end", "def expect_list_addresses(list, present=true)\n list.each do |a|\n if present\n expect(page).to have_content(content_regex(a))\n else\n expect(page).to have_no_content(content_regex(a))\n end\n end\n end", "def look_ahead_for_support_either_side\n look_ahead_for_support do |left, right|\n left + right\n end\n end", "def all_elements_except_first_3\nend", "def all_elements_except_first_3\nend", "def all_elements_except_first_3\nend", "def lookahead(input: $input)\n $lookahead = input.getc\nend", "def lookahead(input: $input)\n $lookahead = input.getc\nend", "def has_elements?; end", "def element_linenumbers(elements); end", "def elem\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 16 )\n a = nil\n\n begin\n # at line 56:9: ( ( '-' ) (a= NUMBER | a= FLOAT | a= BOOL | a= STRING | a= ID ) | (a= NUMBER | a= FLOAT | a= BOOL | a= STRING | a= ID ) )\n alt_22 = 2\n look_22_0 = @input.peek( 1 )\n\n if ( look_22_0 == MINUS )\n alt_22 = 1\n elsif ( look_22_0.between?( ID, STRING ) )\n alt_22 = 2\n else\n raise NoViableAlternative( \"\", 22, 0 )\n end\n case alt_22\n when 1\n # at line 56:10: ( '-' ) (a= NUMBER | a= FLOAT | a= BOOL | a= STRING | a= ID )\n # at line 56:10: ( '-' )\n # at line 56:11: '-'\n match( MINUS, TOKENS_FOLLOWING_MINUS_IN_elem_633 )\n # --> action\n agc_1('-1','int',false,true)\n # <-- action\n # --> action\n agc_2('*')\n # <-- action\n\n # at line 56:58: (a= NUMBER | a= FLOAT | a= BOOL | a= STRING | a= ID )\n alt_20 = 5\n case look_20 = @input.peek( 1 )\n when NUMBER then alt_20 = 1\n when FLOAT then alt_20 = 2\n when BOOL then alt_20 = 3\n when STRING then alt_20 = 4\n when ID then alt_20 = 5\n else\n raise NoViableAlternative( \"\", 20, 0 )\n end\n case alt_20\n when 1\n # at line 56:60: a= NUMBER\n a = match( NUMBER, TOKENS_FOLLOWING_NUMBER_IN_elem_642 )\n # --> action\n agc_1(a, 'int',false,true)\n # <-- action\n\n when 2\n # at line 56:99: a= FLOAT\n a = match( FLOAT, TOKENS_FOLLOWING_FLOAT_IN_elem_649 )\n # --> action\n agc_1(a, 'float',false,true)\n # <-- action\n\n when 3\n # at line 56:139: a= BOOL\n a = match( BOOL, TOKENS_FOLLOWING_BOOL_IN_elem_656 )\n # --> action\n agc_1(a, 'boolean',false,true)\n # <-- action\n\n when 4\n # at line 56:180: a= STRING\n a = match( STRING, TOKENS_FOLLOWING_STRING_IN_elem_663 )\n # --> action\n agc_1(a, 'string',false,true)\n # <-- action\n\n when 5\n # at line 56:222: a= ID\n a = match( ID, TOKENS_FOLLOWING_ID_IN_elem_670 )\n # --> action\n agc_1(a)\n # <-- action\n\n end\n # --> action\n agc_3(['*'])\n # <-- action\n\n when 2\n # at line 56:253: (a= NUMBER | a= FLOAT | a= BOOL | a= STRING | a= ID )\n # at line 56:253: (a= NUMBER | a= FLOAT | a= BOOL | a= STRING | a= ID )\n alt_21 = 5\n case look_21 = @input.peek( 1 )\n when NUMBER then alt_21 = 1\n when FLOAT then alt_21 = 2\n when BOOL then alt_21 = 3\n when STRING then alt_21 = 4\n when ID then alt_21 = 5\n else\n raise NoViableAlternative( \"\", 21, 0 )\n end\n case alt_21\n when 1\n # at line 56:255: a= NUMBER\n a = match( NUMBER, TOKENS_FOLLOWING_NUMBER_IN_elem_680 )\n # --> action\n agc_1(a, 'int',false,true)\n # <-- action\n\n when 2\n # at line 56:294: a= FLOAT\n a = match( FLOAT, TOKENS_FOLLOWING_FLOAT_IN_elem_687 )\n # --> action\n agc_1(a, 'float',false,true)\n # <-- action\n\n when 3\n # at line 56:334: a= BOOL\n a = match( BOOL, TOKENS_FOLLOWING_BOOL_IN_elem_694 )\n # --> action\n agc_1(a, 'boolean',false,true)\n # <-- action\n\n when 4\n # at line 56:375: a= STRING\n a = match( STRING, TOKENS_FOLLOWING_STRING_IN_elem_701 )\n # --> action\n agc_1(a, 'string',false,true)\n # <-- action\n\n when 5\n # at line 56:417: a= ID\n a = match( ID, TOKENS_FOLLOWING_ID_IN_elem_708 )\n # --> action\n agc_1(a)\n # <-- action\n\n end\n # --> action\n agc_3(['*'])\n # <-- action\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 16 )\n\n end\n \n return \n end", "def test_parse_set_collating_sequence\n root = RP.parse('[a[.span-ll.]h]', :any)\n exp = root[0]\n\n assert_equal '[.span-ll.]', exp[1].to_s\n end", "def =~ (re)\n re.match(just_cards)\n end", "def used_by?(element)\n end", "def used_by?(element)\n end", "def element_lines(elements); end", "def next_element; end", "def include?(element)\n @element_list.include? element\n end", "def assert_valid_field_list(values)\n if values.length == @entry_fields.length + 1 # values also includes raw_entry\n @field_list_is_valid = true\n else\n raise Indy::Source::FieldMismatchException, \"Number of expected fields does not match those captured via the regexp pattern.\\nThe expected fields are:\\n=> #{@entry_fields.join(\"\\n=> \")}\\nThe log entry and captured fields are:\\n=> #{values.join(\"\\n=> \")}\"\n end\n end", "def check_for_inconsistency(elements)\n elements.any?{|e| e != elements.first}\n end", "def test_rack_contains_some_but_not_all_needed_letters\n [:A,:B,:C,:D].each{|x| @newTileRack.append(x)}\n assert_equal(false,@newTileRack.has_tiles_for?('IABJ'))\n end", "def contain_a(collections)\n collections.select{|element| element.include?(\"a\")}\nend", "def validate_input(list)\n\n list.each { |i|\n if /[a-zA-Z]+\\d+/ !~ i\n return false\n end\n }\n\n true\nend", "def test_it_replaces_asterisks_with_li_tags_in_ordered_lists\n ordered = OrderedListParser.new(\"1. Sushi\\n2. Barbeque\\n3. Mexican\")\n expected = \"\\t<li>Sushi</li>\\n\\t<li>Barbeque</li>\\n\\t<li>Mexican</li>\\n\"\n result = ordered.list_item_marker\n assert_equal expected, result\n end", "def safelists; end", "def split(pattern=$;, limit=0) end", "def split(pattern=$;, limit=0) end", "def saw_end_list(list); end", "def alt_list\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 16 )\n return_value = AltListReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal83 = nil\n altpair82 = nil\n altpair84 = nil\n\n tree_for_char_literal83 = nil\n stream_T__82 = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token T__82\" )\n stream_altpair = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule altpair\" )# - - - - @init action - - - -\n\n block_root = @adaptor.create(BLOCK, @input.look(-1), \"BLOCK\");\n\n\n begin\n # at line 198:9: altpair ( '|' altpair )*\n @state.following.push( TOKENS_FOLLOWING_altpair_IN_alt_list_1221 )\n altpair82 = altpair\n @state.following.pop\n if @state.backtracking == 0\n stream_altpair.add( altpair82.tree )\n end\n # at line 198:17: ( '|' altpair )*\n while true # decision 33\n alt_33 = 2\n look_33_0 = @input.peek( 1 )\n\n if ( look_33_0 == T__82 )\n alt_33 = 1\n\n end\n case alt_33\n when 1\n # at line 198:19: '|' altpair\n char_literal83 = match( T__82, TOKENS_FOLLOWING_T__82_IN_alt_list_1225 )\n if @state.backtracking == 0\n stream_T__82.add( char_literal83 )\n end\n @state.following.push( TOKENS_FOLLOWING_altpair_IN_alt_list_1227 )\n altpair84 = altpair\n @state.following.pop\n if @state.backtracking == 0\n stream_altpair.add( altpair84.tree )\n end\n\n else\n break # out of loop for decision 33\n end\n end # loop for decision 33\n # AST Rewrite\n # elements: altpair\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 198:34: -> ^( ( altpair )+ EOB[\\\"eob\\\"] )\n # at line 198:37: ^( ( altpair )+ EOB[\\\"eob\\\"] )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( ( block_root ), root_1 )\n\n # at line 198:53: ( altpair )+\n stream_altpair.has_next? or raise ANTLR3::RewriteEarlyExit\n\n while stream_altpair.has_next?\n @adaptor.add_child( root_1, stream_altpair.next_tree )\n\n end\n stream_altpair.reset\n @adaptor.add_child( root_1, @adaptor.create( EOB, \"eob\" ) )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 16 )\n\n end\n \n return return_value\n end", "def match(p0) end" ]
[ "0.6453942", "0.6453942", "0.6257085", "0.61439216", "0.5880077", "0.5837135", "0.5837135", "0.55989635", "0.55989635", "0.5563123", "0.5544219", "0.55290323", "0.55127263", "0.5496163", "0.5496163", "0.5470681", "0.5434442", "0.54006726", "0.54006726", "0.53724897", "0.5306622", "0.5283314", "0.5263095", "0.52301043", "0.52208155", "0.5217339", "0.5213552", "0.5213552", "0.52117234", "0.5204705", "0.5169962", "0.5164079", "0.5144614", "0.51108813", "0.5103184", "0.50885075", "0.49924913", "0.49896184", "0.49851754", "0.49851754", "0.49819842", "0.49649212", "0.4940609", "0.49141568", "0.49128878", "0.49023667", "0.4897819", "0.48842922", "0.48808128", "0.48764986", "0.48705718", "0.48504162", "0.48488462", "0.48435533", "0.4835854", "0.48352653", "0.48310483", "0.48156452", "0.48068053", "0.48065466", "0.4805915", "0.47995004", "0.47918174", "0.4787551", "0.4760214", "0.47594255", "0.4754169", "0.4754169", "0.47516757", "0.47465664", "0.47424534", "0.47415254", "0.47381258", "0.47381258", "0.47381258", "0.4735158", "0.4735158", "0.47307032", "0.4723723", "0.47220162", "0.47104153", "0.47076496", "0.4700635", "0.4700635", "0.4693211", "0.46864802", "0.46784556", "0.46780103", "0.46764997", "0.46748933", "0.46736556", "0.46697187", "0.46678966", "0.4665143", "0.4660613", "0.4660613", "0.46570656", "0.4653443", "0.46504763" ]
0.5220684
26
can the current element deal with a lookahead?
def expect_lookahead?(element) return element.class == Node[:capture] unless element.is_a? Node[:group] element.payload.all? { |e| expect_lookahead?(e) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lookahead(lookahead = nil) \n @lookahead = lookahead unless lookahead.nil?\n @lookahead\n end", "def lookahead(input: $input)\n $lookahead = input.getc\nend", "def lookahead(input: $input)\n $lookahead = input.getc\nend", "def lookahead(input: $srcin)\n $lookahead = input.getc\nend", "def lookahead?(element, in_lookahead = false)\n case element\n when Node[:char] then in_lookahead\n when Node[:group] then lookahead_payload?(element.payload, in_lookahead)\n when Node[:optional] then lookahead?(element.payload, true) or expect_lookahead?(element.payload)\n end\n end", "def lookahead?(element, in_lookahead = false)\n case element\n when Node[:char] then in_lookahead\n when Node[:group] then lookahead_payload?(element.payload, in_lookahead)\n when Node[:optional] then lookahead?(element.payload, true) or expect_lookahead?(element.payload)\n end\n end", "def lookahead(ll_index = 0)\n retun nil if @current + ll_index >= tokens.size\n tokens[@current + ll_index]\n end", "def match(x)\n if $lookahead == x\n lookahead\n skip_white\n else\n expected x\n end\nend", "def advance\n @lookahead = next_token()\n end", "def match(x)\n if $lookahead == x\n lookahead\n else\n expected x\n end\nend", "def match(x)\n if $lookahead == x\n lookahead\n else\n expected x\n end\nend", "def consume()\n la(1)\n return @lookahead.shift\n end", "def look_ahead(kclass, index, char, buffer, classified_sentence, nivel_parentese)\n if @raw[index + 1] && kclass::REGEX.match( \"#{buffer}#{char}#{@raw[index + 1]}\" )\n buffer.concat char\n else\n classified_sentence.push kclass.new(buffer+char)\n buffer.clear\n end\n end", "def create_lookahead(elements, *args)\n return elements unless elements.size > 1\n [Node[:with_look_ahead].new(elements, *args)]\n end", "def create_lookahead(elements, *args)\n return elements unless elements.size > 1\n [Node[:with_look_ahead].new(elements, *args, start: elements.first.start, stop: elements.last.stop)]\n end", "def lookahead_payload?(payload, in_lookahead)\n return unless payload[0..-2].all? { |e| lookahead?(e, in_lookahead) }\n expect_lookahead?(payload.last) or lookahead?(payload.last, in_lookahead)\n end", "def lookahead_payload?(payload, in_lookahead)\n return unless payload[0..-2].all? { |e| lookahead?(e, in_lookahead) }\n expect_lookahead?(payload.last) or lookahead?(payload.last, in_lookahead)\n end", "def lookahead_buffer\n @lookahead_buffer ||= []\n end", "def lookahead_buffer\n @lookahead_buffer ||= []\n end", "def address_lookahead\n\tlookahead = []\n\twhile @sym == SYM_ATOM ||\n @sym == SYM_ATOM_NON_ASCII ||\n @sym == SYM_QTEXT ||\n @sym == SYM_PERIOD\n\t lookahead.push([@sym, @lexeme])\n\t get\n\tend\n\tretval = @sym\n\tputback(@sym, @lexeme)\n\tputback_array(lookahead)\n\tget\n\tretval\n end", "def track(element)\n return list_for(element) << element if lookahead_buffer.empty?\n return lookahead_buffer << element if lookahead? element\n\n lookahead = lookahead_buffer.dup\n lookahead = create_lookahead(lookahead, false) if element.is_a? Node[:separator]\n lookahead_buffer.clear\n\n payload.concat(lookahead) << element\n end", "def track(element)\n return list_for(element) << element if lookahead_buffer.empty?\n return lookahead_buffer << element if lookahead? element\n\n lookahead = lookahead_buffer.dup\n lookahead = create_lookahead(lookahead, false) if element.is_a? Node[:separator]\n lookahead_buffer.clear\n\n payload.concat(lookahead) << element\n end", "def pre_match() end", "def test_the_left_most_match_wins\n ## assert_equal __, \"abbccc az\"[/az*/]\n assert_equal \"a\", \"abbccc az\"[/az*/]\n\n # The regex matches starting from left to right\n end", "def regexp_with_working_captures?(node); end", "def list_for(element)\n expect_lookahead?(element) ? lookahead_buffer : payload\n end", "def list_for(element)\n expect_lookahead?(element) ? lookahead_buffer : payload\n end", "def pre_match\n m = @match\n @string[0...(@pos - m.to_s.size)] if (not m.equal?(nil))\n end", "def must_see(char)\n spaces\n if next_is char\n # All good, input as expected.\n char\n elsif input.eos?\n # Finally, the case we've been waiting for:\n # Input exhausted, but still elements to close.\n append char\n else\n append char\n # The magic trick:\n # We implicitly use the stack to count how many closing tags we have/need.\n # We pair with exception's `ensure` mechanism to actually write them out.\n if debug\n msg = \"Seen so far: %s\" % result.clone\n raise UnexpectedTokenError, msg\n else\n raise UnexpectedTokenError\n end\n end\n end", "def element_match(tree, exp, bindings); end", "def matching_text_element_lines(regex, exclude_nested = T.unsafe(nil)); end", "def reduce_if_followed(_production, _range, _tokens, theChildren)\n polarity = theChildren[1] ? :negative : :positive\n Regex::Lookaround.new(theChildren.last, :ahead, polarity)\n end", "def next_match char\n data = get_content\n row = focussed_index + 1\n row.upto(data.length-1) do |ix|\n val = data[ix].chomp rescue return # 2010-01-05 15:28 crashed on trueclass\n #if val[0,1] == char #and val != currval\n if val[0,1].casecmp(char) == 0 #AND VAL != CURRval\n return ix\n end\n end\n row = focussed_index - 1\n 0.upto(row) do |ix|\n val = data[ix].chomp\n #if val[0,1] == char #and val != currval\n if val[0,1].casecmp(char) == 0 #and val != currval\n return ix\n end\n end\n return -1\n end", "def match(x)\n $look == x or expected(\"#{x}\")\n getChar\n skipWhite\nend", "def peek_char(lookahead = 1)\n @string[@current_char_pos + lookahead, 1]\n end", "def ABCheck(str)\n str.scan(/a...b/) == [] ? false : true # how this method tests 'b' before 'a'? \nend", "def find_more\n return unless @last_regex\n ix = next_match @last_regex\n return unless ix\n #@oldindex = @current_index\n @current_index = ix[0]\n @curpos = ix[1]\n ensure_visible\n end", "def find_more\n return unless @last_regex\n ix = next_match @last_regex\n return unless ix\n @oldindex = @current_index\n @current_index = ix[0]\n @curpos = ix[1]\n ensure_visible\n end", "def each_element_tree regex, namelast, subtree\n begin\n @reader.read # move pointer forward\n e = get_element(nil,namelast)\n # p e\n break if e == nil\n if e.name =~ /#{regex}/\n get_element(subtree) if subtree\n yield e.name, @reader.expand\n end\n end while e != nil\n end", "def start_re=(_); end", "def scan_for_at(token); end", "def match(p0) end", "def match(p0) end", "def test_srch_back_for_nonexist_pattern\n @buffer = Buffer.new 'Now is the time for all good men to come to the aid of their country'\n @buffer.fin\n @buffer.srch_back 'xxyyzz'\n assert_eq '', @buffer.at\n end", "def unshift(token); end", "def take_before(node, source_part); end", "def test_failure_of_normal_block_insertion_2\n input = '<a href=\"xxx\">xxx</a>'\n\n Hpricot(input).text_gsub!(/(xxx)/) { assert_nil(Regexp.last_match) }\n end", "def scan_until(pattern); end", "def lookahead_rule(aName, aBeforeAction = nil, &aBlock)\n\t\tnew_rule = LookaheadRule.new(aName, aBeforeAction)\n\t\tprocess_rule(new_rule, &aBlock)\n\tend", "def eat_this(line)\n @rest = line + @rest\n things_read = 0\n until @rest.empty?\n case self.state\n when :inside_comment\n if @m = CommentEnd.match(@rest)\n my_debug \"#{@state}: Comment End: #{@m.to_s.inspect}\"\n @already << @m.pre_match << @m.to_s\n @rest = @m.post_match\n self.state = :inside_element\n else\n @already << @rest\n @rest = \"\"\n self.state = :inside_comment\n end\n when :inside_element\n if @m = CommentStart.match(@rest)\n my_debug \"#{@state}: Comment: #{@m.to_s.inspect}\"\n things_read += 1\n @already << @m.pre_match << @m.to_s\n @rest = @m.post_match\n self.state = :inside_comment\n elsif @m = Tag.match(@rest)\n my_debug \"#{@state}: Tag: #{@m.to_s.inspect}\"\n things_read += 1\n self.state = :inside_element\n handle_tag\n elsif @m = CData.match(@rest)\n my_debug \"#{@state}: CDATA: #{@m.to_s.inspect}\"\n @already << @m.pre_match << @m.to_s\n @rest = @m.post_match\n self.state = :inside_cdata\n elsif @m = PartialTag.match(@rest)\n my_debug \"#{@state}: PartialTag: #{@m.to_s.inspect}\"\n @already << @m.pre_match\n @rest = @m.post_match\n @partial_tag = @m.to_s\n self.state = :inside_tag\n elsif @m = EverythingElse.match(@rest)\n my_debug \"#{@state}: Everything: #{@m.to_s.inspect}\"\n @already << @m.pre_match << @m.to_s\n @rest = @m.post_match\n self.state = :inside_element\n else\n error \"Malformed HTML: not complete: #{@rest.inspect}\"\n end\n when :inside_tag\n if @m = /^[^>]*>/.match(@rest)\n my_debug \"#{@state}: matched #{@m.to_s.inspect}\"\n @partial_tag << @m.to_s\n my_debug \"#{@state}: matched TOTAL: #{@partial_tag.to_s.inspect}\"\n @rest = @partial_tag + @m.post_match\n @partial_tag = nil\n self.state = :inside_element\n else\n @partial_tag << @rest\n @rest = \"\"\n self.state = :inside_tag\n end\n when :inside_cdata\n if @m = CDataEnd.match(@rest)\n my_debug \"#{@state}: matched #{@m.to_s.inspect}\"\n @already << @m.pre_match << @m.to_s\n @rest = @m.post_match\n self.state = %(script style).include?(@tag_stack.last) ? :inside_script_style : :inside_element\n else\n @already << @rest\n @rest = \"\"\n self.state = :inside_cdata\n end\n when :inside_script_style\n if @m = CData.match(@rest)\n if @already.rstrip.end_with?('<![CDATA[')\n @already << @m.pre_match\n @rest = @m.post_match\n else\n my_debug \"#{@state}: CDATA: #{@m.to_s.inspect}\"\n @already << @m.pre_match << @m.to_s\n @rest = @m.post_match\n self.state = :inside_cdata\n end\n elsif @m = Tag.match(@rest)\n is_closing = !!@m[1]\n tag = @m[2]\n if is_closing && tag == @tag_stack.last\n my_debug \"#{@state}: matched #{@m.to_s.inspect}\"\n @already << @m.pre_match\n @rest = @m.post_match\n # This is necessary to properly parse\n # script tags\n @already << \"]]>\" unless @already.rstrip.end_with?(\"]]>\")\n self.state = :inside_element\n handle_tag false # don't double-add pre_match\n else\n @already << @rest\n @rest = \"\"\n end\n elsif @m = EverythingElse.match(@rest)\n my_debug \"#{@state}: Everything: #{@m.to_s.inspect}\"\n @already << @m.pre_match << @m.to_s\n @rest = @m.post_match\n else\n @already << @rest\n @rest = \"\"\n end\n else\n raise \"Bug bug: state = #{self.state.inspect}\"\n end # not inside comment\n\n break if is_finished? && things_read > 0\n end\n end", "def preceding(node); end", "def match_and_value?(expected)\n match?(expected) ? @lookahead.value : nil\n end", "def next_element; end", "def splitTextToken(original)\n\n if original.children\n first_node = original.children[0]\n if first_node\n text = first_node.content\n matches = text.match(PATTERN)\n\n return original if matches == nil\n\n value = matches[1]\n label = matches[2]\n checked = false\n checked = true if (value == \"X\" || value == \"x\")\n\n return createTokens(checked, label, original)\n end\n end\n return original\n end", "def look_ahead_for_support_either_side\n look_ahead_for_support do |left, right|\n left + right\n end\n end", "def match(event)\n if @last.nil?\n @content << %Q|<span class=\"match\">|\n elsif @last != :match\n @content << %Q|#{closing}</span><span class=\"match\">|\n end\n @content << event.old_element.to_s\n @last = :match\n @closing = \"\"\n end", "def match?(expected)\n @lookahead = next_token() if @lookahead.nil?\n expected.include?(@lookahead.type)\n end", "def on_regexp_beg(token)\n log \"REGEXP_BEG: '#{token}'\"\n super(token)\n end", "def start_re; end", "def submatcher; end", "def submatcher; end", "def forward_regex regex\n if regex.is_a? Symbol\n regex = @text_patterns[regex]\n raise \"Pattern specified #{regex} does not exist in text_patterns \" unless regex\n end\n $multiplier = 1 if !$multiplier || $multiplier == 0\n line = @current_index\n _arr = _getarray\n buff = _arr[line].to_s\n return unless buff\n pos = @curpos || 0 # list does not have curpos\n $multiplier.times {\n found = buff.index(regex, pos)\n if !found\n # if not found, we've lost a counter\n if line+1 < _arr.length\n line += 1\n else\n return\n end\n pos = 0\n else\n pos = found + 1\n end\n $log.debug \" forward_word: pos #{pos} line #{line} buff: #{buff}\"\n }\n $multiplier = 0\n @current_index = line\n @curpos = pos\n ensure_visible\n @repaint_required = true\n end", "def offset_after_match\n offset + match_length\n end", "def test_the_left_most_match_wins\n assert_equal 'a', \"abbccc az\"[/az*/]\n end", "def test_lost_gap_unknown\r\n # Some unknown number of lost characters\r\n assert_equal_fragment_transform '[.?]', '<gap reason=\"lost\" extent=\"unknown\" unit=\"character\"/>'\r\n end", "def peel_off_outer_tag(record)\n rg = /(<\\w+\\s+.*?>)(.*)(<\\/\\w+>)/\n m_a = rg.match(record.parent.frgtxt).to_a\n # I want the meat in the middle of the sandwich.\n return m_a[2]\n end", "def contain_a(elements)\n elements.select do |i|\n has_a = []\n if i.chars.include?\"a\" \n has_a.unshift(i)\n end\n end\nend", "def scan_for_and(token); end", "def test_the_left_most_match_wins\n assert_equal \"a\", \"abbccc az\"[/az*/]\n end", "def test_the_left_most_match_wins\n assert_equal \"a\", \"abbccc az\"[/az*/]\n end", "def scan_for_plus(token); end", "def nextto(regex)\n buf = \"\"\n while (true)\n\tc = self.nextchar()\n\tif !(regex =~ c).nil? || c == '\\0' || c == '\\n' || c == '\\r'\n\t self.back() if (c != '\\0')\n\t return(buf.chomp())\n\tend\n\tbuf += c\n end\n end", "def nested_anon_pattern \n /#<(#<.*>):(.*)>/\n end", "def prepare_token(token)\n case token\n when Fast::FindWithCapture\n token.previous_captures = find_captures\n end\n end", "def test_parse_set_collating_sequence\n root = RP.parse('[a[.span-ll.]h]', :any)\n exp = root[0]\n\n assert_equal '[.span-ll.]', exp[1].to_s\n end", "def fwd_lit(hint)\n while lit = next_input_element(hint) and (lit.ws? or lit.lt?)\n end\n lit\n end", "def step\n start_group :normal, matched if scan( /\\s+/ )\n if @in_tag\n case\n when scan( /([-\\w]+):([-\\w]+)/ )\n start_group :namespace, subgroup(1)\n start_group :punct, \":\"\n start_group :attribute, subgroup(2)\n when scan( /\\d+/ )\n start_group :number, matched\n when scan( /[-\\w]+/ )\n start_group :attribute, matched\n when scan( %r{[/?]?>} )\n @in_tag = false\n start_group :punct, matched\n when scan( /=/ )\n start_group :punct, matched\n when scan( /[\"']/ )\n scan_string matched\n else\n append getch\n end\n elsif ( text = scan_until( /(?=[<&])/ ) )\n start_group :normal, text unless text.empty?\n if scan(/<!--.*?(-->|\\Z)/m)\n start_group :comment, matched\n else\n case peek(1)\n when \"<\"\n start_group :punct, getch\n case peek(1)\n when \"?\"\n append getch\n when \"/\"\n append getch\n when \"!\"\n append getch\n end\n start_group :normal, matched if scan( /\\s+/ )\n if scan( /([-\\w]+):([-\\w]+)/ )\n start_group :namespace, subgroup(1)\n start_group :punct, \":\"\n start_group :tag, subgroup(2)\n elsif scan( /[-\\w]+/ )\n start_group :tag, matched\n end\n @in_tag = true\n when \"&\"\n if scan( /&\\S{1,10};/ )\n start_group :entity, matched\n else\n start_group :normal, scan( /&/ )\n end\n end\n end\n else\n append scan_until( /\\Z/ )\n end\n end", "def la( count = 1 )\n until @lookahead.length >= count\n if token = @lexer.next_token( @lexer_state.number ) then\n @lookahead << token\n else\n nyi \"error handling for lexer error\" if @lexer.input_remaining?\n break\n end\n end\n \n return @lookahead[count - 1]\n end", "def lead_captured\n end", "def pre_match\n nil\n end", "def reduce_if_had(_production, _range, _tokens, theChildren)\n polarity = theChildren[1] ? :negative : :positive\n Regex::Lookaround.new(theChildren.last, :behind, polarity)\n end", "def underlying_matcher; end", "def underlying_matcher; end", "def on_match_pattern_p(node); end", "def match_any(ignore)\n # ignore stream, copy of input\n self.attr_state.attr_error_recovery = false\n self.attr_state.attr_failed = false\n look = @input._lt(1)\n if ((@input.get_tree_adaptor.get_child_count(look)).equal?(0))\n @input.consume # not subtree, consume 1 node and return\n return\n end\n # current node is a subtree, skip to corresponding UP.\n # must count nesting level to get right UP\n level = 0\n token_type = @input.get_tree_adaptor.get_type(look)\n while (!(token_type).equal?(Token::EOF) && !((token_type).equal?(UP) && (level).equal?(0)))\n @input.consume\n look = @input._lt(1)\n token_type = @input.get_tree_adaptor.get_type(look)\n if ((token_type).equal?(DOWN))\n level += 1\n else\n if ((token_type).equal?(UP))\n level -= 1\n end\n end\n end\n @input.consume # consume UP\n end", "def backtrack_expecting!(location, offset, expectation)\n if text_at(location, offset, expectation.length) == expectation\n location[1] += offset\n true\n end\n end", "def peek_lit(hint)\n pos0 = @pos\n while lit = next_input_element(hint) and (lit.ws? or lit.lt?)\n end\n @pos = pos0\n lit\n end", "def match_and_both?(expected)\n match?(expected) ? [@lookahead.type, @lookahead.value] : nil\n end", "def forward characters\n @char += characters\n char || false\n end", "def scan_for_w(token); end", "def skip_until(pattern)\n x = @pos || 0\n y = _scan(pattern, true, false)\n y.nil? ? nil : y - x\n end", "def next_match char\n start = @current_index\n start.upto(@list.length-1) do |ix|\n if @list[ix][0,1].casecmp(char) == 0\n return @list[ix] unless @list[ix] == @buffer\n end\n @current_index += 1\n end\n ## could not find, start from zero\n @current_index = 0\n start = [@list.length()-1, start].min\n 0.upto(start) do |ix|\n if @list[ix][0,1].casecmp(char) == 0\n return @list[ix] unless @list[ix] == @buffer\n end\n @current_index += 1\n end\n @current_index = [@list.length()-1, @current_index].min\n return nil\n end", "def next_match char\n start = @current_index\n start.upto(@list.length-1) do |ix|\n if @list[ix][0,1].casecmp(char) == 0\n return @list[ix] unless @list[ix] == @buffer\n end\n @current_index += 1\n end\n ## could not find, start from zero\n @current_index = 0\n start = [@list.length()-1, start].min\n 0.upto(start) do |ix|\n if @list[ix][0,1].casecmp(char) == 0\n return @list[ix] unless @list[ix] == @buffer\n end\n @current_index += 1\n end\n @current_index = [@list.length()-1, @current_index].min\n return nil\n end", "def next_hack(n)\n return n.next if hack? n.next\n next_hack n.next\nend", "def get_name\n la = $lookahead\n\n return expected(\"Name\") unless is_alpha(la)\n\n lookahead\n\n \"_#{la}\"\nend", "def get_name\n la = $lookahead\n\n return expected(\"Name\") unless is_alpha(la)\n\n lookahead\n\n \"_#{la}\"\nend", "def trailing_positionals; end", "def style_two_regex_not_prev(n, text, re, re_prev, warning)\n return if text.nil?\n arr = text.split(/\\W+/)\n arr.each_index do |i|\n m = re.match arr[i]\n m_prev = i.zero? ? nil : re_prev.match(arr[i - 1])\n if !m.nil? && m_prev.nil?\n style_warning(n, warning, m[:num])\n end\n end\n end", "def next_part\n nl \"#{algn\"|::#{id_name}: search_space\"}#{search_space.inspect}\", 3\n nl \"#{algn\"|::#{id_name}: limit\"}#{\" \"*(start_token_search_space.inspect.size-2)}^\", 3\n nl \"#{algn\"|::#{id_name}: find own end pattern\"}#{@rule.end_pattern(start_captures).inspect}\", 3\n \n # If this happens to be a for_pattern rule (which by definition, can't have children)\n if @rule.consume_immediately?\n nl \"|::#{id_name}: CONSUME SELF IMMEDIATELY\", 3 \n # Set the end part to \"\" and stop looking for parts\n @end_part = nil\n @end_part_offset = 0\n return nil\n end\n\n # By default, always look for our own end pattern\n end_patterns = {:own_end_pattern => proc{ @rule.end_pattern(start_captures) }}\n \n # If we have no end rule, look for the parent's rule instead\n if @rule.end_rule.nil? && parent\n nl \"#{algn\"|::#{id_name}: or parent end pattern\"}#{first_parent_end_pattern.inspect}\", 3\n end_patterns[:parent_end_pattern] = proc {\n first_parent_end_pattern\n }\n end\n first_match = Match.first(search_space, @rule.child_rules, start_token_limit, \n #Look for any of our possible child rules' start patterns\n proc{|obj|\n obj.start_pattern\n },\n #... if matched by their end patterns\n proc{|obj, captures|\n obj.end_pattern(captures)\n #Or one of the end patterns we are looking for - whichever comes sooner \n }, end_patterns)\n\n #If we have an unconditional_rule, and we found no start rules\n if @rule.unconditional_rule && (!first_match || !first_match.matched_obj)\n nl \"|:::#{id_name}: UNCONDITIONAL RULE #{@rule.unconditional_rule.scope_name.inspect} \", 3 \n unless @used_up_unconditional\n # Fake a match for the unconditional rule (matching the whole search_space end to end)\n new_scope = nil\n indent \"| \" do\n new_scope = Scope.new(@rule.unconditional_rule, search_space, self)\n end\n @parts << new_scope\n @used_up_unconditional = true\n return new_scope\n else\n nl \"::: but it was used up\",3\n end\n end\n \n # Nothing else is left - we probably ran out of source\n if first_match.nil?# && parent.nil?\n @parts << search_space\n nl \"|:::#{id_name}: FOUND NOTHING AT ALL .. #{search_space.size} chars added to parts\", 1\n return nil\n end\n \n # if we matched one of our children's start rules, create a new scope for them\n if first_match.matched_obj\n nl \"|:::#{id_name}: FOUND NEW SCOPE START #{first_match.matched_obj.scope_name.inspect}\", 3\n @parts << first_match.find_match.pre_match\n advance_by(first_match.find_match.end(0))\n new_scope = nil\n indent \"| \" do\n new_scope_start_part = first_match.find_match[0]\n new_scope_start_captures = first_match.find_match.captures\n new_scope = Scope.new(first_match.matched_obj, first_match.full_post_find_match, self, new_scope_start_part, new_scope_start_captures)\n end\n @parts << new_scope\n return new_scope\n end\n \n # If you found an end_pattern, take note of where you found it and return yourself\n if which_end = first_match.matched_additional\n src_to_end_part = first_match.find_match.pre_match\n @parts << src_to_end_part unless src_to_end_part.empty?\n @end_part_offset = @offset\n if which_end == :own_end_pattern\n @end_part_offset += first_match.find_match.end(0)\n @end_part = first_match.find_match[0]\n elsif which_end == :parent_end_pattern\n # When matching an unconditional end (via it's parent) we want to return BEFORE the actual end token (so the parent may properly consume it)\n @end_part_offset += first_match.find_match.begin(0)\n @end_part = \"\"\n end\n @end_part = nil if @end_part.empty?\n @parts << @end_part unless @end_part.nil?\n nl \"|:::#{id_name}: FOUND END TOKEN #{first_match.matched_additional.inspect} at offset #{@end_part_offset}\", 3\n return nil\n end\n end" ]
[ "0.67900527", "0.64776665", "0.64776665", "0.63481325", "0.6316817", "0.6316817", "0.6305322", "0.6260874", "0.6243686", "0.61513036", "0.61513036", "0.6115929", "0.6062335", "0.6032461", "0.5979385", "0.55537844", "0.55537844", "0.5526214", "0.5526214", "0.54737514", "0.54627705", "0.54627705", "0.544055", "0.5414934", "0.5395858", "0.535976", "0.535976", "0.53279626", "0.53275836", "0.5282383", "0.5251121", "0.52435476", "0.5203074", "0.51807034", "0.51681304", "0.5156416", "0.5147438", "0.51189107", "0.5110942", "0.51086", "0.51071686", "0.50986254", "0.50986254", "0.50853217", "0.5070228", "0.50694025", "0.50654775", "0.5024558", "0.5004041", "0.4992568", "0.49887365", "0.4987139", "0.49848765", "0.49789652", "0.49725336", "0.496473", "0.4953059", "0.4949341", "0.4947487", "0.49463266", "0.49463266", "0.49454898", "0.49389467", "0.49359012", "0.4929489", "0.4927553", "0.4927501", "0.49234945", "0.49087417", "0.49087417", "0.4900529", "0.48996177", "0.4897027", "0.48758107", "0.48566243", "0.4854641", "0.48429483", "0.4842039", "0.4841588", "0.48270452", "0.4805616", "0.47899902", "0.47899902", "0.47788766", "0.47703946", "0.4760453", "0.4757945", "0.47552717", "0.4754041", "0.4742118", "0.47401285", "0.47399032", "0.47399032", "0.4734628", "0.47273722", "0.47273722", "0.47245306", "0.47109586", "0.47073144" ]
0.6359956
4
helper method for deciding where to put an element for now
def list_for(element) expect_lookahead?(element) ? lookahead_buffer : payload end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def store_element_position_top locator, variable_name\r\n command 'storeElementPositionTop', locator, variable_name\r\n end", "def positioned where\n self[where] ||= RenderNodeList.new\n end", "def place_in_layout?; end", "def place_in_layout?; end", "def move_to element_name, right_by = nil, down_by = nil\n begin\n $driver.action.move_to(el(element_name), right_by, down_by).perform\n rescue Exception => e\n $LOG.error \"error in moving element \\n element name : #{element_name}, right: #{right_by} and down: #{down_by} \"+e.message\n $driver.save_screenshot(\"log/webscreenshot/webScreenshot_#{$webscreenshot}.png\")\n $webscreenshot = $webscreenshot+1\n raise \"error in moving element \\n element name : #{element_name}, right: #{right_by} and down: #{down_by} \"+e.message\n end\n end", "def element?; end", "def element?; end", "def xml_at_element_top( xml, name )\r\n xml.interface {\r\n xml.name name\r\n xml.unit { \r\n xml.name '0'\r\n return xml\r\n }\r\n } \r\n end", "def store_element_present locator, variable_name\r\n command 'storeElementPresent', locator, variable_name\r\n end", "def addMissingAddedToSlab(type, theElement)\n # locationStr contains \"HouseFile/House/Components/X/\", where X is \"Basement\",\n # \"Walkout\", \"Crawlspace\" or \"Slab\"\n # The Floor element is always three elements from the basement Configuration element,\n # two elements from the Crawlspace config and one from the slab config.\n if type == \"B\"\n theFloorElement = theElement.next_element.next_element.next_element\n elsif type == \"C\"\n theFloorElement = theElement.next_element.next_element\n elsif type == \"S\"\n theFloorElement = theElement.next_element\n end\n theFloorConstElement = theFloorElement[1] # First child element is always \"Construction\"\n theSlabElement = theFloorConstElement.add_element(\"AddedToSlab\", {\"rValue\"=>\"0\", \"nominalInsulation\"=>\"0\"})\n theSlabElement.add_text(\"User specified\")\nend", "def element; end", "def element; end", "def element; end", "def element; end", "def element_location(element_name)\n $LOG.info \"getting element location #{element_name}\"\n begin\n wait_and_find_element(element_name)\n el_loc = el element_name\n el_loc.location\n rescue Exception => e\n $LOG.error \"Error getting element location of element name : #{element_name} \"+e.message\n $driver.save_screenshot(\"log/webscreenshot/webScreenshot_#{$webscreenshot}.png\")\n $webscreenshot = $webscreenshot+1\n raise \"Error getting element location of element name : #{element_name} \"+e.message\n end\n end", "def addPositioned(w, left, top)\n # In order to avoid the potential for a flicker effect, it is necessary\n # to set the position of the widget before adding it to the AbsolutePanel.\n # The Widget should be removed from its parent before any positional\n # changes are made to prevent flickering.\n w.removeFromParent\n DOM.setAbsolutePixelPosition(w.getElement, left, top)\n add(w)\n end", "def insert_at(position = acts_as_list_top)\n insert_at_position(position)\n end", "def place_object\n @board.place_object *next_position\n end", "def insert_after(preceding, located_entry)\n res = aug.insert(preceding.path, located_entry.key, false)\n # if insert failed it means, that previous preceding entry was single\n # element and now it is multiple ones, so try to first element as add\n # is done in reverse order\n if res == -1\n # TODO: what about deep nesting of trees where upper level change\n # from single to collection?\n aug.insert(preceding.path + \"[1]\", located_entry.key, false)\n end\n path_after(preceding)\n end", "def click_and_drag_to_position(capybara_element, xLoc, yLoc)\n wait_for_loading\n execute_script(\"jQuery('body').append('<div id=\\\"tempPositionMarker\\\" style=\\\"position:absolute; left:#{xLoc}px; top:#{yLoc}px; width: 0px; height: 0px;\\\"></div>');\")\n capybara_element.drag_to(find(:css, \"#tempPositionMarker\"))\n execute_script(\"jQuery('#tempPositionMarker').remove();\")\n wait_for_loading\n end", "def place(x, y, buddy)\n # Skip invalid states, when the buddy may fall down from the table\n if validate_pos(x, y)\n buddy.x = x\n buddy.y = y\n end\n end", "def setWidgetPosition(w, left, top)\n checkWidgetParent(w)\n DOM.setAbsolutePixelPosition(w.getElement, left, top)\n end", "def global_position_of_elmt elmt\n elmt_offset_at find_elmt_index(elmt)\n end", "def store_element_position_left locator, variable_name\r\n command 'storeElementPositionLeft', locator, variable_name\r\n end", "def move_to_element(element)\n driver.execute_script('arguments[0].scrollIntoView(true)', element)\n end", "def element_add\r\n @env.issue.element_add @meta.element_add ElementAdd.new(@env).insert @is.element_add\r\n end", "def element=(element); end", "def used_by?(element)\n end", "def used_by?(element)\n end", "def locate_by\n options_by_type(:locate_by) || :element\n end", "def addMissingExteriorAddedInsulation(theElement)\n # locationStr contains \"HouseFile/House/Components/X/\", where X is \"Basement\",\n # \"Walkout\", \"Crawlspace\" or \"Slab\"\n # The Wall element is always four elements from the basement Configuration element\n theWallElement = theElement.next_element.next_element.next_element.next_element\n theWallConstElement = theWallElement[1] # First child element is always \"Construction\"\n theExtWallElement = theWallConstElement.add_element(\"ExteriorAddedInsulation\", {\"nominalInsulation\"=>\"0\"})\n theExtWallElement.add_element(\"Description\")\n theExtWallCompElement = theExtWallElement.add_element(\"Composite\")\n theExtWallCompElement.add_element(\"Section\", {\"rank\"=>\"1\", \"percentage\"=>\"100\", \"rsi\"=>\"0\", \"nominalRsi\"=>\"0\"} )\nend", "def locate_element(how, what)\n return super unless @nokogiri\n\n el = @query_scope.browser.doc.send(\"at_#{how}\", what)\n Watigiri::Element.new element: el, selector: {how => what}\n end", "def insert_at(position = 1)\n move_to_child_with_index(parent, position - 1)\n end", "def autogenerate_elements\n to_auto_generate_elements = self.layout_description[\"autogenerate\"]\n unless (to_auto_generate_elements.blank?)\n to_auto_generate_elements.each do |element|\n element = Element.create_from_scratch({'page_id' => self.id, 'name' => element})\n element.move_to_bottom\n end\n end\n end", "def insert(elt)\n unless elt.key.nil?\n @contents << elt\n bubble_up(@contents.size - 1)\n end\n end", "def location(locator)\n find_element(locator).location\n end", "def push_element\n return if @element_name.nil?\n\n # Add the class attribute if the element is a <p> element.\n @attrs[:class] = 'ppp' if :p == @element_name\n\n # Check @void_elements to determine how the element start would be\n # written. HTML includes void elements that are self closing so those\n # should be handled correctly.\n if VOID_ELEMENTS.include?(@element_name)\n @builder.void_element(@element_name, @attrs)\n else\n @builder.element(@element_name, @attrs)\n end\n # Reset the element name.\n @element_name = nil\n @attrs = {}\n end", "def push(element)\r\n # IMPLEMENTME!\r\n end", "def insert_at_bottom\n assume_bottom_position\n end", "def place_piece(piece, pos)\n raise 'position not empty' unless empty?(pos)\n \n self[pos] = piece\n end", "def place_piece(piece, pos)\n self[pos] = piece\n end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def is_here?(element)\n element.exists?\n rescue\n false\n end", "def insert(element)\n if @ary.include? element\n return false\n else\n @ary << element\n return element\n end\n end", "def add_at(obj, tx, ty)\n if @classes.include?(obj.class)\n @grid[tx][ty] = obj\n end\n rescue NoMethodError\n warn(\"WARNING: Tried to insert element at invalid index (#{obj}, #{tx}|#{ty})\")\n add(obj)\n end", "def place_marker(spot, mark)\n board[spot - 1] = mark\n end", "def place!(val, &block)\n pos = nil\n orig_size = self.size\n block ||= lambda{|a, b| a <=> b}\n self.each_with_index do |e, i|\n if block.call(e, val) == 1\n pos = i\n break\n end\n end\n return nil unless pos\n self.insert(pos, val)\n while self.size > orig_size\n self.pop\n end\n val\n end", "def insert(element)\n [email protected]\n\n @store[@store.length]=element\n return if insertindex==1\n\n #For even inserts parent index is insertedindex/2-1 otherwise its juts insertedindex/2\n\n parentindex=insertindex/2\n\n #Incase it does not fit in(violating Heap Property)\n while insertindex!=1 && @store[parentindex] > @store[insertindex]\n swap(parentindex,insertindex)\n insertindex=parentindex\n parentindex=insertindex/2\n end\n\n end", "def active_element; end", "def insert_entry(located_entry)\n # entries with add not exist yet\n preceding = located_entry.preceding_existing\n prefix = located_entry.prefix\n if preceding\n insert_after(preceding, located_entry)\n # entries with remove is already removed, otherwise find previously\n elsif located_entry.any_following?\n aug.insert(prefix + \"/*[1]\", located_entry.key, true)\n aug.match(prefix + \"/*[1]\").first\n else\n \"#{prefix}/#{located_entry.key}\"\n end\n end", "def locate\r\n @o = nil\r\n if @how == :jssh_name\r\n @element_name = @what\r\n elsif @how == :xpath\r\n @element_name = element_by_xpath(@container, @what)\r\n else\r\n @element_name = locate_tagged_element(\"TR\", @how, @what) \r\n end\r\n @o = self\r\n end", "def addMissingInteriorAddedInsulation(theElement)\n # locationStr contains \"HouseFile/House/Components/X/\", where X is \"Basement\",\n # \"Walkout\", \"Crawlspace\" or \"Slab\"\n # The Wall element is always four elements from the basement Configuration element\n theWallElement = theElement.next_element.next_element.next_element.next_element\n theWallConstElement = theWallElement[1] # First child element is always \"Construction\"\n theIntWallElement = theWallConstElement.add_element(\"InteriorAddedInsulation\", {\"nominalInsulation\"=>\"0\"})\n theIntWallElement.add_element(\"Description\")\n theIntWallCompElement = theIntWallElement.add_element(\"Composite\")\n theIntWallCompElement.add_element(\"Section\", {\"rank\"=>\"1\", \"percentage\"=>\"100\", \"rsi\"=>\"0\", \"nominalRsi\"=>\"0\"} )\nend", "def elem?; end", "def elem?; end", "def get_ordered_element(index)\n result = @ordered_elements[index]\n raise RuntimeError if result.nil?\n result\n end", "def getElement_placeholder(text)\n xpath = Keys_CONFIG[\"placeHolder_start\"]+text+Keys_CONFIG[\"placeHolder_end\"]\n #puts xpath\n @driver.find_element(:xpath,xpath)\nend", "def place(x, y, heading_symbol)\n heading = Heading.create(heading_symbol)\n valid_location = @board.safe_location(x, y)\n if valid_location && heading\n @state.unshift(Robot.new(x,y,heading))\n else\n puts \"Invalid heading: #{heading}\" if heading.nil?\n puts \"Invalid location: (#{x}, #{y}). Must be between (0, 0) and (#{@width}, #{@height})\" unless valid_location\n end\n self\n end", "def insert_front(value)\n \n end", "def display_position\n # Fill this in\n end", "def display_position\n # Fill this in\n end", "def insert_locator(loc)\n priority = loc.priority\n subpriority = loc.subpriority || default_subpriority\n i = self.size\n loc.send(:internal_inserted, self, i)\n set_entry(i, loc, priority, subpriority)\n @totalcount += 1\n loc\n end", "def find_element(obj, prev_obj=nil)\n # puts \"finding: #{obj.locator} parent: #{prev_obj.locator unless prev_obj.nil?}\"\n begin\n if obj.find_by == :xpath && obj.locator.include?('html')\n @element = page.find(:xpath, obj.locator, :visible => true)\n elsif obj.parent_element != nil && obj.parent_element.locator != nil\n @element = find_element(obj.parent_element, obj)\n else\n #TODO: this does not account for selectors after the id. I.E. #this that.overthere\n # need to do a split and do multiple finds based on the results of the split\n if obj.find_by == :css && obj.locator.include?('#')\n @element = page.find(:id, obj.locator.gsub('#', ''), :visible => true)\n else\n @element = page.find(obj.find_by, obj.locator, :visible => true)\n end\n end\n #TODO: There may be a flaw in this logic. Need to come back and review at some point\n if prev_obj\n if prev_obj.find_by == :css && prev_obj.locator.include?('#')\n @element = page.find(:id, prev_obj.locator.gsub('#', ''), :visible => true)\n else\n @element = @element.find(prev_obj.find_by, prev_obj.locator, :visible => true)\n end\n\n end\n rescue\n raise DATPages::Errors::ElementNotFound.new(obj.locator)\n end\n @element\n end", "def set_top(position, piece)\n if position < 0 || position > 2\n \"Not a valid spot, please put the piece in the 0-2 spot\" \n else\n @top.delete_at(position)\n @top.insert(position, piece)\n end\n end", "def add_element (element, row_num, col_num)\n #puts \"adding element #{element} #{row_num} #{col_num}\"\n @rows[row_num].add element\n @columns[col_num].add element\n @blocks.block(row_num, col_num).add element\n end", "def getElement_placeholder_text(text) \n xpath = Keys_CONFIG[\"placeHolder_start_text\"]+text+Keys_CONFIG[\"placeHolder_end\"]\n @driver.find_element(:xpath,xpath)\nend", "def locate\r\n if @how == :jssh_name\r\n @element_name = @what\r\n elsif @how == :xpath\r\n @element_name = element_by_xpath(@container, @what)\r\n else\r\n @element_name = locate_tagged_element('A', @how, @what)\r\n end\r\n @o = self\r\n end", "def put_in_place\n if place==:append\n item = self\n self.class.with_tree_scope(self) do\n root.append(item)\n end\n end\n end", "def index(element); end", "def add element\n add_last(element)\n end", "def add element\n add_last(element)\n end", "def insert_component_before(name, component)\n # iterate over all components, find the component with the given name\n # once found, insert the given component at that location and return\n components.each_with_index do |c, i|\n if c.name == name\n components.insert(i, component)\n return\n end\n end\n\n components << component\n end", "def assume_bottom_position\n pos = bottom_position_in_list(self).to_i + 1 \n set_my_position(pos)\n end", "def push(element); end", "def store_ordered locator_1, locator_2, variable_name\r\n raise 'Not supported in Selenium Core at the moment'\r\n end", "def push(element)\n\t if element.is_a?(Numeric)\n\t\[email protected] Spacer.new(element)\n\t elsif element.is_a?(Spacer)\n\t\[email protected] element\n\t else\n\t\[email protected] Spacer.new(spacing) if spacing && !(elements.empty? || elements.last.is_a?(Spacer))\n\t\[email protected] element\n\t end\n\n\t self\n\tend", "def assume_top_position\n update_attribute(:position, 1)\n end", "def widget_at_relative(x, y)\n x_index = x / @tile_size\n y_index = y / @tile_size\n if x_index > @grid_width\n error(\"Asking for relative widget beyond width: #{x}\")\n return nil \n end\n if y_index > @grid_height\n error(\"Asking for relative widget beyond height: #{y}\")\n return nil \n end\n @tiles[x_index][y_index]\n end", "def holding_location_container(holding, location, holding_id, call_number)\n markup = holding_location_span(location, holding_id)\n link_markup = locate_link(holding['location_code'], call_number, holding['library'], holding)\n markup << link_markup.html_safe\n markup\n end", "def guarded_locator\n return unguarded_locator if unguarded_locator\n self.locator = case \n when template_id \n then %Q{//#{XMLManipulation::CDA_NAMESPACE}:section[./#{XMLManipulation::CDA_NAMESPACE}:templateId[@root = '#{template_id}']]}\n when locate_by == :attribute\n then \"@#{section_key.to_s.camelcase(:lower)}\"\n when section_key =~ /[^\\w]/\n # non word characters--asume an xpath locator is the section_key\n then section_key\n when section_key.to_s =~ /^\\w+/\n # all word characters--assume an element reference\n then \"#{XMLManipulation::CDA_NAMESPACE}:#{section_key.to_s.camelcase(:lower)}\"\n end \n end", "def setWidgetPositionToStatic(w)\n checkWidgetParent(w)\n DOM.changeToStaticPositioning(w.getElement)\n end", "def placed_fragment(_machine, _index)\n end", "def push(element)\n # IMPLEMENT ME!\n end", "def part_position\n return self.parent.children.index(self) rescue nil\n end", "def get_element_position(element_id)\n return evaluate_script(\"jQuery('##{element_id}').offset();\")\n end", "def replace_existing_element(matrix,element, current_row, current_col)\r\n matrix[current_row][current_col] = element\r\n end", "def reposition_element(index)\n return if size <= 1\n\n element = @backing_store.delete_at(index)\n index = binary_index(@backing_store, element)\n\n @backing_store.insert(index, element)\n end", "def replace_element_by_own_content(element)\n if element.has_children_elements?\n element.get_children_elements.each do |child|\n element.insert_before(child)\n end\n element.remove_node\n elsif element.has_children?\n element.replace_node(element.get_first_node_child)\n end\n end", "def finished_init\n loc = self.location\n loc.move_item_inside(self) unless loc.nil?\n nil\n end", "def move_to_top(tag, klass)\n self.instance.add(tag, klass, 0)\n end", "def insert_after(child1, child2); end", "def locate_place(pos, board)\n board[pos[0]][pos[1]]\n end", "def move_to(locator, offset = {})\n x = offset.fetch(:x, 0)\n y = offset.fetch(:y, 0)\n\n element = find_element(locator)\n\n action\n .move_to(element, x, y)\n .perform\n end", "def locate\n self\n end", "def element_locator(element)\n current_locator << create_jquery_selector(element)\n end" ]
[ "0.5854572", "0.5833458", "0.5619768", "0.5619768", "0.55928504", "0.54975057", "0.54975057", "0.54111356", "0.5389292", "0.53844744", "0.5369884", "0.5369884", "0.5369884", "0.5369884", "0.53650236", "0.5334279", "0.53278804", "0.532399", "0.53110635", "0.5277394", "0.52759576", "0.52629364", "0.5261155", "0.5203994", "0.5199622", "0.51870984", "0.5151728", "0.5136677", "0.5136677", "0.5135193", "0.51320475", "0.5128233", "0.51275885", "0.5127022", "0.5126038", "0.5117703", "0.51099056", "0.51052964", "0.51031584", "0.5102438", "0.50975066", "0.5095512", "0.5095512", "0.5095512", "0.5095512", "0.5095512", "0.5095512", "0.5095512", "0.5095512", "0.50864476", "0.5079792", "0.5073735", "0.5072341", "0.5066513", "0.5060836", "0.5053388", "0.5044222", "0.5041587", "0.5041345", "0.5036324", "0.5036324", "0.5033569", "0.50325483", "0.5031445", "0.5027395", "0.50186867", "0.50186867", "0.50179607", "0.4995047", "0.49936202", "0.49927607", "0.49765497", "0.4968623", "0.49662057", "0.4954711", "0.49515253", "0.49515253", "0.49462676", "0.49447918", "0.494184", "0.49314937", "0.49240878", "0.49214038", "0.49191356", "0.4910887", "0.49108276", "0.49091822", "0.49047333", "0.49015227", "0.48959526", "0.48889533", "0.4872433", "0.48706254", "0.48692814", "0.4864868", "0.48647776", "0.4858843", "0.48574153", "0.48553678", "0.48513898", "0.4848342" ]
0.0
-1
Add more helper methods to be used by all tests here...
def setup Sidekiq::Worker.clear_all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_legacy_helpers\n assert_equal @patron.primary_phone, @patron.primary_address_phone\n assert_equal @patron.secondary_phone, @patron.secondary_address_phone\n assert_nil @patron.primary_address_mobile_phone\n assert_nil @patron.secondary_address_mobile_phone\n end", "def helpers; end", "def helpers; end", "def helpers; end", "def my_tests\n end", "def tests; end", "def tests; end", "def testing\n # ...\n end", "def test_legacy\n # Set up legacy handlers\n setup_legacy_handling\n\n common_tests\n end", "def test_method\n end", "def define_helpers; end", "def test_defaults\n end", "def self_test; end", "def self_test; end", "def test_case; end", "def default_test; end", "def default_test\r\n end", "def default_test\n end", "def __dummy_test__\n end", "def test_added_methods\r\n assert_respond_to @default_user, :roles\r\n assert_respond_to @default_user, :has_role?\r\n \r\n assert_respond_to @default_user, :permissions\r\n assert_respond_to @default_user, :has_static_permission?\r\n end", "def test_nothing\n end", "def default_test\n end", "def test_cases; end", "def test_users_searches\n do_users_all\n do_simple_query\n do_tag_query\n do_profile_query\n end", "def stest_method_1(test); end", "def test_should_eat()\n yay_or_nay = should_eat(\"ice cream\", \"winter\")\n assert_equal(\"False\", should_eat)\n end", "def test_nothing\n end", "def should; super end", "def before_test(test); end", "def before_test(test); end", "def spec; end", "def spec; end", "def test_entry_attrs\n raise \"Implement this method in your test class\"\n end", "def test_get_content_for\n end", "def test\n end", "def test\n end", "def test\n end", "def test_hack\n assert(true)\n end", "def test_pet_shop_name # this uses a function calles pet_shop_name ans passes in the argument @petshop (which contains the list of pets and admin info)\n name = pet_shop_name(@pet_shop) # the function should pull out the the name:\n assert_equal(\"Camelot of Pets\", name) # should return Camelot of pets\n end", "def test \n end", "def test_nothing; end", "def test_entry_attrs\n raise 'Implement the method \"test_entry_attrs\" in your test class'\n end", "def test\n\n end", "def compare_tests(test_a, test_b); end", "def compare_tests(test_a, test_b); end", "def assertions; end", "def assertions; end", "def test_setup\r\n \r\n end", "def test_truth\n end", "def build_test_helper \n \n return if skip_method(__method__)\n \n puts \"build Rails test helper for #{model_name} in test/helpers\"\n filename = \"#{plural_table_name}_helper_test.rb\"\n\n template = File.read(template(\"rails/test/helper_test.rb\"))\n # #text = ERB.new(template, nil, '-').result(binding)\n text = Erubis::Eruby.new(template).evaluate( self )\n\n path = namespaced_path(\"test/helpers\",filename)\n write_artifact(path,text) \n end", "def make_assertions_on_tests( tests, method )\n assert_equal false, tests[:bad].__send__( method )\n assert_equal true, tests[:good].__send__( method )\n assert_equal true, tests[:extra_good].__send__( method )\n end", "def default_test\n end", "def default_test\n end", "def test_entry\n raise \"Implement this method in your test class\"\n end", "def helper_method(*methods); end", "def integration_test()\n return [\"all\"]\n end", "def test_entry\n raise 'Implement the method \"test_entry\" in your test class'\n end", "def test_order; end", "def test_nothing\n return true\n end", "def test_a\n end", "def test_frameworks; end", "def prepare_helpers\n base = File.join(config[:test_base_path], \"helpers\")\n\n helper_files.each do |src|\n dest = File.join(sandbox_suites_dir, src.sub(\"#{base}/\", \"\"))\n FileUtils.mkdir_p(File.dirname(dest))\n FileUtils.cp(src, dest, preserve: true)\n end\n end", "def smoke_test ()\n\n smoke_test = [\"rest_get\"]\n return smoke_test\n end", "def add_testing\n setup_rspec\n setup_rspec_generators\n setup_rails_helper\n setup_factories_file\nend", "def testHelper arr, description, expected\n\tresult = leastOccuringValueInArray(arr)\n\tString resultType = result.class\n\t \n\tString testStatus = \"Failed\"\n\tif (leastOccuringValueInArray(arr).class == expected.class)\n\t\t(leastOccuringValueInArray(arr) == expected)? testStatus = \"Passed\" : testStatus = \"Failed\"\n\tend\n\t\n\t# Print test results\n\tputs \"| \" + testStatus + \" | \" + description + \", expected: \" + expected.to_s + \"(\" + expected.class.to_s + \")\" + \", actual: \" + result.to_s + \"(\" + resultType.to_s + \")\"\nend", "def test_respond_to\n assert_respond_to system_wide, :role\n assert_respond_to system_wide, :role=\n assert_respond_to system_wide, :inspect\n assert_respond_to system_wide, :object_id\n end", "def final_test_methods\n return []\n end", "def tests=(_arg0); end", "def tests=(_arg0); end", "def running_test_case; end", "def test\n return \"\ndef test_#{@test_name}\n assert_nothing_raised(#{self.class.name}) do\n #{@method} :#{@action}, #{@params.inspect}, #{@session.inspect}, #{@flash.inspect}\n end\nend\n\"\n end", "def smoke_test()\n return [\"case_aaaa\"]\n end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def test_guest_name\n assert_equal('Peter', @guest1.return_guest_name)\n end", "def test_truth\n april = riders(:rider_1)\n assert_equal \"April Jones\", april.name\n trigger = horses(:horse_1)\n assert_equal \"Trigger\", trigger.name\n event2 = events(:event_2)\n assert_equal \"5 Horse Scramble\", event2.name\n \n end", "def generate_alltest\n\n end", "def test_camel_case\n raise NotImplementedError, 'Undecided as to whether to check camel case or not'\n end", "def test_find_single_item\n\n result=find_single_item(@warehouse_data, :b7)\n assert_equal(\"bath fizzers\",result)\n \nend", "def test_autocomplete_searches\n do_find_all\n do_autocomplete_query\n end", "def my_array_splitting_method(source)\n source # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend", "def my_array_splitting_method(source)\n source # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend", "def my_array_splitting_method(source)\n source # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend", "def my_array_splitting_method(source)\n source # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend" ]
[ "0.7330966", "0.701972", "0.701972", "0.701972", "0.6772961", "0.6679903", "0.6679903", "0.6583205", "0.65507036", "0.6377433", "0.63762784", "0.632961", "0.6280821", "0.6280821", "0.6249786", "0.6142927", "0.6137607", "0.6121912", "0.6108209", "0.60972595", "0.60949636", "0.6085482", "0.6077252", "0.60748607", "0.603319", "0.60055846", "0.60010356", "0.59755695", "0.5975158", "0.5975158", "0.5973282", "0.5973282", "0.59555405", "0.59167516", "0.59057903", "0.59057903", "0.59057903", "0.5894578", "0.5886192", "0.58858806", "0.5885474", "0.58805525", "0.5860731", "0.5860412", "0.5860412", "0.584998", "0.584998", "0.58033717", "0.5794802", "0.5785648", "0.57691133", "0.57356757", "0.57356757", "0.5733712", "0.5718457", "0.569885", "0.5686251", "0.56847906", "0.56680214", "0.5660432", "0.56465375", "0.5645647", "0.5644992", "0.56355596", "0.5591017", "0.55830294", "0.5579137", "0.55729306", "0.55729306", "0.5563504", "0.555469", "0.55488664", "0.5540873", "0.5540873", "0.5540873", "0.5540873", "0.5540873", "0.5540873", "0.5540873", "0.5540873", "0.5540873", "0.5540873", "0.5540873", "0.5540873", "0.5540873", "0.5540873", "0.5540873", "0.5540873", "0.5540873", "0.5540873", "0.5540873", "0.55373555", "0.5536957", "0.55365646", "0.5536232", "0.5533716", "0.5533225", "0.5530253", "0.5530253", "0.5530253", "0.5530253" ]
0.0
-1
GET /addresses/1 GET /addresses/1.xml
def show render :partial => 'show', :object => @address end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_addresses(**params)\n get('addresses', params)\n end", "def addresses\n message = { nodes: { item: resource[:name]}}\n transport[wsdl].get(:get_address, message)\n end", "def addresses\n IbmCloudRest.get \"#{@uri}/addresses\"\n end", "def show\n @address = Address.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @address }\n end\n end", "def getaddressesbyaccount(account)\n request :getaddressesbyaccount, account\n end", "def addresses\n @client.request('getaddressesbyaccount', name)\n end", "def index\n @address_ranges = AddressRange.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @address_ranges }\n end\n end", "def index\n @addresses = Address.paginate :page => params[:page], :order => 'street ASC'\n #@addresses = Address.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @addresses }\n end\n end", "def show\n @address_range = AddressRange.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @address_range }\n end\n end", "def index\n if address_type==\"Address\"\n @addresses = Address.find(:all)\n else\n @addresses = Address.find_all_by_type(address_type)\n end\n @addresses ||= []\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @addresses }\n end\n end", "def show\n @user_address = UserAddress.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user_address }\n end\n end", "def show\n @person = Person.find(params[:id])\n @addresses = @person.addresses\n end", "def show_address(id)\n get(\"addresses/#{id}\")\n end", "def addresses\n query(:address)\n end", "def get_address_books\n self.class.get('https://api.yesgraph.com/v0/address-books', :headers => @options)\n end", "def list_addresses\n Address.list(@id)\n end", "def show\n @ip_addr = IpAddr.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ip_addr }\n end\n end", "def getaddressesbyaccount(account)\n @api.request 'getaddressesbyaccount', account\n end", "def index\n @addresses = Address.all\n end", "def index\n @addresses = Address.all\n end", "def call_address_service\n addresses = []\n success = call_ok?(:address_search, make_request) do |body|\n ServiceClient.iterate_element(body[:address_list]) do |address|\n add_address(addresses, address) unless address.nil?\n end\n end\n [success, addresses]\n end", "def show\n @address_book_item = AddressBookItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @address_book_item }\n end\n end", "def multi_addr(addresses)\n get(\"addr/\"+addresses.join(\",\")+\"/balance?noCache=1\")\n end", "def index\n\t\t@addresses = Address.all\t\n\tend", "def show\n @address_type = AddressType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @address_type }\n end\n end", "def getnewaddress\n @api.request 'getnewaddress'\n end", "def show\n @technocal_client_address = TechnocalClientAddress.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @technocal_client_address }\n end\n end", "def address\n @client.request('getaccountaddress', name)\n end", "def fetch_xml(uri)\n http = Net::HTTP.new(uri.host, uri.port)\n\n if uri.scheme == 'https'\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n\n http.read_timeout = GoogleCustomSearch.configuration.timeout\n\n request = Net::HTTP::Get.new(uri.request_uri)\n request.initialize_http_header({ 'User-Agent' => user_agent })\n\n response = http.request(request)\n\n raise GoogleCustomSearch::InvalidRequest if response.code.match(/[34]\\d{2}/)\n raise GoogleCustomSearch::ServerError if response.code.match(/5\\d{2}/)\n\n response.body\n end", "def getaccountaddress(account)\n request :getaccountaddress, account\n end", "def index\n @ag_addresses = Ag::Address.all\n end", "def addresses\n nodename = params[:node_id]\n @node = nodename == \"admin\" ? Node.admin.where(:available => true).first : Node.find_key(nodename)\n if params[:network]\n @net = Network.find_key(params[:network])\n res = {\n \"node\" => @node.name,\n \"network\" => @net.name,\n \"category\" => @net.category,\n \"addresses\" => @net.node_allocations(@node).map{|a|a.to_s}\n }\n render :json => res, :content_type=>cb_content_type(:addresses, \"object\")\n else\n res = []\n\n if params[:category]\n nets = Network.in_category(params[:category])\n else\n nets = Network.all\n end\n\n nets.each do |n|\n ips = n.node_allocations(@node)\n next if ips.empty?\n\n res << {\n \"node\" => @node.name,\n \"network\" => n.name,\n \"category\" => n.category,\n \"addresses\" => ips.map{|a|a.to_s}\n }\n end\n\n render :json => res, :content_type=>cb_content_type(:addresses, \"array\")\n end\n end", "def get_xml\n response = @api.request(:get, @location, type: 'xml')\n response.body if response.status == 200\n end", "def index\n @customers_addresses = CustomersAddress.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @customers_addresses }\n end\n end", "def show\n @address = Address.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @address }\n end\n end", "def show\n @address = Address.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @address }\n end\n end", "def show\n @address = Address.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @address }\n end\n end", "def address\n AddressBuilder.new(opts).to_xml\n end", "def show\n @customers_address = CustomersAddress.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customers_address }\n end\n end", "def index\n @client_addresses = ClientAddress.all\n end", "def index\n @contacts = current_user.get_address_book_contacts\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @contacts }\n end\n end", "def index\n @ripple_addresses = RippleAddress.all\n end", "def getnewaddress(account = nil)\n request :getnewaddress, account\n end", "def show\n id = params[:id].to_i - 1\n if (id < 0) or (id > @addresses.length)\n respond_to do |format|\n format.html { redirect_to \"/#{@user.name}\", alert: 'Address was not found.'}\n format.json { render json: @address }\n end\n else\n @address = @addresses[id]\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @address }\n end\n end\n \n end", "def show\n @address = current_user.addresses.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @address }\n end\n end", "def show\n\t @addresses = @user.addresses\n end", "def route_xml(route_id, query_params = nil)\n get(\"/routes/#{route_id}/xml\", query_params)\n end", "def index\n @person_addresses = PersonAddress.all\n end", "def show\n @address = Address.find(params[:id])\n end", "def show\n @address = Address.find(params[:id])\n end", "def get_address_book(user_id)\n self.class.get(\"https://api.yesgraph.com/v0/address-book/#{user_id}\",\n {\n :headers => @options\n }\n )\n end", "def new\n @address = Address.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @address }\n end\n end", "def index\n @sales_addresses = Sales::Address.all\n end", "def xml(id)\n http.get(\"/nfse/#{id}/xml\") do |response|\n response.headers.fetch(\"Location\") { \"\" }\n end\n end", "def index\n @addresses_people = AddressesPerson.all\n end", "def getaddressesbyaccount(account)\n coind.getaddressesbyaccount account\n end", "def new\n @address_range = AddressRange.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @address_range }\n end\n end", "def index\n @account_addresses = AccountAddress.all\n end", "def new\n @address_book = AddressBook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @address_book }\n end\n end", "def retrieve_address\n address_id = params[:address_id] \n @address = Address.find(address_id)\n end", "def index\n @user_addresses = UserAddress.all\n end", "def locate(address)\n get :location => address\n end", "def all(options={})\n response = MLS.get('/addresses', options)\n MLS::Address::Parser.parse_collection(response.body)\n end", "def address(address_id)\n from_resource :address,\n connection.get(api_uri(\"addresses/#{address_id}\"))\n end", "def address\n node = @root.xpath('./ns:Address')\n Address.new(node)\n end", "def get_contract_addresses\n service_response = ClientManagement::GetContractAddresses.new(params).perform\n render_api_response(service_response)\n end", "def index\n @electronic_addresses = ElectronicAddress.all\n end", "def new\n @user_address = UserAddress.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user_address }\n end\n end", "def describe_addresses( options = {} )\n options = { :public_ip => [] }.merge(options)\n params = pathlist(\"PublicIp\", options[:public_ip])\n return response_generator(:action => \"DescribeAddresses\", :params => params)\n end", "def get_address(event)\n this_uri = \"http://data.pollstar.com/api/pollstar.asmx/VenueEvents?venueID=#{event.VenueID}&startDate=#{Time.now.strftime(\"%m/%d/%Y\")}&dayCount=0&page=0&pageSize=0#{ps_key}\"\n\n doc = Nokogiri::XML(Net::HTTP.get(URI(this_uri)))\n venue = doc.xpath(\"//VenueInfo\")\n address = Address.new(event.id) \n address.address1 = venue.attribute('Address1')\n address.address2 = venue.attribute('Address2')\n address.zip = venue.attribute('Zip')\n\n return address\n end", "def index\n\t\t@addresses = current_user.addresses\n\tend", "def service_addresses!(service, index = nil)\n meta = {}\n resp = _service.get(service, :all, {index: index, wait: '2s'}, meta)\n\n if (nindex = meta[:index]) != index\n addresses = resp.map do |address|\n {\n id: address.ServiceID,\n ip: address.ServiceAddress,\n node: address.Node,\n port: address.ServicePort\n }\n end\n\n [addresses, nindex]\n end\n end", "def show\n @user_address = UserAddress.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_address }\n end\n end", "def show\n @hosts_to_mac_addresses = HostsToMacAddresses.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hosts_to_mac_addresses }\n end\n end", "def index\n @address_records = AddressRecord.all\n end", "def index\n @customer_addresses = CustomerAddress.all\n end", "def addresses; end", "def show\n @taddress = Taddress.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @taddress }\n end\n end", "def index\n @post_addresses = PostAddress.all\n end", "def show\n @pneighbour = Pneighbour.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @pneighbour }\n end\n end", "def url\n Addressable::URI.new :scheme => 'http',\n :host => endpoint.host,\n :path => '/onca/xml',\n :query_values => parameters\n end", "def locate(address)\n get :geo, :q => address\n end", "def search\r\n @addresses = Address.find_by_address(params[:address])\r\n end", "def read(id=nil)\r\n request = Net::HTTP.new(@uri.host, @uri.port)\r\n if id.nil?\r\n response = request.get(\"#{@uri.path}.xml\") \r\n else\r\n response = request.get(\"#{@uri.path}/#{id}.xml\") \r\n end\r\n response.body\r\n end", "def index\n @addresses = Address.paginate(:page => params[:page], :per_page => 30).order('updated_at DESC')\n end", "def getnewaddress(account = nil)\n @api.request 'getnewaddress', account\n end", "def index\n @adresses = Adress.all\n end", "def index\n @vendor_addresses = VendorAddress.all\n end", "def getaccountaddress(account)\n @api.request 'getaccountaddress', account\n end", "def index\n\t\t@people = Person.all\n\t\t# respond_to do |format|\n\t\t# \tformat.xml { send_data @entries.to_xml, :type => 'text/xml; charset=UTF-8;', :disposition => 'attachment; filename=entries.xml'}\n\t\t# end\n\tend", "def index\n @requests = Request.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @requests }\n end\n end", "def index\n @locations = Location.find(:all)\n\n respond_to do |format|\n format.html \n format.xml { render :xml => @locations }\n end\n end", "def rest_get(uri)\n \n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n return doc\n \n end\n \nend", "def index\n @relationships = Relationship.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @relationships }\n end\n end", "def find(address)\n Mailgun.submit :get, list_url(address)\n end", "def show\n @approximate_service = ApproximateService.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @approximate_service }\n end\n end", "def address\n post('/api/1/generic/bitcoin/address')['addr']\n end", "def show\n @address_customer = AddressCustomer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @address_customer }\n end\n end", "def get_address_json\r\n address = @customer.addresses.find( params[:id] )\r\n render :text => address.attributes.to_json\r\n end", "def index\n @addresses = current_user.addresses\n @address = Address.new\n end", "def resource_url\n \"orders/#{self.order_id}/shippingaddresses\"\n end" ]
[ "0.70659995", "0.6980729", "0.67692554", "0.6680082", "0.6662398", "0.6593149", "0.6581707", "0.65305597", "0.6475209", "0.6430766", "0.6424034", "0.64002424", "0.6387896", "0.62941444", "0.6278892", "0.6224116", "0.61983526", "0.6169594", "0.61588556", "0.61588556", "0.61496145", "0.6148258", "0.6126444", "0.61069715", "0.6093393", "0.60522705", "0.6032902", "0.60056037", "0.59954846", "0.5983015", "0.59767526", "0.5972704", "0.5920293", "0.5919038", "0.5908563", "0.5908563", "0.5908563", "0.58612216", "0.58384234", "0.5831632", "0.5815571", "0.5814705", "0.58116674", "0.5803085", "0.5802301", "0.5792442", "0.57853144", "0.5778766", "0.5741364", "0.5741364", "0.5740607", "0.57376784", "0.573252", "0.573224", "0.5724388", "0.57180536", "0.56792414", "0.5677129", "0.5673121", "0.5664649", "0.56583375", "0.565502", "0.5637695", "0.5634583", "0.56186455", "0.5603598", "0.55999213", "0.5585069", "0.55810076", "0.55701804", "0.5567255", "0.5554418", "0.5547341", "0.5539929", "0.55325663", "0.5528012", "0.55019754", "0.54894525", "0.5489268", "0.5487198", "0.5476898", "0.54729044", "0.5467827", "0.5456294", "0.54555434", "0.5455396", "0.5453092", "0.54480517", "0.5434225", "0.5433864", "0.54201335", "0.5406435", "0.5403409", "0.54010993", "0.5398136", "0.5391334", "0.5385578", "0.53766894", "0.53625375", "0.5362151", "0.53615665" ]
0.0
-1
GET /addresses/new GET /addresses/new.xml
def new @address = Address.new render :partial => 'new', :object => @address end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @address = Address.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @address }\n end\n end", "def new\n @person = Person.new\n @person.build_address\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def getnewaddress(account = nil)\n request :getnewaddress, account\n end", "def new\n @address = Address.new\n @url = { controller: '/addresses', action: :create }\n end", "def new\n @user_address = UserAddress.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user_address }\n end\n end", "def getnewaddress\n @api.request 'getnewaddress'\n end", "def new\n @address = Address.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @address }\n end\n end", "def new\n @address = Address.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @address }\n end\n end", "def new\n @address = Address.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @address }\n end\n end", "def new\n @address_range = AddressRange.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @address_range }\n end\n end", "def new\n @address_type = AddressType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @address_type }\n end\n end", "def new\n @address_book = AddressBook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @address_book }\n end\n end", "def new\n @ip_addr = IpAddr.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ip_addr }\n end\n end", "def new\n @node = Node.new\n @node.addresses.build\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "def new_address(account_name=nil)\n request('getnewaddress', account_name)\n end", "def getnewaddress(account = nil)\n @api.request 'getnewaddress', account\n end", "def new_address\n @client.new_address(name)\n end", "def new\n @technocal_client_address = TechnocalClientAddress.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @technocal_client_address }\n end\n end", "def new\n @address_book_item = AddressBookItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @address_book_item }\n end\n end", "def new\n @customers_address = CustomersAddress.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @customers_address }\n end\n end", "def new\n @taddress = Taddress.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @taddress }\n end\n end", "def new\n @pneighbour = Pneighbour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pneighbour }\n end\n end", "def new\n @addresstype = Addresstype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @addresstype }\n end\n end", "def new\n @people = People.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @people }\n end\n end", "def new\n @user_address = UserAddress.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_address }\n end\n end", "def new\n build_resource({})\n resource.build_user_address\n respond_with self.resource\n end", "def new\n @route = Route.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @route }\n end\n end", "def new\n @route = Route.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @route }\n end\n end", "def new\n @place = Place.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @place }\n end\n end", "def new\n @place = Place.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @place }\n end\n end", "def new\n @place = Place.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @place }\n end\n end", "def new\n @place = Place.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @place }\n end\n end", "def new\n @place = Place.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @place }\n end\n end", "def new\n @place = Place.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @place }\n end\n end", "def new\n @place = Place.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @place }\n end\n end", "def new\n @pinrequest = Pinrequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pinrequest }\n end\n end", "def new\n @contacts = Contact.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contacts }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @event = Event.new\n @event.build_address\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end", "def new\n @geoname = Geoname.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @geoname }\n end\n end", "def new\n @address = Address.new\n end", "def new\n @omatsuri = Omatsuri.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @omatsuri }\n end\n end", "def new\n @contributor_address = ContributorAddress.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contributor_address }\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end", "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @location }\n end\n end", "def new\n @person_contact = PersonContact.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person_contact }\n end\n end", "def new\n @origin = OriginAddr.new\n \n drop_breadcrumb('新增')\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @origin }\n end\n end", "def new\n @address = current_user.addresses.new\n @address.phones.build\n @address.faxs.build\n @address.emails.build\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @address }\n end\n end", "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "def create_address\n create_resource :address, {}\n end", "def new\n @new_employee_request = NewEmployeeRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @new_employee_request }\n end\n end", "def new\n @provider = Provider.new\n @provider.build_address\n @services = Service.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @provider }\n end\n end", "def new\n @adress = Adresse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @adress }\n end\n end", "def new\n @neighborhood = Neighborhood.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @neighborhood }\n end\n end", "def new\n @lookup_source = LookupSource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_source }\n end\n end", "def new\n @node = Node.scopied.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "def new\n @address = Address.new\n @address.user = current_user\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @address }\n end\n end", "def new\n @address_customer = AddressCustomer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @address_customer }\n end\n end", "def new\n @address = Address.new\n render :partial => \"addresses/new\"\n end", "def new\n @relationship = Relationship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @relationship }\n end\n end", "def new\n @town = Town.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @town }\n end\n end", "def new\n @domain = Domain.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @domain }\n end\n end", "def new\n @land = Land.new\n @address=Address.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @land }\n end\n end", "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end", "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end", "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end", "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "def new\n @delivery_address = DeliveryAddress.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @delivery_address }\n end\n end", "def new\n # customer creates a new shipping address\n end", "def new\n @location = Location.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "def new\n @email = Email.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @email }\n end\n end", "def new\n @origin = Origin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @origin }\n end\n end", "def new\n @request = Request.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end", "def new\n @emailcontact = Emailcontact.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @emailcontact }\n end\n end", "def new\n @contact = Contact.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contact }\n end\n end", "def new\n @contact = Contact.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contact }\n end\n end", "def new\n @contact = Contact.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contact }\n end\n end", "def new\n @service = Service.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml\n end\n end", "def new\n @atom = Atom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @atom }\n end\n end", "def new\n @uri_type = UriType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @uri_type }\n end\n end", "def new\n @countries = Countries.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @countries }\n end\n end", "def new\n @contact = Contact.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contact }\n end\n end", "def new\n @person = Person.new\n @title = \"people\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @solicitation = @representative.solicitations.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @solicitation }\n end\n end", "def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end" ]
[ "0.75105965", "0.7177552", "0.7095347", "0.70659614", "0.70255035", "0.70088935", "0.6991741", "0.6991741", "0.6991741", "0.6982", "0.6962507", "0.6958841", "0.69266534", "0.69193476", "0.6803977", "0.67660844", "0.6743507", "0.6610345", "0.65838194", "0.6573972", "0.65257394", "0.652237", "0.6488317", "0.639925", "0.6381836", "0.63693327", "0.6357592", "0.6357592", "0.63307554", "0.63307554", "0.63307554", "0.63307554", "0.63307554", "0.63307554", "0.63307554", "0.63288593", "0.63192385", "0.63037586", "0.63037586", "0.63037586", "0.63037586", "0.63037586", "0.63037586", "0.63037586", "0.63037586", "0.63037586", "0.63037586", "0.62969214", "0.62932056", "0.62931305", "0.6290128", "0.6287407", "0.6283533", "0.62821436", "0.62821364", "0.6281095", "0.62747055", "0.6263671", "0.6263671", "0.62496513", "0.62471706", "0.6246368", "0.62420547", "0.6228343", "0.6227867", "0.62259054", "0.6209602", "0.62018764", "0.6200841", "0.61984676", "0.61924857", "0.6190189", "0.6189846", "0.6187415", "0.6187415", "0.6187415", "0.6187029", "0.61865646", "0.61865646", "0.61865646", "0.61865646", "0.61865646", "0.61865646", "0.6185827", "0.6183752", "0.6172242", "0.61704385", "0.6166039", "0.61547506", "0.61496097", "0.61473435", "0.61473435", "0.61473435", "0.6147018", "0.6140769", "0.6139121", "0.61345816", "0.6116866", "0.6111247", "0.6104101", "0.60938466" ]
0.0
-1
POST /addresses POST /addresses.xml
def create @address = Address.new(params[:address]) if @address.save flash[:notice] = 'Address was successfully created.' render :partial => 'element_container', :object => @address else render :partial => 'new', :object => @address, :status => 409 end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def postEntityInvoice_address( entity_id, building_number, address1, address2, address3, district, town, county, province, postcode, address_type)\n params = Hash.new\n params['entity_id'] = entity_id\n params['building_number'] = building_number\n params['address1'] = address1\n params['address2'] = address2\n params['address3'] = address3\n params['district'] = district\n params['town'] = town\n params['county'] = county\n params['province'] = province\n params['postcode'] = postcode\n params['address_type'] = address_type\n return doCurl(\"post\",\"/entity/invoice_address\",params)\n end", "def create_and_verify(params = {})\n wrapped_params = {}\n wrapped_params[:address] = params\n\n @client.make_request(:post, 'addresses/create_and_verify', MODEL_CLASS, wrapped_params).address\n end", "def postEntityPostal_address( entity_id, building_number, address1, address2, address3, district, town, county, province, postcode, address_type, do_not_display)\n params = Hash.new\n params['entity_id'] = entity_id\n params['building_number'] = building_number\n params['address1'] = address1\n params['address2'] = address2\n params['address3'] = address3\n params['district'] = district\n params['town'] = town\n params['county'] = county\n params['province'] = province\n params['postcode'] = postcode\n params['address_type'] = address_type\n params['do_not_display'] = do_not_display\n return doCurl(\"post\",\"/entity/postal_address\",params)\n end", "def create_address\n create_resource :address, {}\n end", "def create\n @addresses = Address.paginate(:page => params[:page], :per_page => 30).order('updated_at DESC')\n @address = Address.create(params[:address])\n end", "def post(uri, xml)\r\n req = Net::HTTP::Post.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end", "def create\n @ag_address = Ag::Address.new(ag_address_params)\n\n respond_to do |format|\n if @ag_address.save\n format.html { redirect_to @ag_address, notice: 'Address was successfully created.' }\n format.json { render :show, status: :created, location: @ag_address }\n else\n format.html { render :new }\n format.json { render json: @ag_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @user_address = UserAddress.new(params[:user_address])\n\n respond_to do |format|\n if @user_address.save\n format.html { redirect_to(@user_address, :notice => 'User address was successfully created.') }\n format.xml { render :xml => @user_address, :status => :created, :location => @user_address }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user_address.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create(name=\"Default Name\", age=\"50\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <name>#{name}</name>\r\n <age>#{age}</age>\r\n </person>\"\r\n \r\n request = Net::HTTP::Post.new(@url)\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n response.body \r\n end", "def create_address(params)\n EasyPost::Address.create(params)\n end", "def create(address, options={})\n \tparams = {:address => address}\n Mailgun.submit :post, list_url, params.merge(options)\n end", "def create\n @address = Address.new(params[:address])\n\n respond_to do |format|\n if @address.save\n format.html { redirect_to @address, notice: 'Address was successfully created.' }\n format.json { render json: @address, status: :created, location: @address }\n else\n format.html { render action: \"new\" }\n format.json { render json: @address.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @address = Address.new(params[:address])\n\n respond_to do |format|\n if @address.save\n format.html { redirect_to @address, notice: 'Address was successfully created.' }\n format.json { render json: @address, status: :created, location: @address }\n else\n format.html { render action: \"new\" }\n format.json { render json: @address.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @address = Address.new(address_params)\n @num = 1\n while Address.where([\"address_id = ?\", @num]).size > 0\n @num = @num+1\n end\n @address.address_id = @num\n @address.user_email = current_user.email\n respond_to do |format|\n if @address.save\n format.html { redirect_to home_path, notice: 'Address was successfully created.' }\n format.json { render :show, status: :created, location: @address }\n else\n format.html { render :new }\n format.json { render json: @address.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\t@address = current_user.addresses.new(address_params)\n\t\t@earring = Earring.find(@address.detail.earring_id)\n\n\t\trespond_to do |format|\n\t\t\tif @address.save\n\t\t\t\tformat.html { redirect_to \"/confirm\" }\n\t\t\t\tformat.json { render action: 'show', status: :created, location: @address }\n\t\t\telse\n\t\t\t\tformat.html { redirect_to \"/addresses/new?d=#{@address.detail.id}\" }\n\t\t\t\tformat.json { render json: @address.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def process_addresses(params)\n assign_attributes(params)\n save(validate: false)\n add_email!\n add_addresses!\n save\n end", "def create(params = {})\n wrapped_params = { address: params }\n\n @client.make_request(:post, 'end_shippers', MODEL_CLASS, wrapped_params)\n end", "def create\n @sales_address = Sales::Address.new(sales_address_params)\n\n respond_to do |format|\n if @sales_address.save\n format.html { redirect_to sales_seller_address_path(@sales_seller, @sales_address), notice: \"Endereço adicionado com sucesso!\" }\n format.json { render :show, status: :created, location: @sales_address }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @sales_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(name=\"Default name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Post.new(@url)\n request.add_field \"Content-Type\", \"application/xml\"\n request.body = xml_req\n\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n response.body\n end", "def create\n\n @advertiser = Advertiser.new(advertiser_params)\n @advertiser.create_address(address_params)\n @advertiser.user = current_user\n\n respond_to do |format|\n if @advertiser.save\n format.html { redirect_to @advertiser, notice: 'Advertiser was successfully created.' }\n format.json { render json: @advertiser.to_json }\n else\n format.html { render :new }\n format.json { render json: @advertiser.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_spree_address\n @spree_address = Spree::Address.new(address_attributes)\n @spree_address.save(validate: false)\n end", "def post(xmldoc)\n headers = {'Content-Type' => 'text/xml'}\n check_response( @httpcli.post(@endpoint, xmldoc, headers) )\n end", "def create\n @customers_address = CustomersAddress.new(params[:customers_address])\n\n respond_to do |format|\n if @customers_address.save\n format.html { redirect_to @customers_address, notice: 'Customers address was successfully created.' }\n format.json { render json: @customers_address, status: :created, location: @customers_address }\n else\n format.html { render action: \"new\" }\n format.json { render json: @customers_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @post_address = PostAddress.new(post_address_params)\n\n respond_to do |format|\n if @post_address.save\n format.html { redirect_to @post_address, notice: 'Adress skapad.' }\n format.json { render action: 'show', status: :created, location: @post_address }\n else\n format.html { render action: 'new' }\n format.json { render json: @post_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @address = Address.new(params[:address])\n @address.type = params[:address][:address_type] unless params[:address][:address_type].blank?\n \n respond_to do |format|\n if @address.save\n flash[:notice] = 'Address was successfully created.'\n format.html { redirect_to( address_path(@address.id) ) }\n format.xml { render :xml => @address, :status => :created, :location => @address }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @address.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @account_address = AccountAddress.new(account_address_params)\n\n respond_to do |format|\n if @account_address.save\n format.html { redirect_to @account_address, notice: 'Account address was successfully created.' }\n format.json { render :show, status: :created, location: @account_address }\n else\n format.html { render :new }\n format.json { render json: @account_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @addresses_person = AddressesPerson.new(addresses_person_params)\n\n respond_to do |format|\n if @addresses_person.save\n format.html { redirect_to @addresses_person, notice: 'Addresses person was successfully created.' }\n format.json { render :show, status: :created, location: @addresses_person }\n else\n format.html { render :new }\n format.json { render json: @addresses_person.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client_address = ClientAddress.new(client_address_params)\n\n respond_to do |format|\n if @client_address.save\n format.html { redirect_to @client_address, notice: 'Client address was successfully created.' }\n format.json { render :show, status: :created, location: @client_address }\n else\n format.html { render :new }\n format.json { render json: @client_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def create \n @address = Address.new(address_params)\n\n respond_to do |format|\n if @address.save\n format.html { redirect_to admin_path(current_user), notice: 'Address was successfully created.' }\n format.json { render :show, status: :created, location: @address }\n else\n format.html { render :new }\n format.json { render json: @address.errors, status: :unprocessable_entity }\n end\n end\n end", "def addresses\n message = { nodes: { item: resource[:name]}}\n transport[wsdl].get(:get_address, message)\n end", "def create\n @user_address = UserAddress.new(user_address_params)\n\n respond_to do |format|\n if @user_address.save\n format.html { redirect_to @user_address, notice: \"User address was successfully created.\" }\n format.json { render :show, status: :created, location: @user_address }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @user_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_address(params)\n ad = AnubisNetwork::Model::AddAddress.new\n ad_arr = Array.new\n ad.domain_id = params[:domain_id]\n params[:address].each do |address|\n add = AnubisNetwork::Model::Address.new\n add.address = address\n ad_arr.push(add)\n end\n\n ad.address = ad_arr\n ad.import_type = params[:import_type]\n payload = ad.to_xmldoc_r\n result = @connection.rest_request(\n method: :post,\n path: \"/mps_setup/add_address/\",\n body: payload,\n session: params[:session]\n )\n xml = result.body.sub(/(?<=\\<n:add_addressResponse).*?(?=\\>)/,\"\")\n xml = xml.gsub(/(?=n:add_addressResponse).*?(?=\\>)/,\"add_addressResponse\")\n return Hash.from_xml(xml).to_json\n\n end", "def create\n @taddress = Taddress.new(params[:taddress])\n \n respond_to do |format|\n if @taddress.save\n format.html { redirect_to @taddress, notice: 'Taddress was successfully created.' }\n format.json { render json: @taddress, status: :created, location: @taddress }\n else\n format.html { render action: \"new\" }\n format.json { render json: @taddress.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_Addresses(value)\n set_input(\"Addresses\", value)\n end", "def set_Addresses(value)\n set_input(\"Addresses\", value)\n end", "def set_Addresses(value)\n set_input(\"Addresses\", value)\n end", "def create\n @person_address = PersonAddress.new(person_address_params)\n\n respond_to do |format|\n if @person_address.save\n format.html { redirect_to @person_address, notice: 'Person address was successfully created.' }\n format.json { render :show, status: :created, location: @person_address }\n else\n format.html { render :new }\n format.json { render json: @person_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @node = Node.new\n @node.addresses.build\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "def create\n @user_address = UserAddress.new(params[:user_address])\n\n respond_to do |format|\n if @user_address.save\n format.html { redirect_to @user_address, notice: 'User address was successfully created.' }\n format.json { render json: @user_address, status: :created, location: @user_address }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def call_address_service\n addresses = []\n success = call_ok?(:address_search, make_request) do |body|\n ServiceClient.iterate_element(body[:address_list]) do |address|\n add_address(addresses, address) unless address.nil?\n end\n end\n [success, addresses]\n end", "def create\n @customer_address = CustomerAddress.new(customer_address_params)\n\n respond_to do |format|\n if @customer_address.save\n format.html { redirect_to @customer_address, notice: 'Customer address was successfully created.' }\n format.json { render :show, status: :created, location: @customer_address }\n else\n format.html { render :new }\n format.json { render json: @customer_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @address = current_customer.addresses.build(\n province: Province.find(params[:province_id].to_i),\n country_code: params[:country_code],\n is_primary_address: address_params[:is_primary_address].to_i == 1,\n address_line_one: address_params[:address_line_one],\n address_line_two: address_params[:address_line_two],\n address_additional: address_params[:address_additional],\n city: address_params[:city],\n postal_code: address_params[:postal_code]\n )\n\n respond_to do |format|\n if @address.save\n format.html { redirect_to @address, notice: \"Address was successfully created.\" }\n format.json { render :show, status: :created, location: @address }\n else\n format.html { render :new }\n format.json { render json: @address.errors, status: :unprocessable_entity }\n end\n end\n end", "def post_config(url_prefix, xml)\n post_data(url_prefix, xml, 'application/xml;charset=UTF-8')\n end", "def address\n AddressBuilder.new(opts).to_xml\n end", "def create\n @address_book = AddressBook.new(params[:address_book])\n\n respond_to do |format|\n if @address_book.save\n flash[:notice] = :address_book_created.l\n format.html { redirect_to(address_books_url) }\n format.xml { render :xml => @address_book, :status => :created, :location => @address_book }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @address_book.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @technocal_client_address = TechnocalClientAddress.new(params[:technocal_client_address])\n\n respond_to do |format|\n if @technocal_client_address.save\n format.html { redirect_to([:admin, @technocal_client_address], :notice => 'TechnocalClientAddress criada com sucesso.') }\n format.xml { render :xml => @technocal_client_address, :status => :created, :location => @technocal_client_address }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @technocal_client_address.errors, :status => :unprocessable_entity }\n end\n end\n end", "def addresses\n IbmCloudRest.get \"#{@uri}/addresses\"\n end", "def create_address(order_or_user, expect_success, values, type=nil)\n visit_addresses(order_or_user)\n\n expect(page).to have_css('#new_address_link')\n click_link 'new_address_link'\n expect(current_path).to eq(spree.new_admin_address_path)\n\n fill_in_address(values, type)\n\n click_button Spree.t('actions.create')\n\n if expect_success\n expect_address_collection_path(order_or_user)\n expect(page).to have_content(Spree.t(:successfully_created, resource: Spree::Address.model_name.human))\n else\n expect(path_with_query).to eq(spree.admin_addresses_path(user_id: @user_id, order_id: @order_id))\n expect(page).to have_no_content(Spree.t(:successfully_created, resource: Spree::Address.model_name.human))\n end\n end", "def add_address\n \n params[:place]\n address = ReceiverAddress.new(:label => params[:place], \n :city_id => params[:city_id], \n :address => params[:address])\n @receive.document = \"234\"\n @receiver.receiver_addresses << address\n respond_to do |format|\n format.html { render @receiver, action ='new'}\n end\n end", "def create_service_request\n # Geocode the address\n lat, long = Geocoder.coordinates(\"#{self.restaurant_address} , Chicago, IL\") \n\n HTTParty.post('http://311api.cityofchicago.org/open311/v2/requests.json', :body => { \n :api_key => SETTINGS[\"OPEN_311_KEY\"],\n :service_code => '4fd6e4ece750840569000019',\n :attribute => {\n :PLEASESE => 'FOODPOIS',\n :WHATISTH => self.restaurant_name,\n :ONWHATDA => self.date\n },\n :address_string => self.restaurant_address,\n :description => self.description,\n :lat => lat, \n :long => long, \n :first_name => self.first_name,\n :last_name => self.last_name,\n :email => self.email,\n :phone => self.phone\n })\n end", "def create_easypost_address\n EasyPost::Address.create(\n name: full_name,\n street1: street,\n street2: street2,\n city: city,\n state: state,\n zip: postal_code,\n country: 'US',\n verify_strict: ['delivery']\n )\n end", "def post\n response = HTTParty.post(servlet_url,\n :body => to_xml,\n :headers => { 'Content-Type' => 'application/xml' }\n ).response\n\n return Dhl::Shipment::Response.new(response.body)\n rescue Exception => e\n request_xml = if @to_xml.to_s.size>0\n @to_xml\n else\n '<not generated at time of error>'\n end\n\n response_body = if (response && response.body && response.body.to_s.size > 0)\n response.body\n else\n '<not received at time of error>'\n end\n\n log_level = if e.respond_to?(:log_level)\n e.log_level\n else\n :critical\n end\n\n log_request_and_response_xml(log_level, e, request_xml, response_body )\n raise e\n end", "def create\n @address_type = AddressType.new(params[:address_type])\n\n respond_to do |format|\n if @address_type.save\n format.html { redirect_to(@address_type, :notice => 'AddressType was successfully created.') }\n format.xml { render :xml => @address_type, :status => :created, :location => @address_type }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @address_type.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @address_record = AddressRecord.new(address_record_params)\n\n respond_to do |format|\n if @address_record.save\n format.html { redirect_to @address_record, notice: 'Address record was successfully created.' }\n format.json { render :show, status: :created, location: @address_record }\n else\n format.html { render :new }\n format.json { render json: @address_record.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @address = Address.new(params[:address])\n @address.user = current_user\n\n respond_to do |format|\n if @address.save\n format.html { redirect_to user_address_path(current_user, @address), notice: 'Address was successfully created.' }\n format.json { render json: @address, status: :created, location: @address }\n else\n format.html { render action: \"new\" }\n format.json { render json: @address.errors, status: :unprocessable_entity }\n end\n end\n end", "def create \n @address = Address.new()\n @address.addressable_type = params[:address][:addressable_type]\n @address.addressable_id = params[:address][:addressable_id]\n @address.number = params[:address][:number]\n @address.street = params[:address][:street]\n @address.suburb = params[:address][:city]\n @address.state = params[:address][:state]\n @address.country = params[:address][:country]\n @address.postcode = params[:address][:postcode]\n if @address.save\n redirect_to home_path\n else\n flash[:alert] = \"Opps, something went wrong when creating your review\"\n redirect_to items_path \n end \n end", "def create\n super\n if resource.save\n \t\taddress.attributes = address_params\n \t\taddress.user_id = resource.id \n \t\taddress.save\n end\n end", "def create\n @ip_addr = IpAddr.new(params[:ip_addr])\n\n respond_to do |format|\n if @ip_addr.save\n flash[:notice] = 'IpAddr was successfully created.'\n format.html { redirect_to(@ip_addr) }\n format.xml { render :xml => @ip_addr, :status => :created, :location => @ip_addr }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ip_addr.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @address_range = AddressRange.new(params[:address_range])\n\n respond_to do |format|\n if @address_range.save\n format.html { redirect_to(@address_range, :notice => 'Address range was successfully created.') }\n format.xml { render :xml => @address_range, :status => :created, :location => @address_range }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @address_range.errors, :status => :unprocessable_entity }\n end\n end\n end", "def address_params\n end", "def create\n @adress = Adresse.new(params[:adresse])\n \n respond_to do |format|\n if @adress.save\n format.html { redirect_to @adress, notice: 'Adresse was successfully created.' }\n format.json { render json: @adress, status: :created, location: @adress }\n else\n format.html { render action: \"new\" }\n format.json { render json: @adress.errors, status: :unprocessable_entity }\n end\n end\n end", "def post(body)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true if uri.scheme == 'https'\n\n request = Net::HTTP::Post.new(uri)\n request['Content-Type'] = 'text/xml'\n request['Accept-Language'] = locale if locale\n request.body = body\n\n response = http.request(request)\n\n Response.new(response, uri)\n end", "def post_fundingsources_addresses_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FundingSourcesApi.post_fundingsources_addresses ...'\n end\n # resource path\n local_var_path = '/fundingsources/addresses'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])\n\n # return_type\n return_type = opts[:debug_return_type] || 'CardholderAddressResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || []\n\n new_options = opts.merge(\n :operation => :\"FundingSourcesApi.post_fundingsources_addresses\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: FundingSourcesApi#post_fundingsources_addresses\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_elasticsearch_addressbase_data(title_address_data)\n id = title_address_data[:uprn]\n uri = URI.parse(\"#{$ELASTIC_SEARCH_ENDPOINT}\")\n conn = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Post.new \"/#{$ELASTICSEARCH_ADDRESSBASE}/#{$ELASTICSEARCH_POSTCODE_SEARCH}/#{id}\"\n request['Content-Type'] = 'application/json'\n request.body = title_address_data.to_json\n conn.request(request)\nend", "def addresses\n nodename = params[:node_id]\n @node = nodename == \"admin\" ? Node.admin.where(:available => true).first : Node.find_key(nodename)\n if params[:network]\n @net = Network.find_key(params[:network])\n res = {\n \"node\" => @node.name,\n \"network\" => @net.name,\n \"category\" => @net.category,\n \"addresses\" => @net.node_allocations(@node).map{|a|a.to_s}\n }\n render :json => res, :content_type=>cb_content_type(:addresses, \"object\")\n else\n res = []\n\n if params[:category]\n nets = Network.in_category(params[:category])\n else\n nets = Network.all\n end\n\n nets.each do |n|\n ips = n.node_allocations(@node)\n next if ips.empty?\n\n res << {\n \"node\" => @node.name,\n \"network\" => n.name,\n \"category\" => n.category,\n \"addresses\" => ips.map{|a|a.to_s}\n }\n end\n\n render :json => res, :content_type=>cb_content_type(:addresses, \"array\")\n end\n end", "def create\n @electronic_address = ElectronicAddress.new(electronic_address_params)\n\n respond_to do |format|\n if @electronic_address.save\n format.html { redirect_to @electronic_address, notice: 'Electronic address was successfully created.' }\n format.json { render action: 'show', status: :created, location: @electronic_address }\n else\n format.html { render action: 'new' }\n format.json { render json: @electronic_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @address = Address.new(address_params)\n\n if @address.save\n redirect_to checkout_index_path, notice: 'Address was successfully created.'\n else\n redirect_to checkout_index_path, notice: 'Algo ocurrio mal'\n #format.html { render :new }\n #format.json { render json: @address.errors, status: :unprocessable_entity }\n end\n end", "def create\n @ip_address = IpAddress.new(ip_address_params)\n\n respond_to do |format|\n if @ip_address.save\n format.html { redirect_to ip_addresses_path, notice: 'Ip address was successfully created.' }\n format.json { render action: 'show', status: :created, location: @ip_address }\n else\n format.html { render action: 'new' }\n format.json { render json: @ip_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @address = Address.new(params[:address])\n @address.user_id=current_user.id\n\n respond_to do |format|\n if @address.save\n format.html { redirect_to @address, notice: 'Address was successfully created.' }\n format.json { render json: @address, status: :created, location: @address }\n else\n format.html { render action: \"new\" }\n format.json { render json: @address.errors, status: :unprocessable_entity }\n end\n end\n end", "def addresses\n @client.request('getaddressesbyaccount', name)\n end", "def create\n @ip_adress = IpAddress.new(ip_adress_params)\n\n respond_to do |format|\n if @ip_adress.save\n format.html { redirect_to @ip_adress, notice: 'Ip adress was successfully created.' }\n format.json { render :show, status: :created, location: @ip_adress }\n else\n format.html { render :new }\n format.json { render json: @ip_adress.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @address_book = AddressBook.new(address_book_params)\n\n respond_to do |format|\n if @address_book.save\n format.html { redirect_to @address_book, notice: 'Address book was successfully created.' }\n format.json { render :show, status: :created, location: @address_book }\n else\n format.html { render :new }\n format.json { render json: @address_book.errors, status: :unprocessable_entity }\n end\n end\n end", "def getnewaddress\n @api.request 'getnewaddress'\n end", "def post_request(params, useSSL=false)\n # get a server handle\n port = (useSSL == true) ? 443 : 80\n http_server = Net::HTTP.new(API_HOST, port)\n http_server.use_ssl = useSSL\n \n # build a request\n http_request = Net::HTTP::Post.new(API_PATH_REST)\n http_request.form_data = params\n \n # get the response XML\n return http_server.start{|http| http.request(http_request)}.body\n end", "def post_query( xml )\n url = URI.parse( self.url )\n response = self.http.post_form( url, { \"query\" => xml } )\n return response.body\n end", "def contact_params\n params.require(:contact).permit(:name, :email, addresses_attributes: [ :city, :street, :street_number ])\n end", "def send_post(data_xml,url)\r\n result = @client.post(self.target_uri(url), :body => data_xml , :head => {'Content-Type' => 'application/xml'} ) \r\n raise \"Invalid status #{result.http_status} from server #{@host}:#{@port}\" if(result.http_status != '200') \r\n #reply = Reply.from_xml(result.http_body)\r\n if block_given?\r\n yield(result.http_body)\r\n else\r\n result.http_body\r\n end\r\n end", "def resource_params\n params.require(:address).permit(:place, :codigopostal, :estado, :municipio, :colonia, :domicilio, :country)\n end", "def create\n @host_address = HostAddress.new(host_address_params)\n respond_to do |format|\n if @host_address.save\n format.html { redirect_to @host_address, notice: 'Host address was successfully created.' }\n format.json { render :show, status: :created, location: @host_address }\n else\n format.html { render :new }\n format.json { render json: @host_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @user = User.find(params[:user_id])\n @address = @user.addresses.new(params[:address])\n\n respond_to do |format|\n if @address.save\n format.html { redirect_to admin_user_address_path(@user, @address), notice: 'Address was successfully created.' }\n format.json { render json: admin_user_address_path(@user, @address), status: :created, location: @address }\n format.js\n else\n format.html { render action: \"new\" }\n format.json { render json: @address.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "def getaddressesbyaccount(account)\n request :getaddressesbyaccount, account\n end", "def callback_addresses\n request_api = \"#{api_call('api')}/namaster\"\n url = URI.parse(request_api)\n req = Net::HTTP.new(url.host, url.port)\n req.use_ssl = USE_SSL\n http = Net::HTTP::Get.new(url.request_uri)\n http['apiKey'] = api_call('key')\n res = req.request(http)\n result = JSON.parse(res.body)\n if Address.save_name_and_address_from_api(result)\n render :nothing => true, :layout => false, :status => 201\n else\n render :nothing => true, :layout => false, :status => 401\n end\n end", "def create\n @customer_ship_address = current_customer.build_customer_ship_address(customer_ship_address_params)\n respond_to do |format|\n if @customer_ship_address.save\n format.html { redirect_to edit_customer_registration_path, notice: t(:ship_address_suc_create) }\n format.json { redirect_to edit_customer_registration_path, status: :created, location: @customer_ship_address}\n else\n format.html { render action: 'new' }\n format.json { render json: @customer_ship_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def post_fundingsources_addresses(opts = {})\n data, _status_code, _headers = post_fundingsources_addresses_with_http_info(opts)\n data\n end", "def new_address(account_name=nil)\n request('getnewaddress', account_name)\n end", "def create\n @addresstype = Addresstype.new(params[:addresstype])\n\n respond_to do |format|\n if @addresstype.save\n format.html { redirect_to @addresstype, notice: 'Addresstype was successfully created.' }\n format.json { render json: @addresstype, status: :created, location: @addresstype }\n else\n format.html { render action: \"new\" }\n format.json { render json: @addresstype.errors, status: :unprocessable_entity }\n end\n end\n end", "def permit_request_params\n params.permit(:address)\n end", "def new_address\n @client.new_address(name)\n end", "def post(resource, params)\n case resource\n when \"pedidos\", \"place_order\", \"new_order\" then url = \"/pedidos\"\n when \"envios\", \"shipping\" then url = \"/envios\"\n else url = \"/#{resource}\"\n end\n\n post_request(url, params)\n end", "def create\n @address = @company.addresses.build(address_params) \n\n respond_to do |format|\n if @address.save\n # If this is first address, set as bill and ship address\n @company.billaddress ||= @address.id\n @company.shipaddress ||= @address.id\n @company.save!\n\n format.html { redirect_to edit_company_path(@company), notice: 'Address was successfully created.' }\n format.json { render :show, status: :created, location: @address }\n else\n format.html { render :new }\n format.json { render json: @address.errors, status: :unprocessable_entity }\n end\n end\n end", "def call\n begin\n context[:organization_addresses].each do |address|\n address = context.organization.organization_addresses.new(\n city: address[:city],\n street: address[:street],\n house_number: address[:house_number],\n phone: address[:phone])\n address.save\n end\n rescue => e\n context.fail!(message: e)\n end\n end", "def address_params\n @addr_attrs ||= params.require(:address).permit(Spree::PermittedAttributes.address_attributes)\n end", "def create\n @weventaddress = Weventaddress.new(weventaddress_params)\n\n respond_to do |format|\n if @weventaddress.save\n format.html { redirect_to @weventaddress, notice: 'Weventaddress was successfully created.' }\n format.json { render :show, status: :created, location: @weventaddress }\n else\n format.html { render :new }\n format.json { render json: @weventaddress.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ripple_address = RippleAddress.new(ripple_address_params)\n\n respond_to do |format|\n if @ripple_address.save\n format.html { redirect_to @ripple_address, notice: 'Ripple address was successfully created.' }\n format.json { render :show, status: :created, location: @ripple_address }\n else\n format.html { render :new }\n format.json { render json: @ripple_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @cliente = Cliente.new id: '300', nome:'David', identificador:'14725836910', telefone:'8735334268', celular:'3698521472', email:'[email protected]', senha:'65423'\n @cliente.save\n @order = @cliente.orders.build(id: '800', menuTitle: 'Senor Froggy', street: 'Elm Street')\n @cliente.save\n #@adress = Adress.new(street: :street, block: :block, number: :number, additional_info: :additional_info, order_id: @order)\n @adress = @order.adresses.build(street: :street, block: :block, number: :number, additional_info: :additional_info, order_id: @order.id)\n respond_to do |format|\n if @adress.save\n format.html { redirect_to @adress, notice: 'Adress was successfully created.' }\n format.json { render :show, status: :created, location: @adress }\n else\n format.html { render :new }\n format.json { render json: @adress.errors, status: :unprocessable_entity }\n end\n end\n end", "def post_xml(url, ls_data)\n uri = URI.parse(url)\n request = Net::HTTP::Post.new(uri.request_uri, HEADER_XML)\n request.body = ls_data\n request.basic_auth(@nsx_user, @nsx_password)\n response = Net::HTTP.start(uri.host, uri.port, :use_ssl => true,\n :verify_mode => OpenSSL::SSL::VERIFY_NONE) do |https|\n https.request(request)\n end\n return response.body if check_response(response, 201)\n end", "def build_and_create_address\n\t\tbegin\n\t\t\t@address = Address.new(\n\t\t\t\tstreet_address: params[:address][:street_address],\n\t\t\t\textended_address: params[:address][:extended_address],\n\t\t\t\tlocality: params[:address][:locality],\n\t\t\t\tregion: params[:address][:region],\n\t\t\t\tpostal_code: params[:address][:postal_code],\n\t\t\t\tphone: params[:address][:phone],\n\t\t\t\temail: params[:address][:email]\n\t\t\t\t)\n\n\t\t\tunless @address.save\n\t\t\t\trender status: 422, json: {\n error: \"Could not create address\"\n }\n end\n rescue ActiveRecord::ActiveRecordError\n render status: 422, json: {\n error: \"Could not create address\"\n }\n end\n end", "def index\n @form = Form.new(params[:form]) \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @addresses }\n end\n end", "def create\n @address_detail = AddressDetail.new(address_detail_params)\n\n respond_to do |format|\n if @address_detail.save\n format.html { redirect_to @address_detail, notice: 'Address detail was successfully created.' }\n format.json { render :show, status: :created, location: @address_detail }\n else\n format.html { render :new }\n format.json { render json: @address_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "def post(body)\n request = Net::HTTP::Post.new(bind_uri)\n request.body = body\n request.content_length = request.body.size\n request[\"Content-Type\"] = \"text/xml; charset=utf-8\"\n\n Jabber.debug(\"Sending POST request - #{body.strip}\")\n\n response = Net::HTTP.new(domain, port).start { |http| http.request(request) }\n\n Jabber.debug(\"Receiving POST response - #{response.code}: #{response.body.inspect}\")\n\n unless response.is_a?(Net::HTTPSuccess)\n raise Net::HTTPBadResponse, \"Net::HTTPSuccess expected, but #{response.class} was received\"\n end\n\n response\n end", "def create\n @address_customer = AddressCustomer.new(params[:address_customer])\n\n respond_to do |format|\n if @address_customer.save\n format.html { redirect_to @address_customer, notice: 'Address customer was successfully created.' }\n format.json { render json: @address_customer, status: :created, location: @address_customer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @address_customer.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.631463", "0.6245289", "0.60543716", "0.6018989", "0.60139626", "0.5956214", "0.5948452", "0.5946253", "0.59098965", "0.58948094", "0.58936965", "0.5867695", "0.5867695", "0.5845449", "0.5821028", "0.581031", "0.5809577", "0.5792074", "0.57846224", "0.57422054", "0.57216", "0.57213503", "0.5719628", "0.57183945", "0.57101285", "0.5690762", "0.5686663", "0.5676094", "0.5675774", "0.56624067", "0.56453276", "0.55929875", "0.55770046", "0.5573969", "0.5573969", "0.5573969", "0.5571819", "0.55583423", "0.55408186", "0.5537452", "0.5536197", "0.55215496", "0.5504585", "0.5498951", "0.5492637", "0.5489311", "0.5486488", "0.548167", "0.547105", "0.5470516", "0.545491", "0.5449355", "0.54440695", "0.5432999", "0.54329455", "0.54199135", "0.5410383", "0.5402566", "0.53938127", "0.53892446", "0.5386219", "0.53857285", "0.537785", "0.5376598", "0.53498083", "0.5343799", "0.534373", "0.5337732", "0.5333204", "0.5332788", "0.532192", "0.5307813", "0.5306376", "0.52914643", "0.5286118", "0.52827364", "0.52752995", "0.52697366", "0.5269059", "0.5267864", "0.52639824", "0.52627695", "0.5256726", "0.525586", "0.5251841", "0.52463424", "0.52418023", "0.5237863", "0.5235695", "0.5235492", "0.522298", "0.5217641", "0.521503", "0.52088773", "0.52047443", "0.5200872", "0.5193518", "0.5191565", "0.5189162", "0.51835024", "0.51832616" ]
0.0
-1
PUT /addresses/1 PUT /addresses/1.xml
def update if @address.update_attributes(params[:address]) and (@address.status == 'live' or @address.user_input) flash[:notice] = 'Address was successfully updated.' render :partial => 'show', :object => @address else render :partial => 'edit', :object => @address, :status => 409 end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end", "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end", "def update_address(id, params)\n put(\"addresses/#{id}\", address: params, change_case: false)\n end", "def update(id, name= \"Updated Name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <id type='integer'>#{id}</id>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\n request.add_field \"Content-Type\", \"application/xml\"\n request.body = xml_req\n\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end", "def update\n @address = @addressable.addresses.find_by_id(params[:id])\n\n respond_to do |format|\n if @address.update_attributes(params[:address])\n format.html { redirect_to current_user, notice: 'address was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @address.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(id, name=\"Updated Name\", age=\"55\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <id type='integer'>#{id}</id>\r\n <name>#{name}</name>\r\n <age>#{age}</age> \r\n </person>\"\r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end", "def update\n @address = Address.find(params[:id])\n\n respond_to do |format|\n if @address.update_attributes(params[:address])\n format.html { redirect_to @address, :notice => 'Address was successfully updated.' }\n format.json { render :json => @address }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @address.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @address = Address.find(params[:id])\n\n respond_to do |format|\n if @address.update_attributes(params[:address])\n format.html { redirect_to @address, notice: 'Address was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @address.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @address = Address.find(params[:id])\n\n respond_to do |format|\n if @address.update_attributes(params[:address])\n format.html { redirect_to @address, notice: 'Address was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @address.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @address = Address.find(params[:id])\n\n respond_to do |format|\n if @address.update_attributes(params[:address])\n format.html { redirect_to @address, notice: 'Address was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @address.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @address = Address.find(params[:id])\n\n respond_to do |format|\n if @address.update_attributes(params[:address])\n format.html { redirect_to @address, notice: 'Address was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @address.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @address = Address.find(params[:id])\n @address.update_attributes(params[:address])\n @addresses = Address.paginate(:page => params[:page], :per_page => 30).order('updated_at DESC')\n end", "def rest_update(uri, method: Net::HTTP::Put)\n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n doc = strip_class_attributes(yield doc)\n \n request2 = method.new uri\n request2.content_type = 'application/xml'\n auth_admin(request2)\n\n request2.body=doc.to_s\n \n response2 = http.request request2\n response.value\n\n end\n \nend", "def update\n if @address.update(address_params)\n render json: @address\n else\n render json: @address.errors, status: :unprocessable_entity\n end\n end", "def update\n @user_address = UserAddress.find(params[:id])\n\n respond_to do |format|\n if @user_address.update_attributes(params[:user_address])\n format.html { redirect_to(@user_address, :notice => 'User address was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user_address.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @address = current_user.addresses.find(params[:id])\n\n respond_to do |format|\n if @address.update_attributes(params[:address])\n format.html { redirect_to user_address_path(current_user, @address), notice: 'Address was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @address.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @address_book = AddressBook.find(params[:id])\n\n respond_to do |format|\n if @address_book.update_attributes(params[:address_book])\n flash[:notice] = :address_book_updated.l\n format.html { redirect_to(address_books_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @address_book.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @address = current_user.addresses.find(params[:id])\n respond_to do |format|\n if @address.update_attributes(params[:address])\n format.html { redirect_to \"/#{current_user.name}\", notice: 'Address was successfully updated.' }\n format.json { head :no_content }\n else\n @address.phones.build\n @address.faxs.build\n @address.emails.build\n format.html { render action: \"edit\" }\n format.json { render json: @address.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @ip_addr = IpAddr.find(params[:id])\n\n respond_to do |format|\n if @ip_addr.update_attributes(params[:ip_addr])\n flash[:notice] = 'IpAddr was successfully updated.'\n format.html { redirect_to(@ip_addr) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ip_addr.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @address.update(address_params)\n format.html { redirect_to @address, notice: \"Address was successfully updated.\" }\n format.json { render :show, status: :ok, location: @address }\n else\n format.html { render :edit }\n format.json { render json: @address.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @address.update(address_params)\n format.html { redirect_to @address, notice: 'Address was successfully updated.' }\n format.json { render :show, status: :ok, location: @address }\n else\n format.html { render :edit }\n format.json { render json: @address.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @customers_address = CustomersAddress.find(params[:id])\n\n respond_to do |format|\n if @customers_address.update_attributes(params[:customers_address])\n format.html { redirect_to @customers_address, notice: 'Customers address was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @customers_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @address_range = AddressRange.find(params[:id])\n\n respond_to do |format|\n if @address_range.update_attributes(params[:address_range])\n format.html { redirect_to(@address_range, :notice => 'Address range was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @address_range.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n # @address = Address.find(params[:id])\n @address = Address.find_by_permalink!(params[:id])\n \n respond_to do |format|\n if @address.update_attributes(params[:address])\n \n flash[:notice] = 'Address was successfully updated.'\n format.html { redirect_to(@address) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @address.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @address_type = AddressType.find(params[:id])\n\n respond_to do |format|\n if @address_type.update_attributes(params[:address_type])\n format.html { redirect_to(@address_type, :notice => 'AddressType was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @address_type.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n user = User.find(params[:id])\n if user.address.update(address_params)\n render status: :ok\n else\n render status: :unprocessable_entity #was :bad_request\n end\n end", "def update\n if @contact.address.update(address_params)\n render json: @contact.address\n else\n render json: @contact.errors, status: :unprocessable_entity\n end\n end", "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "def update\n respond_to do |format|\n if @address.update(address_params)\n format.html { redirect_to admin_path(current_user), notice: 'Address was successfully updated.' }\n format.json { render :show, status: :ok, location: @address }\n else\n format.html { render admin_path(current_user), error: 'Issue.' }\n format.json { render json: @address.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @address.update(address_params)\n format.html { redirect_to home_path, notice: 'Address was successfully updated.' }\n format.json { render :show, status: :ok, location: @address }\n else\n format.html { render :edit }\n format.json { render json: @address.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @ag_address.update(ag_address_params)\n format.html { redirect_to @ag_address, notice: 'Address was successfully updated.' }\n format.json { render :show, status: :ok, location: @ag_address }\n else\n format.html { render :edit }\n format.json { render json: @ag_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(address, new_address, options={})\n params = {:address => new_address}\n Mailgun.submit :put, list_url(address), params.merge(options)\n end", "def update options={}\n client.put(\"/#{id}\", options)\n end", "def update\n resource_path = \"/projects/#{project_id}/people/#{id}\"\n Request.put(resource_path, self.to_xml('person'))\n end", "def update\n respond_to do |format|\n if @address.update(address_params)\n format.html { redirect_to root_path, notice: 'Address was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end", "def update\n @user_address = UserAddress.find(params[:id])\n\n respond_to do |format|\n if @user_address.update_attributes(params[:user_address])\n format.html { redirect_to @user_address, notice: 'User address was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @technocal_client_address = TechnocalClientAddress.find(params[:id])\n\n respond_to do |format|\n if @technocal_client_address.update_attributes(params[:technocal_client_address])\n format.html { redirect_to([:admin, @technocal_client_address], :notice => 'TechnocalClientAddress atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @technocal_client_address.errors, :status => :unprocessable_entity }\n end\n end\n end", "def put(*args)\n request :put, *args\n end", "def update\n @addresstype = Addresstype.find(params[:id])\n\n respond_to do |format|\n if @addresstype.update_attributes(params[:addresstype])\n format.html { redirect_to @addresstype, notice: 'Addresstype was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @addresstype.errors, status: :unprocessable_entity }\n end\n end\n end", "def test_should_update_invite_via_API_XML\r\n get \"/logout\"\r\n put \"/invites/1.xml\", :invite => {:message => 'API Invite 1',\r\n :accepted => false,\r\n :email => '[email protected]',\r\n :user_id => 1 }\r\n assert_response 401\r\n end", "def update\n @address = Address.find(params[:id])\n\n respond_to do |format|\n if @address.update_attributes(params[:test])\n format.html { render :partial => 'addresses/show', notice: 'Address was successfully updated.' }\n else\n format.html { render :partial => 'addresses/edit' }\n end\n end\n end", "def update\n respond_to do |format|\n if @address_book.update(address_book_params)\n format.html { redirect_to @address_book, notice: 'Address book was successfully updated.' }\n format.json { render :show, status: :ok, location: @address_book }\n else\n format.html { render :edit }\n format.json { render json: @address_book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @address_book.update(address_book_params)\n format.html { redirect_to @address_book, notice: 'Address book was successfully updated.' }\n format.json { render :show, status: :ok, location: @address_book }\n else\n format.html { render :edit }\n format.json { render json: @address_book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @address.update(address_params)\n format.html { redirect_to edit_company_path(@company), notice: 'Address was successfully updated.' }\n format.json { render :show, status: :ok, location: @address }\n else\n format.html { render :edit }\n format.json { render json: @address.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize @address\n\n respond_to do |format|\n if @address.update(@pars)\n flash[:success] = \"Address was successfully updated. #{@pars.inspect}\"\n format.html { redirect_to addresses_path }\n format.json { render json: {locale: I18n.locale,\n user_id: @user_id,\n recyclable: @address.recyclable} }\n else\n flash[:danger] = \"There was a problem updating the address.\"\n format.html { render action: 'edit' }\n format.json { render json: @address.errors,\n status: :unprocessable_entity }\n end\n end\n end", "def update\n @taddress = Taddress.find(params[:id])\n \n respond_to do |format|\n if @taddress.update_attributes(params[:taddress])\n format.html { redirect_to @taddress, notice: 'Taddress was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @taddress.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_deposit_address\n service_response = ClientManagement::UpdateDepositAddress.new(params).perform\n render_api_response(service_response)\n end", "def update\n respond_to do |format|\n if @addresses_person.update(addresses_person_params)\n format.html { redirect_to @addresses_person, notice: 'Addresses person was successfully updated.' }\n format.json { render :show, status: :ok, location: @addresses_person }\n else\n format.html { render :edit }\n format.json { render json: @addresses_person.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_xml\n self.xml= dumpRouteAsXml\n self.save\n end", "def update\n respond_to do |format|\n if @address.update(address_params)\n format.html { redirect_to @address, notice: 'Form was updated successfully!' }\n format.json { render :show, status: :ok, location: @address }\n else\n format.html { render :edit }\n format.json { render json: @address.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(entity)\n return unless entity\n return unless entity.id\n\n address = Core::Dal::Address.find(entity.id)\n return unless address\n\n address.update(entity.to_json)\n address.save!\n entity.id\n end", "def update\n respond_to do |format|\n if @advertiser.update(advertiser_params)\n @advertiser.address.update(address_params)\n format.html { redirect_to @advertiser, notice: 'Advertiser was successfully updated.' }\n format.json { render :show, status: :ok, location: @advertiser }\n else\n format.html { render :edit }\n format.json { render json: @advertiser.errors, status: :unprocessable_entity }\n end\n end\n end", "def put_update(options = {})\n options[:id] ||= @phone.id\n options[:phone] ||= @attributes\n\n # options[:email][@email.id.to_s] = @attributes\n put :update,options\n end", "def update\n respond_to do |format|\n if @client_address.update(client_address_params)\n format.html { redirect_to @client_address, notice: 'Client address was successfully updated.' }\n format.json { render :show, status: :ok, location: @client_address }\n else\n format.html { render :edit }\n format.json { render json: @client_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end", "def put(path, options={})\n request :put, path, options\n end", "def put!\n request! :put\n end", "def update\n respond_to do |format|\n if @electronic_address.update(electronic_address_params)\n format.html { redirect_to @electronic_address, notice: 'Electronic address was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @electronic_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @person_address.update(person_address_params)\n format.html { redirect_to @person_address, notice: 'Person address was successfully updated.' }\n format.json { render :show, status: :ok, location: @person_address }\n else\n format.html { render :edit }\n format.json { render json: @person_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @address_book_item = AddressBookItem.find(params[:id])\n\n respond_to do |format|\n if @address_book_item.update_attributes(params[:address_book_item])\n format.html { redirect_to(@address_book_item, :notice => 'AddressBookItem was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @address_book_item.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update(id, params)\n wrapped_params = { address: params }\n\n @client.make_request(:put, \"end_shippers/#{id}\", MODEL_CLASS, wrapped_params)\n end", "def update\n respond_to do |format|\n if @ip_address.update(ip_address_params)\n format.html { redirect_to ip_addresses_path, notice: 'Ip address was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ip_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n begin\n ActiveRecord::Base.transaction do\n @client.update!(client_params)\n @client.address.update!(address_params)\n end\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n rescue\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @address = Address.find(params[:id])\n\n respond_to do |format|\n if @address.update_attributes(params[:address])\n flash[:notice] = 'Address was successfully updated.'\n #format.html { redirect_to admin_user_path(@address.user_id) } if authorized?\n format.html { redirect_to( :action=>'show', :id=>@address.id ) } # here we're editing from the user profile; add a conditional for editing from payment process\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @address.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @sales_address.update(sales_address_params)\n format.html { redirect_to sales_seller_address_path(@sales_seller, @sales_address), notice: \"Endereço atualizado com sucesso!\" }\n format.json { render :show, status: :ok, location: @sales_address }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @sales_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def _update(type, current_name, metadata={})\n type = type.to_s.camelize\n request :update do |soap|\n soap.body = {\n :metadata => {\n :current_name => current_name,\n :metadata => prepare(metadata),\n :attributes! => { :metadata => { 'xsi:type' => \"ins0:#{type}\" } }\n }\n }\n end\n end", "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end", "def update\n @address_customer = AddressCustomer.find(params[:id])\n\n respond_to do |format|\n if @address_customer.update_attributes(params[:address_customer])\n format.html { redirect_to @address_customer, notice: 'Address customer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @address_customer.errors, status: :unprocessable_entity }\n end\n end\n end", "def put(*args)\n request(:put, *args)\n end", "def update\n respond_to do |format|\n if @account_address.update(account_address_params)\n format.html { redirect_to @account_address, notice: 'Account address was successfully updated.' }\n format.json { render :show, status: :ok, location: @account_address }\n else\n format.html { render :edit }\n format.json { render json: @account_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_address\n @address = Address.find(params[:id])\n end", "def set_address\n @address = Address.find(params[:id])\n end", "def set_address\n @address = Address.find(params[:id])\n end", "def set_address\n @address = Address.find(params[:id])\n end", "def set_address\n @address = Address.find params[:id]\n end", "def set_address\n @address = Address.find params[:id]\n end", "def put endpoint, data\n do_request :put, endpoint, data\n end", "def update_address_book(address_book_id, prop_patch)\n end", "def update!(**args)\n @address = args[:address] if args.key?(:address)\n end", "def update\n respond_to do |format|\n if @customer_address.update(customer_address_params)\n format.html { redirect_to @customer_address, notice: 'Customer address was successfully updated.' }\n format.json { render :show, status: :ok, location: @customer_address }\n else\n format.html { render :edit }\n format.json { render json: @customer_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def test_should_update_link_via_API_XML\r\n get \"/logout\"\r\n put \"/links/1.xml\", :link => {:user_id => 1,\r\n :title => 'API Link 1',\r\n :url => 'http://www.api.com'}\r\n assert_response 401\r\n end", "def update\n respond_to do |format|\n if @user_address.update(user_address_params)\n format.html { redirect_to @user_address, notice: \"User address was successfully updated.\" }\n format.json { render :show, status: :ok, location: @user_address }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @user_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @ripple_address.update(ripple_address_params)\n format.html { redirect_to @ripple_address, notice: 'Ripple address was successfully updated.' }\n format.json { render :show, status: :ok, location: @ripple_address }\n else\n format.html { render :edit }\n format.json { render json: @ripple_address.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n put :update\n end", "def set_address\n @address = Address.find(params[:id])\n end", "def set_address\n @address = Address.find(params[:id])\n end", "def set_address\n @address = Address.find(params[:id])\n end", "def set_address\n @address = Address.find(params[:id])\n end", "def set_address\n @address = Address.find(params[:id])\n end", "def set_address\n @address = Address.find(params[:id])\n end", "def set_address\n @address = Address.find(params[:id])\n end", "def set_address\n @address = Address.find(params[:id])\n end", "def set_address\n @address = Address.find(params[:id])\n end", "def set_address\n @address = Address.find(params[:id])\n end", "def set_address\n @address = Address.find(params[:id])\n end", "def set_address\n @address = Address.find(params[:id])\n end", "def put(path, params={})\n RestClient.put request_base+path, params\n end", "def update\n @adress = Adresse.find(params[:id])\n \n respond_to do |format|\n if @adress.update_attributes(params[:adresse])\n format.html { redirect_to @adress, notice: 'Adresse was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @adress.errors, status: :unprocessable_entity }\n end\n end\n end", "def edit_address(edited_address)\n address = Address.find(edited_address.uid)\n address.attributes = edited_address.attributes\n address.save!\n end", "def update\n respond_to do |format|\n if @address_detail.update(address_detail_params)\n format.html { redirect_to @address_detail, notice: 'Address detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @address_detail }\n else\n format.html { render :edit }\n format.json { render json: @address_detail.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.66847277", "0.65563285", "0.6184888", "0.61655885", "0.6144139", "0.6102229", "0.59433633", "0.59377646", "0.59377646", "0.59377646", "0.59377646", "0.5936607", "0.5897686", "0.5852343", "0.5824345", "0.58183295", "0.5799043", "0.5787573", "0.5755386", "0.5739251", "0.5735645", "0.571483", "0.57069165", "0.5701062", "0.5665682", "0.5662598", "0.56606245", "0.5649846", "0.5624283", "0.55812377", "0.5578099", "0.55731755", "0.5568291", "0.5567691", "0.5539262", "0.5538807", "0.553273", "0.55219316", "0.55099463", "0.5486267", "0.5485889", "0.5472677", "0.5472677", "0.54601336", "0.5454112", "0.54429036", "0.54424435", "0.5432264", "0.5428703", "0.54229236", "0.5403242", "0.54004484", "0.5398025", "0.5396102", "0.53893274", "0.5376679", "0.53733045", "0.5361663", "0.53602016", "0.5350612", "0.5346107", "0.53241867", "0.532022", "0.5307277", "0.5301007", "0.5287985", "0.5281685", "0.52798563", "0.52750134", "0.5273131", "0.5271669", "0.5271669", "0.5271669", "0.5271669", "0.5257362", "0.5257362", "0.5255489", "0.52534866", "0.52520955", "0.5251715", "0.5244639", "0.5239022", "0.5234359", "0.52338594", "0.523165", "0.5225224", "0.5225224", "0.5225224", "0.5225224", "0.5225224", "0.5225224", "0.5225224", "0.5225224", "0.5225224", "0.5225224", "0.5225224", "0.5225224", "0.52227265", "0.5219393", "0.5211912", "0.52076876" ]
0.0
-1
DELETE /addresses/1 DELETE /addresses/1.xml
def destroy @address.destroy render :nothing => true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @address = Address.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to(:action=>'index') }\n format.xml { head :ok }\n end\n end", "def destroy\n # @address = Address.find(params[:id])\n @address = Address.find_by_permalink!(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to(addresses_url) }\n format.xml { head :ok }\n end\n end", "def delete_address(id)\n delete(\"addresses/#{id}\")\n end", "def delete\n @addresses = Address.where(person_id: params[:id])\n @addresses.each do |c|\n Address.find(c.id).destroy\n end\n Person.find(params[:id]).destroy\n redirect_to :action => 'list'\n end", "def destroy\n @ip_addr = IpAddr.find(params[:id])\n @ip_addr.destroy\n\n respond_to do |format|\n format.html { redirect_to(ip_addrs_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @user_address = UserAddress.find(params[:id])\n @user_address.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_addresses_url) }\n format.xml { head :ok }\n end\n end", "def delete\n @address = Address.find(params[:address_id])\n end", "def destroy\n @addresses = Address.paginate(:page => params[:page], :per_page => 5).order('updated_at DESC')\n @address = Address.find(params[:id])\n @error = nil\n\n begin\n @address.destroy\n rescue ActiveRecord::DeleteRestrictionError => e\n @error = e.message\n end\n end", "def delete(address)\n \tMailgun.submit :delete, list_url(address)\n end", "def destroy\n @address = Address.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to addresses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @address = Address.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to addresses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @address = Address.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to addresses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @address = Address.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to addresses_url }\n format.json { head :no_content }\n end\n end", "def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end", "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end", "def destroy\n @technocal_client_address = TechnocalClientAddress.find(params[:id])\n @technocal_client_address.destroy\n\n respond_to do |format|\n format.html { redirect_to(technocal_client_addresses_url) }\n format.xml { head :ok }\n end\n end", "def delete_data(index_name)\n uri = @client.make_uri(\"/#{index_name}/update/\")\n req = HTTP::Post.new(uri)\n req.content_type = 'text/xml'\n req.body = '<delete><query>*:*</query></delete>'\n response = @client.send_http(req, true, ['200'])\n end", "def destroy\n @customers_address = CustomersAddress.find(params[:id])\n @customers_address.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_addresses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @address = current_user.addresses.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to user_addresses_path(current_user) }\n format.json { head :no_content }\n end\n end", "def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Address was successfully destroyed.' }\n end\n end", "def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end", "def destroy\n @address_book = AddressBook.find(params[:id])\n @address_book.destroy\n flash[:notice] = :address_book_deleted.l\n\n respond_to do |format|\n format.html { redirect_to(address_books_url) }\n format.xml { head :ok }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def delete_address(address)\n address.delete!\n end", "def destroy\n @address_type = AddressType.find(params[:id])\n @address_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(address_types_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to addresses_url, notice: 'Address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to addresses_url, notice: \"Address was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to addresses_url, notice: \"Address was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def delete_elasticsearch_addressbase_data\n uri = URI.parse(\"#{$ELASTIC_SEARCH_ENDPOINT}/\")\n conn = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Delete.new \"#{$ELASTICSEARCH_ADDRESSBASE}\"\n request['Content-Type'] = 'application/json'\n conn.request(request)\nend", "def destroy\n @ag_address.destroy\n respond_to do |format|\n format.html { redirect_to ag_addresses_url, notice: 'Address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def deleteEntityInvoice_address( entity_id)\n params = Hash.new\n params['entity_id'] = entity_id\n return doCurl(\"delete\",\"/entity/invoice_address\",params)\n end", "def delete_address\n @mailing_list_address.destroy if @ok\n render 'update_addresses'\n end", "def destroy\n @address_range = AddressRange.find(params[:id])\n @address_range.destroy\n\n respond_to do |format|\n format.html { redirect_to(address_ranges_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to admin_path(current_user), notice: 'Address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @address_book_item = AddressBookItem.find(params[:id])\n @address_book_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(address_book_items_url) }\n format.xml { head :ok }\n end\n end", "def delete(type, id)\n http_delete @target, \"#{type_info(type, :path)}/#{Addressable::URI.encode(id)}\", @auth_header, @zone\n end", "def destroy\n @address = Address.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { render :partial => 'addresses/list' }\n end\n end", "def delete(contactname)\n\n end", "def destroy\n @user_address = UserAddress.find(params[:id])\n @user_address.destroy\n\n respond_to do |format|\n format.html { redirect_to user_addresses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @post_address.destroy\n respond_to do |format|\n format.html { redirect_to post_addresses_url }\n format.json { head :no_content }\n end\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def delete\n request(:delete)\n end", "def destroy\n\t\t@address = Address.find(params[:id])\n\t\[email protected] do |c|\n\t\t\tc.destroy\n\t\tend\n\t\tredirect_to address_url(@address)\n\tend", "def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end", "def delete\n execute_request('DELETE') do |uri, headers|\n HTTP.http_client.delete(uri, header: headers)\n end\n end", "def delete(options={})\n connection.delete(\"/\", @name)\n end", "def delete(id:)\n id_check(:id, id)\n\n cf_delete(path: \"#{uri_prefix}/virtual_dns/#{id}\")\n end", "def destroy\n @taddress = Taddress.find(params[:id])\n @taddress.destroy\n \n respond_to do |format|\n format.html { redirect_to taddresses_url }\n format.json { head :ok }\n end\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def destroy\n @address = current_user.addresses.find(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to addresses_url }\n format.json { head :no_content }\n format.js { render :js => \"$(this).parent().parent().remove(); this.preventDefault();\" } \n end\n end", "def destroy\n @address_record.destroy\n respond_to do |format|\n format.html { redirect_to address_records_url, notice: 'Address record was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to addresses_url, notice: 'Form was deleted successfully!' }\n format.json { head :no_content }\n end\n end", "def delete_address_book(address_book_id)\n end", "def destroy\n @adress = Adresse.find(params[:id])\n @adress.destroy\n\n respond_to do |format|\n format.html { redirect_to adresses_url }\n format.json { head :no_content }\n end\n end", "def delete_address_list(id)\n delete(\"addressGroups/#{id}\")\n end", "def delete(id)\n request = Net::HTTP::Delete.new(\"#{@url}/#{id}.xml\")\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end", "def _delete(type, *args)\n type = type.to_s.camelize\n metadata = args.map { |full_name| {:full_name => full_name} }\n request :delete do |soap|\n soap.body = {\n :metadata => metadata\n }.merge(attributes!(type))\n end\n end", "def destroy\n @address_customer = AddressCustomer.find(params[:id])\n @address_customer.destroy\n\n respond_to do |format|\n format.html { redirect_to address_customers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ip_address.destroy\n respond_to do |format|\n format.html { redirect_to ip_addresses_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @client_address.destroy\n respond_to do |format|\n format.html { redirect_to client_addresses_url, notice: 'Client address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n start { |connection| connection.request http :Delete }\n end", "def destroy\n @config_xml = ConfigXml.find(params[:id])\n @config_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(config_xmls_url) }\n format.xml { head :ok }\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\n end", "def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to url_back, notice: 'Address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete!\n PoolNode.rmdir(@id)\n super\n Address.delete(@id)\n Subnet.delete(@subnet)\n end", "def destroy\n @electronic_address.destroy\n respond_to do |format|\n format.html { redirect_to electronic_addresses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ripple_address.destroy\n respond_to do |format|\n format.html { redirect_to ripple_addresses_url, notice: 'Ripple address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_by_id id, opts = {}\n update opts.merge(:data => xml.delete_by_id(id))\n end", "def delete(path)\n request(:delete, path)\n end", "def delete(id)\n results = connection.exec_params('DELETE FROM contacts WHERE id=$1;', [id]) \n end", "def destroy\n @person_address.destroy\n respond_to do |format|\n format.html { redirect_to person_addresses_url, notice: 'Person address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @node_config = NodeConfig.destroy(params[:id])\n xml=@node_config.to_xml\n json=@node_config.to_json\n @node_config.destroy\n\n respond_to do |format|\n format.html { redirect_to(node_configs_url) }\n format.json { render :json => json}\n format.xml { render :xml => xml}\n end\n end", "def destroy\n @billing_address = BillingAddress.find(params[:id])\n @billing_address.destroy\n\n respond_to do |format|\n format.html { redirect_to billing_addresses_url }\n format.json { head :no_content }\n end\n end", "def delete_address(name,region)\n data = false\n conn = @ec2_main.environment.connection\n if conn != nil\n response = conn.delete_address(name,region)\n if response.status == 200\n data = response.body\n else\n data = {}\n end\n else\n raise \"Connection Error\"\n end\n return data\n end", "def destroy\n @address.destroy\n respond_to do |format|\n format.html { redirect_to edit_company_path(@company), notice: 'Address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer_address.destroy\n respond_to do |format|\n format.html { redirect_to customer_addresses_url, notice: 'Customer address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account_address.destroy\n respond_to do |format|\n format.html { redirect_to account_addresses_url, notice: 'Account address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @contributor_address = ContributorAddress.find(params[:id])\n @contributor_address.destroy\n\n respond_to do |format|\n format.html { redirect_to contributor_addresses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @delivery_address = DeliveryAddress.find(params[:id])\n @delivery_address.destroy\n\n respond_to do |format|\n format.html { redirect_to delivery_addresses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @addresses_person.destroy\n respond_to do |format|\n format.html { redirect_to addresses_people_url, notice: 'Addresses person was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_address.destroy\n respond_to do |format|\n format.html { redirect_to user_addresses_path, notice: 'User address was successfully destroyed.' }\n end\n end", "def delete\n @carddav_backend.delete_address_book(@address_book_info['id'])\n end", "def delete\n Iterable.request(conf, base_path).delete\n end", "def delete endpoint\n do_request :delete, endpoint\n end", "def destroy\n @sales_address.destroy\n respond_to do |format|\n format.html { redirect_to sales_seller_addresses_path(@sales_seller), notice: \"Endereço removido com sucesso!\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @emailcontact = Emailcontact.find(params[:id])\n @emailcontact.destroy\n\n respond_to do |format|\n format.html { redirect_to(emailcontacts_url) }\n format.xml { head :ok }\n end\n end", "def delete(*uris); end", "def deletes_to(path,opts={},&block) #:nodoc: \n crud_to(:delete,path,opts[:params] || {},opts,&block)\n end", "def destroy\n name, type = resource[:name].split('/')\n case type\n when 'MX'\n @dnsres.each do |res|\n preference = res.preference\n target = res.to_rdata\n nsupdate(\"server #{server}\n update delete #{name} MX #{preference} #{target}.\n send\")\n end\n when 'SRV'\n @dnsres.each do |res|\n priority = res.priority\n weight = res.weight\n port = res.port\n target = res.to_rdata\n nsupdate(\"server #{server}\n update delete #{name} SRV #{priority} #{weight} #{port} #{target}\n send\")\n end\n else\n rdata = @dnsres.to_rdata\n nsupdate(\"server #{server}\n update delete #{name} #{type} #{rdata}\n send\")\n end\n end", "def delete(name)\n request(uri = uri(name), Net::HTTP::Delete.new(uri.request_uri))\n end", "def destroy\n @adress.destroy\n respond_to do |format|\n format.html { redirect_to adresses_url, notice: 'Adress was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @absence_request = AbsenceRequest.find(params[:id])\n @absence_request.destroy\n\n respond_to do |format|\n format.html { redirect_to(absence_requests_url) }\n format.xml { head :ok }\n end\n end", "def delete(path)\n request 'DELETE', path\n end", "def destroy\n @address_book.destroy\n respond_to do |format|\n format.html { redirect_to address_books_url, notice: '删除完成!Address book destroyed!' }\n format.json { head :no_content }\n end\n end", "def delete(path, params = {})\n debug_log \"DELETE #{@host}#{path} params:#{params}\"\n res = connection.delete path, params\n debug_log \"Response status:#{res.status}, body:#{res.body}\"\n res\n end", "def destroy\n @address_book.destroy\n respond_to do |format|\n format.html { redirect_to address_books_url, notice: 'Address book was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @address_book.destroy\n respond_to do |format|\n format.html { redirect_to address_books_url, notice: 'Address book was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @service_request = ServiceRequest.find(params[:id])\n @service_request.destroy\n\n respond_to do |format|\n format.html { redirect_to(service_requests_url) }\n format.xml { head :ok }\n end\n end", "def delete(splat)\n bad_request if splat.empty?\n _delete resolve_uri(splat[0])\n end", "def destroy\n @address_detail.destroy\n respond_to do |format|\n format.html { redirect_to address_details_url, notice: 'Address detail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @browsenodeid = Browsenodeid.find(params[:id])\n @browsenodeid.destroy\n\n respond_to do |format|\n format.html { redirect_to(browsenodeids_url) }\n format.xml { head :ok }\n end\n end" ]
[ "0.69786114", "0.6934582", "0.68614566", "0.68110317", "0.6797546", "0.67844826", "0.66834015", "0.6653049", "0.6608906", "0.6578678", "0.6578678", "0.6578678", "0.6578678", "0.6558031", "0.65317494", "0.6476804", "0.6476491", "0.64417404", "0.640167", "0.63981533", "0.6394291", "0.6387539", "0.6370871", "0.6368928", "0.6360888", "0.6351435", "0.6350119", "0.6350119", "0.6339723", "0.6327035", "0.63104045", "0.6298108", "0.6269928", "0.62588835", "0.625011", "0.62497824", "0.6244701", "0.6244249", "0.623885", "0.62245417", "0.6201587", "0.61867696", "0.6185161", "0.61705947", "0.6157929", "0.61500573", "0.6141633", "0.6125323", "0.61157435", "0.61136913", "0.61100364", "0.610916", "0.6106801", "0.6094177", "0.6088664", "0.6085599", "0.60846716", "0.6084183", "0.6081825", "0.6078551", "0.60771006", "0.6076278", "0.60725266", "0.6071889", "0.6057558", "0.605544", "0.60504204", "0.6042108", "0.6031511", "0.60295105", "0.60283303", "0.60186917", "0.60083646", "0.6003831", "0.60028183", "0.59988225", "0.5988307", "0.59841996", "0.59830296", "0.59816206", "0.5975082", "0.5973978", "0.5972287", "0.5971564", "0.59649473", "0.5964449", "0.5962319", "0.59551656", "0.59537625", "0.59408236", "0.5939234", "0.5932171", "0.59303015", "0.59292597", "0.59243184", "0.59243184", "0.59221977", "0.59203124", "0.5915099", "0.5914453" ]
0.624746
36
Use callbacks to share common setup or constraints between actions.
def set_item @item = Item.find(params[:item_id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def set_actions\n actions :all\n end", "def define_action_helpers?; end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def workflow\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def setup\n # override and do something appropriate\n end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def save_action; end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def setup(&blk)\n @setup_block = blk\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def callback_phase\n super\n end", "def advice\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def duas1(action)\n action.call\n action.call\nend", "def _handle_action_missing(*args); end" ]
[ "0.6164095", "0.6046031", "0.5945298", "0.59179014", "0.58890367", "0.58341795", "0.5776118", "0.5700777", "0.5700777", "0.5656277", "0.56218207", "0.5423995", "0.5411516", "0.5411516", "0.5411516", "0.5395004", "0.53783494", "0.53593004", "0.53412604", "0.534078", "0.5332865", "0.53135896", "0.52999926", "0.5297309", "0.5296569", "0.5261449", "0.5247048", "0.52376497", "0.52376497", "0.52376497", "0.52376497", "0.52376497", "0.52323204", "0.52310973", "0.523081", "0.5225785", "0.5219039", "0.52136266", "0.5208033", "0.520763", "0.5177365", "0.5175224", "0.5173357", "0.5166104", "0.5162502", "0.51573396", "0.5154547", "0.5153531", "0.51502854", "0.51436496", "0.5142863", "0.51330835", "0.5115634", "0.5115634", "0.511527", "0.5109693", "0.51076853", "0.5093146", "0.5090683", "0.50829846", "0.50819314", "0.50670373", "0.5055505", "0.5053398", "0.50504035", "0.50504035", "0.5037765", "0.5027292", "0.5024484", "0.50150335", "0.5014069", "0.50022113", "0.5001542", "0.49981874", "0.49915564", "0.49915564", "0.49880967", "0.4982312", "0.49787375", "0.49786067", "0.49687737", "0.49676532", "0.49602765", "0.49565676", "0.49550772", "0.495342", "0.49522525", "0.49463704", "0.49447197", "0.49362713", "0.49328062", "0.49280638", "0.49272856", "0.4927058", "0.49221697", "0.4919526", "0.49185994", "0.49184805", "0.49170163", "0.49168405", "0.49167764" ]
0.0
-1
Check if the owner of the item.
def check_buyable raise PermissionDeniedError, "出品したアイテムはサポートできません" if @item.owner?(current_user) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_owner?(item)\n current_user_id == item.user_id\n end", "def item_owner?\n unless user_signed_in? && !current_user.items.find_by(id: params[:id]).nil?\n flash.alert = \"You are not authorized to access that!\"\n redirect_to root_path\n end\n end", "def owner?(user)\n user == owner || owners.include?(user)\n end", "def is_owner_of?(thing)\n return false unless thing.user == self\n true\n end", "def is_owner?(user)\n !user.nil? && (self.user_id == user.id)\n end", "def is_owner?\n Account.current ? Account.current.has_owner?(self) : false\n end", "def owner? (user)\n user == owner\n end", "def is_owner?(user)\n user.id == self.user_id\n end", "def is_owner?(pid, oid)\n oid.owner == get_object(pid).owner\n end", "def file_owned?(file, item)\n file.owner_item_type == item.class.name && file.owner_item_id == item.id\n end", "def owned_by?(u)\n self.user == u\n end", "def is_owner\n object == current_user\n end", "def owner?\n resource.user_id == current_user.id\n end", "def owned?\n user.present?\n end", "def owned?\n !owner.nil?\n end", "def item_owner(item)\n User.find(item.user_id)\n end", "def owner?(user)\n\t\tuser.id == self.user.id\n\tend", "def is_owner?(this_user)\n user == this_user\n end", "def owner?(key = :user_id)\n # Lookup the original user_id\n owner_id = was(key) || send(:\"_#{key}\")\n !owner_id.nil? && owner_id == Volt.current_user_id\n end", "def has_owner(user)\n return self.user.id==user.id\n end", "def owner?(photo)\n !photo.nil? && photo.owner == current_user\n end", "def current_user_owns?(item)\n \t!item.nil? && current_user.is_a?(User) && (item.is_a?(User) ? current_user == item : current_user.is_author_of?(item)) \n end", "def owner?(c_utor)\n contribution.owner?(c_utor)\n end", "def owned_by?(actor)\n # defaults to false. Override if resource has owner\n false\n end", "def owner?\n name == 'owner'\n end", "def owner? usr\n user_id == usr.id\n end", "def owner?(id)\n if current_user.id == id\n return true\n else\n return false\n end\n end", "def owner?(mem)\n return false if not mem\n mem.lifes._ids.include?(data.owner_id)\n end", "def owner?(current_user)\n user == current_user\n end", "def has_owner? user\n self.account_users.where(user: user, is_owner: true).count > 0\n end", "def owned_by?(user)\n if (access_restricted?)\n return self.acl.owner?(user)\n end\n return false\n end", "def owner_set?\n return false if current_owner_name.nil?\n\n !current_owner_name.empty?\n end", "def article_owner?(obj)\n\t\t\tcurrent_user.id == obj.user_id\n\t\tend", "def is_owner?(username)\n User.get_user(username).eql?(self.owner)\n end", "def owned_by?(current_user)\n current_user && user_id == current_user.id\n end", "def is_owner? (opportunity)\n \topportunity.user_id == self.id\n end", "def owner?(resource:)\n current_user.present? && resource&.user_id == current_user.id\n end", "def item_owner\n self\n end", "def user_owner_entry?\n user_entry? && principle == \"OWNER\"\n end", "def owned?(user_to_check = current_user)\n user_to_check ? self.creator == user_to_check : false\n end", "def has_owner_id(owner_id)\n content.owner_id == owner_id\n end", "def owner?\n record.id == user.id\n end", "def owned_by?(user)\n return false unless user.is_a? User\n \n # allow admins and project owners to edit\n user.admin? or self.owner == user\n end", "def owned_by?(user)\n return false unless user.is_a? User\n \n # allow admins and project owners to edit\n user.admin? or self.owner == user\n end", "def hasOwner? \n\t\tunless self.author_id.nil? || self.author_id == 0\n\t\t\tUser.find(self.author_id)\n\t\tend\n\n\tend", "def object_owner?\n User.find(params[:user_id]) == current_user\n end", "def user_is_owner?\n current_cookbook.is_owner?(current_user)\n end", "def is_owned_by_user?(user)\n self.user == user\n end", "def owned_by? a_user\n a_user == user\n end", "def is_owner?(object, no_admin = false)\n if current_user && current_user.id === object.user.id && (object.user.is_admin? || !no_admin)\n return true\n elsif is_admin? && !no_admin\n return true\n else\n return false\n end\n rescue\n return false\n end", "def is_owned_by?(member = nil)\n return false if member.blank?\n if self.designer == member or self.client == member\n true\n else\n member.is_super_user? ? true : false\n end\n rescue\n false\n end", "def item_owner\n items.first.owner\n end", "def check_owner_user\n @guild = Guild.find(@invite[:guild_id])\n if self.admin?\n return 1\n end\n return (@guild[:owner_id] == session[:user_id]) ? 1 : nil\n end", "def owner?(post_owner) # <= User object\n current_user == post_owner\n end", "def is_owned_by?(user_id)\n self.user_id == user_id\n end", "def owns?(object); object.owners.include?(self) end", "def owner?\n customer.owner_id == id\n end", "def appctrl_ensure_is_owner\n model = controller_name.camelize.singularize.constantize # :-)\n @item = model.find( params[ :id ] )\n\n if ( @item.user_id != current_user.id )\n render_optional_error_file( 401 ) unless current_user.is_admin?\n end\n end", "def object_owner_for_resource?(object)\n object.user == current_user\n end", "def item_usable?\n return false unless @item\n return @actor ? @actor.usable?(@item) : $game_player.usable?(@item)\n end", "def owner?(user_asking)\n user_asking.in? company.owners\n end", "def owner_of(resource)\n id == resource.user_id ? true : false\n end", "def owned?\n @owner == caller\n end", "def owner?(current_user)\n current_user && (self.user == current_user || current_user.has_role?(:refinery))\n end", "def owner_of_dog?\n dog_has_owner? && current_user ? dog_owner.id == current_user.id : false\n end", "def is_owner?(person)\n return person !=nil && person.team_id == self.id && person.role == \"captain\"\n end", "def game_owner?\n self == game.owner if game.winner.nil?\n end", "def owned_by?(peer_id)\n if peer_id == local_owner_id\n self_owned?\n else\n owners.include?(peer_id)\n end\n end", "def private?\n return (self.owner_id != 0)\n end", "def is_resource_owner?(resource)\n current_user && current_user.id == resource.user_id\n end", "def is_author_of?(item)\n if item.respond_to?(:user)\n self == item.user\n elsif item.respond_to?(:pseud)\n self.pseuds.include?(item.pseud)\n elsif item.respond_to?(:pseuds)\n !(self.pseuds & item.pseuds).empty? \n else\n false\n end\n end", "def check_is_guild_owner\n @guild = Guild.find(User.find(session[:user_id])[:guild_id])\n return (@guild[:owner_id] == session[:user_id]) ? 1 : nil\n end", "def owner?(project)\n if id == project.user.id\n true\n else\n false\n end\n end", "def i_dont_own?(object)\n if(current_user.present? and object.user.present? and object.user.id.present? and (current_user.id == object.user.id))\n false\n else\n true\n end\n end", "def owned?\n !!if owner_ident == (lock_full_ident = @locked_owner_id)\n redis_pool.mget(*@ns_names).all? {|v| v == lock_full_ident}\n end\n end", "def concrete?\n owner_id.nil?\n end", "def owning?(owned)\r\n master_song_relationships.find_by_owned_id(owned)\r\n end", "def owner? obj, relation=nil\n if relation \n return true if user_relation?(obj, relation)\n end \n [:user, :owner, :author].each do |relation| \n return true if user_relation?(obj, relation)\n end\n false\n end", "def check_resource_ownership\n if admin_user.is_not_root?\n\n condition_typus_users = @item.respond_to?(Typus.relationship) && [email protected](Typus.relationship).include?(admin_user)\n condition_typus_user_id = @item.respond_to?(Typus.user_foreign_key) && !admin_user.owns?(@item)\n\n not_allowed if (condition_typus_users || condition_typus_user_id)\n end\n end", "def is_owner?(xaccount:)\n # DRAFT and creator means owner\n return true if publication.is_draft? && publication.current_version.is_creator?(xaccount: xaccount)\n\n # Author means owner\n return true if publication.current_version.is_author?(xaccount: xaccount)\n\n # All others are not owners\n false\n end", "def is_owner?(account)\n attachable == account.profile\n end", "def editable_by?(user)\n \tuser && user == owner\n\tend", "def check_owner\n return if params[:id].blank? or @login_user.nil?\n\n begin\n owner_id = Location.find(params[:id]).user_id\n rescue\n owner_id = -1\n end\n if !@login_user.admin?(User::AUTH_LOCATION) and owner_id != @login_user.id\n Log.add_check(request, '[check_owner]'+request.to_s)\n\n flash[:notice] = t('msg.need_to_be_owner')\n redirect_to(:controller => 'desktop', :action => 'show')\n end\n end", "def is_author_of?(item)\n if item.respond_to?(:user)\n self == item.user\n elsif item.respond_to?(:pseud)\n self.pseuds.include?(item.pseud)\n elsif item.respond_to?(:pseuds)\n !(self.pseuds & item.pseuds).empty?\n elsif item.respond_to?(:author)\n self == item.author\n else\n false\n end\n end", "def validateOwner(dest_cell, owner)\n piece = @cells[dest_cell[0]][dest_cell[1]].getPiece()\n if piece != nil\n return piece.isOwner(owner)\n end\n return false\n end", "def locked?\n !!@owner\n end", "def owner?\n self.role_level == 0 ? true : false\n end", "def user_is_guild_owner?\n @guild = Guild.find(User.find(session[:user_id])[:guild_id])\n return (@guild[:owner_id] == session[:user_id]) ? true : false\n end", "def editable_by?(user)\n\t \t# user && user == owner\n\t user == user\n \tend", "def check_owner\n\n return if params[:id].blank? \\\n or (params[:id] == TreeElement::ROOT_ID.to_s) \\\n or @login_user.nil?\n\n begin\n owner_id = MailFolder.find(params[:id]).user_id\n rescue\n owner_id = -1\n end\n if !@login_user.admin?(User::AUTH_MAIL) and owner_id != @login_user.id\n Log.add_check(request, '[check_owner]'+request.to_s)\n\n flash[:notice] = t('msg.need_to_be_owner')\n redirect_to(:controller => 'desktop', :action => 'show')\n end\n end", "def owned?\n locked? && @object.size == @uuid.size && @object.download.read == @uuid\n end", "def item_usable?\r\n user.usable?(item) && item_effects_valid?\r\n end", "def belongs_to?(user)\n return false unless user.instance_of? User\n return self.owner == user\n end", "def updatable_by?(actor)\n actor.is_a?(User) && self.owned_by?(actor)\n end", "def owner?(obj)\n (self.id == RedisMutexer.config.redis.get(key(obj)).to_i)\n end", "def is_allowed_to_edit?(person)\n if person.id == item_owner.id && status.eql?(\"pending_owner\")\n return true\n elsif person.id != item_owner.id && status.eql?(\"pending_reserver\")\n return true\n end\n return false \n end", "def belongs_to?(user)\n return nil if user.nil?\n\n owner == user\n end", "def owner_required?\n !Refinery::Multisites.user_class.nil?\n end", "def owner?\n # exists? ? `ls -al #{path} | grep '[0-9] \\.$'`.split[2] : false\n proprieties[:owner]\n end", "def owner_user_in_db?\n Woodlock::User.find_by(github_username: @project.github_owner) ? true : false\n end", "def is_not_global_and_is_owned_by?(user)\n !self.is_global? && self.user_id == user.id\n end" ]
[ "0.86574405", "0.80341214", "0.7641747", "0.7616202", "0.7561327", "0.7494988", "0.74660265", "0.74452186", "0.74128777", "0.74086225", "0.7380202", "0.7356623", "0.7353671", "0.7346775", "0.73422843", "0.73139346", "0.7305085", "0.7287406", "0.7273473", "0.72720855", "0.72480285", "0.72160083", "0.7214764", "0.7185896", "0.7184381", "0.7131451", "0.7127117", "0.71135354", "0.7108585", "0.71049136", "0.70724136", "0.70581347", "0.7053324", "0.703939", "0.7038161", "0.7037799", "0.70286274", "0.7027876", "0.7016683", "0.70079154", "0.7000449", "0.6992307", "0.69864446", "0.69864446", "0.6970995", "0.6967219", "0.696715", "0.6958679", "0.6953566", "0.6953471", "0.6948873", "0.6938018", "0.6928435", "0.69246924", "0.69052714", "0.6898205", "0.6891316", "0.68860805", "0.68608564", "0.6833976", "0.68050957", "0.67907345", "0.67812127", "0.67788726", "0.67765576", "0.6743463", "0.66752714", "0.66642714", "0.6654834", "0.6652643", "0.6648672", "0.66466373", "0.6635644", "0.6625016", "0.65880364", "0.6582151", "0.65813076", "0.6579155", "0.656131", "0.65446156", "0.6538079", "0.6527907", "0.65102446", "0.65038615", "0.65029824", "0.6478434", "0.64674354", "0.644094", "0.64347214", "0.643413", "0.6422688", "0.6417761", "0.6414376", "0.6404345", "0.63990027", "0.63980156", "0.6386591", "0.6366717", "0.6357493", "0.6352268", "0.6350198" ]
0.0
-1
Create mocks for Stratiform::Stack
def add_stack_mocks(obj) allow(obj).to receive(:read_template).and_return(MOCK_TEMPALTE) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(stack)\n @stack = stack\n super stack.api\n end", "def initialize\n @stack = []\n end", "def initialize\n @stack = []\n end", "def create_stack(stack_name, options = {})\n params = {\n 'StackName' => stack_name,\n }\n\n if options['DisableRollback']\n params['DisableRollback'] = options['DisableRollback']\n end\n\n if options['OnFailure']\n params['OnFailure'] = options['OnFailure']\n end\n\n if options['NotificationARNs']\n params.merge!(Fog::AWS.indexed_param(\"NotificationARNs.member\", [*options['NotificationARNs']]))\n end\n\n if options['Parameters']\n options['Parameters'].keys.each_with_index do |key, index|\n index += 1 # params are 1-indexed\n params.merge!({\n \"Parameters.member.#{index}.ParameterKey\" => key,\n \"Parameters.member.#{index}.ParameterValue\" => options['Parameters'][key]\n })\n end\n end\n\n num_tags = 0\n if options['Tags']\n options['Tags'].keys.each_with_index do |key, index|\n index += 1 # tags are 1-indexed\n num_tags += 1 # 10 tag max\n\n params.merge!({\n \"Tags.member.#{index}.Key\" => key,\n \"Tags.member.#{index}.Value\" => options['Tags'][key]\n })\n end\n end\n\n if num_tags > 10\n raise ArgumentError.new(\"a maximum of 10 tags can be specified <#{num_tags}>\")\n end\n\n if options['TemplateBody']\n params['TemplateBody'] = options['TemplateBody']\n elsif options['TemplateURL']\n params['TemplateURL'] = options['TemplateURL']\n end\n\n if options['StackPolicyBody']\n params['StackPolicyBody'] = options['StackPolicyBody']\n elsif options['StackPolicyURL']\n params['StackPolicyURL'] = options['StackPolicyURL']\n end\n\n if options['TimeoutInMinutes']\n params['TimeoutInMinutes'] = options['TimeoutInMinutes']\n end\n\n if options['Capabilities']\n params.merge!(Fog::AWS.indexed_param(\"Capabilities.member\", [*options['Capabilities']]))\n end\n\n request({\n 'Action' => 'CreateStack',\n :parser => Fog::Parsers::AWS::CloudFormation::CreateStack.new\n }.merge!(params))\n end", "def initialize\n @stacks = []\n end", "def test_full_stack_push_and_pop\n puts \"test_full_stack_push_and_pop\"\n (rand(10) + 2).times do\n expects = []\n 100.times do\n expects << random_string\n pr = push(expects[-1])\n assert_equal(0, pr, \"expected 0, got #{pr}\")\n end\n\n 100.times do\n r = pop\n s = expects.pop\n assert_equal(s, r, \"expected #{s}, got #{r}\")\n end\n end\n end", "def setup\n flexmock(Woofer).new_instances.should_receive(:woof => :grrr)\n end", "def mocks\n calls = @mocks.flat_map {|m| m.__SPLATS_child_objects }\n\n constructors = []\n\n expects = calls.flat_map do |c|\n recv = c[0]\n constructors << (recv.__SPLATS_print + ' = flexmock(\"' + recv.__SPLATS_print + '\")')\n c[1].map do |call|\n line = recv.__SPLATS_print\n line += \".should_receive(#{call[0].inspect})\"\n (line += \".with\" + self.class.args_to_s(call[2])) unless call[2].empty?\n line += '.and_return(' + self.class.construct_value(call[1]) + ').once'\n end\n end\n\n constructors + expects\n end", "def load_stack_data(stack = nil)\n d_params = Smash.new(\"Action\" => \"DescribeStacks\")\n l_params = Smash.new(\"Action\" => \"ListStacks\")\n # TODO: Need to update to allow passing in list of desired\n # states for lookup or to remove state filtering. This\n # used to work with earlier versions with sfn but something\n # has changed breaking the integration.\n STACK_STATES.each_with_index do |state, idx|\n l_params[\"StackStatusFilter.member.#{idx + 1}\"] = state.to_s.upcase\n end\n if stack\n logger.debug(\"loading stack information for `#{stack.id}`\")\n d_params[\"StackName\"] = stack.id\n descriptions = all_result_pages(nil, :body,\n \"DescribeStacksResponse\", \"DescribeStacksResult\",\n \"Stacks\", \"member\") do |options|\n request(\n :method => :post,\n :path => \"/\",\n :form => options.merge(d_params),\n )\n end\n else\n logger.debug(\"loading stack listing information\")\n lists = all_result_pages(nil, :body,\n \"ListStacksResponse\", \"ListStacksResult\",\n \"StackSummaries\", \"member\") do |options|\n request(\n :method => :post,\n :path => \"/\",\n :form => options.merge(l_params),\n )\n end\n descriptions = []\n end\n (lists || descriptions).map do |stk|\n if lists\n desc = descriptions.detect do |d_stk|\n d_stk[\"StackId\"] == stk[\"StackId\"]\n end || Smash.new\n stk.merge!(desc)\n end\n if stack\n next if stack.id != stk[\"StackId\"] && stk[\"StackId\"].split(\"/\")[1] != stack.id\n end\n state = stk[\"StackStatus\"].downcase.to_sym\n unless Miasma::Models::Orchestration::VALID_RESOURCE_STATES.include?(state)\n parts = state.to_s.split(\"_\")\n state = [parts.first, *parts.slice(-2, parts.size)].join(\"_\").to_sym\n unless Miasma::Models::Orchestration::VALID_RESOURCE_STATES.include?(parts)\n state = :unknown\n end\n end\n new_stack = stack || Stack.new(self)\n new_stack.load_data(\n :id => stk[\"StackId\"],\n :name => stk[\"StackName\"],\n :capabilities => [stk.get(\"Capabilities\", \"member\")].flatten(1).compact,\n :description => stk[\"Description\"],\n :created => stk[\"CreationTime\"],\n :updated => stk[\"LastUpdatedTime\"],\n :notification_topics => [stk.get(\"NotificationARNs\", \"member\")].flatten(1).compact,\n :timeout_in_minutes => stk[\"TimeoutInMinutes\"] ? stk[\"TimeoutInMinutes\"].to_i : nil,\n :status => stk[\"StackStatus\"],\n :status_reason => stk[\"StackStatusReason\"],\n :state => state,\n :template_description => stk[\"TemplateDescription\"],\n :disable_rollback => !!stk[\"DisableRollback\"],\n :outputs => [stk.get(\"Outputs\", \"member\")].flatten(1).compact.map { |o|\n Smash.new(\n :key => o[\"OutputKey\"],\n :value => o[\"OutputValue\"],\n :description => o[\"Description\"],\n )\n },\n :tags => Smash[\n [stk.fetch(\"Tags\", \"member\", [])].flatten(1).map { |param|\n [param[\"Key\"], param[\"Value\"]]\n }\n ],\n :parameters => Smash[\n [stk.fetch(\"Parameters\", \"member\", [])].flatten(1).map { |param|\n [param[\"ParameterKey\"], param[\"ParameterValue\"]]\n }\n ],\n :custom => Smash.new(\n :stack_policy => stk[\"StackPolicyBody\"],\n :stack_policy_url => stk[\"StackPolicyURL\"],\n ),\n ).valid_state\n logger.debug(\"loaded stack information `#{new_stack.inspect}`\")\n new_stack\n end\n end", "def session\n Rack::Test::Session.new(Rack::MockSession.new(FULL_STACK_SYNERGY_APP))\nend", "def initialize()\n @stack = Stack.new\n end", "def setup\n @requester = Rack::MockRequest.new(SampleApp)\n end", "def stack_manager(stack_prefix)\n aws_clients = {\n CloudFormationClient: @aws[:CloudFormationClient],\n CloudWatchClient: @aws[:CloudWatchClient],\n CloudWatchLogsClient: @aws[:CloudWatchLogsClient],\n DynamoDBClient: @aws[:DynamoDBClient],\n S3Client: @aws[:S3Client],\n S3Resource: @aws[:S3Resource]\n }\n\n RubyAemAws::StackManager.new(stack_prefix, aws_clients)\n end", "def InstallStack\n\n end", "def test_clear_stacks\n @eval.load_stacks([5, 5, 6, '+', '-'])\n @eval.clear_stacks\n assert_equal 0, @eval.op_stack.size?\n assert_equal 0, @eval.n_stack.size?\n end", "def StartStack\n\n end", "def stack; end", "def stack; end", "def __mock_reset; end", "def build_stack\n stack = Stack.new\n rand(1..10).times do |i| \n stack.push(i)\n end\n return stack\nend", "def test_stack_050\n\n @vc.parse <<EOF\n\n: test\n\n 0. 2dup 1+\n 2dup 1+\n 2dup 1+\n\n;\n\nEOF\n @vc.compile\n @vc.run\n assert_equal(:halt, @vc.vm.state)\n assert_equal(8, @vc.vm.depth)\n assert_equal(3, @vc.vm.tos)\n assert_equal(0, @vc.vm.nos)\n assert_equal(2, @vc.vm.pick(2))\n assert_equal(0, @vc.vm.pick(3))\n assert_equal(1, @vc.vm.pick(4))\n assert_equal(0, @vc.vm.pick(5))\n assert_equal(0, @vc.vm.pick(6))\n assert_equal(0, @vc.vm.pick(7))\n end", "def create_mock( name )\n return flexmock( name )\n\tend", "def build_stack_args(payload, directory)\n Smash.new(\n :base_directory => File.join(directory, 'cloudformation'),\n :parameters => load_stack_parameters(payload, directory),\n :ui => Bogo::Ui.new(\n :app_name => 'JackalStacks',\n :defaults => true,\n :output_to => StringIO.new('')\n ),\n :interactive_parameters => false,\n :nesting_bucket => config.get(:orchestration, :bucket_name),\n :apply_nesting => true,\n :processing => true,\n :options => {\n :disable_rollback => true,\n :capabilities => ['CAPABILITY_IAM']\n },\n :credentials => config.get(:orchestration, :api, :credentials),\n :file => payload.fetch(:data, :stacks, :template, config.get(:default_template_path)),\n :file_path_prompt => false,\n :poll => false\n )\n end", "def initialize(*args, stack:)\n super()\n if !stack.is_a?(Stack)\n raise TypeError,\n \"Expecting `#{Stack.name}` but received `#{stack.class.name}`\"\n end\n @stacks = [stack].freeze\n @data = Smash.new\n freeze_data!\n end", "def create_stack(response, resource, properties, parameters, message)\n stack = remote_api(properties[:location]).stacks.build(\n :name => generate_stack_name(resource),\n :template => properties.fetch(:stack, fetch_template(properties[:template_url])),\n :parameters => Hash[parameters.map{|k,v| [Bogo::Utility.camel(k), v] }]\n )\n stack.save\n until(stack.state.to_s.end_with?('complete'))\n message.touch!\n debug \"Waiting for created stack to reach completion...\"\n sleep 5\n stack.reload\n end\n if(stack.state.to_s.end_with?('complete') || stack.state.to_s.end_with?('failed'))\n stack.outputs.each do |output|\n response['Data'][\"Outputs.#{output.key}\"] = output.value\n end\n response['PhysicalResourceId'] = [\n properties[:location],\n stack.id\n ].join(LOCATION_JOINER)\n true\n else\n response['Status'] = 'FAILED'\n response['Reason'] = 'Stack creation failed!'\n stack.destroy\n false\n end\n end", "def setup\n @dog = Dog.new\n flexmock(@dog, :bark => :grrr)\n end", "def test_full_stack_ignore\n puts \"test_full_stack_ignore\"\n expects = []\n 100.times do\n expects << random_string\n pr = push(expects[-1])\n assert_equal(0, pr, \"expected 0, got #{pr}\")\n end\n\n (rand(5) + 2).times do\n r = push(\"too full\", :timeout => 3)\n assert_equal(nil, r, \"expected nil, got #{r}\")\n end\n\n 100.times do |i|\n r = pop\n s = expects.pop\n assert_equal(s, r, \"expected #{s}, got #{r}\")\n end\n end", "def test_nil_town_search_found_something\n ruby_rush=RubyRush.new(1, 2, 3)\n doubled_prng = Minitest::Mock.new('doubled prng')\n def doubled_prng.rand(seed); 3; end\n ruby_rush.prng=doubled_prng\n ruby_rush.cur_fake_rb=3\n ruby_rush.fake_sp='rubies'\n assert_output(\"\\tFound #{ruby_rush.cur_fake_rb} fake #{ruby_rush.fake_sp} in #{ruby_rush.city}.\\n\" ) {ruby_rush.nil_town_search}\n end", "def test_pros_sim\r\n sim = GoldRushSim.new(1, 1)\r\n fakePros = Minitest::Mock.new(\"fake prospector\")\r\n def fakePros.location; 'Sutter Creek'; end\r\n \tdef fakePros.mine_iteration(param); 1; end\r\n \tdef fakePros.mine_last_two(param); 1; end\r\n \tdef fakePros.convert_resources(); 1; end\r\n \tdef fakePros.days; 1; end\r\n \tdef fakePros.gold; 1; end\r\n \tdef fakePros.silver; 1; end\r\n \tdef fakePros.end_messages(a, b, c, d, e); nil; end\r\n assert_equal true, sim.pros_sim(fakePros, 0)\r\n end", "def initialize(pstack)\n super(pstack)\n end", "def mock(*args)\n Spec::Mocks::Mock.new(*args)\n end", "def test_topOnEmptyStack\n assert_nil(@stack.top)\n end", "def test_string_results_silver_zero\n mock_loc = Minitest::Mock.new(\"mock_loc\")\n\tdef mock_loc.name;'Sutter Creek';end\n p = Prospector.new(0, mock_loc, 0)\n\tp.silver_found = 0\n\tp.gold_found = 3\n\tp.sg = 's'\n\tassert_equal 'Found 3 ounces of gold in Sutter Creek', p.string_findings\n end", "def test_string_results_gold_one_silver_zero\n mock_loc = Minitest::Mock.new(\"mock_loc\")\n\tdef mock_loc.name;\"Sutter Creek\";end\n p = Prospector.new(0, mock_loc, 0)\n\tp.silver_found = 0\n\tp.gold_found = 1\n\tp.sg = ''\n\tp.s = ''\n\tassert_equal 'Found 1 ounce of gold in Sutter Creek', p.string_findings\n end", "def build_middleware_stack\n Jets.application.build_stack\n end", "def mock_beer(name, style, origin, bars, events)\n beer = Minitest::Mock.new\n beer.expect :name, name\n beer.expect :style, style\n beer.expect :origin, origin\n beer.expect :bars, bars\n beer.expect :events, events\n @result << beer\n end", "def initialize\n @in_stack = []\n @out_stack = []\n end", "def mock_request( params, response_body )\n mock_post = {}\n mock_post.expects(:set_form_data).with(params)\n #mock.expects(:[]=).with('user-agent', anything)\n\n url = Smsinabox.uri\n Net::HTTP::Post.expects(:new).with( url.path ).returns(mock_post)\n\n response = Net::HTTPSuccess.new('1.1', 200, 'OK')\n response.instance_variable_set :@body, response_body\n response.instance_variable_set :@read, true\n\n mock_http = Object.new\n mock_http.expects(:start).returns(response)\n\n Net::HTTP.expects(:new).with( url.host, url.port ).returns(mock_http)\nend", "def mock_request(script = \"test\" , headers = {})\n unless @mock_request\n @mock_request = mock(\"MockAgiRequest[script=#{script}]\")\n @mock_request.stub!(\n :extension => \"test\",\n :priority => \"1\",\n :context => \"default\",\n :uniqueId => \"123456789.7\", \n :language => \"en\",\n :channel => \"SIP/127.0.0.1-00000003\",\n :type => \"SIP\",\n :script => script,\n :requestURL => \"agi://fake_test_host:1234/#{script}\") #[?param1=value1&param2=value2]. \"\n end\n @mock_request\nend", "def test_hash_crossing_search_found_something\n ruby_rush=RubyRush.new(1, 2, 3)\n doubled_prng = Minitest::Mock.new('doubled prng')\n def doubled_prng.rand(seed); 2; end\n ruby_rush.prng=doubled_prng\n ruby_rush.cur_real_rb=2\n ruby_rush.cur_fake_rb=2\n ruby_rush.real_sp='rubies'\n ruby_rush.fake_sp='rubies'\n assert_output(\"\\tFound #{ruby_rush.cur_real_rb} #{ruby_rush.real_sp} and #{ruby_rush.cur_fake_rb} fake #{ruby_rush.fake_sp} in #{ruby_rush.city}.\\n\" ) {ruby_rush.hash_crossing_search}\n end", "def InstallStack\n if (@rstack==nil)\n puts \"InstallStack not defined!\"\n exit 1\n else\n @rstack.InstallStack\n end\n end", "def test_ruby_rush_turns\n mock_location = Minitest::Mock.new('location')\n mock_rng = Minitest::Mock.new('rng')\n @p2 = Prospector.new(1, 2, mock_rng)\n def mock_location.name; 'a'; end\n def mock_location.go_to_next(mock_rng); [self, self][0];end\n def mock_location.random_total_ruby(mock_rng); [0, 0]; end\n assert_output(\"Rubyist #1 starting in Enumerable Canyon.\n Found no rubies or fake rubies in a.\nHeading from a to a\n Found no rubies or fake rubies in a.\n Found no rubies or fake rubies in a.\nAfter 3 days, Rubyist 1 found:\n 0 rubies.\n 0 fake rubies.\nGoing home empty-handed.\\n\"){@p2.ruby_rush(mock_location)}\n end", "def validate_stack!\n \n mockup_options = {}\n relativizer_options = {}\n run_relativizer = true\n if @extractor_options\n mockup_options = {:env => @extractor_options[:env]}\n relativizer_options = {:url_attributes => @extractor_options[:url_attributes]}\n run_relativizer = @extractor_options[:url_relativize]\n end\n \n unless @stack.find{|(processor, options)| processor.class == HtmlMockup::Release::Processors::Mockup }\n @stack.unshift([HtmlMockup::Release::Processors::UrlRelativizer.new, relativizer_options]) \n @stack.unshift([HtmlMockup::Release::Processors::Mockup.new, mockup_options])\n end\n end", "def initialize(stack:)\n super()\n if !stack.is_a?(Stack)\n raise TypeError,\n \"Expecting `#{Stack.name}` but received `#{stack.class.name}`\"\n end\n @prepend_entries = [].freeze\n @append_entries = [].freeze\n @after_entries = [].freeze\n @before_entries = [].freeze\n @applied = false\n @stack = stack\n end", "def switch_stacks\r\n SwitchStacksController.instance\r\n end", "def create_stack(name, template, parameters)\n cfm = AWS::CloudFormation.new\n\n stack = cfm.stacks.detect { |s| s.name == name }\n\n # Helpful when spinning up and down the stack for testing.\n unless stack.nil?\n wait_statuses = %w{DELETE_IN_PROGRESS ROLLBACK_IN_PROGRESS}\n if stack.status == 'ROLLBACK_COMPLETE'\n stack.delete\n stack = nil\n elsif wait_statuses.include?(stack.status)\n puts 'Stack is being deleted or rolled back. Please wait.'\n sleep 2 while stack.exists? and wait_statuses.include?(stack.status)\n stack = nil\n end\n end\n\n if stack.nil? or !stack.exists?\n stack = cfm.stacks.create(name, template, parameters: parameters, capabilities: ['CAPABILITY_IAM'])\n else\n # Updating is somewhat problematic because a simple format change will raise an exception.\n stack.update(template: template, parameters: parameters) if template != stack.template\n end\n\n # Send back the stack progress along the way.\n while stack.status.include? 'PROGRESS'\n last_event = stack.events.first\n yield last_event if block_given?\n sleep 2\n end\n\n stack\n end", "def test_addition\n @eval.load_stacks([5, 5, '+'])\n assert_equal 10, @eval.quick_maffs_a('+')\n end", "def create_object\n sut.send(:new)\n end", "def test_ruby_rush_no_turn\n mock_location = Minitest::Mock.new('location')\n mock_rng = Minitest::Mock.new('rng')\n @p2 = Prospector.new(1, 0, mock_rng)\n def mock_location.name; 'a'; end\n def mock_location.random_total_ruby(mock_rng); [0, 0]; end\n assert_output(\"Rubyist #1 starting in Enumerable Canyon.\n Found no rubies or fake rubies in a.\nAfter 1 days, Rubyist 1 found:\n 0 rubies.\n 0 fake rubies.\nGoing home empty-handed.\\n\"){@p2.ruby_rush(mock_location)}\n end", "def stub_shellouts(*sequence)\n expect(::Mixlib::ShellOut).\n to receive(:new).and_return(*sequence)\n end", "def test_string_results_gold_zero_silver_one\n mock_loc = Minitest::Mock.new(\"mock_loc\")\n\tdef mock_loc.name;\"Sutter Creek\";end\n p = Prospector.new(0, mock_loc, 0)\n\tp.silver_found = 1\n\tp.gold_found = 0\n\tp.s = ''\n\tassert_equal 'Found 1 ounce of silver in Sutter Creek', p.string_findings\n end", "def interrogate_stack(stack_name, client)\n def get_next_page(client, stack_name, current_items, next_token)\n puts(\"DEBUG: getting stack #{stack_name}\")\n result = client.list_stack_resources({:stack_name=>stack_name,:next_token=>next_token})\n updated_items = current_items.merge(result.stack_resource_summaries.map {|entry| [entry.logical_resource_id, entry.physical_resource_id]}.to_h)\n if result.next_token\n get_next_page(client, stack_name, updated_items, next_token)\n else\n updated_items\n end\n end\n\n get_next_page(client, stack_name, {}, nil)\nend", "def setup_base_mocks\n RunGit.any_instance.expects(:git).with(:init)\n RunGit.any_instance.expects(:git).with(:add => \".\")\n end", "def get_context(*params); raise('Stub or mock required.') end", "def plan_stack(stack, new_template, new_parameters)\n plan_results = Smash.new(\n :stacks => Smash.new,\n :added => Smash.new,\n :removed => Smash.new,\n :replace => Smash.new,\n :interrupt => Smash.new,\n :unavailable => Smash.new,\n :unknown => Smash.new,\n :outputs => Smash.new,\n :n_outputs => [],\n )\n\n origin_template = dereference_template(\n \"#{stack.data.checksum}_origin\",\n stack.template,\n Smash[\n stack.parameters.map do |k, v|\n [k, v.to_s]\n end\n ].merge(get_global_parameters(stack))\n )\n\n translator_key = \"#{stack.data.checksum}_#{stack.data.fetch(:logical_id, stack.name)}\"\n run_stack_diff(stack, translator_key, plan_results, origin_template, new_template, new_parameters)\n\n new_checksum = nil\n current_checksum = false\n until new_checksum == current_checksum\n current_checksum = plan_results.checksum\n run_stack_diff(stack, translator_key, plan_results, origin_template, new_template, new_parameters)\n new_checksum = plan_results.checksum\n end\n scrub_plan(plan_results)\n plan_results\n end", "def test_push_and_pop\n\tn = Stack.new()\n\tn.push(3)\n\tn.push(4)\n\tn.push(5)\n\tassert_equal(5, n.pop)\n\tassert_equal(4, n.pop)\n\tassert_equal(3, n.pop)\n\tassert_raise(RuntimeError) {n.pop}\n end", "def mock_response(status_code, body_str='')\n response_class = Net::HTTPResponse::CODE_TO_OBJ[status_code.to_s]\n response = response_class.new('1.1', status_code.to_s, '')\n response.instance_eval(\"def body; #{body_str.inspect}; end\")\n response\nend", "def stack_reload(stack)\n if(stack.persisted?)\n result = request(\n :method => :get,\n :path => \"/stacks/#{stack.name}/#{stack.id}\",\n :expects => 200\n )\n stk = result.get(:body, :stack)\n stack.load_data(\n :id => stk[:id],\n :capabilities => stk[:capabilities],\n :created => Time.parse(stk[:creation_time]),\n :description => stk[:description],\n :disable_rollback => stk[:disable_rollback].to_s.downcase == 'true',\n :notification_topics => stk[:notification_topics],\n :name => stk[:stack_name],\n :state => stk[:stack_status].downcase.to_sym,\n :status => stk[:stack_status],\n :status_reason => stk[:stack_status_reason],\n :template_description => stk[:template_description],\n :timeout_in_minutes => stk[:timeout_mins].to_s.empty? ? nil : stk[:timeout_mins].to_i,\n :updated => stk[:updated_time].to_s.empty? ? nil : Time.parse(stk[:updated_time]),\n :parameters => stk.fetch(:parameters, Smash.new),\n :outputs => stk.fetch(:outputs, []).map{ |output|\n Smash.new(\n :key => output[:output_key],\n :value => output[:output_value],\n :description => output[:description]\n )\n }\n ).valid_state\n end\n stack\n end", "def validate_stack!\n return if config[:blank]\n\n ensure_mockup_processor_in_stack!\n ensure_dir_finalizer_in_stack!\n end", "def image_stubs # rubocop:disable MethodLength\n ::Chef::Recipe.any_instance.stub(:address_for)\n .with('lo')\n .and_return('127.0.1.1')\n ::Chef::Recipe.any_instance.stub(:config_by_role)\n .with('rabbitmq-server', 'queue')\n .and_return(\n 'host' => 'rabbit-host', 'port' => 'rabbit-port'\n )\n ::Chef::Recipe.any_instance.stub(:get_password).and_return('')\n ::Chef::Recipe.any_instance.stub(:secret)\n .with('secrets', 'openstack_identity_bootstrap_token')\n .and_return('bootstrap-token')\n ::Chef::Recipe.any_instance.stub(:get_password)\n .with(\"service\", 'openstack-image')\n .and_return('glance-pass')\n ::Chef::Application.stub(:fatal!)\nend", "def create_stack(stack_name, options = {})\n request({\n 'Action' => 'CreateStack',\n 'StackName' => stack_name,\n :parser => Fog::Parsers::AWS::CloudFormation::CreateStack.new\n }.merge!(options))\n end", "def stack(*args); end", "def test_zero_maths\n @eval.load_stacks([4, 0, '/'])\n assert_equal [5, nil], @eval.maths\n end", "def create_stack(name, options = {})\n given = options.dup\n query = {'Action' => 'CreateStack', 'StackName' => name}\n\n if parameters = given.delete('Parameters')\n parameters.each_with_index do |(key, value), idx|\n query[\"Parameters.member.#{idx + 1}.ParameterKey\"] = key\n query[\"Parameters.member.#{idx + 1}.ParameterValue\"] = value\n end\n end\n\n if notifications = given.delete('NotificationARNs')\n notifications.each_with_index do |member, idx|\n query[\"NotificationARNs.member.#{idx + 1}\"] = member\n end\n end\n\n query.merge!(given)\n\n response = request(query).xpath('//aws:CreateStackResponse', NS)\n id = response.xpath('aws:CreateStackResult/aws:StackId', NS).text\n rid = response.xpath('aws:ResponseMetadata/aws:RequestId', NS).text\n return {:stack_id => id, :response_id => id}\n end", "def test_matzburgh_search_found_something\n ruby_rush=RubyRush.new(1, 2, 3)\n doubled_prng = Minitest::Mock.new('doubled prng')\n def doubled_prng.rand(seed); 3; end\n ruby_rush.prng=doubled_prng\n ruby_rush.cur_real_rb=3\n ruby_rush.real_sp='rubies'\n assert_output(\"\\tFound #{ruby_rush.cur_real_rb} #{ruby_rush.real_sp} in #{ruby_rush.city}.\\n\" ) {ruby_rush.matzburgh_search}\n end", "def test_ruby_rush_no_rubyist\n mock_location = Minitest::Mock.new('location')\n mock_rng = Minitest::Mock.new('rng')\n @p2 = Prospector.new(0, 0, mock_rng)\n def mock_location.name; 'a'; end\n def mock_location.random_total_ruby(mock_rng); [0, 0]; end\n assert_output(\"Rubyist #0 starting in Enumerable Canyon.\n Found no rubies or fake rubies in a.\nAfter 1 days, Rubyist 0 found:\n 0 rubies.\n 0 fake rubies.\nGoing home empty-handed.\\n\"){@p2.ruby_rush(mock_location)}\n end", "def test_sutter_creek_move_coloma\r\n \t@test_prospector.stub(:sutter_creek_move, 'Coloma') do\r\n \t@test_prospector.move\r\n \tassert_equal 'Coloma' , @test_prospector.current_location \r\n \tend\r\n end", "def stacks\n response = OpenStack::Heat::Connection.heat_conn.req('GET', '/stacks')\n stacks_hash = JSON.parse(response.body)[\"stacks\"]\n stacks_hash.inject([]){|res, current| res << OpenStack::Heat::Stack.new(current); res}\n end", "def to_stack; end", "def test_orderOfElements\n @stack.push( 42 )\n assert_equal(@stack.top, 42)\n @stack.push( 84 )\n assert_equal(@stack.top, 84)\n @stack.pop\n assert_equal(@stack.top, 42)\n @stack.pop\n assert_nil(@stack.top)\n end", "def execute!\n name_required!\n name = name_args.first\n\n stack_info = \"#{ui.color(\"Name:\", :bold)} #{name}\"\n begin\n stack = provider.stacks.get(name)\n rescue Miasma::Error::ApiError::RequestError\n stack = provider.stacks.build(name: name)\n end\n\n return display_plan_lists(stack) if config[:list]\n\n if config[:plan_name]\n # ensure custom attribute is dirty so we can modify\n stack.custom = stack.custom.dup\n stack.custom[:plan_name] = config[:plan_name]\n end\n\n use_existing = false\n\n unless config[:print_only]\n ui.info \"#{ui.color(\"SparkleFormation:\", :bold)} #{ui.color(\"plan\", :green)}\"\n if stack && stack.plan\n ui.warn \"Found existing plan for this stack\"\n begin\n if config[:load_existing]\n raise Bogo::Ui::ConfirmationDeclined\n end\n if config[:load_existing].nil?\n ui.confirm \"Destroy existing plan\"\n end\n ui.info \"Destroying existing plan to generate new plan\"\n stack.plan.destroy\n rescue Bogo::Ui::ConfirmationDeclined\n ui.info \"Loading existing stack plan for #{ui.color(stack.name, :bold)}...\"\n use_existing = true\n end\n end\n end\n\n unless use_existing\n config[:compile_parameters] ||= Smash.new\n\n if config[:file]\n s_name = [name]\n\n c_setter = lambda do |c_stack|\n if c_stack.outputs\n compile_params = c_stack.outputs.detect do |output|\n output.key == \"CompileState\"\n end\n end\n if compile_params\n compile_params = MultiJson.load(compile_params.value)\n c_current = config[:compile_parameters].fetch(s_name.join(\"__\"), Smash.new)\n config[:compile_parameters][s_name.join(\"__\")] = compile_params.merge(c_current)\n end\n c_stack.nested_stacks(false).each do |n_stack|\n s_name.push(n_stack.data.fetch(:logical_id, n_stack.name))\n c_setter.call(n_stack)\n s_name.pop\n end\n end\n\n if stack && stack.persisted?\n c_setter.call(stack)\n end\n\n ui.debug \"Compile parameters - #{config[:compile_parameters]}\"\n file = load_template_file(:stack => stack)\n stack_info << \" #{ui.color(\"Path:\", :bold)} #{config[:file]}\"\n else\n file = stack.template.dup\n end\n\n unless file\n if config[:template]\n file = config[:template]\n stack_info << \" #{ui.color(\"(template provided)\", :green)}\"\n else\n stack_info << \" #{ui.color(\"(no template update)\", :yellow)}\"\n end\n end\n unless config[:print_only]\n ui.info \" -> #{stack_info}\"\n end\n if file\n if config[:print_only]\n ui.puts format_json(parameter_scrub!(template_content(file)))\n return\n end\n\n original_parameters = stack.parameters\n\n apply_stacks!(stack)\n\n populate_parameters!(file, :current_parameters => stack.root_parameters)\n\n stack.parameters = config_root_parameters\n\n if config[:upload_root_template]\n upload_result = store_template(name, file, Smash.new)\n stack.template_url = upload_result[:url]\n else\n stack.template = parameter_scrub!(template_content(file, :scrub))\n end\n else\n apply_stacks!(stack)\n original_parameters = stack.parameters\n populate_parameters!(stack.template, :current_parameters => stack.root_parameters)\n stack.parameters = config_root_parameters\n end\n\n ui.info \" -> Generating plan information...\"\n else\n ui.info \" -> Loading plan information...\"\n end\n\n # Set options defined within config into stack instance for update request\n if config[:merge_api_options]\n config.fetch(:options, Smash.new).each_pair do |key, value|\n if stack.respond_to?(\"#{key}=\")\n stack.send(\"#{key}=\", value)\n end\n end\n end\n\n plan = stack.plan || stack.plan_generate\n namespace.const_get(:Realize).\n new(config, [name]).execute!\n end", "def test_string_results_gold_zero\n mock_loc = Minitest::Mock.new(\"mock_loc\")\n\tdef mock_loc.name;\"Sutter Creek\";end\n p = Prospector.new(0, mock_loc, 0)\n\tp.silver_found = 3\n\tp.gold_found = 0\n\tp.s = 's'\n\tassert_equal 'Found 3 ounces of silver in Sutter Creek', p.string_findings\n end", "def test_monkey_patch_city_search_found_something\n ruby_rush=RubyRush.new(1, 2, 3)\n doubled_prng = Minitest::Mock.new('doubled prng')\n def doubled_prng.rand(seed); 1; end\n ruby_rush.prng=doubled_prng\n ruby_rush.cur_real_rb=1\n ruby_rush.cur_fake_rb=1\n ruby_rush.real_sp='ruby'\n ruby_rush.fake_sp='ruby'\n assert_output(\"\\tFound #{ruby_rush.cur_real_rb} #{ruby_rush.real_sp} and #{ruby_rush.cur_fake_rb} fake #{ruby_rush.fake_sp} in #{ruby_rush.city}.\\n\" ) {ruby_rush.monkey_patch_city_search}\n end", "def test_run_string\n sim = Simulator.new(1, 2, 1)\n sim.setup_map\n mock_prospector = Minitest::Mock.new('Mock Prospector')\n def mock_prospector.mine(_param)\n 1\n end\n\n def mock_prospector.next_location(_param, _param2)\n 1\n end\n\n def mock_prospector.location_count\n 1\n end\n assert_raises(RBS::Test::Tester::TypeError) { sim.run('HI', mock_prospector) }\n end", "def mock(*args)\n Rspec::Mocks::Mock.new(*args)\n end", "def clear_previous_github_service_stubs!\n github_service_stubs.instance_variable_set(:@stack, {})\n end", "def plan_nested_stacks(stack, translator, origin_template, new_template_hash, plan_results)\n origin_stacks = origin_template.fetch(\"Resources\", {}).find_all do |s_name, s_val|\n is_stack?(s_val[\"Type\"])\n end.map(&:first)\n new_stacks = (new_template_hash[\"Resources\"] || {}).find_all do |s_name, s_val|\n is_stack?(s_val[\"Type\"])\n end.map(&:first)\n [origin_stacks + new_stacks].flatten.compact.uniq.each do |stack_name|\n original_stack = stack.nested_stacks(false).detect do |stk|\n stk.data[:logical_id] == stack_name\n end\n new_stack_exists = is_stack?(new_template_hash.get(\"Resources\", stack_name, \"Type\"))\n new_stack_template = new_template_hash.fetch(\"Resources\", stack_name, \"Properties\", \"Stack\", Smash.new)\n new_stack_parameters = new_template_hash.fetch(\"Resources\", stack_name, \"Properties\", \"Parameters\", Smash.new)\n new_stack_type = new_template_hash.fetch(\"Resources\", stack_name, \"Type\",\n origin_template.get(\"Resources\", stack_name, \"Type\"))\n resource = Smash.new(\n :name => stack_name,\n :type => new_stack_type,\n :properties => [],\n )\n if original_stack && new_stack_template\n new_stack_parameters = Smash[\n new_stack_parameters.map do |new_param_key, new_param_value|\n [new_param_key, translator.dereference(new_param_value)]\n end\n ]\n result = plan_stack(original_stack, new_stack_template, new_stack_parameters)\n result[:outputs].keys.each do |modified_output|\n translator.flag_ref(\"#{stack_name}_Outputs.#{modified_output}\")\n end\n plan_results[:stacks][stack_name] = result\n elsif original_stack && (!new_stack_template && !new_stack_exists)\n plan_results[:removed][stack_name] = resource\n elsif new_stack_template && !original_stack\n plan_results[:added][stack_name] = resource\n end\n end\n nil\n end", "def flexmock_get\n @mock\n end", "def flexmock_get\n @mock\n end", "def test_valid_maths\n @eval.load_stacks([4, 5, '+'])\n assert_equal [9, 'success'], @eval.maths\n end", "def mock_queue(name=nil)\n MockQueue.new(name || \"anonymous-#{rand(2**32).to_s(16)}\")\n end", "def stub_server_interface\n @handler.stubs(:accept_header ).returns \"format_one,format_two\"\n @handler.stubs(:content_type_header).returns \"text/yaml\"\n @handler.stubs(:set_content_type ).returns \"my_result\"\n @handler.stubs(:set_response ).returns \"my_result\"\n @handler.stubs(:path ).returns \"/my_handler/my_result\"\n @handler.stubs(:http_method ).returns(\"GET\")\n @handler.stubs(:params ).returns({})\n @handler.stubs(:content_type ).returns(\"text/plain\")\n end", "def initialize\n @info = Array.new(STACK_SIZE)\n @index = 0\n end", "def create\n @stack = Stack.new(stack_params)\n\n respond_to do |format|\n if @stack.save\n format.html { redirect_to @stack, notice: 'Stack was successfully created.' }\n format.json { render :show, status: :created, location: @stack }\n else\n format.html { render :new }\n format.json { render json: @stack.errors, status: :unprocessable_entity }\n end\n end\n end", "def spy_into object, stubs_map = {}\n ::Crispy::CrispyInternal::Spy.new object, stubs_map\n end", "def create\n @stack = Stack.new(stack_params)\n\n if @stack.save\n render json: @stack, status: :created, location: @stack\n else\n render json: @stack.errors, status: :unprocessable_entity\n end\n end", "def stack_from_stdin(options = {})\n s = Cfer::Core::Stack.new(options)\n templatize_errors('STDIN') do\n s.build_from_string STDIN.read, 'STDIN'\n end\n s\n end", "def test_add_resource_hillman\n driver = Minitest::Mock.new(\"Driver\")\n location = Minitest::Mock.new(\"Location\")\n def location.name; \"Hillman\"; end\n driver.expect :add_book, nil\n @c.add_resource(driver, location)\n assert_mock driver\n end", "def test_add_resource_cathedral\n driver = Minitest::Mock.new(\"Driver\")\n location = Minitest::Mock.new(\"Location\")\n def location.name; \"Cathedral\"; end\n driver.expect :add_class, nil\n @c.add_resource(driver, location)\n assert_mock driver\n end", "def stack(name = nil, opts = {})\n if self::StackMiddleware._mwares[name] && mw = self::StackMiddleware._mwares[name]\n unless mw.stack == self\n mw = self::StackMiddleware._mwares[name] = self::StackMiddleware._mwares[name].dup\n end\n mw\n else\n self::StackMiddleware.new(name, self, opts)\n end\n end", "def create_stack_with_http_info(stack_definition, organization, name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: StacksApi.create_stack ...\"\n end\n # verify the required parameter 'stack_definition' is set\n if @api_client.config.client_side_validation && stack_definition.nil?\n fail ArgumentError, \"Missing the required parameter 'stack_definition' when calling StacksApi.create_stack\"\n end\n # verify the required parameter 'organization' is set\n if @api_client.config.client_side_validation && organization.nil?\n fail ArgumentError, \"Missing the required parameter 'organization' when calling StacksApi.create_stack\"\n end\n if @api_client.config.client_side_validation && organization !~ Regexp.new(/[0-9a-z\\\\-]+/)\n fail ArgumentError, \"invalid value for 'organization' when calling StacksApi.create_stack, must conform to the pattern /[0-9a-z\\\\-]+/.\"\n end\n\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling StacksApi.create_stack\"\n end\n if @api_client.config.client_side_validation && name !~ Regexp.new(/[a-z0-9\\\\-_]+/)\n fail ArgumentError, \"invalid value for 'name' when calling StacksApi.create_stack, must conform to the pattern /[a-z0-9\\\\-_]+/.\"\n end\n\n # resource path\n local_var_path = \"/stacks/{organization}/{name}\".sub('{' + 'organization' + '}', organization.to_s).sub('{' + 'name' + '}', name.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'overwrite'] = opts[:'overwrite'] if !opts[:'overwrite'].nil?\n\n # header parameters\n header_params = {}\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(stack_definition)\n auth_names = ['ApiKeyAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Stack')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: StacksApi#create_stack\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def mock_queue(queue_name)\n data[queue_name]\n end", "def test_dynamic_palisades_search_found_something\n ruby_rush=RubyRush.new(1, 2, 3)\n doubled_prng = Minitest::Mock.new('doubled prng')\n def doubled_prng.rand(seed); 2; end\n ruby_rush.prng=doubled_prng\n ruby_rush.cur_real_rb=2\n ruby_rush.cur_fake_rb=2\n ruby_rush.real_sp='rubies'\n ruby_rush.fake_sp='rubies'\n assert_output(\"\\tFound #{ruby_rush.cur_real_rb} #{ruby_rush.real_sp} and #{ruby_rush.cur_fake_rb} fake #{ruby_rush.fake_sp} in #{ruby_rush.city}.\\n\" ) {ruby_rush. dynamic_palisades_search}\n end", "def stack\n @stack\n end", "def bootstrap_stack(ops, config, input, options_hash)\n puts \"Creating stack #{config['stack']['name']} ...\"\n stack = ops.create_stack(config['stack'])\n\n if config['permissions']\n stack.grant_access(config['permissions'])\n else\n puts \"Warning! No permissions defined in config. Granting full access to everyone.\"\n stack.grant_full_access \n end\n\n layers = []\n config['layers'].each do |l|\n layer_aws_config = l['config']\n layer = stack.create_layer(layer_aws_config)\n\n if not l.has_key?('instances')\n puts \"Warning! no instances key for layer #{layer_aws_config['name']}\"\n else\n l['instances'].each do |i|\n layer.create_instance(i)\n end\n layers.push(layer)\n end\n\n if l['elb']\n stack.create_elb(l['elb']) if options_hash[:create_elbs]\n layer.attach_elb(l['elb']['name']) if options_hash[:attach_elb]\n update_alarms(l['elb']['alarms']) if l['elb']['alarms']\n end\n\n if l['load_based_auto_scaling'] and l['load_based_auto_scaling']['enabled']\n layer.configure_load_based_auto_scaling(config['load_based_auto_scaling'], l, {:enable => options_hash[:enable_auto_scaling]})\n end\n\n if l['time_based_auto_scaling'] and l['time_based_auto_scaling']['enabled']\n layer.configure_time_based_auto_scaling(config['time_based_auto_scaling'], l)\n end\n\n end\n\n config['apps'].each do |a, value|\n stack.create_app(a, config['apps'][a])\n end\n\n if options_hash[:start_instances]\n instances = []\n\n layers.each do |l|\n started = l.send_start\n instances += started\n\n if options_hash[:load_instances_to_start] and options_hash[:load_instances_to_start][l.name] > 0\n started_load_instances = l.start_load_instances(options_hash[:load_instances_to_start][l.name])\n instances += started_load_instances\n end\n end\n\n ops.wait_for_instances_status(instances, \"online\", [\"stopped\", \"requested\", \"pending\", \"booting\", \"running_setup\"])\n end\n\n puts \"\\n\\nStack #{config['stack']['name']} successfully created.\"\n return stack\nend", "def mas_net_http_post(obj_stubs = {})\n request = Spec::Mocks::Mock.new(Net::HTTP::Post)\n Net::HTTP::Post.stub!(:new).and_return(request)\n obj_stubs.each do |method, value|\n request.stub!(method).and_return(value)\n end\n request\nend", "def mock_exchange(opts={})\n MockExchange.new(opts)\n end", "def test_operator_maths\n @eval.load_stacks([5, 6, '-', '*'])\n assert_equal [2, nil], @eval.maths\n end", "def get_stack_with_http_info(organization, name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: StacksApi.get_stack ...\"\n end\n # verify the required parameter 'organization' is set\n if @api_client.config.client_side_validation && organization.nil?\n fail ArgumentError, \"Missing the required parameter 'organization' when calling StacksApi.get_stack\"\n end\n if @api_client.config.client_side_validation && organization !~ Regexp.new(/[0-9a-z\\\\-]+/)\n fail ArgumentError, \"invalid value for 'organization' when calling StacksApi.get_stack, must conform to the pattern /[0-9a-z\\\\-]+/.\"\n end\n\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling StacksApi.get_stack\"\n end\n if @api_client.config.client_side_validation && name !~ Regexp.new(/[a-z0-9\\\\-_]+/)\n fail ArgumentError, \"invalid value for 'name' when calling StacksApi.get_stack, must conform to the pattern /[a-z0-9\\\\-_]+/.\"\n end\n\n # resource path\n local_var_path = \"/stacks/{organization}/{name}\".sub('{' + 'organization' + '}', organization.to_s).sub('{' + 'name' + '}', name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['ApiKeyAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Stack')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: StacksApi#get_stack\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def spec; end" ]
[ "0.5836761", "0.5825939", "0.5825939", "0.57308805", "0.5691807", "0.56296855", "0.5556125", "0.5537543", "0.5536057", "0.5533132", "0.5498599", "0.54967946", "0.5495594", "0.549271", "0.5484807", "0.5475166", "0.54750097", "0.54750097", "0.5440714", "0.5402894", "0.53823984", "0.5379407", "0.53327227", "0.5296087", "0.52860165", "0.5284729", "0.5284445", "0.52806103", "0.5255908", "0.5255171", "0.52184826", "0.52123743", "0.5201326", "0.51682884", "0.5147447", "0.5139067", "0.5136908", "0.51335454", "0.5125122", "0.5108605", "0.5099598", "0.5091953", "0.50896025", "0.5086303", "0.50806946", "0.50716746", "0.50705284", "0.5065165", "0.5063103", "0.5060459", "0.5054797", "0.5051853", "0.5047251", "0.5046821", "0.50429034", "0.5036553", "0.50345707", "0.5031593", "0.5029988", "0.5021627", "0.50195676", "0.50179565", "0.5014249", "0.50123805", "0.50068593", "0.49982783", "0.49910676", "0.49865225", "0.4983432", "0.49779743", "0.49752945", "0.49715987", "0.49684024", "0.49673602", "0.49657202", "0.49555686", "0.49533597", "0.49124968", "0.49124968", "0.4911247", "0.49096793", "0.4905627", "0.49053007", "0.49044618", "0.49017423", "0.48982736", "0.48953953", "0.48938316", "0.48868865", "0.48830265", "0.4881813", "0.48748258", "0.48727402", "0.48719138", "0.48664007", "0.48661396", "0.4861747", "0.486064", "0.485999", "0.48546255" ]
0.71573895
0
Credentials mock for Stratiform::Target
def get_mocked_creds(obj) obj.target_credentials end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def credentials; end", "def credentials; end", "def credentials; end", "def credentials; end", "def credentials; end", "def credentials=(_arg0); end", "def credentials=(_arg0); end", "def credentials=(_arg0); end", "def credentials=(_arg0); end", "def credentials=(_arg0); end", "def mock_defective_auth_hash\n nil\n end", "def credential; end", "def credential; end", "def initialize(credentials)\n @credentials = credentials\n end", "def credential=(_arg0); end", "def credential=(_arg0); end", "def credentials=(target, scheme, username, password)\r\n\t\t\t`#{BITS::BITSADMIN} /setcredentials {#{@id}} #{target} #{scheme} #{username} #{password}`\r\n\t\tend", "def credentials\n @credentials ||= {}\n end", "def set_credential(target_credential)\n @credential_name = target_credential \n end", "def set_credentials(credentials)\n @credentials = credentials\n end", "def credentials(opts = T.unsafe(nil)); end", "def fake_token auths = %w(TS S U)\n token = Java::ezbake.data.test.TestUtils.createTestToken *auths\n token.validity.setIssuedTo @ezconfig.app.getSecurityID\n token.validity.setIssuedFor(options[:service] || 'mockTargetSecurityId')\n token\nend", "def credential\n @path = \"/services/Cloud\"\n @credential ||= Nephophobia::Resource::Credential.new self\n end", "def test_verify_credentials\n return_values = JSON.parse('{\"applicationTag\":\"Test application\", \"isTestKey\":\"true\"}')\n @entity.stubs(:send_api_call).returns(return_values)\n\n credentials = @entity.credentials\n assert_true credentials.is_a?(Twizo::Result)\n assert_equal 'Test application', credentials.applicationTag\n assert_equal 'true', credentials.isTestKey\n end", "def credentials\n @credentials || self.class.credentials\n end", "def credentials\n config.credentials.credentials\n end", "def credentials=(credentials)\n @lock.synchronize do\n @credentials = credentials\n end\n end", "def credentials(authorization, request); end", "def credentials\n Trackerific.config[name]\n end", "def get_creds \n yml = YAML::load(File.open(ENV['TM_PROJECT_DIRECTORY'] + \"/config/settings.yaml\"))\n project_name = yml['project_name']\n username = yml['username']\n environment = yml['environment']\n password = KeyChain::find_internet_password(\"#{project_name}-mm\")\n endpoint = environment == \"sandbox\" ? \"https://test.salesforce.com/services/Soap/u/#{MM_API_VERSION}\" : \"https://www.salesforce.com/services/Soap/u/#{MM_API_VERSION}\"\n return { :username => username, :password => password, :endpoint => endpoint }\n end", "def credentials\n if Rails.env.test? || Rails.env.development?\n Rugged::Credentials::SshKeyFromAgent.new(username: username)\n else\n Rugged::Credentials::SshKey.new(username: 'git', publickey: SETTINGS['ssh_public_key'], privatekey: SETTINGS['ssh_private_key'])\n end\n end", "def credential_source\n super\n end", "def setup_base_mocks\n client = mock(\"Heroku::Client\")\n Heroku::Client.expects(:new).with(\"heroku_username\", \"heroku_password\").returns(client)\n client\n end", "def credentials\n @credentials ||= params.unpack1('m*').split(':', 2)\n end", "def use_demo_credentials!\n self.username = 'demo'\n self.password = 'password'\n end", "def credentials=(value)\n BaseTask.validate value, \"credentials\", Database::CREDENTIALS\n @credentials = value\n end", "def credentials_file\n dir['credentials']\n end", "def mock_oauth_request(result = nil)\n instance_double('oauth_request', execute: result)\n end", "def test(config)\n # Simulated credentials to be injected with InjectorMiddleware\n credential_injector_middleware(config, config.x.rails_auth.test_credentials ||= {})\n end", "def base_credential; end", "def test_server_creds\r\n certs = load_test_certs\r\n GRPC::Core::ServerCredentials.new(\r\n nil, [{private_key: certs[1], cert_chain: certs[2]}], false)\r\nend", "def credential(url); end", "def configure(credentials)\n credentials.each { |key, val| self.send(\"#{key}=\", val) }\n self\n end", "def tm_credentials\n tm_u, tm_ak = 'TEXTMAGIC_USERNAME', 'TEXTMAGIC_API_KEY'\n username, api_key = ENV[tm_u], ENV[tm_ak]\n unless username and api_key\n raise ArgumentError, \"To use the #{__method__} method, you must set the #{tm_u} and #{tm_ak} environment variables.\"\n end\n return username, api_key\nend", "def setup(credentials = {})\n requires :public_key, :ssh_ip_address, :username\n\n credentials[:proxy]= ssh_proxy unless ssh_proxy.nil?\n credentials[:password] = password unless self.password.nil?\n credentials[:key_data] = [private_key] if self.private_key\n\n commands = [\n %{mkdir .ssh},\n # %{passwd -l #{username}}, #Not sure if we need this here\n # %{echo \"#{Fog::JSON.encode(attributes)}\" >> ~/attributes.json}\n ]\n if public_key\n commands << %{echo \"#{public_key}\" >> ~/.ssh/authorized_keys}\n end\n\n # wait for domain to be ready\n Timeout::timeout(360) do\n begin\n Timeout::timeout(8) do\n Fog::SSH.new(ssh_ip_address, username, credentials.merge(:timeout => 4)).run('pwd')\n end\n rescue Errno::ECONNREFUSED\n sleep(2)\n retry\n rescue Net::SSH::AuthenticationFailed, Timeout::Error\n retry\n end\n end\n Fog::SSH.new(ssh_ip_address, username, credentials).run(commands)\n end", "def initialize(credentials, attributes = {})\n super(attributes)\n @credentials = credentials\n end", "def credz\n return @target, @port, @user, @pass, @domain, @hashpass, @hostname\nend", "def credentials\n {\n :login => Spree::Fulfillment.config[:api_key],\n :password => Spree::Fulfillment.config[:secret_key]\n }\n end", "def test_server_creds\n certs = load_test_certs\n GRPC::Core::ServerCredentials.new(\n nil, [{private_key: certs[1], cert_chain: certs[2]}], false)\nend", "def credentials\n @credentials ||= WebCredentials.new(self.config['user'], self.config['password'], self.config['domain'])\n end", "def set_credentials(credentials: nil)\n raise StandardError, 'credentials must be a hash' unless credentials.is_a?(Hash)\n\n password = ENV['CARRIER_PRODUCTS_ENCRYPTION_PASSWORD']\n encrypted_credentials = credentials.inject({}) do |hash, (key, value)|\n raise StandardError, \"#{key.to_s.capitalize} must be specified\" if value.blank? && !key.to_s.include?('test')\n\n hash[key] = AESCrypt.encrypt(value, password) if value.present?\n hash\n end\n\n self.credentials = encrypted_credentials\n self.save!\n end", "def setCredentials(service, host, port, userid, password, realm)\n @isblob = false\n @securityblob = nil\n @service = service\n @host = host\n @port = port\n @userid = userid\n @password = password\n @realm = realm\n end", "def credential\n authorizer.get_credentials('default')\n end", "def credentials\n {\n :provider => 'vsphere',\n :vsphere_username => new_resource.user,\n :vsphere_password => new_resource.password,\n :vsphere_server => new_resource.host,\n :vsphere_ssl => true,\n :vsphere_expected_pubkey_hash => new_resource.pubkey_hash\n }\nend", "def credentials_obj\n @credentials_obj ||= Aws::Credentials.new(\n access_key,\n secret_key\n )\n end", "def setCredentials(service, host, port, userid, password, realm)\n\t\t@isblob = false\n\t\t@securityblob = nil\n\t\t@service = service\n\t\t@host = host\n\t\t@port = port\n\t\t@userid = userid\n\t\t@password = password\n\t\t@realm = realm\n\tend", "def credentials_for(uri, realm); end", "def target\n expect :call, :attrasgn, :safe_call, :safe_attrasgn\n self[1]\n end", "def new_client(credentials)\n #Fog constructor expecting credentials[:terremark_password] and credentials[:terremark_username]\n terremark_credentials = {:terremark_vcloud_username => \"#{credentials.user}\", :terremark_vcloud_password => \"#{credentials.password}\" }\n safely do\n terremark_client = Fog::Terremark::Vcloud.new(terremark_credentials)\n vdc_id = terremark_client.default_vdc_id\n end\n if (vdc_id.nil?)\n raise \"AuthFailure\"\n end\n terremark_client\n end", "def file_path\n @credentials_file\n end", "def get_context(*params); raise('Stub or mock required.') end", "def setup\n if @request.present?\n @request.env['HTTP_ACCEPT'] = 'application/json'\n @request.headers['x-api-key'] = 'some_api_key'\n end\n ActiveSupport::Cache::FileStore.any_instance.stubs(:read).returns(\"anandsai_auth\")\n end", "def credentials\n auth_hash['credentials']\n end", "def environment_credentials(options)\n options[:type] == 'OneView' ? environment_credentials_from_oneview : environment_credentials_from_image_streamer\nend", "def create_target_mock\n ref = self.service_name.downcase.gsub(/ /, '-')\n create_row = {\n ref: ref,\n display_name: self.service_name,\n type: 'instance',\n iaas_type: 'ec2',\n iaas_properties: {},\n project_id: self.project.id\n }\n Model.create_from_row(self.project.model_handle(:target), create_row, convert: true, ret_obj: { model_name: :target_instance })\n end", "def initialize project, credentials, host: nil, timeout: nil\n @project = project\n @credentials = credentials\n @host = host\n @timeout = timeout\n @client_id = SecureRandom.uuid.freeze\n end", "def with_uri_credentials(uri); end", "def credentials(username, password, digest = false)\n self.username = username\n self.password = password\n self.digest = digest\n end", "def credentials(username, password, digest = false)\n self.username = username\n self.password = password\n self.digest = digest\n end", "def credentials(credentials_override = nil)\n result = super(credentials_override)\n #puts \"credentials result=\\n#{result}\"\n validate_headers_for_server(result)\n\n extra_headers = {\n 'userAgent' => generate_user_agent(),\n 'developerToken' => result[:developer_token]\n }\n if !@use_mcc and result[:client_customer_id]\n extra_headers['clientCustomerId'] = result[:client_customer_id]\n end\n extra_headers['validateOnly'] = 'true' if @validate_only\n extra_headers['partialFailure'] = 'true' if @partial_failure\n result[:extra_headers] = extra_headers\n #puts \"credentials result2=\\n#{result}\"\n return result\n end", "def initialize project, credentials, timeout: nil, client_config: nil\n @project = project\n @credentials = credentials\n @timeout = timeout\n @client_config = client_config || {}\n end", "def test_secure_setup\n customer = customers(:bob)\n \n credit_card_params = {\n :number => \"4111111111111111\",\n :last_four => \"1111\",\n :month => \"1\",\n :year => (Date.today.year + 2).to_s,\n }\n\n cc = CreditCard.secure_setup(credit_card_params, customer)\n assert cc.original_valid?\n end", "def credentials\n {\n marketplace_id: MWS_MARKETPLACE_ID,\n merchant_id: ENV['MWS_MERCHANT_ID'],\n aws_access_key_id: ENV['MWS_ACCESS_KEY'],\n aws_secret_access_key: ENV['MWS_SECRET_KEY'],\n }\n end", "def credentials\n @credentials ||= Rugged::Credentials::UserPassword.new({\n :username => \"x-oauth-basic\",\n :password => ENV[\"GITHUB_TOKEN\"]\n })\n end", "def credentials\n @credentials ||= begin\n request = Rack::Auth::Basic::Request.new(env)\n request.provided? ? request.credentials : []\n end\n end", "def assert_configuration_valid(credentials)\n mandatory_config_keys =\n [ENTERPRISE_SERVER_URL_SERVICE_CONFIG_KEY, SENSOR_HOST_SERVICE_CONFIG_KEY,\n SENSOR_PORT_SERVICE_CONFIG_KEY, SEEKER_SERVER_URL_CONFIG_KEY]\n mandatory_config_keys.each do |config_key|\n raise \"'#{config_key}' credential must be set\" unless credentials[config_key]\n end\n end", "def initialize project, credentials, timeout: nil, host: nil\n @project = project\n @credentials = credentials\n @timeout = timeout\n @host = host\n end", "def store_credentials(credentials)\n conf = configuration\n conf[:credentials] = {}\n conf[:credentials][:access_key], conf[:credentials][:secret_key] = credentials[0], credentials[1]\n store_configuration(conf)\n end", "def create_request\n super(@credentials)\n end", "def test_get_composition_with_files_warns_the_noble_developer_and_he_quickly_corrects_himself\n assert_raise(Mosquito::SageAdvice) do\n @req.query_string_params = {:hello => \"welcome\", :somefile => MockUpload.new(\"pic.jpg\") }\n end\n end", "def third_party_credential(url); end", "def client\n @client ||= CFoundry::Client.new(@target.to_s).tap do |c|\n c.login(@username, @password)\n end\n end", "def set_credential\n # @credential = Credential.find(params[:id])\n end", "def set_creds\n\n creds = Aws::SharedCredentials.new({profile_name: session[:current_profile], correctClockSkew: true})\n Aws.config.update({\n region: 'us-east-1',\n credentials: creds\n })\n\n get_mfa_device\n if !session[:profile_mfa].nil? && !session[:profile_mfa].empty?\n begin\n res = sts.get_session_token(duration_seconds: 3600, serial_number: session[:mfa_device], token_code: session[:profile_mfa])\n\n session[:elevated] = true\n session[session[:current_profile]] = {\n access_key_id: res.credentials['access_key_id'],\n secret_access_key: res.credentials['secret_access_key'],\n session_token: res.credentials['session_token'],\n expiration: res.credentials['expiration'],\n containers: []\n }\n creds = Aws::Credentials.new(\n res.credentials['access_key_id'],\n res.credentials['secret_access_key'],\n res.credentials['session_token']\n )\n Aws.config.update({\n region: 'us-east-1',\n credentials: creds\n })\n\n { err: false }\n rescue Exception => e\n p \"RESCUE----\"\n p e\n session[session[:current_profile]] = {\n containers: []\n }\n session[:profile_mfa] = \"\"\n session[:elevated] = false\n { err: true }\n end\n\n else\n session[session[:current_profile]] = {\n containers: []\n }\n session[:profile_mfa] = \"\"\n session[:elevated] = false\n { err: false}\n end\n\n end", "def initialize(credentials = {})\n self.client_id = credentials[:client_id]\n self.client_secret = credentials[:client_secret]\n self.access_token = credentials[:access_token]\n self.access_token_secret = credentials[:access_token_secret]\n end", "def mock_file\n file = 'a_file.png'\n file.stubs(:size).returns(32)\n file.stubs(:original_filename).returns('a_file.png')\n file.stubs(:content_type).returns('image/png')\n file.stubs(:read).returns(false)\n file\nend", "def credentials\n @lock.synchronize do\n @credentials\n end\n end", "def credentials\n @credentials ||= begin\n txt = ::Base64.decode64(header.params || '')\n txt.split(/:/, 2)\n end\n end", "def target= exp\n expect :call, :attrasgn, :safe_call, :safe_attrasgn\n @my_hash_value = nil\n self[1] = exp\n end", "def setup\n OmniAuth.config.test_mode = true\n OmniAuth.config.mock_auth[:github] = OmniAuth::AuthHash.new({:provider => 'github',:uid => '123545',:info => {:name => 'Satine', :email => '[email protected]'}})\n end", "def setup\n @requester = Rack::MockRequest.new(SampleApp)\n end", "def get_issuer(*params); raise('Stub or mock required.') end", "def credentials\n []\n end", "def credentials\n []\n end", "def flexmock_get\n @mock\n end", "def flexmock_get\n @mock\n end", "def credentials\n return unless type\n send type\n end", "def write_credentials\n # AWS CLI is needed because writing AWS credentials is not supported by the AWS Ruby SDK.\n return unless system('which aws >/dev/null 2>&1')\n Aws::SharedCredentials::KEY_MAP.transform_values(&@credentials.method(:send)).\n merge(expiration: @expiration).each do |key, value|\n system(\"aws configure set #{key} #{value} --profile #{@session_profile}\")\n end\n end", "def credentials\n R10K::Git::Rugged::Credentials.new(self)\n end", "def credentials\n {\n client_id: client_id,\n client_secret: client_secret\n }\n end" ]
[ "0.62596613", "0.62596613", "0.62596613", "0.62596613", "0.62596613", "0.6157348", "0.6157348", "0.6157348", "0.6157348", "0.6157348", "0.60763097", "0.584286", "0.584286", "0.5740586", "0.57397795", "0.57397795", "0.5651312", "0.56274176", "0.5566876", "0.55356437", "0.55125535", "0.5509884", "0.548898", "0.5461695", "0.5443991", "0.54140955", "0.53981185", "0.5387284", "0.53450763", "0.5317261", "0.5305295", "0.53016084", "0.52832174", "0.52816445", "0.52582663", "0.5252032", "0.52486235", "0.5241876", "0.52242565", "0.52137876", "0.5210084", "0.519376", "0.5190871", "0.5182694", "0.51800776", "0.5167273", "0.5145925", "0.5137244", "0.5131519", "0.51248693", "0.511759", "0.5091857", "0.50662863", "0.50566465", "0.50551164", "0.504859", "0.49986187", "0.49925336", "0.49912405", "0.49906316", "0.49878332", "0.49816567", "0.49813655", "0.49756467", "0.4973446", "0.4967651", "0.49589828", "0.4945831", "0.4945831", "0.49419677", "0.493677", "0.49341232", "0.49324724", "0.49289343", "0.49246222", "0.4923938", "0.49196202", "0.49177364", "0.49149042", "0.49126405", "0.49053946", "0.49021888", "0.48978984", "0.48703378", "0.48669973", "0.48656133", "0.48651895", "0.48501137", "0.484344", "0.48349306", "0.4828939", "0.4827807", "0.4826452", "0.4826452", "0.48250678", "0.48250678", "0.48189944", "0.48164", "0.48160332", "0.48120522" ]
0.7272078
0
GET /rentables GET /rentables.json
def index @rentables = params[:q] ? Rentable.where(['LOWER(name) LIKE ?', "%#{params[:q].downcase}%"]) : Rentable.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @rentable_items = RentableItem.all\n render json: @rentable_items\n end", "def index\n @rents = Rent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rents }\n end\n end", "def show\n render json: @rentable_item\n end", "def index\n @rentals = Rental.get_all\n end", "def listRestaurants\n _restaurants = Restaurant.all\n render json: _restaurants\n end", "def my_rentals\n @rentals = Rental.get_all_for_user current_user\n end", "def index\n if params[:user_id]\n @rents = find_user.rents\n render json: @rents\n elsif params[:book_id]\n @rents = find_book.rents\n render json: @rents\n else\n @rents = Rent.all\n render json: @rents\n end\n end", "def index\n @rentals = @car.rentals.all\n end", "def index\n @rentals = current_user.rentals\n end", "def index\n @rents = Rent.all\n end", "def index\n json_response(Restaurant.all)\n end", "def index\n @rents = Rent.all\n @client = Client.new\n end", "def show\n @rent = Rent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rent }\n end\n end", "def index\n @rentals = Rental.all\n end", "def index\n @rentals = Rental.all\n end", "def index\n @rentals = Rental.all\n end", "def index\n @restaurants = Restaurant.all\n # @restaurants = current_owner.restaurants\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @restaurants }\n end\n end", "def index\n @nepals = Nepal.all\n\n render json: @nepals\n end", "def index\n render json: reservations\n end", "def get_carriers\n @transporter = Transporter.find(params[:id])\n\n render json: @transporter.carriers\n end", "def index\n @curriculum_vitaes = findable_curriculum_vitaes.all\n respond_to do |format|\n format.html {}\n format.json { render json: @curriculum_vitaes }\n end\n end", "def get_travellers\n if current_user != nil\n @trip = Trip.find(params[:id])\n render json: @trip.trip_json\n else\n render json: session[:trip].trip_json\n end\n\n end", "def index\n @restaurants = Restaurant.all\n # render json: @restaurants\n end", "def rental(rental, options = {})\n get(\"rentals/#{rental}\", options).pop\n end", "def index\n @rental_requests = RentalRequest.all\n end", "def index \n restaurant = Restaurant.all\n render json: restaurant\n end", "def index\n @relatories = Relatory.all\n end", "def index\n @election = Election.find(params[:election_id])\n @races = @election.races\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @races }\n end\n end", "def index\n @recipes = Recipe.all\n render json: @recipes\n end", "def index\n @treks = Trek.all\n @title = \"Trekking routes and destinations\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @treks }\n end\n end", "def index\n recipe_items = current_user.recipes.includes(recipe_items: :ingredient).find(params[:recipe_id]).recipe_items\n render json: { recipe_items: recipe_items}.to_json(include: :ingredient), status: :ok\n end", "def index\n @prayers = Prayer.all\n render json: @prayers, status: 200 # you've got a serializer. Maybe you should use it.\n end", "def index\n if user_signed_in?\n @reservations = current_user.reservations\n elsif owner_signed_in?\n @reservations = []\n # current_owner.restaurants.each {|rest| @reservations += rest.reservations}\n if current_owner.restaurant.blank?\n @reservations = []\n else\n @reservations = current_owner.restaurant.reservations\n end\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reservations }\n end\n end", "def index\n @specialties = Specialty.all\n\n render json: @specialties\n end", "def index\n @ordens = Orden.all\n render json: @ordens\n end", "def index\n\t #@racers = Racer.all\n\t if !request.accept || request.accept == \"*/*\"\n\t\t\trender plain: \"/api/racers/#{params[:racer_id]}/entries\"\n\t\telse\n\t\t\t#real implementation ...\n\t\tend\n\t end", "def list\n \n recipes = Recipe.all\n render :json => recipes.to_json\n\n end", "def index\n @prayers = Prayer.where(\"user_id = ?\", getUser())\n\n @prayer_requests = PrayerRequest.all \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @prayers }\n end\n end", "def index\n @reward_and_levels = RewardAndLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reward_and_levels }\n end\n end", "def index\n @breeds = Breed.all\n\n render json: @breeds\n end", "def index\n if user_signed_in?\n @reservations = current_user.reservations\n elsif owner_signed_in?\n @reservations = []\n # current_owner.restaurants.each {|rest| @reservations += rest.reservations}\n if current_owner.restaurant.blank?\n @reservations = []\n else\n @reservations = current_owner.restaurant.reservations\n end\n end\n @reservations = @reservations.order(\"id desc\").page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reservations }\n end\n end", "def index\n json_response(current_restaurant.restaurant_food_items)\n end", "def index\n @warriors = Warrior.all\n render :json => @warriors, :include => [:skills, :equipment_lists,]\n\n end", "def index\n recipes = Recipe.all\n render status: :ok, json: recipes\n end", "def get_all_rent_by_date\n property = Property.find(params[:id])\n filter_date = Date.new(params[:year].to_i, params[:month].to_i, params[:day].to_i)\n lease_start_date = property.rent_commencement_date\n lease_end_date = property.rent_commencement_date + property.lease_duration_in_years.years\n \n if property.optional_extensions_status\n lease_end_date = lease_end_date + (property.number_of_option_period * property.length_of_option_period).years\n end\n\n if lease_start_date <= filter_date && filter_date <= lease_end_date\n rent_tables = property.rent_tables.where(\"version = ? AND start_year <= ? AND end_year >= ?\", property.rent_table_version, params[:year].to_i, params[:year].to_i)\n else\n rent_tables = []\n end\n daily_table_html = render_to_string :template => \"xhr/daily_rent\", :locals => {:rent_tables => rent_tables, :filter_date => filter_date}\n \n term_status = property.check_in_which_term filter_date\n term_wizard_html = render_to_string :template => \"xhr/lease_term_wizard\", :locals => {:property => property, :term_status => term_status}\n \n render json: { daily_rent: daily_table_html, term_wizard: term_wizard_html }\n end", "def getOrden \n \t@orden = Orden.where(:rest => params[:id_res])\n \trender json: @orden\n end", "def index\n @litters = Litter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @litters }\n end\n end", "def index\n @title = 'Tables'\n @tables = Table.all\n\n respond_to do |format|\n format.html {\n @tables_rabl = Rabl.render(@tables, 'tables/index', view_path: 'app/views', format: 'json')\n @guests_rabl = Rabl.render(Guest.attending, 'tables/guests', view_path: 'app/views', format: 'json')\n }\n format.json { render json: @tables }\n end\n end", "def index\n recipes = current_user.recipes\n render json: { recipes: recipes}.to_json, status: :ok\n end", "def index\n @housing_rents = HousingRent.all\n end", "def dayIndex\n render json: Restaurant.restaurantsDay\n end", "def show\n rent = Rent.find(params['rent_id'])\n authorize rent\n render(json: rent, serializer: RentSerializer)\n end", "def index\n @recipes = Recipe.all\n respond_to do |format|\n format.html {}\n format.json { render json: @recipes }\n end\n end", "def buyers\n result = get_buyers(params, false)\n render json: result, status: 200\n end", "def index\n @meant_it_rels = MeantItRel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @meant_it_rels }\n end\n end", "def index\n @adopters = Adopter.where(filtering_params)\n\n render json: @adopters\n end", "def index\n @itineraryList = Itinerary.all\n render json: @itineraryList, status: 200\n end", "def items\n @beverages = Beverage.available\n respond_to do |format|\n format.json { render :json => @beverages.to_json(methods: :image_url)}\n end\n end", "def index\n @renters = Renter.all\n end", "def taken\n @travels = Travels::Travel.taken.where(performer: current_user)\n\n respond_to do |format|\n format.html { render \"travels/index\" }\n format.json { as_json @travels }\n end\n end", "def index\n @trips = Trip.all\n\n render json: @trips\n end", "def index\n @trips = Trip.all\n\n render json: @trips\n end", "def index\n @realtors = Realtor.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @realtors }\n end\n end", "def index\n @realtors = Realtor.all\n end", "def index\n @realtors = Realtor.all\n end", "def index\n @recruiters = Recruiter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recruiters }\n end\n end", "def index\n @prayers = Prayer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @prayers }\n end\n end", "def index\n @retailers = Retailer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @retailers }\n end\n end", "def index\n\n @debtors = Debtor.all\n\n render json: @debtors\n end", "def index\n @renters = Renter.page(params[:page]).per(10)\n end", "def get_todo_restaurants\n @profile = Profile.find(params[:id])\n @restaurants = @profile.todos\n\n render status: 200, json: @restaurants\n end", "def index\n @notadedebito = Notadedebito.find(params[:notadecredito_id])\n @renglon_notadebitos = @notadedebito.renglon_notadebitos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @renglon_notadebitos }\n end\n end", "def recipes # /v1/user/:id/recipes (GET)\n recipes = ::Recipe.all\n render json: recipes, :each_serializer => RecipeSmallSerializer, root: false, status: 200\n end", "def show\n render json: @tenure\n end", "def index\n @networkings = Networking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @networkings }\n end\n end", "def recipebook\n @levels = Level.all\n\n respond_to do |format|\n format.html # recipebook.html.erb\n format.json { render json: @levels }\n end\n end", "def index\n @items = @deal.items\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end", "def index\n @relationships = Relationship.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @relationships }\n end\n end", "def index\n @trips = Trip.all\n render :json => @trips\n end", "def index\n @waiters = @course.waiters.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @waiters }\n end\n end", "def index\n render json: Loan.all\n end", "def get_data\n users_without_admin = User.where(\"name != 'admin'\").count\n users = Userarchyves.select('user_id, food, voted_for').where(archyves_id: current_round.id).all\n retaurants = Restaurant.select('id, votes').all\n \n # return json \n respond_to do |format|\n format.json {\n render json: {\n users: users.as_json(only: [:user_id, :food, :voted]),\n restaurants: retaurants.as_json(only: [:id, :votes]),\n winner: winner.as_json(only: [:id]),\n food_history: food_history.as_json(only: [:food]),\n round_end: round_ended?.as_json\n }\n }\n end\n end", "def index\n @rebateable = find_rebateable\n\n if params[:category_id]\n @rebates = Category.find(params[:category_id]).find_rebates\n elsif params[:sub_category_id]\n @rebates = SubCategory.find(params[:sub_category_id]).find_rebates\n elsif params[:product_type_id]\n @rebates = ProductType.find(params[:product_type_id]).find_rebates\n elsif @rebateable\n @rebates = @rebateable.rebates\n else\n @rebates = Rebate.order(:name).all\n end\n\n @total = @rebates.count\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rebates }\n end\n end", "def index\n @trucks = Truck.all\n\n render json: @trucks\n end", "def show\n @trainer = Trainer.find(params[:id])\n\n render json: @trainer.as_json(only: [:name], include: [:trainees])\n end", "def index\n render json: Recipe.all\n end", "def show\n @renter = Renter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @renter }\n end\n end", "def index\n if(current_user.customer_id?)\n @resturants = Resturant.where(\"region_id = ?\", current_user.customer.region_id)\n else\n @resturants = Resturant.where(\"region_id = ?\", current_user.driver.region_id)\n end\n \n render json: @resturants, status: 200\n end", "def index \n recipeIngredients = RecipeIngredient.all\n #render will return the object back in json format so that it can be used by the frontend\n render json: recipeIngredients\n end", "def index\n @castes = Caste.includes(:religion).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @castes }\n end\n end", "def index\n @reservations = Reservation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reservations }\n end\n end", "def index\n @reservations = Reservation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reservations }\n end\n end", "def index\n @career_specialties = CareerSpecialty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @career_specialties }\n end\n end", "def show\n respond_with @celeb.to_json(:include => :items)\n end", "def index\n @diaries = current_user.diaries.all\n respond_to do |format|\n format.html {render :index}\n format.json { render json: @diaries }\n end\n end", "def index\n @recruiters = Recruiter.all\n render_json_serializer(@recruiters)\n end", "def set_rentals\n @rentals = Campground.find(params[:campground_id]).rental_categories.find(params[:rental_category_id]).rentals\n end", "def index\n @cartridges = Cartridge.all\n\n respond_to do |format|\n format.html\n format.json { render json: @cartridges }\n end\n end", "def index\n @disponibles = Disponible.take(50)\n\n render json: @disponibles, include: '**'\n end", "def index\n render json: @chapter.reposoitories, status: :ok\n end", "def index\n @rented_units = appointment.rented_units\n end" ]
[ "0.7399179", "0.69396544", "0.692875", "0.674618", "0.6661663", "0.6579528", "0.6551279", "0.64669335", "0.64251274", "0.63881063", "0.6322577", "0.630479", "0.62961066", "0.6281314", "0.6281314", "0.6281314", "0.6277209", "0.625763", "0.6232797", "0.6210624", "0.6195956", "0.6180847", "0.61759096", "0.6173304", "0.6164948", "0.61610323", "0.61292654", "0.61240536", "0.60962546", "0.60819864", "0.60800254", "0.60677737", "0.6064151", "0.60497093", "0.60481083", "0.60353744", "0.60188687", "0.6014259", "0.6010276", "0.6005043", "0.6003606", "0.5999022", "0.59970146", "0.59916466", "0.59825295", "0.59782225", "0.5977195", "0.59751457", "0.5948768", "0.59439725", "0.5942657", "0.5941391", "0.5932368", "0.5922482", "0.5921284", "0.59161717", "0.5915307", "0.59152424", "0.5911935", "0.59109473", "0.5908288", "0.5908288", "0.59032375", "0.59014493", "0.59014493", "0.58997774", "0.58971786", "0.58935636", "0.58886856", "0.5888409", "0.58841366", "0.5878256", "0.5877708", "0.58669823", "0.5866116", "0.5860383", "0.58592033", "0.58590466", "0.5856222", "0.5853204", "0.5852244", "0.58442974", "0.584291", "0.58427924", "0.5842323", "0.58329797", "0.58314294", "0.58286554", "0.5825796", "0.58191353", "0.5813212", "0.5813212", "0.5809841", "0.580799", "0.580403", "0.58018345", "0.58003753", "0.5798135", "0.57941383", "0.57941014", "0.578999" ]
0.0
-1
GET /rentables/1 GET /rentables/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @rentable_items = RentableItem.all\n render json: @rentable_items\n end", "def show\n render json: @rentable_item\n end", "def index\n @rents = Rent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rents }\n end\n end", "def show\n @rent = Rent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rent }\n end\n end", "def index\n @rentals = Rental.get_all\n end", "def rental(rental, options = {})\n get(\"rentals/#{rental}\", options).pop\n end", "def listRestaurants\n _restaurants = Restaurant.all\n render json: _restaurants\n end", "def index\n if params[:user_id]\n @rents = find_user.rents\n render json: @rents\n elsif params[:book_id]\n @rents = find_book.rents\n render json: @rents\n else\n @rents = Rent.all\n render json: @rents\n end\n end", "def index\n @rentals = @car.rentals.all\n end", "def index\n render json: reservations\n end", "def index\n @rents = Rent.all\n @client = Client.new\n end", "def index\n @rents = Rent.all\n end", "def index\n @rentals = Rental.all\n end", "def index\n @rentals = Rental.all\n end", "def index\n @rentals = Rental.all\n end", "def show\n @rental = Rental.get_by_id(params[:id])\n end", "def index\n @restaurants = Restaurant.all\n # @restaurants = current_owner.restaurants\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @restaurants }\n end\n end", "def get_carriers\n @transporter = Transporter.find(params[:id])\n\n render json: @transporter.carriers\n end", "def show\n recipe = Recipe.find(params[:id])\n # recipes = Recipe.find_by(params[:id])\n # render json: recipe\n render json: recipe\n end", "def getOrden \n \t@orden = Orden.where(:rest => params[:id_res])\n \trender json: @orden\n end", "def index \n restaurant = Restaurant.all\n render json: restaurant\n end", "def index\n json_response(Restaurant.all)\n end", "def my_rentals\n @rentals = Rental.get_all_for_user current_user\n end", "def index\n @rentals = current_user.rentals\n end", "def index\n @recipes = Recipe.all\n render json: @recipes\n end", "def index\n @restaurants = Restaurant.all\n # render json: @restaurants\n end", "def show\n @apprentice = Apprentice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @apprentice }\n end\n end", "def index\n @rental_requests = RentalRequest.all\n end", "def index\n @specialties = Specialty.all\n\n render json: @specialties\n end", "def index\n recipe_items = current_user.recipes.includes(recipe_items: :ingredient).find(params[:recipe_id]).recipe_items\n render json: { recipe_items: recipe_items}.to_json(include: :ingredient), status: :ok\n end", "def show\n @renter = Renter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @renter }\n end\n end", "def show\n @ingredient = Ingredient.find_by_url_slug(params[:id])\n @ingredient = Ingredient.find(params[:id]) if @ingredient.nil?\n @recipes = @ingredient.recipes.order('created_at DESC')\n logger.debug @recipes.inspect\n respond_to do |format|\n format.html {render :layout => 'wall'}\n format.json { render json: @ingredient }\n end\n end", "def index\n recipes = Recipe.all\n render status: :ok, json: recipes\n end", "def index\n @curriculum_vitaes = findable_curriculum_vitaes.all\n respond_to do |format|\n format.html {}\n format.json { render json: @curriculum_vitaes }\n end\n end", "def index\n @nepals = Nepal.all\n\n render json: @nepals\n end", "def dayIndex\n render json: Restaurant.restaurantsDay\n end", "def show\n\n recipe = Recipe.find(params[:id])\n render :json => recipe.to_json\n\n end", "def show\n @railway = Railway.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @railway }\n end\n end", "def getArrondissement\r\n \tvil = params[:id]\r\n \trender json: Arrondissement.where(vil_id: vil)\r\n end", "def index\n @recipes = Recipe.all\n respond_to do |format|\n format.html {}\n format.json { render json: @recipes }\n end\n end", "def ingredients_by_recipe\n recipe = Recipe.find(params[:id])\n render json: recipe.ingredients\n end", "def show\n rent = Rent.find(params['rent_id'])\n authorize rent\n render(json: rent, serializer: RentSerializer)\n end", "def get_todo_restaurants\n @profile = Profile.find(params[:id])\n @restaurants = @profile.todos\n\n render status: 200, json: @restaurants\n end", "def index\n @treks = Trek.all\n @title = \"Trekking routes and destinations\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @treks }\n end\n end", "def index\n @election = Election.find(params[:election_id])\n @races = @election.races\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @races }\n end\n end", "def show\n @get_restaurant_list = GetRestaurantList.find(params[:id])\n\n render json: @get_restaurant_list\n end", "def index\n @breeds = Breed.all\n\n render json: @breeds\n end", "def index\n @recruiters = Recruiter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recruiters }\n end\n end", "def index\n @items = @deal.items\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end", "def show\n @restaurant_table = RestaurantTable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @restaurant_table }\n end\n end", "def show\n @account_receivable = AccountReceivable.find(params[:id])\n @account_receivables = AccountReceivable.where(parent_id: @account_receivable.id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @account_receivable }\n end\n end", "def show\n render json: @tenure\n end", "def show\n @restaurant = Restaurant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @restaurant.to_json(except: [ :created_at, :updated_at ], methods: [ :partial_dishes, :partial_comments, :busy, :partial_recommendations ]) }\n end\n end", "def index\n @trips = Trip.all\n\n render json: @trips\n end", "def index\n @trips = Trip.all\n\n render json: @trips\n end", "def set_rentable\n @rentable = Rentable.find(params[:id])\n end", "def show\n @borrower = Borrower.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @borrower }\n end\n end", "def index\n @rental = Rental.friendly.find(params[:rental_id])\n @features = Feature.all\n end", "def get_travellers\n if current_user != nil\n @trip = Trip.find(params[:id])\n render json: @trip.trip_json\n else\n render json: session[:trip].trip_json\n end\n\n end", "def index\n @itineraryList = Itinerary.all\n render json: @itineraryList, status: 200\n end", "def show\n @trainer = Trainer.find(params[:id])\n\n render json: @trainer.as_json(only: [:name], include: [:trainees])\n end", "def index\n @relatories = Relatory.all\n end", "def index\n @recipes = Recipe.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recipes }\n end\n end", "def index\n @trips = Trip.all\n render :json => @trips\n end", "def index\n json_response(current_restaurant.restaurant_food_items)\n end", "def index\n @housing_rents = HousingRent.all\n end", "def show\n render json: @recipe\n end", "def show\n @recipe = Recipe.find(params[:id])\n @nutrition_info = NutritionInfo.where( \"recipe_id = ?\", @recipe.id ).first\n @inventory_items = []\n @recipe.inventory_items.each do |inventory_item|\n @inventory_items << inventory_item\n end\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe }\n end\n end", "def show\n @rental_list = RentalList.find(params[:id])\n end", "def index\n @warriors = Warrior.all\n render :json => @warriors, :include => [:skills, :equipment_lists,]\n\n end", "def index\n @reservations = Reservation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reservations }\n end\n end", "def index\n @reservations = Reservation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reservations }\n end\n end", "def index\n @networkings = Networking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @networkings }\n end\n end", "def index\n @items = Item.all\n @budget = Budget.find params[:budget_id]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end", "def show\n render json: Agent.find(params[:id]).buyers\n end", "def list_ingredients\n rid = params[:id]\n items = Aws.get_ingredients_from_db(rid)\n render :json => items\n end", "def index\n @ordens = Orden.all\n render json: @ordens\n end", "def show\n # @retailer = Retailer.find(params[:id], :include => [:deals, :advertisements, :account] )\n respond_to do |format|\n format.html # show.html.erb\n format.json # show.json.rabl\n end\n end", "def index\n recipes = current_user.recipes\n render json: { recipes: recipes}.to_json, status: :ok\n end", "def index\n if user_signed_in?\n @reservations = current_user.reservations\n elsif owner_signed_in?\n @reservations = []\n # current_owner.restaurants.each {|rest| @reservations += rest.reservations}\n if current_owner.restaurant.blank?\n @reservations = []\n else\n @reservations = current_owner.restaurant.reservations\n end\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reservations }\n end\n end", "def show\n @meal = Meal.find(params[:meal_id]) if params[:meal_id]\n @recipe = @meal.recipes.find(params[:id]) if @meal\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe }\n end\n end", "def index\n @prayers = Prayer.all\n render json: @prayers, status: 200 # you've got a serializer. Maybe you should use it.\n end", "def index\n @trips = Trip.desc.all\n @latest_trip = @trips.first\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trips }\n end\n end", "def show\n @reef_tank = ReefTank.find(params[:id])\n @watchers = Watcher.all\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reef_tank }\n end\n end", "def index\n @notadedebito = Notadedebito.find(params[:notadecredito_id])\n @renglon_notadebitos = @notadedebito.renglon_notadebitos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @renglon_notadebitos }\n end\n end", "def index\n @relationships = Relationship.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @relationships }\n end\n end", "def index\n if user_signed_in?\n @reservations = current_user.reservations\n elsif owner_signed_in?\n @reservations = []\n # current_owner.restaurants.each {|rest| @reservations += rest.reservations}\n if current_owner.restaurant.blank?\n @reservations = []\n else\n @reservations = current_owner.restaurant.reservations\n end\n end\n @reservations = @reservations.order(\"id desc\").page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reservations }\n end\n end", "def taken\n @travels = Travels::Travel.taken.where(performer: current_user)\n\n respond_to do |format|\n format.html { render \"travels/index\" }\n format.json { as_json @travels }\n end\n end", "def index\n @prayers = Prayer.where(\"user_id = ?\", getUser())\n\n @prayer_requests = PrayerRequest.all \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @prayers }\n end\n end", "def recipes # /v1/user/:id/recipes (GET)\n recipes = ::Recipe.all\n render json: recipes, :each_serializer => RecipeSmallSerializer, root: false, status: 200\n end", "def index\n @trucks = Truck.all\n\n render json: @trucks\n end", "def list\n \n recipes = Recipe.all\n render :json => recipes.to_json\n\n end", "def show\n @rebate = Rebate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rebate }\n end\n end", "def show\n @data = @recipe.read(params[:id])\n render json: @data\n end", "def show\n\t\t@recipe = Recipe.find(params[:id])\n\t\tif @recipe \n\t\t\trender json: @recipe.to_json(:include => [:inventories])\n\t\telse\n\t\t\trender status: 400, nothing: true\n\t\tend\n\tend", "def show\n @restaurant = Restaurant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @restaurant }\n end\n end", "def show\n @restaurant = Restaurant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @restaurant }\n end\n end", "def show\n @restaurant = Restaurant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @restaurant }\n end\n end", "def show\n @carrito_item = CarritoItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @carrito_item }\n end\n end", "def show\n @rater = Rater.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rater }\n end\n end", "def index\n render json: Recipe.all\n end" ]
[ "0.7197679", "0.70144725", "0.6795755", "0.6617176", "0.6565496", "0.64870125", "0.634783", "0.63366985", "0.6275659", "0.6265954", "0.626387", "0.62233245", "0.61892474", "0.61892474", "0.61892474", "0.618295", "0.61814964", "0.6177243", "0.6161448", "0.61508054", "0.611972", "0.61161983", "0.6097895", "0.60865754", "0.60864806", "0.6074255", "0.6057551", "0.6039381", "0.6025789", "0.60164285", "0.6011134", "0.6004407", "0.59895647", "0.59669864", "0.5955895", "0.59505105", "0.5949749", "0.59432507", "0.5942478", "0.5939711", "0.5929782", "0.592877", "0.59237427", "0.5908251", "0.58992094", "0.5898292", "0.5894916", "0.58944553", "0.5891819", "0.58872473", "0.5883823", "0.58837813", "0.5882474", "0.5882399", "0.5882399", "0.5880753", "0.5880008", "0.5872337", "0.5868239", "0.5854551", "0.58520246", "0.5851514", "0.5847523", "0.5843266", "0.5842996", "0.58356714", "0.5831199", "0.583002", "0.5829509", "0.5827138", "0.58195955", "0.58195955", "0.5817168", "0.58152944", "0.5811789", "0.5808319", "0.5808291", "0.58005035", "0.5798126", "0.5792104", "0.57904315", "0.578901", "0.57878643", "0.5786241", "0.5785761", "0.5785656", "0.57842344", "0.5782037", "0.5780593", "0.57689583", "0.5766781", "0.576575", "0.57646227", "0.5763976", "0.57634455", "0.5760065", "0.5760065", "0.5760065", "0.5759398", "0.57588005", "0.5758061" ]
0.0
-1
POST /rentables POST /rentables.json
def create @rentable = Rentable.new(rentable_params) respond_to do |format| if @rentable.save format.html { redirect_to @rentable, notice: 'Rentable was successfully created.' } format.json { render :show, status: :created, location: @rentable } else format.html { render :new } format.json { render json: @rentable.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_rental(options = {})\n post(:rentals, rentals: [options]).pop\n end", "def create\n rental = sporting_goods.rentals.new(rental_params)\n rental.user_id = current_user.id\n if rental.save\n render json: rental, status: 200\n else\n render json: rental, status: 400\n end\n end", "def index\n @rentable_items = RentableItem.all\n render json: @rentable_items\n end", "def create\n @rentable_item = RentableItem.new(rentable_item_params)\n @rentable_item.save\n end", "def create\n @rent = Rent.new(rent_params)\n\n respond_to do |format|\n if @rent.save\n format.html { redirect_to @rent, notice: 'Rent was successfully created.' }\n format.json { render :show, status: :created, location: @rent }\n else\n format.html { render :new }\n format.json { render json: @rent.errors, status: :unprocessable_entity }\n end\n end\n end", "def rental_item_params\n params.permit(:name, :is_rentable)\n end", "def rentable_params\n params.require(:rentable).permit(:name, :image, :description, :location, :quantity, :category, :hourly_rate)\n end", "def create\n @rent = Rent.new(rent_params)\n\n respond_to do |format|\n if @rent.save\n format.html { redirect_to redirecting_rent_path(@rent.token) }#, notice: 'Rent was successfully created.' }\n format.json { render json: { url: redirecting_rent_path(@rent.token) }, status: :created, location: @rent }\n else\n format.html { render :new }\n format.json { render json: @rent.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n render json: @rentable_item\n end", "def create \n num_days = (Date.parse(params['rent_info']['end_date']).mjd - Date.parse(params['rent_info']['start_date']).mjd) \n total = num_days * params['rent_info']['price_per_day']\n # byebug\n if User.find(params['rent_info']['owner_id'])\n user = User.find(params['rent_info']['owner_id'])\n user.money_made += total \n user.save\n end\n\n renter_post = RenterPost.create(\n renter_id: params['rent_info']['renter_id'],\n post_id: params['rent_info'][\"post_id\"],\n start_date: params['rent_info'][\"start_date\"],\n end_date: params['rent_info'][\"end_date\"],\n status: params['rent_info'][\"status\"]\n )\n if renter_post \n render json: renter_post\n else\n render json: {error: \"Could not create Renter Post\"}\n end\n end", "def create\n @rebateable = find_rebateable\n @rebate = @rebateable.rebates.build(params[:rebate])\n @sector_names = params[:sector_names] || []\n @industry_names = params[:industry_names] || []\n @rebate.tag_names = @sector_names.join(',') + \",\" + @industry_names.join(',')\n\n respond_to do |format|\n if @rebate.save\n format.html { redirect_to :id => nil }\n format.json { render json: @rebate, status: :created, location: @rebate }\n else\n format.html { render action: \"new\" }\n format.json { render json: @rebate.errors, status: :unprocessable_entity }\n end\n end\n end", "def createCharities\n\tcharity_list = [\"Direct Relief\", \"Catholic Medical Mission Board\", \"MAP International\", \"United Nations Foundation\", \"The Rotary Foundation of Rotary International\", \"Samaritan's Purse\", \"Institute of International Education\", \"International Rescue Committee\", \"Compassion International\", \"United States Fund for UNICEF\"]\n\tcharity_list.each do |charity|\n\t\tRestClient.post 'http://api.reimaginebanking.com/merchants?key=e0486a76005721ee6d86b140eaea2a40', { \"name\": \"#{charity}\"}.to_json, :content_type => :json, :accept => :json\n\tend\nend", "def create\n @rental = Rental.new(rental_params)\n\n respond_to do |format|\n if @rental.save\n format.html { redirect_to @rental, notice: \"Rental was successfully created.\" }\n format.json { render :show, status: :created, location: @rental }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @rental.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @plate = @restaurante.plates.create(plate_params)\n @plate.ratings ||= []\n @plate.clients_ratings ||= []\n\n respond_to do |format|\n if @plate.save\n format.html { redirect_to restaurante_plate_path(@restaurante, @plate),\n notice: 'Plato creado exitosamente.' }\n format.json { render :show, status: :created, location: @plate }\n else\n format.html { render :new }\n format.json { render json: @plate.errors,\n status: :unprocessable_entity }\n end\n end\n end", "def index\n @rents = Rent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rents }\n end\n end", "def generate_json\n @array = []\n Rental.all.each do |rental|\n @actions = []\n Action.all.each do |action|\n action.rental_id = rental.id\n @actions.push(who: action.who, type: action.type, amount: action.amount)\n end\n @array.push(\n id: rental.id,\n actions: @actions\n )\n end\n JSON.pretty_generate(rentals: @array)\nend", "def generate_json\n @array = []\n Rental.all.each do |rental|\n @actions = []\n Action.all.each do |action|\n action.rental_id = rental.id\n @actions.push(who: action.who, type: action.type, amount: action.amount)\n end\n @array.push(\n id: rental.id,\n options: Option.types(rental.id),\n actions: @actions\n )\n end\n JSON.pretty_generate(rentals: @array)\nend", "def create\n @nepal = Nepal.new(nepal_params)\n\n if @nepal.save\n render json: @nepal, status: :created, location: @nepal\n else\n render json: @nepal.errors, status: :unprocessable_entity\n end\n end", "def rental_params\n # require(:rental) - params hash MUST have a key with the symbol :rental\n # permit(...) - hash value for rental must have keys, :name, :desc, ...\n params.require(:rental).permit(\n :title, :address1, :price, :bedrooms, :bathrooms, :move_in, :move_out, :washer_dryer, :outdoor_space,\n :fitness_center, :pet_friendly, :dishwasher, :pool, :storage_space, :wifi, :utilities_included, :porch,\n :bike_friendly, :ceiling_fans, :parking, :central_air, :concierge, :fireplace)\n end", "def create\n @relatory = Relatory.new(relatory_params)\n\n respond_to do |format|\n if @relatory.save\n format.html { redirect_to @relatory, notice: 'Relatório Salvo.' }\n format.json { render :show, status: :created, location: @relatory }\n else\n format.html { render :new }\n format.json { render json: @relatory.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n render json: reservations\n end", "def listRestaurants\n _restaurants = Restaurant.all\n render json: _restaurants\n end", "def rental_params\n params.require(:rental).permit(:rental_category_id, :name)\n end", "def set_rentals\n @rentals = Campground.find(params[:campground_id]).rental_categories.find(params[:rental_category_id]).rentals\n end", "def create\n # render :text => params.inspect;return\n @rent = Rent.new(params[:rent])\n @properties = AddProperty.find(:all, :conditions => \" is_rented = 0 \");\n\n respond_to do |format|\n if @rent.save\n property = @rent.add_property\n property.is_rented = true\n property.save\n \n due_date = @rent.signed_contract_date\n period = @rent.contract_period.to_i\n period.times do \n rt = RentsTransaction.new\n rt.rent_id = @rent.id\n rt.rent_amount = @rent.rent_per_month\n rt.due_date = due_date\n rt.next_due_date = due_date + 1.month\n rt.bal_amount = @rent.rent_per_month\n rt.save\n due_date = due_date + 1.month\n end\n\n format.html { redirect_to @rent, notice: 'Rent was successfully created.' }\n format.json { render json: @rent, status: :created, location: @rent }\n else\n format.html { render action: \"new\" }\n format.json { render json: @rent.errors, status: :unprocessable_entity }\n end\n\n end\n end", "def index\n @rental_requests = RentalRequest.all\n end", "def rental_params\n params.require(:rental).permit(:user_id, :listing_id, :start_time, :end_time, :num_guests)\n end", "def create\n @rent = Rent.new(rent_params)\n vehicle_ids = @rent.uses.map(&:vehicle_id)\n # todo: custom validator desconsiderando os marked_to_delete\n if vehicle_ids.length == vehicle_ids.uniq.length # to check length is faster\n respond_to do |format|\n if @rent.save\n format.html { redirect_to @rent, notice: 'Locação salva com sucesso.' }\n format.json { render action: 'show', status: :created, location: @rent }\n else\n byebug\n format.html { render action: 'new' }\n format.json { render json: @rent.errors, status: :unprocessable_entity }\n end\n end\n else\n # now is to make it work with render (same request)\n flash.now[:error] = \"O mesmo veículo foi selecionado mais de uma vez.\"\n # select's collection\n @vehicles = Vehicle.where(status: \"available\")\n rent_length = @rent.uses.length\n (5 - rent_length).times { @rent.uses.build.build_vehicle }\n render action: \"new\"\n end\n end", "def set_rentable\n @rentable = Rentable.find(params[:id])\n end", "def rent_params\n params.require(:rent).permit(:token, :pay_state, :total, :payment_method, :house_name, :room_name, :receipt_num)\n end", "def rental_params\n params.require(:rental).permit(:code, :name, :model_id, :rental_type_id, :km_limit, :km_cost, :hour_cost,\n :day_cost, :forfeit, :earnest, :note)\n end", "def create\n @realtor = Realtor.new(realtor_params)\n\n respond_to do |format|\n if @realtor.save\n format.html { redirect_to @realtor, notice: 'Realtor was successfully created.' }\n format.json { render :show, status: :created, location: @realtor }\n else\n format.html { render :new }\n format.json { render json: @realtor.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n p'*'*800\n p params\n\n @trainer = Trainer.new(trainer_params)\n\n p @trainer\n\n if @trainer.save\n render json: @trainer, status: :created, location: @trainer\n else\n render json: @trainer.errors, status: :unprocessable_entity\n end\n end", "def create\n json_response(Restaurant.create!(restaurant_params), :created)\n end", "def post_spoonacular\n # %encode ingredients to url\n encoded_ingr = URI.escape(@translated_recipe[:ingredients_list])\n # post call block :\n url = URI(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/parseIngredients?includeNutrition=true\")\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Post.new(url)\n request[\"content-type\"] = \"application/x-www-form-urlencoded\"\n request[\"x-rapidapi-key\"] = ENV[\"X_RAPIDAPI_KEY\"]\n request[\"x-rapidapi-host\"] = \"spoonacular-recipe-food-nutrition-v1.p.rapidapi.com\"\n # body of the call with ingredients and servings\n request.body = \"ingredientList=#{encoded_ingr}&#{@recipe_hash[:servings]}\"\n # response\n response = http.request(request)\n end", "def create\n @bruschettum = Bruschettum.new(params[:bruschettum])\n params[:ingredient].each{|ingr|\n @bruschettum.ingredients << Ingredient.find_by_name(ingr)\n }\n\n\n respond_to do |format|\n if @bruschettum.save\n format.html { redirect_to @bruschettum, notice: 'Bruschetta è stata creata con successo.' }\n format.json { render json: @bruschettum, status: :created, location: @bruschettum }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bruschettum.errors, status: :unprocessable_entity }\n end\n end\n end", "def renting_params\n params.require(:renting).permit(:expense, :income, :total, :payment_date, :car_id, :renter_id)\n end", "def create\n\n @rental = Rental.new(rental_params)\n @rental.start_time = Time.now\n respond_to do |format|\n if @rental.save\n Bike.where(:id => @rental.bike_id).update(available: 'f')\n\n format.html { redirect_to @rental, notice: 'Yay! You just rented a bike!' }\n format.json { render :show, status: :created, location: @rental }\n else\n format.html { render :new }\n format.json { render json: @rental.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @restaurant = Restaurant.new(restaurant_params)\n if @restaurant.save\n render json: {success: true, restaurant: @restaurant} \n else\n render json: {success: false, errors: @restaurant.errors}, status: :unprocessable_entity\n end\n end", "def reservation_params\n # params.require(:reservation).permit(:nombre, :apellido, :check_in, :check_out, :type_of_room_id)\n #json.extract! reservation, :id, :nombre, :apellido, :check_in, :check_out, :type_of_room_id, :created_at, :updated_at\n #json.url reservation_url(reservation, format: :json)\n params.require(:reservation).permit(:id, :budget_id, :nombre, :apellido, :email, :telefono, :total, :state,\n :reservation_rooms_attributes => [:id, :type_of_room_id,:comfort_id,:room_id,:check_in,:check_out, :subtotal, :_destroy])\n\n end", "def rent_params\n params.require(:rent).permit(:name, :address, :rooms, :bathrooms, :dbl_price, :tpl_price, :qpl_price, :home, :X, :Y, :features, :tripadvisor,:location_id,:language_ids=>[],:facility_ids=>[],:service_ids=>[])\n end", "def index\n @nepals = Nepal.all\n\n render json: @nepals\n end", "def create\n\n @recipe = Recipe.new(recipe_params)\n @recipe.recipe_creator_id = current_user.id\n @recipe.allergies = get_allergies_from_params\n @recipe.ingredients = get_selected_ingredients\n\n #Shows an example on how to automatically check whether a recipe is suitable for a person with an intolerance\n laktoseintoleranz = Allergy.where(name: 'Laktoseintoleranz').first\n unless @recipe.allergies.include?(laktoseintoleranz)\n neo = Neography::Rest.new({:username => \"user\", :password => \"user\"})\n includes_laktose_ingredient = false\n\n @recipe.ingredients.each do |ingredient|\n node = neo.execute_query(\"MATCH (n)-[]->(i) WHERE n.name = 'Laktoseintoleranz' AND i.name = '#{ingredient.name}' RETURN i\")\n if node[\"data\"].present?\n includes_laktose_ingredient = true\n end\n end\n unless includes_laktose_ingredient\n @recipe.allergies << laktoseintoleranz\n end\n end\n\n respond_to do |format|\n if @recipe.save\n format.html { redirect_to @recipe, notice: 'Recipe was successfully created.' }\n format.json { render :show, status: :created, location: @recipe }\n else\n format.html { render :new }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @restaurants = Restaurant.all\n # render json: @restaurants\n end", "def create\n @relatorio_gerals = RelatorioGeral.all\n authorize @relatorio_gerals\n\n @relatorio_geral = RelatorioGeral.new(relatorio_geral_params)\n\n respond_to do |format|\n if @relatorio_geral.save\n format.html { redirect_to @relatorio_geral, notice: 'Relatório geral criado com sucesso!' }\n format.json { render :show, status: :created, location: @relatorio_geral }\n else\n format.html { render :new }\n format.json { render json: @relatorio_geral.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n\n @debtors = Debtor.all\n\n render json: @debtors\n end", "def create\n @recipe = current_user.recipes.new(recipe_params)\n\n respond_to do |format|\n if @recipe.save\n if params[:lista].present?\n params[:lista].each do |(c,ingrediente)|\n Ingredient.create(name: ingrediente, recipe_id:@recipe.id) if ingrediente != \"\"\n end\n end\n format.html { redirect_to @recipe, notice: 'Recipe was successfully created.' }\n format.json { render :show, status: :created, location: @recipe }\n format.js {flash.now[:notice] = 'La receta se ha creado de forma exitosa.'} #ajax\n else\n format.html { render :new }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n format.js {flash.now[:alert] = 'Error al crear la receta.'} #ajax\n end\n end\n end", "def add_tenant_circle(args = {}) \n post(\"/tenantcircles.json/\", args)\nend", "def my\n @trips = Trip.completed.\n includes(:driver, {trip_request: :rider}).\n joins(trip_request: :rider).\n where(users: {id: params[:rider_id]})\n\n options = {}\n # JSON API: https://jsonapi.org/format/#fetching-sparse-fieldsets\n # fast_jsonapi: https://github.com/Netflix/fast_jsonapi#sparse-fieldsets\n #\n # convert input params to options arguments\n if params[:fields]\n trip_params = params[:fields].permit(:trips).to_h.\n inject({}) { |h, (k,v)| h[k.singularize.to_sym] = v.split(\",\").map(&:to_sym); h }\n options.merge!(fields: trip_params)\n end\n\n render json: TripSerializer.new(@trips, options).serializable_hash\n end", "def create\n recipeIngredient = rRcipeIngredient.create(recipeIngredient_params)\n render json: recipeIngredient\n end", "def create\n @rental_request = RentalRequest.new(rental_request_params)\n\n respond_to do |format|\n if @rental_request.save\n format.html { redirect_to @rental_request, notice: 'Rental request was successfully created.' }\n format.json { render :show, status: :created, location: @rental_request }\n else\n format.html { render :new }\n format.json { render json: @rental_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @field_rent = FieldRent.new(field_rent_params)\n\n respond_to do |format|\n if @field_rent.save\n format.html { redirect_to @field_rent, notice: 'Field rent was successfully created.' }\n format.json { render :show, status: :created, location: @field_rent }\n else\n format.html { render :new }\n format.json { render json: @field_rent.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @rental_list = RentalList.new(rental_list_params)\n\n respond_to do |format|\n if @rental_list.save\n format.html { redirect_to @rental_list, notice: 'Rental list was successfully created.' }\n format.json { render :show, status: :created, location: @rental_list }\n else\n format.html { render :new }\n format.json { render json: @rental_list.errors, status: :unprocessable_entity }\n end\n end\n end", "def rent_params\n params.require(:rent).permit(:grossrent, :mortage_interest, :mortage_interest_allowed, :repairs, :insurance, :management_charges, :agent_fee, :other, :total_expenses, :rental_profit_or_loss, :wear_and_tear, :net_profit_or_loss, :income_tac, :prsi, :usc, :total)\n end", "def create\n @resturant = Resturant.new(resturant_params)\n\n respond_to do |format|\n if @resturant.save\n format.html { redirect_to root_url, notice: 'Resturant was successfully created.' }\n format.json { render :show, status: :created, location: @resturant }\n else\n format.html { render :new }\n format.json { render json: @resturant.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @rents = Rent.all\n @client = Client.new\n end", "def rent_params\n params.require(:rent).permit :start_date,\n :client_id,\n uses_attributes: [\n :vehicle_id,\n :return_date\n ]\n end", "def create\n recipe = Recipe.create(recipe_params)\n render json: recipe\n end", "def create\n @recipe = Recipe.new(recipe_params)\n\n respond_to do |format|\n if @recipe.save\n count = 1\n complete_directions = \"\"\n params[\"directions\"].each do |direction|\n complete_directions += direction + \"\\n\"\n count += 1\n end\n @recipe.directions = complete_directions\n params[\"ingredients\"].each_with_index do |ingredient, index|\n found = false\n Ingredient.all.each do |db_ingredient|\n if db_ingredient.name == ingredient\n @ingredient = db_ingredient\n Recipeingredient.create({:ingredient_id => @ingredient.id, :recipe_id => @recipe.id, :amount => params[\"amounts\"][index]})\n found = true\n end\n end\n if found == false\n @ingredient = Ingredient.create({:name => ingredient})\n Recipeingredient.create({:ingredient_id => @ingredient.id, :recipe_id => @recipe.id, :amount => params[\"amounts\"][index]})\n end\n end\n Userrecipe.create({:contribution_id => @recipe.id, :user_id => current_user.id})\n if params[\"tags\"] != nil\n params[\"tags\"].each do |tag|\n @tag = Tag.find_by_name(tag)\n Recipetag.create({:recipe_id => @recipe.id,:tag_id => @tag.id})\n end\n end\n @recipe.serves = params[\"serves\"]\n @recipe.save\n format.html { redirect_to @recipe, notice: 'Recipe was successfully created.' }\n format.json { render :show, status: :created, location: @recipe }\n else\n format.html { render :new }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @rental_payment_method = RentalPaymentMethod.new(rental_payment_method_params)\n @rental = @rental_payment_method.rental\n respond_to do |format|\n begin\n @rental_payment_method.save\n format.js\n rescue Exception => e\n logger.info \"#{e.message}\"\n end\n end\n end", "def create\r\n @relatorio = Relatorio.new(relatorio_params)\r\n\r\n respond_to do |format|\r\n if @relatorio.save\r\n format.html { redirect_to @relatorio, notice: 'Relatório criado com sucesso.' }\r\n format.json { render :show, status: :created, location: @relatorio }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @relatorio.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def rental_params\n params.require(:rental).permit(:bike_id, :user_id, :start_time, :end_time, :start_stand_id, :end_stand_id, :cost)\n end", "def create\n @adopter = Adopter.new(adopter_params)\n\n if @adopter.save\n render json: @adopter, status: :created, location: @adopter\n else\n render json: @adopter.errors, status: :unprocessable_entity\n end\n end", "def create\n @riesgo = Riesgo.new(riesgo_params)\n\n respond_to do |format|\n if @riesgo.save\n format.html { redirect_to @riesgo, notice: 'Riesgo was successfully created.' }\n format.json { render :show, status: :created, location: @riesgo }\n else\n format.html { render :new }\n format.json { render json: @riesgo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @relatorio_pedagogicos = RelatorioPedagogico.all\n authorize @relatorio_pedagogicos\n\n @relatorio_pedagogico = RelatorioPedagogico.new(relatorio_pedagogico_params)\n\n respond_to do |format|\n if @relatorio_pedagogico.save\n format.html { redirect_to @relatorio_pedagogico, notice: 'Relatório pedagógico criado com sucesso!' }\n format.json { render :show, status: :created, location: @relatorio_pedagogico }\n else\n format.html { render :new }\n format.json { render json: @relatorio_pedagogico.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n # services / get_nutrients.rb\n fetched_params = GetNutrients.new(params[:marmiton_url]).perform\n puts fetched_params\n @recipe = Recipe.new(fetched_params)\n respond_to do |format|\n if @recipe.save\n format.html { redirect_to root_path, notice: 'La recette a été crée.' }\n else\n format.html { redirect_to root_path, notice: \"La recette n'a pas pu être ajoutée.\" }\n end\n end\n end", "def index \n restaurant = Restaurant.all\n render json: restaurant\n end", "def create\n passenger = Passenger.new(:name => params[:name], :contact_number => params[:contact_number], :nationality => params[:nationality], :meal_pref => params[:meal_pref])\n passenger.save\n render :json => passenger\n end", "def create\n @racer = Racer.new(racer_params)\n\t\t@race = Race.find(racer_params[:race_id])\n\t\[email protected]_id = nil\n respond_to do |format|\n @race.racers << @racer\n if @racer.save\n #format.html { redirect_to @racer, notice: 'Racer was successfully created.' }\n format.html { redirect_to racers_path(:race_id => racer_params[:race_id]), notice: 'Racer was successfully created.' }\n format.json { render :show, status: :created, location: @racer }\n else\n format.html { render :new }\n format.json { render json: @racer.errors, status: :unprocessable_entity }\n end\n end\n end", "def new_rent_flat\n @rent_entry = RentEntry.new\n @rent_entry.user_id = session[:user_id]\n @subway_stations = SubwayStation.find(:all)\n @ess = EntriesSubwayStations.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry }\n end\n end", "def create\n render json: Beverage.create!(beverage_post_params), status: :created\n end", "def create_item()\n\n request_body = {\n 'name' => 'Milkshake',\n 'variations' => [\n {\n 'name' => 'Small',\n 'pricing_type' => 'FIXED_PRICING',\n 'price_money' => {\n 'currency_code' => 'USD',\n 'amount' => 400\n }\n }\n ]\n }\n\n response = Unirest.post CONNECT_HOST + '/v1/' + LOCATION_ID + '/items',\n headers: REQUEST_HEADERS,\n parameters: request_body.to_json\n\n if response.code == 200\n puts 'Successfully created item:'\n puts JSON.pretty_generate(response.body)\n return response.body\n else\n puts 'Item creation failed'\n puts response.body\n return nil\n end\nend", "def generate_json\n @array = []\n Rental.all.each do |rental|\n commission = Commission.new(rental.id)\n @array.push(\n id: rental.id,\n price: rental.price,\n commission: {\n insurance_fee: commission.insurancefee,\n assistance_fee: commission.assistancefee,\n drivy_fee: commission.drivyfee\n }\n )\n end\n JSON.pretty_generate(rentals: @array)\nend", "def create\n @renter = Renter.new(renter_params)\n\n respond_to do |format|\n if @renter.save\n format.html { redirect_to @renter, notice: 'Renter was successfully created.' }\n format.json { render :show, status: :created, location: @renter }\n else\n format.html { render :new }\n format.json { render json: @renter.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @reservation = Reservation.new(reservation_params)\n @reservation.requester = current_user\n if params[:reservation][:nook_id]\n @nook = Nook.find(params[:reservation][:nook_id])\n @reservation.nook = @nook\n end\n\n respond_to do |format|\n if @reservation.save\n format.html {\n flash[:notice] = t('reservations.submitted')\n if request.xhr?\n render text: nooks_url\n else\n redirect_to nooks_path\n end\n }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @rented_unit = appointment.rented_units.new(rented_unit_params)\n\n respond_to do |format|\n if @rented_unit.save\n format.html { redirect_to [building, listing, appointment, @rented_unit], notice: 'Rented unit was successfully created.' }\n format.json { render :show, status: :created, location: @rented_unit }\n else\n format.html { render :new }\n format.json { render json: @rented_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @trips = Trip.all\n\n render json: @trips\n end", "def index\n @trips = Trip.all\n\n render json: @trips\n end", "def create\n @restaurant = Restaurant.new(params[:restaurant])\n @restaurant.owner_id = current_owner.id\n\n respond_to do |format|\n if @restaurant.save\n format.html { redirect_to @restaurant, notice: 'Restaurant was successfully created.' }\n format.json { render json: @restaurant, status: :created, location: @restaurant }\n else\n format.html { render action: \"new\" }\n format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end", "def rental_params\n params.require(:rental).permit(:name, :start_time, :end_time, :game_id, :is_optional)\n end", "def create\n @get_restaurant_list = GetRestaurantList.new(params[:get_restaurant_list])\n\n if @get_restaurant_list.save\n render json: @get_restaurant_list, status: :created, location: @get_restaurant_list\n else\n render json: @get_restaurant_list.errors, status: :unprocessable_entity\n end\n end", "def create\n resort = Resort.new(resort_params)\n\n if resort.save\n render json: ResortSerializer.new(resort).serialized_json\n else \n render json: { error: resort.errors.messages }, status: 422\n end\n end", "def create\n @relatorio = Relatorio.new(relatorio_params)\n\n respond_to do |format|\n if @relatorio.save\n format.html { redirect_to @relatorio, notice: 'Relatorio was successfully created.' }\n format.json { render :show, status: :created, location: @relatorio }\n else\n format.html { render :new }\n format.json { render json: @relatorio.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tier = Tier.new(params[:tier])\n @tier.member = current_member\n\n respond_to do |format|\n if @tier.save\n if params[:endeavor_id]\n @tier.tierings.create :endeavor_id => params[:endeavor_id]\n end\n format.html { redirect_to @tier, :notice => \"Your #{current_member.tiers.count.ordinalize} tier.\" }\n format.json { render :json => @tier, :status => :created, :location => @tier }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @tier.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @table = @restaurant.tables.build(table_params)\n\n respond_to do |format|\n if @table.save\n format.html { redirect_to restaurant_tables_path(@restaurant), notice: 'Table was successfully created.' }\n format.json { render :show, status: :created, location: @table }\n else\n format.html { render :new }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @rentals = Rental.get_all\n end", "def create\n @restaurant = Restaurant.new(params[:restaurant])\n notice = 'Restaurant was successfully created.'\n\n if (@restaurant.linkedRestaurator != '')\n @restaurant.restaurator_id = @restaurant.linkedRestaurator\n else\n notice = 'Vous avez ajoute un restaurant sans lui assigner un restaurateur.'\n end\n\n if (current_user.clientType == Client::CLIENT_TYPES[:entrepreneur])\n @restaurant.entrepreneur_id = current_user.id\n end\n\n respond_to do |format|\n if @restaurant.save\n\n format.html { redirect_to @restaurant, notice: notice }\n format.json { render json: @restaurant, status: :created, location: @restaurant }\n else\n format.html { render action: \"new\" }\n format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trenton = Trenton.new(params[:trenton])\n\n respond_to do |format|\n if @trenton.save\n format.html { redirect_to about_path, notice: 'Page successfully set up!' }\n format.json { render json: @trenton, status: :created, location: @trenton }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trenton.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trip = Trip.new(trip_params)\n authorize @trip\n @trip.submitter = current_account.accountable\n\n\n @trip.estimated_expenses.each do |exp|\n exp.requests.each do |req|\n req.amount_from_total = req.percentrequested * exp.total\n req.destination = @trip.destination\n req.expense_type = 'estimated'\n end\n end\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to home_index_path, notice: 'Trip was successfully created.' }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { render :new }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if current_user.restaurant_ids.include?(params[:restaurant_id].to_i)\n # find new table number\n table_index = 1\n tables = Table.where(restaurant_id: params[:restaurant_id])\n if !tables.nil? && tables.count > 0\n tables.each do |table|\n table_index = table.table_number + 1 if table.table_number >= table_index\n end \n end\n\n @table = Table.new(restaurant: Restaurant.find(params[:restaurant_id]), table_number: table_index)\n\n if @table.save\n render json: @table, status: :created, location: nil\n else\n render json: @table.errors, status: :unprocessable_entity\n end\n else\n render json: { error: \"can't add tables to restaurants you don't own\" }, status: :unprocessable_entity\n end\n end", "def index\n @trips = Trip.all\n render :json => @trips\n end", "def create\n @phone_rental = PhoneRental.new(phone_rental_params)\n\n respond_to do |format|\n if @phone_rental.save\n format.html { redirect_to @phone_rental, notice: 'Phone rental was successfully created.' }\n format.json { render :show, status: :created, location: @phone_rental }\n else\n format.html { render :new }\n format.json { render json: @phone_rental.errors, status: :unprocessable_entity }\n end\n end\n end", "def rec_new\n @beer_types_to_try = BeerType.limit(6).map{|type| [type.id, type.name]}\n render json: @beer_types_to_try\n end", "def rental_list_params\n params.require(:rental_list).permit(:project_id, :rental_equipment_id, :rental_price, :cost_frequency)\n end", "def rental_params\n params.require(:rental).permit(:Rental_ID, :UIN, :Apparel_ID, :Checkout_Date, :Expected_Return_Date, :Return_Date)\n end", "def resturant_params\n params.require(:resturant).permit(:name, :tenbis, :address, :max_delivery_time, :cuisine_id)\n end", "def create\n #New itinerary\n @newItinerary = Itinerary.new itin_params\n @newItinerary.save\n #new event and event_itinerary\n @eventArray = event_array\n @eventArray.each do |event|\n event = Event.new(event) #iterate through, add event itinerary to each one with itinerary ID from first save.\n event.save\n @newEventItin = EventItinerary.new(:event_id => event[:id],:itinerary_id => @newItinerary[:id])\n @newEventItin.save\n end\n \n respond_to do |format|\n format.json { render :json => [{:event => @eventArray},{ :itineraries => @newItinerary},{:event_itineraries => @newEventItin} ]}\n end\n end", "def create\n params.permit(:intitule, :estObligatoire, :nombreDeCaractere, :ordre, :sondage_id)\n ajout = QuestionOuverteService.instance.creerQuestionOuverte(params[:intitule], params[:estObligatoire], params[:nombreDeCaractere], params[:ordre], params[:sondage_id])\n (ajout != nil) ? (render json: ajout, status: :ok) : (render json: nil, status: :not_found)\n end", "def create\n json_response(current_restaurant.restaurant_food_items.create!(food_item_params), :created)\n end", "def create\n @rental_car = RentalCar.new(rental_car_params)\n\n respond_to do |format|\n if @rental_car.save\n format.html { redirect_to rental_cars_path, notice: 'Rental car was successfully created.' }\n format.json { render :index, status: :created, location: @rental_car }\n else\n format.html { render :new }\n format.json { render json: @rental_car.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.64633626", "0.64216036", "0.6310469", "0.60686624", "0.60018194", "0.5951624", "0.58466923", "0.58385015", "0.57734996", "0.57711154", "0.5747123", "0.5658235", "0.5656907", "0.5647115", "0.56451344", "0.5634093", "0.55901647", "0.5584728", "0.5579384", "0.55745053", "0.55705893", "0.5567156", "0.555946", "0.5547053", "0.5530568", "0.5502465", "0.5502163", "0.5496445", "0.54905546", "0.5467576", "0.54619443", "0.5458122", "0.54577416", "0.544383", "0.544117", "0.543737", "0.5434081", "0.54147696", "0.541448", "0.5413072", "0.5408093", "0.5392792", "0.5383767", "0.53653085", "0.53644747", "0.53642875", "0.53553826", "0.53539944", "0.5353526", "0.5348847", "0.53483796", "0.534729", "0.5346293", "0.5342614", "0.5342468", "0.534224", "0.53421897", "0.5339663", "0.53295803", "0.53267056", "0.53186136", "0.53113055", "0.5298478", "0.52935785", "0.52914983", "0.5288227", "0.52861744", "0.52759945", "0.5273636", "0.52699065", "0.5268703", "0.52686054", "0.52625704", "0.5262087", "0.52594084", "0.52588624", "0.5252609", "0.5252609", "0.52523947", "0.52452695", "0.5241529", "0.52374154", "0.52318656", "0.5231064", "0.5222383", "0.52162766", "0.5214366", "0.5207091", "0.52022237", "0.51925266", "0.519216", "0.51919", "0.51897097", "0.51872444", "0.517758", "0.5173227", "0.51721096", "0.51654667", "0.51650566", "0.5163123" ]
0.6715356
0
PATCH/PUT /rentables/1 PATCH/PUT /rentables/1.json
def update respond_to do |format| if @rentable.update(rentable_params) format.html { redirect_to @rentable, notice: 'Rentable was successfully updated.' } format.json { render :show, status: :ok, location: @rentable } else format.html { render :edit } format.json { render json: @rentable.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @rent = Rent.find(params[:id])\n\n respond_to do |format|\n if @rent.update_attributes(params[:rent])\n format.html { redirect_to @rent, notice: 'Rent was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rent.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @rent.update(rent_params)\n format.html { redirect_to @rent, notice: 'Rent was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @rent.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @rentable_item.update(rentable_item_params)\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def update\n recipe.update(recipe_params)\n render json: recipe\n end", "def patch!\n request! :patch\n end", "def update\n @rental = Rental.find_by_id params[:rental][:id]\n store = Store.find_by_location params[:rental].delete(:location)\n time = parse_time params[:rental].delete(:date), params[:rental].delete(:time)\n params[:rental][:time] = time if time\n params[:rental][:store_id] = store.try(:id)\n if @rental.nil?\n customer_id = params[:customer][:id]\n render json: { errors: [\"Customer with id #{customer_id} could not be found\"] }, status: 403\n elsif @rental.update_attributes params[:rental]\n render json: @rental\n else\n render json: { errors: @rental.errors.full_messages }, status: 422\n end\n # @new_quantities = params[:rental].delete(:quantities)\n # if @new_quantities && @rental\n # @rental.rental_bikes.destroy_all\n # build_rental_bikes(@new_quantities) if @rental\n # end\n # render json: @rental.to_json if @rental.try(:save)\n end", "def update\n respond_to do |format|\n if @rental_request.update(rental_request_params)\n format.html { redirect_to @rental_request, notice: 'Rental request was successfully updated.' }\n format.json { render :show, status: :ok, location: @rental_request }\n else\n format.html { render :edit }\n format.json { render json: @rental_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @housing_rent.update(housing_rent_params)\n format.html { redirect_to @housing_rent, notice: 'Housing rent was successfully updated.' }\n format.json { render :show, status: :ok, location: @housing_rent }\n else\n format.html { render :edit }\n format.json { render json: @housing_rent.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @rent.update(rent_params)\n format.html { redirect_to @rent, notice: 'Rent was successfully updated.' }\n format.json { render :show, status: :ok, location: @rent }\n else\n format.html { render :edit }\n format.json { render json: @rent.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @data = @recipe.update(params[:id], recipe_params)\n render json: @data\n end", "def update\n if Rental.current_user.admin?\n respond_to do |format|\n if @rental.update(rental_params)\n format.html { redirect_to rentals_path}\n format.json { render :show, status: :ok, location: @rental }\n else\n format.html { render :edit }\n format.json { render json: @rental.errors, status: :unprocessable_entity }\n end\n end\n else \n redirect_to rentals_path\n end\n end", "def update\n respond_to do |format|\n if @rental.update(rental_params)\n format.html { redirect_to @rental, notice: \"Rental was successfully updated.\" }\n format.json { render :show, status: :ok, location: @rental }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @rental.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n ingredient.update(ingredient_params)\n render json: ingredient\n end", "def update\n @rental = Rental.find_by_id params[:rental][:id]\n store = Store.find_by_location params[:rental].delete(:location)\n params[:rental][:time] = parse_time(params[:rental].delete(:date), params[:rental].delete(:time))\n params[:rental][:store_id] = store.try(:id)\n if @rental.nil?\n render json: { errors: [\"Customer with id #{params[:customer][:id]} could not be found\"] }, status: 403\n elsif @rental.update_attributes params[:rental]\n render json: @rental\n else\n render json: { errors: @rental.errors.full_messages }, status: 422\n end\n # @new_quantities = params[:rental].delete(:quantities)\n # if @new_quantities && @rental\n # @rental.rental_bikes.destroy_all\n # build_rental_bikes(@new_quantities) if @rental\n # end\n # render json: @rental.to_json if @rental.try(:save)\n end", "def update\n @my_prayer_request = PrayerRequest.find(params[:id])\n\n respond_to do |format|\n if @my_prayer_request.update_attributes(params[:my_prayer_request])\n format.html { redirect_to @my_prayer_request, notice: 'My prayer request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @my_prayer_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n render json: Item.update(params[\"id\"], params[\"item\"])\n end", "def update\n @prayer_request = PrayerRequest.find(params[:id])\n\n respond_to do |format|\n if @prayer_request.update_attributes(params[:prayer_request])\n format.html { redirect_to @prayer_request, notice: 'Prayer request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @prayer_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @rental = Rental.friendly.find(params[:rental_id])\n \n\n respond_to do |format|\n if @feature.update(feature_params)\n format.html { redirect_to rental_path(@rental), notice: 'Feature was successfully updated.' }\n format.json { render :show, status: :ok, location: @feature }\n else\n format.html { render :edit }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @apprentice = Apprentice.find(params[:id])\n\n respond_to do |format|\n if @apprentice.update_attributes(params[:apprentice])\n format.html { redirect_to @apprentice, notice: 'Apprentice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @apprentice.errors, status: :unprocessable_entity }\n end\n end\n end", "def activo_update\n respond_to do |format|\n activo = params[:laboratorio][:activo]\n id = params[:id]\n Laboratorio.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end", "def update\n @rental = Rental.find(params[:id])\n @old_rental = @rental.clone\n respond_to do |format|\n if @rental.update_attributes(params[:rental])\n Thread.new do\n NoticeMailer.deliver_canceled(@old_rental)\n NoticeMailer.deliver_created(@rental)\n end\n format.html { redirect_to(rentals_url, :notice => 'Reservierung / Verleih erfolgreich aktualisiert') }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end", "def update_rest\n @entry_item = EntryItem.find(params[:id])\n\n respond_to do |format|\n if @entry_item.update_attributes(params[:entry_item])\n flash[:notice] = 'EntryItem was successfully updated.'\n #format.html { redirect_to(@entry_item) }\n format.xml { head :ok }\n else\n #format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_item.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @bruschettum = Bruschettum.find(params[:id])\n @bruschettum.ingredients.clear\n params[:ingredient].each{|ingr|\n @bruschettum.ingredients << Ingredient.find_by_name(ingr)\n }\n\n respond_to do |format|\n if @bruschettum.update_attributes(params[:bruschettum])\n format.html { redirect_to @bruschettum, notice: 'Bruschettum was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bruschettum.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end", "def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end", "def update\n @todo = Todo.find(params[:id])\n @todo.update_attributes(params[:todo])\n render :json => @todo\n end", "def update\n params[:recipe][:ingredient_ids] ||= []\n @recipe = Recipe.find(params[:id])\n\n respond_to do |format|\n if @recipe.update_attributes(params[:recipe])\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @liner_item.update(liner_item_params)\n format.html { redirect_to @liner_item, notice: 'Liner item was successfully updated.' }\n format.json { render :show, status: :ok, location: @liner_item }\n else\n format.html { render :edit }\n format.json { render json: @liner_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @riesgo.update(riesgo_params)\n format.html { redirect_to @riesgo, notice: 'Riesgo was successfully updated.' }\n format.json { render :show, status: :ok, location: @riesgo }\n else\n format.html { render :edit }\n format.json { render json: @riesgo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @resto.update(resto_params)\n format.html { redirect_to @resto, notice: 'Entry was successfully updated.' }\n format.json { render :show, status: :ok, location: @resto }\n else\n format.html { render :edit }\n format.json { render json: @resto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bowl = Bowl.find(params[:id])\n \n # set bowl modify time\n @bowl.modified = Time.now\n \n respond_to do |format|\n if @bowl.update_attributes(params[:bowl])\n \n Rails.logger.info \"Updating Bowl Contents\"\n \n # remove all contents for this bowl and add new\n @bowl.contents.delete_all(\"bowl_id=\" + @bowl.id)\n \n params.keys.each do |param|\n if param.start_with?(\"input_\") and (params[param] != \"\") \n @bowl.contents.create(:bowl_id => @bowl.id, :dryfruit_id => param[6, 2], :quantity => params[param]) \n end\n end\n\n format.html { redirect_to bowls_path, :notice => 'Bowl was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @bowl.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n save_relations\n if @ingredient.update(ingredient_params)\n format.html { redirect_to @ingredient.recipe, notice: 'Ingredient was successfully updated.' }\n format.json { render :show, status: :ok, location: @ingredient }\n else\n format.html { render :edit }\n format.json { render json: @ingredient.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @item.update(item_params)\n render status: 201, :json => @item, :include =>[{:location =>{:except=>[:id, :created_at, :updated_at]}}, {:food =>{:except =>[:id, :created_at, :updated_at]}}], :except => [:created_at, :updated_at, :food_id, :location_id]\n else\n render status: 404, json: { message: @item.errors}.to_json\n end\n\n \n end", "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "def update\n json_response(@restaurant.update!(restaurant_params))\n end", "def restobooking\n @buchung = Buchung.find(params[:id])\n @buchung.status='B' \n \n respond_to do |format|\n if @buchung.update_attributes(params[:buchung])\n format.html { redirect_to @buchung, notice: 'Buchung wurde erfolgreich geaendert.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @buchung.errors, status: :unprocessable_entity }\n end\n end \n end", "def update\n @rental = Rental.find(params[:id])\n rental_data = params[:rental]\n photo_ids = rental_data.delete :photo_ids\n\n respond_to do |format|\n if @rental.update_attributes(rental_data)\n update_photos_with_rental_id photo_ids, @rental\n\n format.html { redirect_to @rental, notice: 'Rental was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rental.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize @ingredient.recipe\n respond_to do |format|\n if @ingredient.update(ingredient_params)\n format.html { redirect_to @ingredient}\n format.json { render :show, status: :ok, location: @ingredient }\n else\n format.html { render :edit }\n format.json { render json: @ingredient.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @supermarket = Supermarket.find(params[:id]) \n respond_to do |format|\n if @supermarket.update(supermarket_params)\n format.json { render json: @supermarket, status: :ok }\n end\n end\n end", "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end", "def update\n respond_to do |format|\n if @recipe.update(recipe_params)\n params[:recipe][:ingredients].each do |ingredient_id|\n next if ingredient_id.to_i == 0\n ingredient = Ingredient.find(ingredient_id.to_i)\n @recipe.ingredients << ingredient\n end\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @rental.update(rental_params)\n format.html do\n redirect_to car_rentals_path(@car)\n flash[:success] = 'Booking was successfully updated.'\n end\n format.json { render :show, status: :ok, location: @rental }\n else\n format.html { render :edit }\n format.json { render json: @rental.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @person.seat\n render json: {errors: 'Cannot update a seated person'}, status: 422\n else\n @person.update person_params\n render json: @person\n end\n end", "def update # PATCH\n raise NotImplementedError\n end", "def update\n @trenton = Trenton.first\n\n respond_to do |format|\n if @trenton.update_attributes(params[:trenton])\n format.html { redirect_to about_path, notice: 'Page was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trenton.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @needed_item.update(needed_item_params)\n format.html { redirect_to @needed_item, notice: 'Needed item was successfully updated.' }\n format.json { render :show, status: :ok, location: @needed_item }\n else\n format.html { render :edit }\n format.json { render json: @needed_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end", "def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end", "def update \n @restaurant = Restaurant.find(params[:id])\n @restaurant.owner_id = current_owner.id\n\n respond_to do |format|\n if @restaurant.update_attributes(params[:restaurant])\n # format.html { redirect_to @restaurant, notice: 'Restaurant was successfully updated.' }\n format.html { redirect_to account_owner_dashboards_path, notice: 'Restaurant was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @field_rent.update(field_rent_params)\n format.html { redirect_to @field_rent, notice: 'Field rent was successfully updated.' }\n format.json { render :show, status: :ok, location: @field_rent }\n else\n format.html { render :edit }\n format.json { render json: @field_rent.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(type, info)\n path, info = type_info(type, :path), force_case(info)\n ida = type == :client ? 'client_id' : 'id'\n raise ArgumentError, \"info must include #{ida}\" unless id = info[ida]\n hdrs = headers\n if info && info['meta'] && (etag = info['meta']['version'])\n hdrs.merge!('if-match' => etag)\n end\n reply = json_parse_reply(@key_style,\n *json_patch(@target, \"#{path}/#{Addressable::URI.encode(id)}\", info, hdrs))\n\n # hide client endpoints that are not quite scim compatible\n type == :client && !reply ? get(type, info['client_id']): reply\n end", "def update\n\n #update the item of request_item\n if (params[:request_item].present?)\n @request_item.item = params[:request_item][:item].present? ? Item.new(name: params[:request_item][:item][:name]) : @request_item.item\n end\n #update all other parameters\n if @request_item.update(request_item_params)\n render json: @request_item\n else\n render json: @request_item.errors, status: :bad_request\n end\n\n end", "def update\n respond_to do |format|\n if @rental_list.update(rental_list_params)\n format.html { redirect_to @rental_list, notice: 'Rental list was successfully updated.' }\n format.json { render :show, status: :ok, location: @rental_list }\n else\n format.html { render :edit }\n format.json { render json: @rental_list.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @special_needs_type = SpecialNeedsType.find(params[:id])\n\n respond_to do |format|\n if @special_needs_type.update_attributes(params[:special_needs_type])\n format.html { redirect_to @special_needs_type, :notice => 'Tipo de necessidade especial atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @special_needs_type.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @requesttomentor = Requesttomentor.find(params[:id])\n\n respond_to do |format|\n if @requesttomentor.update_attributes(params[:requesttomentor])\n format.html { redirect_to @requesttomentor, notice: 'Requesttomentor was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @requesttomentor.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n resource.update(deposit_contract_params)\n respond_with client, resource\n end", "def update\n @borrow_request = BorrowRequest.find(params[:id])\n\n respond_to do |format|\n if @borrow_request.update_attributes(params[:borrow_request])\n format.html { redirect_to @borrow_request, notice: 'Borrow request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @borrow_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch options\n rest_request({ method: :patch }.merge(options))\n end", "def patch options\n rest_request({ method: :patch }.merge(options))\n end", "def update\n respond_to do |format|\n if @ingredients_nutrient.update(ingredients_nutrient_params)\n format.html { redirect_to @ingredients_nutrient, notice: 'Ingredients nutrient was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ingredients_nutrient.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @recipe = Recipe.find(params[:id])\n @recipe.ingrediences = Ingredience.find(params[:ingredience_ids]) if params[:ingredience_ids] \n respond_to do |format|\n if @recipe.update_attributes(params[:recipe])\n flash[:notice] = 'Recipe was successfully updated.'\n format.html { redirect_to(@recipe) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @recipe.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @itemstable = Itemstable.find(params[:id])\n\n respond_to do |format|\n if @itemstable.update_attributes(params[:itemstable])\n format.html { redirect_to @itemstable, notice: 'Itemstable was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @itemstable.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n contract = Contract.find_by_id(params[:id])\n (head :unauthorized unless contract) and return\n \n # try to update the attributes\n if contract.update_attributes(edit_contract_params)\n render json: contract\n else\n render json: { errors: contract.error.full_messages}\n end\n end", "def update\n update_init(@raking)\n respond_to do |format|\n if @raking.update(raking_params)\n format.html { redirect_to @raking, notice: 'Raking was successfully updated.' }\n format.json { render :show, status: :ok, location: @raking }\n else\n format.html { render :edit }\n format.json { render json: @raking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @prayer = Prayer.find(params[:id])\n\n respond_to do |format|\n if @prayer.update_attributes(params[:prayer])\n format.html { redirect_to @prayer, notice: 'Prayer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @prayer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @prayer = Prayer.find(params[:id])\n\n respond_to do |format|\n if @prayer.update_attributes(params[:prayer])\n format.html { redirect_to @prayer, notice: 'Prayer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @prayer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @prayer = Prayer.find(params[:id])\n\n respond_to do |format|\n if @prayer.update_attributes(params[:prayer])\n format.html { redirect_to @prayer, notice: 'Prayer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @prayer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @recipe.allergies.destroy_all\n params[:recipe][:allergy].each do |key,value|\n if value[\"name\"] == \"1\"\n allergy = Allergy.find(key)\n @recipe.allergies << allergy\n end\n end\n\n if params[:recipe][:concentrate] == '1' || params[:recipe][:recipe_category_id] == RecipeCategory.find_by(name: \"Concentrates\").id\n @recipe.concentrate = true\n else\n @recipe.concentrate = false\n end\n\n respond_to do |format|\n if @recipe.update(recipe_params)\n @allergies = Allergy.all\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { render :show, status: :ok, location: @recipe }\n else\n @allergies = Allergy.all\n format.html { render :edit }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @recipe_all = RecipeAll.find(params[:id])\n\n respond_to do |format|\n if @recipe_all.update_attributes(params[:recipe_all])\n format.html { redirect_to @recipe_all, notice: 'Recipe all was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recipe_all.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_rest\n @item_usage = ItemUsage.find(params[:id])\n\n respond_to do |format|\n if @item_usage.update_attributes(params[:item_usage])\n flash[:notice] = 'ItemUsage was successfully updated.'\n format.html { redirect_to(@item_usage) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item_usage.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @rental.update(rental_params)\n Bike.where(:id => @rental.bike_id).update(available: 't',:bikestand_id =>@rental.end_stand_id)\n @rental.update :end_time => Time.now\n @rental.update :cost => ((Time.now - @rental.start_time) / 60 / 60) * 2\n format.html { redirect_to rental_pay_path(@rental), notice: 'Thank you for using bShare!' }\n format.json { render :show, status: :ok, location: @rental }\n else\n format.html { render :edit }\n format.json { render json: @rental.errors, status: :unprocessable_entity }\n end\n end\n end", "def update \n pastry = Pastry.find(params[:id])\n pastry.update(pastry_params)\n render json: pastry\n end", "def update\n @restaurant_table = RestaurantTable.find(params[:id])\n\n respond_to do |format|\n if @restaurant_table.update_attributes(params[:restaurant_table])\n format.html { redirect_to @restaurant_table, notice: 'Restaurant table was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @restaurant_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end", "def update\n # @recipe = Recipe.find(params[:id])\n #\n update! do |success, failure|\n # success.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n # success.json { head :ok }\n # failure.html { render action: \"edit\" }\n # failure.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end", "def update\n @contract = Contract.find(params[:id])\n @units = Unit.unsold(params[:tower_id])\n respond_to do |format|\n if @contract.update_attributes(params[:contract])\n format.html { redirect_to tower_contract_path(@contract.unit.tower, @contract), notice: 'Contract was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contract.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @therapist.specialty_ids = params[:therapist][:specialty_ids]\n respond_to do |format|\n if @therapist.update(therapist_params)\n format.html { redirect_to root_path, notice: \"therapist was successfully updated.\" }\n else\n format.html { render :edit }\n end\n end\n end", "def update\n authorize! :update, @recipe\n \n @recipe.modifier = current_user\n \n respond_to do |format|\n if @recipe.update(recipe_params)\n format.html { redirect_to @recipe, notice: t('.success') }\n format.json { render :show, status: :ok, location: @recipe }\n else\n format.html { render :edit }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n save_relations\n if @recipe.update(recipe_params)\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { render :show, status: :ok, location: @recipe }\n else\n format.html { render :edit }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @resturant.update(resturant_params)\n format.html { redirect_to @resturant, notice: 'Resturant was successfully updated.' }\n format.json { render :show, status: :ok, location: @resturant }\n else\n format.html { render :edit }\n format.json { render json: @resturant.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @recipe.update(recipe_params)\n calculate_nutrients \n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_update\n @recepient = Recepient.find(params[:id]) \n end", "def update\n @tier = Tier.find(params[:id])\n\n respond_to do |format|\n if @tier.update_attributes(params[:tier])\n format.html { redirect_to @tier, :notice => 'Tier was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @tier.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n keystone.update_tenant({:id=>params[:id],:name=>params[:name],:description=>params[:description],:enabled=>params[:enabled]})\n respond_to do |format|\n format.html { redirect_to tenants_path, :notice => 'Tenant was successfully updated.' }\n format.json { head :ok }\n end\n end", "def update\n respond_to do |format|\n if @budget.update(budget_params)\n Item.where([\"budget_id = #{params[:id]}\"]).update_all(budget_id: nil)\n if !params[:budget][:items].nil?\n params[:budget][:items].each do |f| \n Item.where([\"id = #{f}\"]).first.update(budget_id: params[:id])\n end\n end\n format.html { redirect_to budgets_path, notice: \"Budget was successfully updated.\" }\n format.json { render :show, status: :ok, location: @budget }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @todo = Todo.find(params[:id])\n if @todo.update_attributes(todo_params)\n render json: @todo, status: :ok\n else\n render json: @todo.errors, status: 422\n end\n end", "def update\n @reel = Reel.find(params[:id])\n\n respond_to do |format|\n if @reel.update_attributes(params[:reel])\n format.html { redirect_to @reel, notice: 'Reel was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @reel.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @item = Item.find(params[:id])\n\n get_relations_from_params\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @kitten = Kitten.find(params[:id])\n\n respond_to do |format|\n if @kitten.update_attributes(params[:kitten])\n format.html { redirect_to @kitten, notice: 'Kitten was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kitten.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @stationeryrequest = Stationeryrequest.find(params[:id])\n #\n @stationeryrequest.hotelsuppliesrequests.each do |hotelsuppliesrequests|\n \n end\n\n respond_to do |format|\n if @stationeryrequest.update_attributes(params[:stationeryrequest])\n format.html { redirect_to @stationeryrequest, notice: 'Stationeryrequest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stationeryrequest.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n update_resource @ride, ride_params\n end", "def update\n update_restaurant\n end", "def update\n respond_to do |format|\n if @tottle.update(tottle_params)\n format.html { redirect_to @tottle, notice: 'Tottle was successfully updated.' }\n format.json { render :show, status: :ok, location: @tottle }\n else\n format.html { render :edit }\n format.json { render json: @tottle.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @table = Table.find(params[:id])\n\n respond_to do |format|\n if @table.update_attributes(params[:table].permit(:name, :notes, :x, :y, :table_type, :guest_ids => []))\n format.html { redirect_to @table, notice: 'Table was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize @trip\n\n\n @trip.estimated_expenses.each do |exp|\n exp.requests.each do |req|\n req.amount_from_total = req.percentrequested * exp.total\n req.destination = @trip.destination\n req.expense_type = 'estimated'\n end\n end\n\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @potluck_item = PotluckItem.find(params[:id])\n\n respond_to do |format|\n if @potluck_item.update_attributes(params[:potluck_item])\n format.html { render :action => :show }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\", status: :unprocessable_entity }\n format.json { render json: @potluck_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n update_recipe_line_items\n if @recipe.update(recipe_params)\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { render :show, status: :ok, location: @recipe }\n else\n format.html { render :edit }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @objet = Objet.find(params[:id])\n\n respond_to do |format|\n if @objet.update_attributes(params[:objet])\n format.html { redirect_to @objet, notice: 'The found item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @objet.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.6288963", "0.6255919", "0.6255424", "0.6242062", "0.61973363", "0.61742324", "0.613978", "0.6131787", "0.6114515", "0.6093201", "0.60870504", "0.60806334", "0.6072711", "0.6046612", "0.6045368", "0.6035538", "0.60033894", "0.59804565", "0.5973474", "0.595235", "0.59512264", "0.59508336", "0.5948594", "0.59100646", "0.5905545", "0.58995754", "0.58995754", "0.5896735", "0.5894203", "0.5886756", "0.5878678", "0.5877531", "0.58738667", "0.5863378", "0.5858779", "0.5857538", "0.5855385", "0.5853096", "0.5852191", "0.5851451", "0.5840635", "0.5829922", "0.582636", "0.58249927", "0.582019", "0.58190405", "0.5814944", "0.58143675", "0.58130646", "0.58114225", "0.58034307", "0.5795584", "0.57883346", "0.5787004", "0.5783664", "0.57832235", "0.5781553", "0.57792175", "0.5777199", "0.57720256", "0.57720256", "0.57673013", "0.5757891", "0.5755161", "0.5754962", "0.5747035", "0.57455355", "0.57455355", "0.57455355", "0.5745209", "0.57425994", "0.57417744", "0.5738159", "0.57380533", "0.57380295", "0.5733718", "0.5730871", "0.5729352", "0.5727386", "0.5726072", "0.5723625", "0.5719839", "0.57187814", "0.57100964", "0.57087076", "0.57073843", "0.57070696", "0.5694135", "0.56907576", "0.5687403", "0.56873965", "0.56863254", "0.56861836", "0.5684858", "0.56805927", "0.5678687", "0.567857", "0.5675599", "0.5674181", "0.5672211" ]
0.6638201
0
DELETE /rentables/1 DELETE /rentables/1.json
def destroy @rentable.destroy respond_to do |format| format.html { redirect_to rentables_url, notice: 'Rentable was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @rent = Rent.find(params[:id])\n @rent.destroy\n\n respond_to do |format|\n format.html { redirect_to rents_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @rent.destroy\n respond_to do |format|\n format.html { redirect_to rents_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @rental = Rental.find(params[:id])\n @rental.destroy\n\n respond_to do |format|\n format.html { redirect_to rentals_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Item.delete(params[\"id\"])\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @rentable_item.destroy\n end", "def destroy\n @rent.destroy\n respond_to do |format|\n format.html { redirect_to rents_url, notice: 'Rent was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @rent.destroy\n respond_to do |format|\n format.html { redirect_to rents_url, notice: 'Rent was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n render status: 200, json: @request_item.destroy\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @restaurant.destroy\n render json: {success: true}\n end", "def destroy\n @liner_item.destroy\n respond_to do |format|\n format.html { redirect_to liner_items_url, notice: 'Liner item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @item.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @rameur.reservations.each { |resa| resa.destroy if resa.rameurs.size == 1 }\n Reservation.where(responsable_id: @rameur.id).each { |resa| resa.destroy(responsable_id: nil) }\n @rameur.destroy\n respond_to do |format|\n format.html { redirect_to rameurs_url, notice: \"Rameur supprimé\" }\n format.json { head :no_content, status: :success }\n end\n end", "def destroy\n @rental.destroy\n respond_to do |format|\n format.html { redirect_to rentals_url, notice: 'Rental was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def delete(id)\n request(:delete, \"/recipes/#{id}.json\")\n end", "def destroy\n @relatory.destroy\n respond_to do |format|\n format.html { redirect_to relatories_url, notice: 'Relatório deletado.' }\n format.json { head :no_content }\n end\n end", "def delete_from_entzumena\n headline = Headline.where({:source_item_type => params[:source_item_type], :source_item_id => params[:source_item_id]}).first\n if headline.destroy\n render :json => true, :status => 200\n else\n render :json => false, :status => :error\n end\n end", "def destroy\n @railway = Railway.find(params[:id])\n @railway.destroy\n\n respond_to do |format|\n format.html { redirect_to railways_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant = Restaurant.find(params[:id])\n @restaurant.destroy\n\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant = Restaurant.find(params[:id])\n @restaurant.destroy\n\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant = Restaurant.find(params[:id])\n @restaurant.destroy\n\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant = Restaurant.find(params[:id])\n @restaurant.destroy\n\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant = Restaurant.find(params[:id])\n @restaurant.destroy\n\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant = Restaurant.find(params[:id])\n @restaurant.destroy\n\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant = Restaurant.find(params[:id])\n @restaurant.destroy\n\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant = Restaurant.find(params[:id])\n @restaurant.destroy\n\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @housing_rent.destroy\n respond_to do |format|\n format.html { redirect_to housing_rents_url, notice: 'Housing rent was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @data = @recipe.delete(params[:id])\n render json: @data\n end", "def destroy\n @apprentice = Apprentice.find(params[:id])\n @apprentice.destroy\n\n respond_to do |format|\n format.html { redirect_to apprentices_url }\n format.json { head :no_content }\n end\n end", "def delete_item(id)\n record \"/todos/delete_item/#{id}\"\n end", "def destroy\n relationship = Relationships.find(params[:id])\n relationship.destroy\n head 204\n end", "def destroy\n @rental.destroy\n respond_to do |format|\n format.html { redirect_to rentals_url, notice: 'Rental was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @rental.destroy\n respond_to do |format|\n format.html { redirect_to rentals_url, notice: 'Rental was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @rental_request.destroy\n respond_to do |format|\n format.html { redirect_to rental_requests_url, notice: 'Rental request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Alien.delete(params[\"id\"])\n end", "def destroy\n @remito = Remito.find(params[:id])\n @remito.destroy\n\n respond_to do |format|\n format.html { redirect_to remitos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @rebate = Rebate.find(params[:id])\n @rebate.destroy\n\n respond_to do |format|\n format.html { redirect_to rebates_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @rental.destroy\n respond_to do |format|\n format.html { redirect_to rentals_url, notice: \"Rental was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @itemstable = Itemstable.find(params[:id])\n @itemstable.destroy\n\n respond_to do |format|\n format.html { redirect_to itemstables_url }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @restaurant = Restaurant.find(params[:id])\r\n @restaurant.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to restaurants_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to budget_path(params[:budget_id]) }\n format.json { head :no_content }\n end\n end", "def destroy\n @trein_consul_comercial.destroy\n respond_to do |format|\n format.html { redirect_to trein_consul_comercials_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant_table = RestaurantTable.find(params[:id])\n @restaurant_table.destroy\n\n respond_to do |format|\n format.html { redirect_to restaurant_tables_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @wanted_item = WantedItem.find(params[:id]).destroy\n respond_to do |format|\n format.json { head :no_content }\n # format.json { redirect_to wanted_items_url, notice: 'Item was successfully destroyed.' }\n end\n end", "def destroy\n rid = params['id']\n if Aws.delete_recipe(rid) && Aws.delete_all_ingredients(rid)\n msg = {:notice => \"Recipe deleted!\"}\n render :json => msg\n else\n msg = {:notice => \"Error while deleting from DynamoDB!\"}\n render :json => msg\n end\n end", "def destroy\n @api_v1_item.destroy\n render json: {message: 'deletado com sucesso'}\n end", "def destroy\n @ingredients_nutrient.destroy\n respond_to do |format|\n format.html { redirect_to ingredients_nutrients_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @kota_stone.destroy\n respond_to do |format|\n format.html { redirect_to kota_stones_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @resturant.destroy\n respond_to do |format|\n format.html { redirect_to resturants_url, notice: 'Resturant was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @boat = Boat.find(params[:id])\n remove_reknro_from_berth\n @boat.destroy\n\n respond_to do |format|\n format.html { redirect_to boats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @rental_list.destroy\n respond_to do |format|\n format.html { redirect_to rental_lists_url, notice: 'Rental list was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @line_item1 = LineItem1.find(params[:id])\n @line_item1.destroy\n\n respond_to do |format|\n format.html { redirect_to line_item1s_url }\n format.json { head :no_content }\n end\n end", "def delete!\n Recliner.delete(uri)\n end", "def delete\n render json: Company.delete(params[\"id\"])\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def destroy\n @restaurant.destroy\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant.destroy\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant.destroy\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n if Rental.current_user.admin?\n @rental.destroy\n respond_to do |format|\n format.html { redirect_to rentals_url}\n format.json { head :no_content }\n end\n else \n redirect_to rentals_path\n end\n end", "def destroy\n @relearnable.destroy\n respond_to do |format|\n format.html { redirect_to relearnables_url, notice: 'Relearnable was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy_rest\n @entry_item = EntryItem.find(params[:id])\n @entry_item.destroy\n\n respond_to do |format|\n #format.html { redirect_to(entry_items_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @dental = Dental.find(params[:id])\n @dental.destroy\n\n respond_to do |format|\n format.html { redirect_to dentals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @rayon = Rayon.find(params[:id])\n @rayon.destroy\n\n respond_to do |format|\n format.html { redirect_to rayons_url }\n format.json { head :no_content }\n end\n end", "def destroy_rest\n @item_usage = ItemUsage.find(params[:id])\n @item_usage.destroy\n\n respond_to do |format|\n format.html { redirect_to(item_usages_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @get_restaurant_list = GetRestaurantList.find(params[:id])\n @get_restaurant_list.destroy\n\n head :no_content\n end", "def destroy\n self.auth_admin\n @hall = Hall.where(name: @item.location)\n @item.destroy\n respond_to do |format|\n format.html { redirect_to halls_path(@hall), notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @unlimited.destroy\n respond_to do |format|\n format.html { redirect_to unlimiteds_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @reel = Reel.find(params[:id])\n @reel.destroy\n\n respond_to do |format|\n format.html { redirect_to reels_url }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @antenne = Antenne.find(params[:id])\r\n @antenne.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to antennes_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @nail_salon = NailSalon.find(params[:id])\n @nail_salon.destroy\n\n respond_to do |format|\n format.html { redirect_to nail_salons_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @rant = Rant.find(params[:id])\n @rant.destroy\n\n respond_to do |format|\n format.html { redirect_to(rants_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @receitai.destroy\n respond_to do |format|\n format.html { redirect_to proc { receita_url(@receita)}, notice: 'Item excluido.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @orphan.destroy\n respond_to do |format|\n format.html { redirect_to orphans_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tipo_item = TipoItem.find(params[:id])\n @tipo_item.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_items_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subway.destroy\n respond_to do |format|\n format.html { redirect_to subways_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @brave_burst.destroy\n respond_to do |format|\n format.html { redirect_to brave_bursts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @lineitem.destroy\n respond_to do |format|\n format.html { redirect_to lineitems_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @vegetable = Vegetable.find(params[:id])\n @vegetable.destroy\n\n respond_to do |format|\n format.html { redirect_to vegetables_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @item_adicional.destroy\n respond_to do |format|\n format.html { redirect_to item_adicionals_url, notice: 'Item adicional was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n Todo.find(params[:id]).destroy\n render :json => {:message => \"Record deleted\", :item_id => params[:id]}\n end", "def destroy\n @trip_item = TripItem.find(params[:id])\n @trip_item.destroy\n\n respond_to do |format|\n format.html { redirect_to trip_items_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @borrow_request = BorrowRequest.find(params[:id])\n @borrow_request.destroy\n\n respond_to do |format|\n format.html { redirect_to borrow_requests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @habitant.destroy\n respond_to do |format|\n format.html { redirect_to habitants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n # find ALL servings associated with this purchase and delete them\n all_servings = Serving.where(purchase_id: @purchase.id)\n puts \"all servings associated with this purchase: #{all_servings}\"\n all_servings.destroy_all\n puts \"deleted servings\"\n @purchase.destroy\n puts \"deleted purchase\"\n render json: {status: 204, purchase: @purchase}\n end", "def destroy\n @immigrant = Immigrant.find(params[:id])\n @immigrant.destroy\n\n respond_to do |format|\n format.html { redirect_to immigrants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @recurso = Recurso.find(params[:id])\n @recurso.destroy\n\n respond_to do |format|\n format.html { redirect_to recursos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @needed_item.destroy\n respond_to do |format|\n format.html { redirect_to needed_items_url, notice: 'Needed item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @roadcrime = Roadcrime.find(params[:id])\n @roadcrime.destroy\n\n respond_to do |format|\n format.html { redirect_to roadcrimes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @drip = Drip.find(params[:id])\n @drip.destroy\n\n respond_to do |format|\n format.html { redirect_to drips_url }\n format.json { head :no_content }\n end\n end", "def delete(id:)\n id_check(:id, id)\n\n cf_delete(path: \"/organizations/#{org_id}/railguns/#{id}\")\n end", "def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @riesgo.destroy\n respond_to do |format|\n format.html { redirect_to riesgos_url, notice: 'Riesgo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @red.destroy\n respond_to do |format|\n format.html { redirect_to reds_url }\n format.json { head :no_content }\n end\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def destroy\n @antler = Antler.find(params[:id])\n @antler.destroy\n\n respond_to do |format|\n format.html { redirect_to antlers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n authorize @ingredient.recipe\n @ingredient.destroy\n respond_to do |format|\n format.html { redirect_to @ingredient.recipe }\n format.json { head :no_content }\n end\n end", "def destroy\n\[email protected] do |bill|\n\t\tbill.destroy\n\tend\n @responsible.destroy\n respond_to do |format|\n format.html { redirect_to responsibles_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.70265996", "0.70178044", "0.69753623", "0.6973389", "0.69565433", "0.68275833", "0.67586917", "0.67586917", "0.6750311", "0.6656551", "0.66538805", "0.6643503", "0.66408825", "0.6637895", "0.6632602", "0.6628441", "0.6616478", "0.66154647", "0.6611617", "0.6587973", "0.6587973", "0.6587973", "0.6587973", "0.6587973", "0.6587973", "0.6587973", "0.6587973", "0.65834755", "0.6569943", "0.6568749", "0.65569824", "0.65562", "0.65546393", "0.65546393", "0.6553936", "0.65500563", "0.6546771", "0.6546575", "0.654544", "0.6542649", "0.65409577", "0.6538256", "0.65328085", "0.65316415", "0.6526857", "0.6521231", "0.6516838", "0.65065217", "0.65016323", "0.6498314", "0.6497827", "0.6493877", "0.64925915", "0.6491315", "0.6485772", "0.6477861", "0.6477836", "0.6477836", "0.6477836", "0.64711684", "0.64662874", "0.6461255", "0.6459882", "0.64576596", "0.6457294", "0.6455805", "0.6452316", "0.6443291", "0.6441736", "0.64397764", "0.6439198", "0.64385474", "0.6435776", "0.64314884", "0.64313287", "0.6428106", "0.6426968", "0.64250696", "0.6424316", "0.6420237", "0.64113915", "0.64093804", "0.64057696", "0.6405469", "0.6401105", "0.6400399", "0.6395414", "0.63932145", "0.6392203", "0.63916713", "0.63901067", "0.6389689", "0.6389689", "0.638857", "0.6388054", "0.6386486", "0.6385247", "0.6379897", "0.6378589", "0.6375517" ]
0.73329103
0
Use callbacks to share common setup or constraints between actions.
def set_rentable @rentable = Rentable.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def rentable_params params.require(:rentable).permit(:name, :image, :description, :location, :quantity, :category, :hourly_rate) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
The first email sent when a conversation is started. Looks very similar to subsequent reply emails, but puts an explanation of what this feature is front + center. Meat is: the last N elements (messages, frames) in this dicussion roll see private discussion_roll_mail_setup for explanation of opts
def on_discussion_roll_creation(opts) discussion_roll_mail_setup(opts) # for initial roll creation, always calling out video aspect verb, suffix = "sent", "video" @subject = subject_for(@poster_string_name, opts[:all_participants] - [opts[:posting_participant], opts[:receiving_participant]], verb, suffix) mail :from => "\"Shelby Mail\" <#{Settings::Email.discussion_roll['from_email']}>", :reply_to => "\"No Reply\" <#{Settings::Email.discussion_roll['from_email']}>", :to => opts[:receiving_participant_email_address], :subject => @subject end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def discussion_roll_mail_setup(opts)\n @roll = opts[:discussion_roll]\n @recipient_string_id = opts[:receiving_participant].is_a?(User) ? opts[:receiving_participant].id.to_s : opts[:receiving_participant]\n @poster_string_name = nickname_for_user_or_email(opts[:posting_participant])\n @token = opts[:token]\n @permalink = \"http://shelby.tv/mail/#{@roll.id}?u=#{CGI.escape(@recipient_string_id)}&t=#{CGI.escape(CGI.escape(@token))}\"\n\n sendgrid_category Settings::Email.discussion_roll[\"category\"]\n sendgrid_ganalytics_options(:utm_source => 'discussion_roll', :utm_medium => 'notification', :utm_campaign => \"roll_#{@roll.id}\")\n \n # Displaying context for the most recent frame only\n most_recent_frame = Frame.where(:roll_id => @roll.id).order(:score.desc).first\n @conversation_elements = conversation_elements_for([most_recent_frame], Settings::Email.discussion_roll['max_element_count'])\n \n # get the latest message from the latest frame, use that to determine if last posting was video-only\n most_recent_message = most_recent_frame.conversation.messages[-1]\n @last_post_video_only = !most_recent_message or most_recent_message.text.blank?\n end", "def on_discussion_roll_reply(opts)\n discussion_roll_mail_setup(opts)\n \n if @last_post_video_only\n verb, suffix = \"sent\", \"video\"\n else\n verb, suffix = \"replied to\", nil\n end\n @subject = subject_for(@poster_string_name, opts[:all_participants] - [opts[:posting_participant], opts[:receiving_participant]], verb, suffix)\n \n mail :from => \"\\\"Shelby Mail\\\" <#{Settings::Email.discussion_roll['from_email']}>\",\n :reply_to => \"\\\"No Reply\\\" <#{Settings::Email.discussion_roll['from_email']}>\",\n :to => opts[:receiving_participant_email_address], \n :subject => @subject\n end", "def first_email_sent_to(recipient)\n self.current_email = emails_sent_to(recipient).last\n end", "def first_message_number\n @first_message_index < 0 ? @messages.length + @first_message_index : @first_message_index\n end", "def first_unread_message\n gmail.inbox.find(:unread).find do |email|\n email.to[0].mailbox.include? 'performance_group'\n end\n end", "def get_next_message\n return @mailer.get_next_message\n end", "def first_message\n return Message.trainer_issuing_a_challenge\n end", "def messageunreadfirst()\n merge(notmessageunreadfirst: 'true')\n end", "def deliver_rts email, documents, mail_to\n logger.info \"Sending response mail to #{mail_to}\"\n mail = Mail.new\n mail.from @cfg[:from]\n mail.to mail_to\n # CCs to the original email will get a copy of the converted files as well\n mail.cc (email.cc - email.to - (@cfg[:cc_blacklist]||[]) ) if email.cc # Prevent autoheathen infinite loop!\n # Don't prepend yet another Re:\n mail.subject \"#{'Re: ' unless email.subject.start_with? 'Re:'}#{email.subject}\"\n # Construct received path\n # TODO: is this in the right order?\n #rcv = \"by localhost(autoheathen); #{Time.now.strftime '%a, %d %b %Y %T %z'}\"\n #[email.received,rcv].flatten.each { |rec| mail.received rec.to_s }\n mail.return_path email.return_path if email.return_path\n mail.header['X-Received'] = email.header['X-Received'] if email.header['X-Received']\n documents.each do |doc|\n next if doc[:content].nil?\n mail.add_file filename: doc[:filename], content: doc[:content]\n end\n cfg = @cfg # stoopid Mail scoping\n me = self # stoopid Mail scoping\n mail.text_part do\n s = Haml::Engine.new( me.read_file cfg[:text_template] ).render(Object.new, to: mail_to, documents: documents, cfg: cfg)\n body s\n end\n mail.html_part do\n content_type 'text/html; charset=UTF-8'\n s = Haml::Engine.new( me.read_file cfg[:html_template] ).render(Object.new, to: mail_to, documents: documents, cfg: cfg)\n body s\n end\n mail.delivery_method :smtp, address: @cfg[:mail_host], port: @cfg[:mail_port]\n deliver mail\n end", "def group_welcome_email\n NotifierMailer.group_welcome_email Group.take\n end", "def first_contact\n\n mail(\n to:\n cc:\n subject: \"We will contact you soon!\"\n )\n end", "def make_email(opts)\n mail = Mail.new\n mail.to opts.msg_to\n mail.from opts.msg_from\n mail.cc opts.msg_cc if opts.key? \"cc\"\n mail.subject opts[\"subject\"]\n mail.html_part do\n content_type \"text/html; charset=UTF-8\"\n body opts.msg_body\n end\n opts.msg_attachments.each { |f| mail.add_file f }\n mail\n end", "def build_message\n @subject = self.content[:short_subject]\n curate_text\n\n\n mail = Mail.new({\n :from => @replyto,\n :to => @recipients,\n :subject => @subject,\n :body => @text\n })\n\n if @no_send\n self.print\n return\n end\n\n\n return mail\n end", "def first_round_email(email)\n @greeting = \"Hi\"\n\n mail to: email, subject: \"Your ASES Application Decision\"\n end", "def correspond\n @user = current_user\n @recipient = User.find(params[:id])\n @title = \"Email #{@recipient.name}\"\n if param_posted?(:original) #if user is responding to an original mail \n # @original and @original_subject will be availabe in the correspond view\n @original_title = session[:original_title]\n @original_body = session[:original_subject]\n end\n\n @message ||= Message.new({:subject=>\"\", :body=>\"\"})\n\n if param_posted?(:message)\n #if @message.update_attributes(params[:message])\n @message.subject = params[:message][:subject]\n @message.body = params[:message][:body]\n\n if @message.valid?\n #@body_sesson and @title_session will be available to mailer and it's correspond_message view\n @body_session = session[:original_message] #creating session in the controller \n @title_session = session[:original_title]\n #passing message params including session instances to be accessible in action mailer\n UserMailer.correspond_mail(@user, @recipient, @message, \n @body_session, @title_session).deliver\n flash[:success] = \"Email sent to #{@recipient.name}\"\n redirect_to profile_path(@recipient)\n end\n end\n\n end", "def mk_email\n ps = \"P.S. Jeg har vedhæftet relevante dokumenter, så som eksamensbevis og CV i mailen.\"\n ps += \"\\nP.P.S Denne email var genereret med, og sendt fra et Ruby script :)\" if @skills and @skills.include? \"Ruby\"\n \"#{mk_intro}\\n#{mk_body}#{mk_outro}#{mk_sender}#{ps}\"\n end", "def delivered_mail(pos = 1)\n ActionMailer::Base.deliveries.last(pos).first\n end", "def message\n if subject && !subject.empty?\n subject + \"\\n\" + body\n else\n body\n end\n end", "def compose_email\n @title = t 'conclusion_draft_review.send_by_email'\n end", "def first_round_email\n Postman.first_round_email\n end", "def next_message; end", "def next_message; end", "def welcome_email\n NotifierMailer.welcome_email User.take\n end", "def getting_started\n ParentMailer.getting_started\n end", "def do_reply(subject, msg)\n full_msg=<<END_OF_MESSAGE\nFrom: #{@test_data['user_name']}\nTo: #{@test_data['reply_email']}\nSubject: #{subject}\nDate: #{Time.now}\n\n#{msg}\nEND_OF_MESSAGE\n Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)\n Net::SMTP.start(@test_data['smtp_host'], @test_data['smtp_port'], @test_data['mail_domain'], @test_data['user_name'], @test_data['user_passwd'], :login) { |smtp|\n smtp.send_message(full_msg, @test_data['user_name'], @test_data['reply_email'])\n }\nend", "def latest_mail(options = {})\n return only_latest(mail(options))\n end", "def start_message\n @all_text_width = 0\n @pop = nil\n \n @text = \"\"\n @text_line = $game_message.texts.size < $game_message.max_line ? $game_message.texts.size + 1 : MAX_LINE + 1\n for i in 0...$game_message.texts.size\n # Change \" \" to \"\" (Spacing for choice)\n @text += \"\" if i >= $game_message.choice_start\n @text += $game_message.texts[i].clone + \"\\x00\"\n end\n \n @item_max = $game_message.choice_max\n convert_special_characters\n reset_window\n update_window_size\n new_page\n end", "def send_reminder_no_activity(options)\n mailer_content = options['mailer_content']\n MemberMailer.send_reminder_no_activity(mailer_content).deliver if mailer_content.present?\n end", "def welcome_email(email, trial_duration)\n\n @trial_duration = trial_duration\n @email = email\n\n mail :to => email, :subject => \"Welcome to Urbanzeak!\", from: \"Urbanzeak <[email protected]>\"\n\n headers['X-MC-Track'] = \"opens\"\n headers['X-MC-Tags'] = \"Welcome Email\"\n end", "def sending_email\n puts\n email = \"Sending notification email\"\n puts bold(email)\n puts email.length.times.map {\"=\"}.join\n puts\n end", "def testimonial_reminder(conversation, recipient, community)\n @email_type = \"email_about_testimonial_reminders\"\n set_up_layout_variables(recipient, community, @email_type)\n with_locale(recipient.locale, community.locales.map(&:to_sym), community.id) do\n @conversation = conversation\n @other_party = @conversation.other_party(recipient)\n premailer_mail(:to => recipient.confirmed_notification_emails_to,\n :from => community_specific_sender(community),\n :subject => t(\"emails.testimonial_reminder.remember_to_give_feedback_to\", :name => @other_party.name(community)))\n end\n end", "def deliver_email\n#puts \"**** deliver_email: emails=#{emails}\"\n emails = @contact_info.map {|c| c[:email]}.compact.uniq\n self.subject ||= 'Message from SIM Nigeria'\n id_for_reply = self.following_up || id # a follow-up message uses id of the original msg\n#puts \"**** Messages#deliver_email response_time_limit=#{response_time_limit}\"\n outgoing = Notifier.send_group_message(:recipients=>emails, :content=>self.body, \n :subject => subject, :id => id_for_reply , :response_time_limit => response_time_limit, \n :bcc => true, :following_up => following_up) # send using bcc:, not to:\nraise \"send_email with nil email produced\" if outgoing.nil?\n outgoing.deliver\n # Mark all as being sent, but only if they have an email address\n # This is terribly inefficient ... need to find a way to use a single SQL statement\n sent_messages.each do |sm| \n sm.update_attributes(:msg_status => MsgSentToGateway) if sm.member.primary_email\n end\n end", "def guess_first_message(skip_messages: 5) # Can skip the last n messages\n return true if @requested_thread_ts # Always start thread on first message\n return false if @messages.blank? || @messages.size < skip_messages\n\n possible_first_messages = @messages[0..-skip_messages]\n\n # Work through the messages in order. If a gap is found, this could be the first message\n new_first_message_index = nil\n previous_message_ts = @messages[-skip_messages].ts.split(\".\").first.to_i\n possible_first_messages.each_with_index do |message, index|\n # Calculate the time since the last message\n this_ts = message.ts.split(\".\").first.to_i\n time_since_previous_message = this_ts - previous_message_ts\n\n # If greater than 3 minutes, this could be the first message\n new_first_message_index = index if time_since_previous_message > 3.minutes\n\n previous_message_ts = this_ts\n end\n\n if new_first_message_index\n @first_message_index = new_first_message_index\n true\n else\n false\n end\n end", "def comment_added(options)\n @to, @subject, @body, @obj = options[:to], options[:subject], options[:body], options[:obj]\n @bootloader_path = default_bootloader_path(@obj)\n @conference = conference(@to)\n mail(:to => email_addresses(@to),\n :from => email_sender_address(@to),\n :subject => I18n.t('message_mailer.comment_added.subject', \n :number => @obj.presentation.number,\n :namespace => @conference.tag))\n end", "def mail_introduce_connectees\n\t\tConnectionMailer.connectee1_email(self).deliver\n\t\tConnectionMailer.connectee2_email(self).deliver\n\tend", "def find_emails\n options = { :conditions => ['last_send_attempt < ?', Time.now.to_i - 300] }\n options[:limit] = batch_size unless batch_size.nil?\n mail = ActionMailer::Base.email_class.find :all, options\n\n log \"found #{mail.length} emails to send\"\n mail\n end", "def launch_email_client()\n mail_list = @@item.mail_list\n mail_list = \"private@#{mail_list}.apache.org\" unless mail_list.include? '@'\n\n to = @@item.chair_email\n cc = \"#{mail_list},#{@@item.cc}\"\n\n if @@item.missing\n subject = \"Missing #{@@item.title} Board Report\"\n body = %{\n Dear #{@@item.owner},\n\n The board report for #{@@item.title} has not yet been submitted for\n this month's board meeting. If you or another member of the PMC are\n unable to get it in by twenty-four hours before meeting time, please\n let the board know, and plan to report next month.\n\n https://www.apache.org/foundation/board/reporting#how\n\n Thanks,\n\n #{User.username}\n\n (on behalf of the ASF Board)\n }\n\n # strip indentation; concatenate lines within a paragraph\n indent = body[/^\\s*/]\n body = body.strip().gsub(/#{indent}/, \"\\n\").gsub(/(\\S)\\n(\\S)/, \"$1 $2\")\n else\n subject = \"#{@@item.title} Board Report\"\n body = @@item.comments.join(\"\\n\\n\")\n\n if not body and @@item.text\n monthNames = %w(January February March April May June July August\n September October November December)\n year = Agenda.date.split('-')[0].to_i\n month = Agenda.date.split('-')[1].to_i\n\n subject = \"[REPORT] #{@@item.title} - #{monthNames[month-1]} #{year}\"\n to = @@item.cc\n cc = mail_list\n body = @@item.text\n end\n end\n\n window.location = \"mailto:#{to}?cc=#{cc}\" +\n \"&subject=#{encodeURIComponent(subject)}\" +\n \"&body=#{encodeURIComponent(body)}\"\n end", "def this_mail( mail, options )\r\n subject mail.subject\r\n recipients setup_recipients( mail.email )\r\n from mail.from\r\n body options.merge( :mail => mail )\r\n end", "def text_message_default_sender\n current_params.fetch(:from)\n end", "def email\n mail.first\n end", "def email\n mail.first\n end", "def send_one_email_to(name, mail)\n email = @gmail.compose do\n to mail\n subject \"Apprentissage entre pairs + gratuité + code = The Hacking Project\"\n html_part do\n content_type 'text/html; charset=UTF-8'\n body get_the_email_html(name) #TODO faire pour toutes les villes du tableau -> suppose de lire les colonnes du tableau dans une boucle (ajouter un délai)\n end\n end\nemail.deliver!\nend", "def first_report\n @user = @receiver\n @notification = @user.notifications.find_by(path: \"/reports/#{@report.id}\")\n mail to: @user.email,\n subject: \"[bootcamp] #{@report.user.login_name}さんがはじめての日報を書きました!\"\n end", "def instructor_reminder_email(class_date)\n @response_email = ResponseEmail.find_by_purpose(\"auto_instructor_reminder\")\n @body = format_instructor_auto_reminder(@response_email.body, class_date)\n mail(:to => class_date.instructors, :subject => @response_email.subject, :reply_to => @response_email.reply_to) unless class_date.instructors.blank?\n end", "def show\n if params[:email_thread]\n @email_thread = EmailThread.find(params[:email_thread])\n elsif session[:id]\n @summary = Summary.find(session[:id])\n @email_thread = @summary.email_thread\n else\n flash[:notice] = \"You are logged out.\"\n redirect_to(:controller => '/account', :action => 'login')\n return\n end\n @emails = []\n email_count = 0\n for email in @email_thread.myemails\n email_count+=1\n s = email.Body\n #Keep track of tag beginning and ending\n open = false\n count = 1\n while s.include? \"^\"\n if !open\n case params[:control]\n when 'read' , 'sum' , 'show'\n s[s.index(\"^\"),1] = sent(email_count, count)\n when 'label'\n s[s.index(\"^\"),1] = label(email_count, count)\n end\n open = true\n count += 1\n else\n s[s.index(\"^\"),1] = '</div></div>'\n open = false\n end\n end\n s.gsub! \"/-\\\\\", \"^\"\n @emails << email\n end\n #Render correct action\n case params[:control]\n when 'read'\n render :action => 'read'\n when 'sum'\n render :action => 'sum'\n when 'label'\n render :action => 'label'\n when 'show'\n render :action => 'show'\n end\n end", "def subject\n self['subject'] || msg['subject']\n end", "def welcome_one_pager\n UserMailer.welcome_one_pager(Booking.last)\n end", "def launch_email_client(event)\n mail_list = @@item.mail_list\n mail_list = \"private@#{mail_list}.apache.org\" unless mail_list.include? '@'\n\n to = @@item.chair_email\n cc = \"#{mail_list},#{@@item.cc}\"\n\n if @@item.missing\n subject = \"Missing #{@@item.title} Board Report\"\n if @@item.attach =~ /^\\d/\n body = %{\n Dear #{@@item.owner},\n\n The board report for #{@@item.title} has not yet been submitted for\n this month's board meeting. Please try to submit these reports by the\n Friday before the meeting.\n\n Thanks,\n\n #{User.username}\n }\n else\n body = %{\n Dear #{@@item.owner},\n\n The board report for #{@@item.title} has not yet been submitted for\n this month's board meeting. If you or another member of the PMC are\n unable to get it in by twenty-four hours before meeting time, please\n let the board know, and plan to report next month.\n\n https://www.apache.org/foundation/board/reporting#how\n\n Thanks,\n\n #{User.username}\n\n (on behalf of the ASF Board)\n }\n end\n\n # strip indentation; concatenate lines within a paragraph\n indent = body[/^\\s*/]\n body = body.strip().gsub(/#{indent}/, \"\\n\").gsub(/(\\S)\\n(\\S)/, \"$1 $2\")\n else\n subject = \"#{@@item.title} Board Report\"\n body = @@item.comments.join(\"\\n\\n\")\n\n if not body and @@item.text\n monthNames = %w(January February March April May June July August\n September October November December)\n year = Agenda.date.split('-')[0].to_i\n month = Agenda.date.split('-')[1].to_i\n\n subject = \"[REPORT] #{@@item.title} - #{monthNames[month-1]} #{year}\"\n to = @@item.cc\n cc = mail_list\n body = @@item.text\n end\n end\n\n if event.ctrlKey or event.shiftKey or event.metaKey\n @email = {\n to: to,\n cc: cc,\n subject: subject,\n body: body\n }\n\n jQuery('#email-' + @@item.mail_list).modal(:show)\n else\n window.location = \"mailto:#{to}?cc=#{cc}\" +\n \"&subject=#{encodeURIComponent(subject)}\" +\n \"&body=#{encodeURIComponent(body)}\"\n end\n end", "def setup_email(options)\n @recipients = options[:recipients]\n @from = options[:from] || SocialNewsConfig[\"email_addrs\"][\"support\"] \n @cc = options[:cc] || ''\n @bcc = options[:bcc] || ''\n @subject = SUBJECT_PREFIX + (options[:subject] || 'No Subject')\n @body = options[:body] || {}\n @headers = options[:headers] || {}\n @charset = options[:charset] || 'utf-8'\n end", "def current_step\n fail 'Conversation without messages' if conversation.messages.count == 0\n\n # If the all messages in a conversation doesn't have a step,\n # it's the first interaction\n conversation.messages.where.not(step: nil).order(step: :desc).try(:first).try(:step)\n end", "def event_reminder(reminder)\n @event_start = reminder.event.event_start.to_s(:long)\n mail subject: reminder.event.title,\n bcc: reminder.event.subscribers.collect(&:email)\n end", "def send_pre_lesson_reminder_email\n UserMailer.lesson_reminder(mentor).deliver_now\n end", "def prompt_message(pre)\n @greeting = \"Hi\"\n @pre = pre\n @prompt = pre.prompt\n\n mail to: \"#{@pre.user.email}\",\n subject: \"#{@prompt.name}\"\n end", "def headers\n {\n :subject => \"<#{subject}>\",\n :to => \"[email protected]\",\n :from => \"CatchAll\",\n :reply_to => \"#{reply}\"\n }\n end", "def send_welcome_email\n #if Rails.env.production?\n if email.present?\n if followed_by >= 0\n # to send emails in delayed jobs use\n # UserMailer.instauser_welcome_email(id).delay.deliver!\n UserMailer.instauser_welcome_email(self.id).deliver\n else\n UserMailer.instauser_reject_email(self.id).deliver!\n end\n end\n #end\n end", "def remember_message_sent\n Discourse.redis.setex(sent_recently_key, @opts[:limit_once_per].try(:to_i) || 86_400, 1) unless @opts[:limit_once_per] == false\n end", "def message_me(msg)\n @msg = msg\n mail subject: \"From: #{@msg.name} : #{@msg.email} says : #{@msg.subject}\", body: \"From: #{@msg.name} @ #{@msg.email} | Subject: #{@msg.subject} | Body of email : #{@msg.content}\"\n #@msg.content << \"From : #{@msg.name} :: Subject : #{@msg.subject}\" # previous one\n end", "def mailboxer_email(obj=nil)\n return nil\n end", "def receive_inbound_email_from_mail(**kwargs, &block); end", "def sent_at\n # Use date it arrived (created_at) if mail itself doesn't have Date: header\n self.mail.date || self.created_at\n end", "def launch_email_client()\n destination = \"mailto:#{@@item.chair_email}\" +\n \"?cc=private@#{@@item.mail_list}.apache.org,[email protected]\"\n\n if @@item.missing\n subject = \"Missing #{@@item.title} Board Report\"\n body = %{\n Dear #{@@item.owner},\n\n The board report for #{@@item.title} has not yet been submitted for\n this month's board meeting. If you or another member of the PMC are\n unable to get it in by twenty-four hours before meeting time, please\n let the board know, and plan to report next month.\n\n https://www.apache.org/foundation/board/reporting#how\n\n Thanks,\n\n #{Pending.username}\n\n (on behalf of the ASF Board)\n }\n\n # strip indentation; concatenate lines within a paragraph\n indent = body[/^\\s*/]\n body = body.strip().gsub(/#{indent}/, \"\\n\").gsub(/(\\S)\\n(\\S)/, \"$1 $2\")\n else\n subject = \"#{@@item.title} Board Report\"\n body = @@item.comments\n end\n\n window.location = destination +\n \"&subject=#{encodeURIComponent(subject)}\" +\n \"&body=#{encodeURIComponent(body)}\"\n end", "def view_html\n\n $anterior = params[:id].to_i - 1\n $siguiente = params[:id].to_i - 1\n\n $buscar_texto = nil\n $buscar_por = nil\n\n ENV['folder'] = 'mailbox'\n load 'script/mailman_server.rb'\n\n adjuntos = ''\n\n @@messages.each do |message|\n @from = message[:from]\n @to = message[:to]\n @cc = message[:cc]\n @bcc = message[:bcc]\n @subject = message[:subject]\n @date = message[:date]\n @text = message[:text_body]\n @html = message[:html_body]\n end\n\n cc_list = @cc.length > 0 ? 'Cc: <span style=\"word-wrap: break-word;\">' + @cc + '</span><br>' : ''\n bcc_list = @bcc.length > 0 ? 'Cco: <span style=\"word-wrap: break-word;\">' + @bcc + '</span><br>' : ''\n\n @@the_message_attachments.each do |att|\n adjuntos += '<li> <a style=\"color:#666; text-decoration:none;\" href='+att.attached_file.url(:original, false)+' target=\"_blank\">'+att.attached_file_file_name+'</a> </li>'\n end\n\n adjuntos_list = (adjuntos.length > 0) ? 'Adjuntos: <ul>' + adjuntos + '</ul>' : ''\n\n # render file: 'messages/view_html'\n\n respond_to do |format|\n format.html {\n render text: '<div class=\"container-fluid\"> ' +\n '<br>' +\n 'De: ' + @from +\n '<br>' +\n 'A: <span style=\"word-wrap: break-word;\">' + @to + '</span>' +\n '<br>' +\n cc_list +\n bcc_list +\n adjuntos_list +\n '<hr class=\"col-lg-12\">' +\n '</div>' + @html, :layout => false\n }\n # format.html {\n # render text: '<div class=\"container-fluid\">' +\n # '<div class=\"col-md-12\" style=\"background-color: #ced8e1\">' +\n # '<h4>' + @subject + '</h4>' +\n # '<hr style=\"margin-top: 0px; border-top: 1px solid #235589\">' +\n # '<strong>' + @from + '</strong>' +\n # '<br>' +\n # '<div style=\"max-width: 90%; float: left\">' +\n # '<small>Para ' + @to[0..50] + '</small>' +\n # '</div>' +\n # '<div style=\"margin-left: 5px; max-width: 1%; float: left\">' +\n # '<div class=\"dropdown\">' +\n # '<button class=\"btn btn-default btn-xs\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\">' +\n # '<span class=\"caret\"></span>' +\n # '</button>' +\n # '<div class=\"dropdown-menu\"\n # style=\"word-wrap: break-word;\n # width: 500px;\n # padding: 20px;\n # height: 300px;\n # overflow: auto\">' +\n # '<table>\n # <tr>\n # <td valign=\"top\">De:</td>\n # <th>' + @from + '</th>\n # </tr>\n # <tr>\n # <td valign=\"top\">Para:</td>\n # <td>' + @to + '</td>\n # </tr>\n # <tr>\n # <td valign=\"top\">Fecha:</td>\n # <td>' + @date + '</td>\n # </tr>\n # <tr>\n # <td valign=\"top\">Asunto:</td>\n # <td>' + @subject + '</td>\n # </tr>\n # </table>\n # </div>\n # </div>\n # </div>\n # </div>\n # </div>'\n # }\n format.json {\n render json: {\n message: @html\n }\n }\n end\n\n end", "def finalize_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.finalize_mail(Petition.live.first)\n end", "def message\n @messages.first\n end", "def getMail\n# gets maximum id avoiding nil case\n id = Message.maximum(:id)\n if id.nil?\n id = 0\n else\n id += 1\n end\n allMail = Mail.all #Grab all unread mail\n if !allMail.empty? #Check to see if no new mail\n allMail.each do |mail|\n#This is a method to check to see if author is from grinnell domain\n# if mail.from[0].downcase.include? (\"@grinnell.edu\")\n# if mail.subject.downcase.include? (\"csstudent\")\n message = Message.new\n message.id = id\n #Grab subject that doesn't include csstudent and other tags\n message.subject = addTag(message, mail.subject)\n message.tag_list.sort!\n message.author = mail.from[0]\n message.content = getContent(mail)\n message.created_at = mail.date.to_s\n # Makes it so both have the same time format\n message.updated_at = Time.now.strftime(\"%Y-%m-%d %H:%M\")\n message.save\n id += 1\n# end\n end\n end\n end", "def process_message_response\n # Is this email confirming receipt of a previous message? \n msg_id = find_message_id_tag(:subject=>@subject, :body=>@body)\n#puts \"**** body=#{@body}, msg_id=#{msg_id}\"\n if msg_id \n # Does the \"confirmed message\" id actually match a message?\n message = Message.find_by_id(msg_id)\n if message\n msg_tag = message_id_tag(:id => msg_id, :action => :confirm_tag) # e.g. !2104\n search_target = Regexp.new('[\\'\\s\\(\\[]*' + \"#{Regexp.escape(msg_tag)}\" + '[\\'\\s\\.,\\)\\]]*')\n # The main reason to strip out the tag (like !2104) from the message is that it may be the\n # first part of the response, if there is one; e.g. \"!2104 Kafanchan\" replying to a message\n # requesting location. \n user_reply = first_nonblank_line(@body)\n#puts \"**** user_reply='#{user_reply}'\"\n user_reply = user_reply.sub(search_target, ' ').strip if user_reply\n # Mark all members with this email address as having responded to this message\n @possible_senders.each do |a_member|\n message.process_response(:member => a_member, :text => user_reply, :mode => 'email')\n end\n else\n msg_tag = message_id_tag(:id => msg_id, :action => :create, :location => :body)\n Notifier.send_generic(@from_address, I18n.t('error_msg.invalid_confirmation')).deliver\n end\n end\n end", "def build_email_content\n txt = I18n.t(\"estimate_request.fltk.email_content\", :origin => self.origin_port.name, :destination => destination_port.name, :count => self.estimate_items.first.number_of_items, :description => self.estimate_items.first.description)\n txt\n end", "def send(opts)\n if opts.msg_to.empty?\n @log.warn \"ll-012: Email can't be sent to '#{opts.msg_to},\" \\\n \" more: '#{opts}'\"\n else\n msg = make_msg opts\n cli.send_message msg\n msg[:file_attachments].each(&:close) unless opts.msg_attachments.empty?\n @log.debug \"#{__FILE__} sent '#{opts['subject']}' to '#{opts.msg_to}'.\"\n end\n end", "def create_mail\n # Removes the current user from the recipients and cc\n # if he doesn't want to receive notifications about what he does\n @author ||= User.current\n if @author.pref[:no_self_notified]\n recipients.delete(@author.mail) if recipients\n cc.delete(@author.mail) if cc\n end\n \n notified_users = [recipients, cc].flatten.compact.uniq\n # Rails would log recipients only, not cc and bcc\n mylogger.info \"Sending email notification to: #{notified_users.join(', ')}\" if mylogger\n \n # Blind carbon copy recipients\n if Setting.bcc_recipients?\n bcc(notified_users)\n recipients []\n cc []\n end\n super\n end", "def message_body(subscription_count, presenters, batch_subscriptions, batch_emails)\n return @message_body if @message_body\n return nil unless subscription_count > BATCH_SIZE\n\n message = SubscriptionMailer.public_inspection_document_mailing_list(\n presenters,\n batch_subscriptions,\n nil,\n batch_emails\n )\n @message_body = {html: message.html_part.body, text: message.text_part.body}\n end", "def send_email(gmail, body, mail_address)\n\n body_content = body\n mail_address = mail_address\n gmail = gmail\n\n gmail.deliver do\n to mail_address\n\n subject \"[Presentation] - The Hacking Project - Formation d'informatique gratuite\"\n html_part do\n content_type 'text/html; charset=UTF-8'\n body body_content\n end\n puts \"mail sent to #{mail_address}\"\n #in order to stay below the 10 mail / sec limit\n sleep(1)\n\n end\nend", "def scan(mhead, mbody)\n match = 0\n match += 1 if mhead['subject'] =~ /\\AUndeliverable Mail[ ]*\\z/\n match += 1 if mhead['x-mailer'].to_s.start_with?('<SMTP32 v')\n return nil unless match > 0\n\n dscontents = [Sisimai::Bite.DELIVERYSTATUS]\n hasdivided = mbody.split(\"\\n\")\n rfc822list = [] # (Array) Each line in message/rfc822 part string\n blanklines = 0 # (Integer) The number of blank lines\n readcursor = 0 # (Integer) Points the current cursor position\n recipients = 0 # (Integer) The number of 'Final-Recipient' header\n v = nil\n\n while e = hasdivided.shift do\n if readcursor == 0\n # Beginning of the bounce message or delivery status part\n if e == StartingOf[:message][0]\n readcursor |= Indicators[:deliverystatus]\n next\n end\n end\n\n if (readcursor & Indicators[:'message-rfc822']) == 0\n # Beginning of the original message part\n if e == StartingOf[:rfc822][0]\n readcursor |= Indicators[:'message-rfc822']\n next\n end\n end\n\n if readcursor & Indicators[:'message-rfc822'] > 0\n # After \"message/rfc822\"\n if e.empty?\n blanklines += 1\n break if blanklines > 1\n next\n end\n rfc822list << e\n else\n # Before \"message/rfc822\"\n break if readcursor & Indicators[:'message-rfc822'] > 0\n\n # Unknown user: [email protected]\n #\n # Original message follows.\n v = dscontents[-1]\n\n if cv = e.match(/\\A([^ ]+)[ ](.+)[:][ \\t]*([^ ]+[@][^ ]+)/)\n # Unknown user: [email protected]\n if v['recipient']\n # There are multiple recipient addresses in the message body.\n dscontents << Sisimai::Bite.DELIVERYSTATUS\n v = dscontents[-1]\n end\n v['diagnosis'] = cv[1] + ' ' + cv[2]\n v['recipient'] = cv[3]\n recipients += 1\n\n elsif cv = e.match(/\\Aundeliverable[ ]+to[ ]+(.+)\\z/)\n # undeliverable to [email protected]\n if v['recipient']\n # There are multiple recipient addresses in the message body.\n dscontents << Sisimai::Bite.DELIVERYSTATUS\n v = dscontents[-1]\n end\n v['recipient'] = cv[1]\n recipients += 1\n else\n # Other error message text\n v['alterrors'] << ' ' << e if v['alterrors']\n v['alterrors'] = e if e.include?(StartingOf[:error][0])\n end\n end\n end\n return nil unless recipients > 0\n\n dscontents.each do |e|\n e['agent'] = self.smtpagent\n\n unless e['alterrors'].to_s.empty?\n # Copy alternative error message\n e['diagnosis'] = if e['diagnosis']\n e['alterrors'] + ' ' + e['diagnosis']\n else\n e['alterrors']\n end\n e['diagnosis'] = Sisimai::String.sweep(e['diagnosis'])\n e.delete('alterrors')\n end\n e['diagnosis'] = Sisimai::String.sweep(e['diagnosis'])\n\n ReSMTP.each_key do |r|\n # Detect SMTP command from the message\n next unless e['diagnosis'] =~ ReSMTP[r]\n e['command'] = r.to_s.upcase\n break\n end\n\n ReFailures.each_key do |r|\n # Verify each regular expression of session errors\n next unless e['diagnosis'] =~ ReFailures[r]\n e['reason'] = r.to_s\n break\n end\n e.each_key { |a| e[a] ||= '' }\n end\n\n rfc822part = Sisimai::RFC5322.weedout(rfc822list)\n return { 'ds' => dscontents, 'rfc822' => rfc822part }\n end", "def scan(mhead, mbody)\n match = 0\n match += 1 if mhead['subject'] == '[BOUNCE]'\n match += 1 if mhead['message-id'].to_s.include?('.JavaMail.')\n match += 1 if mhead['received'].any? { |a| a.include?('JAMES SMTP Server') }\n return nil unless match > 0\n\n dscontents = [Sisimai::Bite.DELIVERYSTATUS]\n hasdivided = mbody.split(\"\\n\")\n rfc822list = [] # (Array) Each line in message/rfc822 part string\n blanklines = 0 # (Integer) The number of blank lines\n readcursor = 0 # (Integer) Points the current cursor position\n recipients = 0 # (Integer) The number of 'Final-Recipient' header\n diagnostic = '' # (String) Alternative diagnostic message\n subjecttxt = nil # (String) Alternative Subject text\n gotmessage = -1 # (Integer) Flag for error message\n v = nil\n\n while e = hasdivided.shift do\n if readcursor == 0\n # Beginning of the bounce message or delivery status part\n if e.start_with?(StartingOf[:message][0])\n readcursor |= Indicators[:deliverystatus]\n next\n end\n end\n\n if (readcursor & Indicators[:'message-rfc822']) == 0\n # Beginning of the original message part\n if e.start_with?(StartingOf[:rfc822][0])\n readcursor |= Indicators[:'message-rfc822']\n next\n end\n end\n\n if readcursor & Indicators[:'message-rfc822'] > 0\n # After \"message/rfc822\"\n if e.empty?\n blanklines += 1\n break if blanklines > 1\n next\n end\n rfc822list << e\n else\n # Before \"message/rfc822\"\n next if (readcursor & Indicators[:deliverystatus]) == 0\n next if e.empty?\n\n # Message details:\n # Subject: Nyaaan\n # Sent date: Thu Apr 29 01:20:50 JST 2015\n # MAIL FROM: [email protected]\n # RCPT TO: [email protected]\n # From: Neko <[email protected]>\n # To: [email protected]\n # Size (in bytes): 1024\n # Number of lines: 64\n v = dscontents[-1]\n\n if cv = e.match(/\\A[ ][ ]RCPT[ ]TO:[ ]([^ ]+[@][^ ]+)\\z/)\n # RCPT TO: [email protected]\n if v['recipient']\n # There are multiple recipient addresses in the message body.\n dscontents << Sisimai::Bite.DELIVERYSTATUS\n v = dscontents[-1]\n end\n v['recipient'] = cv[1]\n recipients += 1\n\n elsif cv = e.match(/\\A[ ][ ]Sent[ ]date:[ ](.+)\\z/)\n # Sent date: Thu Apr 29 01:20:50 JST 2015\n v['date'] = cv[1]\n\n elsif cv = e.match(/\\A[ ][ ]Subject:[ ](.+)\\z/)\n # Subject: Nyaaan\n subjecttxt = cv[1]\n else\n next if gotmessage == 1\n if v['diagnosis']\n # Get an error message text\n if e.start_with?('Message details:')\n # Message details:\n # Subject: nyaan\n # ...\n gotmessage = 1\n else\n # Append error message text like the followng:\n # Error message below:\n # 550 - Requested action not taken: no such user here\n v['diagnosis'] << ' ' << e\n end\n else\n # Error message below:\n # 550 - Requested action not taken: no such user here\n v['diagnosis'] = e if e == StartingOf[:error][0]\n end\n end\n end\n end\n return nil unless recipients > 0\n\n unless rfc822list.any? { |a| a.start_with?('Subject:') }\n # Set the value of subjecttxt as a Subject if there is no original\n # message in the bounce mail.\n rfc822list << ('Subject: ' << subjecttxt)\n end\n\n dscontents.each do |e|\n e['agent'] = self.smtpagent\n e['diagnosis'] = Sisimai::String.sweep(e['diagnosis'] || diagnostic)\n e.each_key { |a| e[a] ||= '' }\n end\n\n rfc822part = Sisimai::RFC5322.weedout(rfc822list)\n return { 'ds' => dscontents, 'rfc822' => rfc822part }\n end", "def render\n _header do\n _h1 'Agenda Backchannel'\n end\n\n # convert date into a localized string\n datefmt = proc do |timestamp|\n return Date.new(timestamp).\n toLocaleDateString({}, month: 'short', day: 'numeric', year: 'numeric')\n end\n if Chat.log.empty?\n if Chat.backlog_fetched\n _em 'No messages found.'\n else\n _em 'Loading messages'\n end\n else\n i = 0\n\n # group messages by date\n while i < Chat.log.length\n date = datefmt(Chat.log[i].timestamp)\n _h5.chatlog date unless i == 0 and date == datefmt(Date.new().valueOf())\n\n # group of messages that share the same (local) date\n _dl.chatlog do\n while i < Chat.log.length\n message = Chat.log[i]\n break if date != datefmt(message.timestamp)\n _dt message.user, key: \"t#{message.timestamp}\", class: message.type,\n title: Date.new(message.timestamp).toLocaleTimeString()\n _dd key: \"d#{message.timestamp}\", class: message.type do\n if message.link\n _Link text: message.text, href: message.link\n else\n filters = [hotlink, self.mention]\n filters << self.agenda_link if message.type == :agenda\n _Text raw: message.text, filters: filters\n end\n end\n i += 1\n end\n end\n end\n end\n end", "def setup_adhoc_render_default\n subject = MailPart.new_subject(t('email.subject_initial_input'))\n body = MailPart.new_body('')\n\n setup_adhoc_render(subject, body)\n end", "def email\n template = (params[:layout] || 'email').to_sym\n # template = :hero unless [:email, :hero, :simple, :new].include? template\n file = 'user_mailer/welcome_email'\n @user = (defined?(FactoryGirl) \\\n ? User.new( FactoryGirl.attributes_for :user )\n : User.new( email: '[email protected]', first_name: 'John', last_name: 'Smith' ))\n render file, layout: \"emails/#{template}\"\n if params[:premail] == 'true'\n puts \"\\n!!! USING PREMAILER !!!\\n\\n\"\n pre = Premailer.new(response_body[0], warn_level: Premailer::Warnings::SAFE, with_html_string: true)\n reset_response\n # pre.warnings\n render text: pre.to_inline_css, layout: false\n end\n end", "def new_contact_intro_email(user, contact)\n if user.name.present?\n @name = user.name.titlecase\n else\n @name = user.email\n end\n\n @signature = user.signature\n @email = user.email\n\n mail to: contact.email, reply_to: @email, from: \"\\\"#{@name}\\\" <#{@email}>\", subject: \"#{@name} wants to stay in touch with you!\"\n Email.create(:user_id => user.id, :sent_to => contact.id, :title => \"new_contact_intro_email\", :contacts => contact.id)\n end", "def generate_welcome_message\n if default_message.present?\n messages.notification.create(sender_id: owner_id, body: default_message)\n else\n messages.notification.create(sender_id: owner_id, body: \"#{owner.full_name(false)} created this conversation group.\") if is_group_conversation?\n end\n end", "def process_explanation_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.process_explanation_mail(Petition.live.first)\n end", "def emails_send_to\n (emails + [cc.presence]).compact.uniq.to_sentence\n end", "def message\n @message ||= Mail.new(@rfc822)\n end", "def fetch_messages(opts = {}, &block)\n check_client_config\n\n opts[:after] = opts.delete(:since) if opts.include?(:since)\n\n mailbox = @client.label(\"INBOX\")\n mailbox.emails(:all, opts).map do |email|\n from = email.from[0]\n\n message_data = {\n :id => email.message_id,\n :source => 'email',\n :thread => email.thread_id,\n :title => email.subject,\n :body => extract_body(email),\n :sender_name => \"#{from.name || from.mailbox}\",\n :sender => \"#{from.mailbox}@#{from.host}\"\n }\n\n block.call Message.build(message_data)\n end\n end", "def adhoc_mailing\n setup_adhoc_render_default\n end", "def subject; @message_impl.getSubject; end", "def new_mail\n poll_response['num_unread'].to_i\n end", "def get_the_email_html(nline)\n\trecipient = @ws[nline, 1].to_s\n\t$mailsubject = \"A l'attention de la mairie de #{recipient}\"\n\t$html_content = \"<p> <b> A l'attention de la mairie de #{recipient} </b> </p>\n<p>Bonjour, </p>\n<p>Je m'appelle Thomas, je suis élève à une formation de code gratuite, ouverte à tous, sans restriction géographique, ni restriction de niveau. La formation s'appelle The Hacking Project (http://thehackingproject.org/). Nous apprenons l'informatique via la méthode du peer-learning : nous faisons des projets concrets qui nous sont assignés tous les jours, sur lesquel nous planchons en petites équipes autonomes. Le projet du jour est d'envoyer des emails à nos élus locaux pour qu'ils nous aident à faire de The Hacking Project un nouveau format d'éducation gratuite.\nNous vous contactons pour vous parler du projet, et vous dire que vous pouvez ouvrir une cellule à #{recipient}, où vous pouvez former gratuitement 6 personnes (ou plus), qu'elles soient débutantes, ou confirmées. Le modèle d'éducation de The Hacking Project n'a pas de limite en terme de nombre de moussaillons (c'est comme cela que l'on appelle les élèves), donc nous serions ravis de travailler avec #{recipient} ! </p>\n<p> Yann, Moussaillon de The Hacking Project</p>\" \n\nend", "def scheduled_emails\n @chat_history = EmailConversation.where(\"sender_id = #{current_user.id} AND sent_date is not null\")\n end", "def due_next_week_warning_mail\n PetitionMailer.due_next_week_warning_mail(Petition.live.first)\n end", "def second_round_email(email)\n @greeting = \"Hi\"\n\n mail to: email, subject: \"Your ASES Application Decision\"\n end", "def last_sender\n @last_sender ||= last_message.sender\n end", "def mailer; end", "def append_delivery_notes\n self.message += \"\\n----\\nFrom: #{self.user.email} #{Time.now}\\n\" + I18n.translate(:delivered_to)+\" \"\n if( all_users = (@recipients.count == User.count))\n self.message += I18n.translate(:all_users, count: @recipients.count)\n else\n self.message += @recipients.all.map { |recipient|\n recipient.name + \" (#{recipient.email})\"\n }.join(\", \")\n end\n end", "def email_sent\n @email = session[:owners_new_email]\n end", "def center_this(msg)\n\t\tif msg.class == Array\n\t\t\tmsg.each do |line|\n\t\t\t\tcenter_this line\n\t\t\tend\n\t\telse\n\t\t\tprint msg.center(@window_width, \" \")\n\t\tend\n\tend", "def display_mail_queue(what)\n emails = case what\n when 'all' then\n puts 'Showing all emails in the system'\n ArMailerRevised.email_class.all\n when 'deliverable' then\n puts 'Showing emails ready to deliver'\n ArMailerRevised.email_class.ready_to_deliver\n when 'delayed' then\n puts 'Showing delayed emails'\n ArMailerRevised.email_class.delayed\n else\n []\n end\n puts 'Mail queue is empty' and return if emails.empty?\n puts Hirb::Helpers::AutoTable.render emails, :fields => [:from, :to, :delivery_time, :last_send_attempt, :updated_at]\n end", "def sms_deliver_first_octet\n octet = 0\n octet |= 0x04 unless @opts[:more_to_send]\n octet |= 0x80 if @opts[:has_udh]\n octet.chr\n end", "def magic_login_email\n UserMailer.magic_login_email(User.first)\n end", "def mailboxer_email(object)\n #If actor has disabled the emails, return nil.\n return nil if !notify_by_email\n #If actor has enabled the emails and has email\n return \"#{name} <#{email}>\" if email.present?\n #If actor is a Group, has enabled emails but no mail we return the highest_rank ones.\n if (group = self.subject).is_a? Group\n relation = group.relation_customs.sort.first\n receivers = group.contact_actors(:direction => :sent, :relations => relation)\n emails = Array.new\n receivers.each do |receiver|\n receiver_emails = receiver.mailboxer_email(object)\n case receiver_emails\n when String\n emails << receiver_emails\n when Array\n receiver_emails.each do |receiver_email|\n emails << receiver_email\n end\n end\n end\n return emails\n end\n end", "def mk_sender\n [\"-- \", \"Med kærlig hilsen, \", \"Med venlig hilsen, \", \"MVH, \", \"Hilsen \"].sample + \"Nikolaj Lepka\\n\" +\n \"Telefon: 25 14 66 83\\n\" +\n \"Email: [email protected]\\n\" +\n \"Github: https://github.com/ElectricCoffee\\n\" +\n \"Twitter: https://twitter.com/Electric_Coffee\\n\\n\"\n end", "def conversation_start person\n\t\treturn nil if (person.is_not? :person)\n\t\t@mode = :conversation\n\t\t@talking_to = person\n\t\tGAME.window(:conversation).show\n\t\tGAME.window(:input).prompt = :conversation\n\tend" ]
[ "0.6823457", "0.6189862", "0.6045139", "0.5975519", "0.58648443", "0.5800153", "0.5519095", "0.5515834", "0.5437649", "0.5424975", "0.5369577", "0.5362117", "0.52879155", "0.52715766", "0.52672106", "0.5264828", "0.52642584", "0.5229633", "0.52242166", "0.52024496", "0.5196294", "0.5196294", "0.5178184", "0.5137697", "0.512724", "0.51025736", "0.5068842", "0.50359815", "0.5028721", "0.5024903", "0.5023037", "0.50040704", "0.49941924", "0.49916288", "0.49814358", "0.49557495", "0.49488398", "0.49405792", "0.49369037", "0.49175006", "0.49175006", "0.49157202", "0.49018103", "0.4895204", "0.4894671", "0.48928824", "0.48907173", "0.48833114", "0.48814964", "0.4877716", "0.48704067", "0.48675108", "0.48672837", "0.48553827", "0.4849421", "0.4848015", "0.4840802", "0.48405966", "0.48293447", "0.4820052", "0.4803153", "0.48007083", "0.48003498", "0.47985935", "0.47982824", "0.47966933", "0.4795927", "0.47834393", "0.47831014", "0.47788778", "0.47786552", "0.47735453", "0.47728193", "0.47720703", "0.4768703", "0.47659424", "0.47647324", "0.4760621", "0.47586796", "0.4752612", "0.47519058", "0.47494367", "0.4747068", "0.47436368", "0.47433227", "0.47338924", "0.4728054", "0.47204447", "0.4719925", "0.47167397", "0.47131962", "0.4710948", "0.47069055", "0.47059414", "0.47050515", "0.4703801", "0.47011295", "0.4699759", "0.46988258", "0.46956828" ]
0.61954284
1