Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/ExeBy/exe_root.../opt/alt/ruby22/lib64/ruby/2.2.0
File: ripper.rb
require 'ripper/core'
[0] Fix | Delete
require 'ripper/lexer'
[1] Fix | Delete
require 'ripper/filter'
[2] Fix | Delete
require 'ripper/sexp'
[3] Fix | Delete
[4] Fix | Delete
# Ripper is a Ruby script parser.
[5] Fix | Delete
#
[6] Fix | Delete
# You can get information from the parser with event-based style.
[7] Fix | Delete
# Information such as abstract syntax trees or simple lexical analysis of the
[8] Fix | Delete
# Ruby program.
[9] Fix | Delete
#
[10] Fix | Delete
# == Usage
[11] Fix | Delete
#
[12] Fix | Delete
# Ripper provides an easy interface for parsing your program into a symbolic
[13] Fix | Delete
# expression tree (or S-expression).
[14] Fix | Delete
#
[15] Fix | Delete
# Understanding the output of the parser may come as a challenge, it's
[16] Fix | Delete
# recommended you use PP to format the output for legibility.
[17] Fix | Delete
#
[18] Fix | Delete
# require 'ripper'
[19] Fix | Delete
# require 'pp'
[20] Fix | Delete
#
[21] Fix | Delete
# pp Ripper.sexp('def hello(world) "Hello, #{world}!"; end')
[22] Fix | Delete
# #=> [:program,
[23] Fix | Delete
# [[:def,
[24] Fix | Delete
# [:@ident, "hello", [1, 4]],
[25] Fix | Delete
# [:paren,
[26] Fix | Delete
# [:params, [[:@ident, "world", [1, 10]]], nil, nil, nil, nil, nil, nil]],
[27] Fix | Delete
# [:bodystmt,
[28] Fix | Delete
# [[:string_literal,
[29] Fix | Delete
# [:string_content,
[30] Fix | Delete
# [:@tstring_content, "Hello, ", [1, 18]],
[31] Fix | Delete
# [:string_embexpr, [[:var_ref, [:@ident, "world", [1, 27]]]]],
[32] Fix | Delete
# [:@tstring_content, "!", [1, 33]]]]],
[33] Fix | Delete
# nil,
[34] Fix | Delete
# nil,
[35] Fix | Delete
# nil]]]]
[36] Fix | Delete
#
[37] Fix | Delete
# You can see in the example above, the expression starts with +:program+.
[38] Fix | Delete
#
[39] Fix | Delete
# From here, a method definition at +:def+, followed by the method's identifier
[40] Fix | Delete
# <code>:@ident</code>. After the method's identifier comes the parentheses
[41] Fix | Delete
# +:paren+ and the method parameters under +:params+.
[42] Fix | Delete
#
[43] Fix | Delete
# Next is the method body, starting at +:bodystmt+ (+stmt+ meaning statement),
[44] Fix | Delete
# which contains the full definition of the method.
[45] Fix | Delete
#
[46] Fix | Delete
# In our case, we're simply returning a String, so next we have the
[47] Fix | Delete
# +:string_literal+ expression.
[48] Fix | Delete
#
[49] Fix | Delete
# Within our +:string_literal+ you'll notice two <code>@tstring_content</code>,
[50] Fix | Delete
# this is the literal part for <code>Hello, </code> and <code>!</code>. Between
[51] Fix | Delete
# the two <code>@tstring_content</code> statements is a +:string_embexpr+,
[52] Fix | Delete
# where _embexpr_ is an embedded expression. Our expression consists of a local
[53] Fix | Delete
# variable, or +var_ref+, with the identifier (<code>@ident</code>) of +world+.
[54] Fix | Delete
#
[55] Fix | Delete
# == Resources
[56] Fix | Delete
#
[57] Fix | Delete
# * {Ruby Inside}[http://www.rubyinside.com/using-ripper-to-see-how-ruby-is-parsing-your-code-5270.html]
[58] Fix | Delete
#
[59] Fix | Delete
# == Requirements
[60] Fix | Delete
#
[61] Fix | Delete
# * ruby 1.9 (support CVS HEAD only)
[62] Fix | Delete
# * bison 1.28 or later (Other yaccs do not work)
[63] Fix | Delete
#
[64] Fix | Delete
# == License
[65] Fix | Delete
#
[66] Fix | Delete
# Ruby License.
[67] Fix | Delete
#
[68] Fix | Delete
# Minero Aoki
[69] Fix | Delete
# aamine@loveruby.net
[70] Fix | Delete
# http://i.loveruby.net
[71] Fix | Delete
class Ripper; end
[72] Fix | Delete
[73] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function