-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump Ruby checkout to 3.0 #400
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
_1, (_2, _3) = [] | ||
_a, (_b, _c) = [] | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
_1, (_2, _3) = [] | ||
_a, (_b, _c) = [] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,25 +146,25 @@ def escape_percent_array_paren_content(part, pattern) | |
|
||
define_method(:"on_#{event}_add") do |parts, part| | ||
delim = parts[1][0][1] | ||
parts.tap do |node| | ||
unless delim.end_with?('[') | ||
delim_start = delim[-1] | ||
delim_close = DELIM_CLOSE_PAREN[delim_start] | ||
pattern = if delim_close | ||
/(?<!\\)(?:\\\\)*(?:\\[#{Regexp.escape(delim_start)}#{Regexp.escape(delim_close)}]|[\[\]])/ | ||
else | ||
/(?<!\\)(?:\\\\)*(?:\\#{Regexp.escape(delim_start)}|[\[\]])/ | ||
end | ||
if part[0].is_a?(Array) | ||
part.each do |sub_part| | ||
escape_percent_array_paren_content(sub_part, pattern) | ||
end | ||
else | ||
escape_percent_array_paren_content(part, pattern) | ||
|
||
unless delim.end_with?('[') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change is due to ruby/ruby#3281, which moved |
||
delim_start = delim[-1] | ||
delim_close = DELIM_CLOSE_PAREN[delim_start] | ||
pattern = if delim_close | ||
/(?<!\\)(?:\\\\)*(?:\\[#{Regexp.escape(delim_start)}#{Regexp.escape(delim_close)}]|[\[\]])/ | ||
else | ||
/(?<!\\)(?:\\\\)*(?:\\#{Regexp.escape(delim_start)}|[\[\]])/ | ||
end | ||
if part[0].is_a?(Array) | ||
part.each do |sub_part| | ||
escape_percent_array_paren_content(sub_part, pattern) | ||
end | ||
else | ||
escape_percent_array_paren_content(part, pattern) | ||
end | ||
node[1] << part | ||
end | ||
parts[1] << part | ||
|
||
super(parts, part) | ||
end | ||
end | ||
|
@@ -569,5 +569,3 @@ def on___end__(val) | |
end | ||
end | ||
end | ||
|
||
GC.disable |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,7 @@ use simplelog::{ConfigBuilder, LevelFilter, TermLogger, TerminalMode}; | |
|
||
extern "C" { | ||
pub fn Init_ripper(); | ||
pub fn rb_gc_disable(); | ||
} | ||
|
||
pub struct RubyfmtString(Box<str>); | ||
|
@@ -193,6 +194,7 @@ unsafe fn load_ripper() -> Result<(), ()> { | |
"../ruby_checkout/ext/ripper/lib/ripper/sexp.rb" | ||
))?; | ||
|
||
rb_gc_disable(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Totally open to suggestions on a better way to do this since I couldn't really figure out why |
||
Ok(()) | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to ruby/ruby#3163 -- in Ruby 3, assigning to numbered param is now a syntax error. This is technically a backwards-incompatible change for rubyfmt, but IMO I think that's fine.