Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/AnonR/smanonr..../usr/share/ruby/ripper
File: core.rb
# frozen_string_literal: true
[0] Fix | Delete
#
[1] Fix | Delete
# $Id: core.rb 57538 2017-02-05 07:54:32Z kazu $
[2] Fix | Delete
#
[3] Fix | Delete
# Copyright (c) 2003-2005 Minero Aoki
[4] Fix | Delete
#
[5] Fix | Delete
# This program is free software.
[6] Fix | Delete
# You can distribute and/or modify this program under the Ruby License.
[7] Fix | Delete
# For details of Ruby License, see ruby/COPYING.
[8] Fix | Delete
#
[9] Fix | Delete
[10] Fix | Delete
require 'ripper.so'
[11] Fix | Delete
[12] Fix | Delete
class Ripper
[13] Fix | Delete
[14] Fix | Delete
# Parses the given Ruby program read from +src+.
[15] Fix | Delete
# +src+ must be a String or an IO or a object with a #gets method.
[16] Fix | Delete
def Ripper.parse(src, filename = '(ripper)', lineno = 1)
[17] Fix | Delete
new(src, filename, lineno).parse
[18] Fix | Delete
end
[19] Fix | Delete
[20] Fix | Delete
# This array contains name of parser events.
[21] Fix | Delete
PARSER_EVENTS = PARSER_EVENT_TABLE.keys
[22] Fix | Delete
[23] Fix | Delete
# This array contains name of scanner events.
[24] Fix | Delete
SCANNER_EVENTS = SCANNER_EVENT_TABLE.keys
[25] Fix | Delete
[26] Fix | Delete
# This array contains name of all ripper events.
[27] Fix | Delete
EVENTS = PARSER_EVENTS + SCANNER_EVENTS
[28] Fix | Delete
[29] Fix | Delete
private
[30] Fix | Delete
[31] Fix | Delete
def _dispatch_0() nil end
[32] Fix | Delete
def _dispatch_1(a) a end
[33] Fix | Delete
def _dispatch_2(a, b) a end
[34] Fix | Delete
def _dispatch_3(a, b, c) a end
[35] Fix | Delete
def _dispatch_4(a, b, c, d) a end
[36] Fix | Delete
def _dispatch_5(a, b, c, d, e) a end
[37] Fix | Delete
def _dispatch_6(a, b, c, d, e, f) a end
[38] Fix | Delete
def _dispatch_7(a, b, c, d, e, f, g) a end
[39] Fix | Delete
[40] Fix | Delete
#
[41] Fix | Delete
# Parser Events
[42] Fix | Delete
#
[43] Fix | Delete
[44] Fix | Delete
PARSER_EVENT_TABLE.each do |id, arity|
[45] Fix | Delete
alias_method "on_#{id}", "_dispatch_#{arity}"
[46] Fix | Delete
end
[47] Fix | Delete
[48] Fix | Delete
# This method is called when weak warning is produced by the parser.
[49] Fix | Delete
# +fmt+ and +args+ is printf style.
[50] Fix | Delete
def warn(fmt, *args)
[51] Fix | Delete
end
[52] Fix | Delete
[53] Fix | Delete
# This method is called when strong warning is produced by the parser.
[54] Fix | Delete
# +fmt+ and +args+ is printf style.
[55] Fix | Delete
def warning(fmt, *args)
[56] Fix | Delete
end
[57] Fix | Delete
[58] Fix | Delete
# This method is called when the parser found syntax error.
[59] Fix | Delete
def compile_error(msg)
[60] Fix | Delete
end
[61] Fix | Delete
[62] Fix | Delete
#
[63] Fix | Delete
# Scanner Events
[64] Fix | Delete
#
[65] Fix | Delete
[66] Fix | Delete
SCANNER_EVENTS.each do |id|
[67] Fix | Delete
alias_method "on_#{id}", :_dispatch_1
[68] Fix | Delete
end
[69] Fix | Delete
[70] Fix | Delete
end
[71] Fix | Delete
[72] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function