-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle arbitrary expression types in
aref_field
nodes (#381)
* Fixtures * Handle all expression lists in aref fields * Add fixtures for non-assign arefs * Fix multiline item rendering for expressions with hard newlines in them
- Loading branch information
Showing
5 changed files
with
95 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,23 @@ | ||
# As above | ||
a[0] = b | ||
# So below | ||
|
||
a[puts a] = "" | ||
a[puts(a)] = "" | ||
a[()] = "" | ||
a[class A; def foo; puts a; end; end] = "" | ||
a[begin; ""; rescue StandardException; ""; end] = "" | ||
# Users can override #[]= to not have args | ||
a[] = "" | ||
# Users can override #[]= to have multiple args | ||
a[1, 2] = "" | ||
|
||
a[puts a] | ||
a[puts(a)] | ||
a[()] | ||
a[class A; def foo; puts a; end; end] | ||
a[begin; ""; rescue StandardException; ""; end] | ||
# Users can override #[] to not have args | ||
a[] | ||
# Users can override #[] to have multiple args | ||
a[1, 2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,47 @@ | ||
# As above | ||
a[0] = b | ||
# So below | ||
|
||
a[puts(a)] = "" | ||
a[puts(a)] = "" | ||
a[()] = "" | ||
a[ | ||
class A | ||
def foo | ||
puts(a) | ||
end | ||
end | ||
] = "" | ||
a[ | ||
begin | ||
"" | ||
rescue StandardException | ||
"" | ||
end | ||
] = "" | ||
# Users can override #[]= to not have args | ||
a[] = "" | ||
# Users can override #[]= to have multiple args | ||
a[1, 2] = "" | ||
|
||
a[puts(a)] | ||
a[puts(a)] | ||
a[()] | ||
a[ | ||
class A | ||
def foo | ||
puts(a) | ||
end | ||
end | ||
] | ||
a[ | ||
begin | ||
"" | ||
rescue StandardException | ||
"" | ||
end | ||
] | ||
# Users can override #[] to not have args | ||
a[] | ||
# Users can override #[] to have multiple args | ||
a[1, 2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters