ruby_parser
Advanced tools
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
+15
-0
@@ -0,1 +1,16 @@ | ||
| === 3.8.0 / 2016-02-18 | ||
| * 1 major enhancement: | ||
| * Added support for Ruby 2.3.0 and the &. operator. (presidentbeef) | ||
| * 2 minor enhancements: | ||
| * Add support for safe attr assign. (presidentbeef) | ||
| * Added support for safe call. (presidentbeef) | ||
| * 1 bug fix: | ||
| * Fixed parsing of { 'a': :b }. (presidentbeef) | ||
| === 3.7.3 / 2016-01-21 | ||
@@ -2,0 +17,0 @@ |
@@ -683,5 +683,5 @@ # encoding: UTF-8 | ||
| def process_label text | ||
| result = process_symbol text | ||
| result[0] = :tLABEL | ||
| result | ||
| symbol = text[1..-3].gsub(ESC) { unescape $1 } | ||
| result(:expr_labelarg, :tLABEL, [symbol, self.lineno]) | ||
| end | ||
@@ -1078,3 +1078,4 @@ | ||
| def ruby22? | ||
| Ruby22Parser === parser | ||
| Ruby22Parser === parser or | ||
| Ruby23Parser === parser | ||
| end | ||
@@ -1081,0 +1082,0 @@ |
@@ -114,3 +114,3 @@ # encoding: UTF-8 | ||
| end # group /=/ | ||
| when ruby22_label? && (text = ss.scan(/\"(#{SIMPLE_STRING})\":/o)) then | ||
| when ruby22_label? && (text = ss.scan(/\"#{SIMPLE_STRING}\":/o)) then | ||
| process_label text | ||
@@ -236,2 +236,4 @@ when text = ss.scan(/\"(#{SIMPLE_STRING})\"/o) then | ||
| action { result(:expr_beg, :tOP_ASGN, "&" ) } | ||
| when ss.skip(/\&\./) then | ||
| action { result(:expr_dot, :tLONELY, "&.") } | ||
| when text = ss.scan(/\&/) then | ||
@@ -238,0 +240,0 @@ process_amper text |
@@ -94,3 +94,3 @@ # encoding: ASCII-8BIT | ||
| module RubyParserStuff | ||
| VERSION = "3.7.3" unless constants.include? "VERSION" # SIGH | ||
| VERSION = "3.8.0" unless constants.include? "VERSION" # SIGH | ||
@@ -936,3 +936,3 @@ attr_accessor :lexer, :in_def, :in_single, :file | ||
| case lhs[0] | ||
| when :lasgn, :iasgn, :cdecl, :cvdecl, :gasgn, :cvasgn, :attrasgn then | ||
| when :lasgn, :iasgn, :cdecl, :cvdecl, :gasgn, :cvasgn, :attrasgn, :safe_attrasgn then | ||
| lhs << rhs | ||
@@ -1325,2 +1325,6 @@ when :const then | ||
| class Ruby23Parser < Racc::Parser | ||
| include RubyParserStuff | ||
| end | ||
| class Ruby22Parser < Racc::Parser | ||
@@ -1360,2 +1364,3 @@ include RubyParserStuff | ||
| @p22 = Ruby22Parser.new | ||
| @p23 = Ruby23Parser.new | ||
| end | ||
@@ -1365,3 +1370,3 @@ | ||
| e = nil | ||
| [@p22, @p21, @p20, @p19, @p18].each do |parser| | ||
| [@p23, @p22, @p21, @p20, @p19, @p18].each do |parser| | ||
| begin | ||
@@ -1384,2 +1389,3 @@ return parser.process s, f, t | ||
| @p22.reset | ||
| @p23.reset | ||
| end | ||
@@ -1399,2 +1405,4 @@ | ||
| Ruby22Parser.new | ||
| when /^2.3/ then | ||
| Ruby23Parser.new | ||
| else | ||
@@ -1401,0 +1409,0 @@ raise "unrecognized RUBY_VERSION #{RUBY_VERSION}" |
@@ -6,2 +6,3 @@ require 'ruby18_parser' | ||
| require 'ruby22_parser' | ||
| require 'ruby23_parser' | ||
| require 'ruby_parser_extras' |
+2
-0
@@ -19,2 +19,4 @@ .autotest | ||
| lib/ruby22_parser.y | ||
| lib/ruby23_parser.rb | ||
| lib/ruby23_parser.y | ||
| lib/ruby_lexer.rb | ||
@@ -21,0 +23,0 @@ lib/ruby_lexer.rex |
+13
-3
@@ -34,2 +34,4 @@ # -*- ruby -*- | ||
| self.perforce_ignore << "lib/ruby22_parser.y" | ||
| self.perforce_ignore << "lib/ruby23_parser.rb" | ||
| self.perforce_ignore << "lib/ruby23_parser.y" | ||
| self.perforce_ignore << "lib/ruby_lexer.rex.rb" | ||
@@ -42,13 +44,18 @@ end | ||
| file "lib/ruby20_parser.y" => "lib/ruby_parser.yy" do |t| | ||
| sh "unifdef -tk -DRUBY20 -URUBY21 -URUBY22 -UDEAD #{t.source} > #{t.name} || true" | ||
| sh "unifdef -tk -DRUBY20 -URUBY21 -URUBY22 -URUBY23 -UDEAD #{t.source} > #{t.name} || true" | ||
| end | ||
| file "lib/ruby21_parser.y" => "lib/ruby_parser.yy" do |t| | ||
| sh "unifdef -tk -URUBY20 -DRUBY21 -URUBY22 -UDEAD #{t.source} > #{t.name} || true" | ||
| sh "unifdef -tk -URUBY20 -DRUBY21 -URUBY22 -URUBY23 -UDEAD #{t.source} > #{t.name} || true" | ||
| end | ||
| file "lib/ruby22_parser.y" => "lib/ruby_parser.yy" do |t| | ||
| sh "unifdef -tk -URUBY20 -URUBY21 -DRUBY22 -UDEAD #{t.source} > #{t.name} || true" | ||
| sh "unifdef -tk -URUBY20 -URUBY21 -DRUBY22 -URUBY23 -UDEAD #{t.source} > #{t.name} || true" | ||
| end | ||
| file "lib/ruby23_parser.y" => "lib/ruby_parser.yy" do |t| | ||
| sh "unifdef -tk -URUBY20 -URUBY21 -URUBY22 -DRUBY23 -UDEAD #{t.source} > #{t.name} || true" | ||
| end | ||
| file "lib/ruby18_parser.rb" => "lib/ruby18_parser.y" | ||
@@ -59,2 +66,3 @@ file "lib/ruby19_parser.rb" => "lib/ruby19_parser.y" | ||
| file "lib/ruby22_parser.rb" => "lib/ruby22_parser.y" | ||
| file "lib/ruby23_parser.rb" => "lib/ruby23_parser.y" | ||
| file "lib/ruby_lexer.rex.rb" => "lib/ruby_lexer.rex" | ||
@@ -135,2 +143,4 @@ | ||
| Ruby22Parser.new | ||
| when "23" then | ||
| Ruby23Parser.new | ||
| else | ||
@@ -137,0 +147,0 @@ raise "Unsupported version #{ENV["V"]}" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display