ruby_parser
Advanced tools
+7
-0
@@ -0,1 +1,8 @@ | ||
| === 3.8.2 / 2016-05-05 | ||
| * 2 bug fixes: | ||
| * Fixed lex_state in interpolated strings. (whitequark) | ||
| * Fixed safe operator for newline/semicolon contexts. (presidentbeef) | ||
| === 3.8.1 / 2016-02-19 | ||
@@ -2,0 +9,0 @@ |
@@ -94,3 +94,3 @@ # encoding: ASCII-8BIT | ||
| module RubyParserStuff | ||
| VERSION = "3.8.1" unless constants.include? "VERSION" # SIGH | ||
| VERSION = "3.8.2" unless constants.include? "VERSION" # SIGH | ||
@@ -561,4 +561,11 @@ attr_accessor :lexer, :in_def, :in_single, :file | ||
| def new_call recv, meth, args = nil | ||
| result = s(:call, recv, meth) | ||
| def new_call recv, meth, args = nil, call_op = :'.' | ||
| result = case call_op.to_sym | ||
| when :'.' | ||
| s(:call, recv, meth) | ||
| when :'&.' | ||
| s(:safe_call, recv, meth) | ||
| else | ||
| raise "unknown call operator: `#{type.inspect}`" | ||
| end | ||
@@ -582,2 +589,18 @@ # TODO: need a test with f(&b) to produce block_pass | ||
| def new_attrasgn recv, meth, call_op | ||
| meth = :"#{meth}=" | ||
| result = case call_op.to_sym | ||
| when :'.' | ||
| s(:attrasgn, recv, meth) | ||
| when :'&.' | ||
| s(:safe_attrasgn, recv, meth) | ||
| else | ||
| raise "unknown call operator: `#{type.inspect}`" | ||
| end | ||
| result.line = recv.line | ||
| result | ||
| end | ||
| def new_case expr, body, line | ||
@@ -751,2 +774,19 @@ result = s(:case, expr) | ||
| def new_op_asgn2 val | ||
| recv, call_op, meth, op, arg = val | ||
| meth = :"#{meth}=" | ||
| result = case call_op.to_sym | ||
| when :'.' | ||
| s(:op_asgn2, recv, meth, op.to_sym, arg) | ||
| when :'&.' | ||
| s(:safe_op_asgn2, recv, meth, op.to_sym, arg) | ||
| else | ||
| raise "unknown call operator: `#{type.inspect}`" | ||
| end | ||
| result.line = recv.line | ||
| result | ||
| end | ||
| def new_regexp val | ||
@@ -753,0 +793,0 @@ node = val[1] || s(:str, '') |
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
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 not supported yet
Sorry, the diff of this file is too big to display