ruby_parser
Advanced tools
+10
-0
@@ -0,1 +1,11 @@ | ||
| === 3.19.2 / 2022-12-03 | ||
| * 5 bug fixes: | ||
| * Fixed bug parsing array patterns using %w, %i, etc. | ||
| * Fixed dedenting when heredoc has only empty line and interpolation. (mvz) | ||
| * Fixed dsym unescaping. (mvz) | ||
| * Fixed vars in pattern matching that should be lasgn, not lvar. | ||
| * find_pat mid-patterns are now splatted inline, not wrapped in an array_pat. | ||
| === 3.19.1 / 2022-04-05 | ||
@@ -2,0 +12,0 @@ |
+11
-4
@@ -235,3 +235,3 @@ # frozen_string_literal: true | ||
| if text =~ check then | ||
| content.gsub(ESC) { unescape $1 } | ||
| unescape_string content | ||
| else | ||
@@ -594,5 +594,3 @@ content.gsub(/\\\\/, "\\").gsub(/\\\'/, "'") | ||
| str = text[1..-2] | ||
| .gsub(ESC) { unescape($1).b.force_encoding Encoding::UTF_8 } | ||
| str = str.b unless str.valid_encoding? | ||
| str = unescape_string text[1..-2] | ||
@@ -822,2 +820,11 @@ result EXPR_END, :tSTRING, str, orig_line | ||
| def unescape_string str | ||
| str = str.gsub(ESC) { unescape($1).b.force_encoding Encoding::UTF_8 } | ||
| if str.valid_encoding? | ||
| str | ||
| else | ||
| str.b | ||
| end | ||
| end | ||
| def unescape s | ||
@@ -824,0 +831,0 @@ r = ESCAPES[s] |
@@ -33,3 +33,3 @@ # encoding: ASCII-8BIT | ||
| module RubyParserStuff | ||
| VERSION = "3.19.1" | ||
| VERSION = "3.19.2" | ||
@@ -475,3 +475,3 @@ attr_accessor :lexer, :in_def, :in_single, :file | ||
| warn "unprocessed: %p" % [s] | ||
| end.map { |l| whitespace_width l.chomp } | ||
| end.map { |l| whitespace_width l } | ||
| }.compact.min | ||
@@ -736,2 +736,9 @@ end | ||
| def ary_to_pat ary | ||
| pat = ary.dup | ||
| pat.sexp_type = :array_TAIL | ||
| new_array_pattern nil, nil, pat, ary.line | ||
| end | ||
| def new_array_pattern const, pre_arg, arypat, loc | ||
@@ -1072,5 +1079,5 @@ result = s(:array_pat, const).line loc | ||
| mid.sexp_type = :array_pat # HACK? | ||
| raise "BAD?" unless mid.sexp_type == :array_TAIL | ||
| s(:find_pat_TAIL, lhs_id, mid, rhs_id).line line | ||
| s(:find_pat_TAIL, lhs_id, *mid.sexp_body, rhs_id).line line | ||
| end | ||
@@ -1658,3 +1665,3 @@ | ||
| line[idx..-1] | ||
| elsif line[idx].nil? | ||
| elsif line[idx] == "\n" | ||
| nil | ||
@@ -1661,0 +1668,0 @@ else |
+1
-0
@@ -15,2 +15,3 @@ # -*- ruby -*- | ||
| Hoe.add_include_dirs "../../oedipus_lex/dev/lib" | ||
| Hoe.add_include_dirs "../../ruby2ruby/dev/lib" | ||
@@ -17,0 +18,0 @@ V2 = %w[20 21 22 23 24 25 26 27] |
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 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