mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Reflect behavior changes to argument name
0c459af7c2
changed the meaning of
`detect_compile_error`, and this commit lets it follow the change.
This commit is contained in:
parent
fc7b4c7018
commit
9987f45765
1 changed files with 3 additions and 3 deletions
|
@ -108,7 +108,7 @@ module IRB # :nodoc:
|
||||||
colored = +''
|
colored = +''
|
||||||
length = 0
|
length = 0
|
||||||
|
|
||||||
scan(code, detect_compile_error: complete) do |token, str, expr|
|
scan(code, allow_last_error: !complete) do |token, str, expr|
|
||||||
in_symbol = symbol_state.scan_token(token)
|
in_symbol = symbol_state.scan_token(token)
|
||||||
str.each_line do |line|
|
str.each_line do |line|
|
||||||
line = Reline::Unicode.escape_for_print(line)
|
line = Reline::Unicode.escape_for_print(line)
|
||||||
|
@ -132,12 +132,12 @@ module IRB # :nodoc:
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def scan(code, detect_compile_error:)
|
def scan(code, allow_last_error:)
|
||||||
pos = [1, 0]
|
pos = [1, 0]
|
||||||
|
|
||||||
Ripper::Lexer.new(code).scan.each do |elem|
|
Ripper::Lexer.new(code).scan.each do |elem|
|
||||||
str = elem.tok
|
str = elem.tok
|
||||||
next if !detect_compile_error and elem.message&.end_with?("meets end of file")
|
next if allow_last_error and elem.message&.end_with?('meets end of file')
|
||||||
next if ([elem.pos[0], elem.pos[1] + str.bytesize] <=> pos) <= 0
|
next if ([elem.pos[0], elem.pos[1] + str.bytesize] <=> pos) <= 0
|
||||||
|
|
||||||
str.each_line do |line|
|
str.each_line do |line|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue