| Age | Commit message (Collapse) | Author |
|
A closed brace in auto-indent shouldn't affect the next brace in the same line,
but it behaves like below:
p() {
}
It's a bug.
https://github.com/ruby/irb/commit/fbe59e344f
|
|
https://github.com/ruby/irb/issues/55
If we had put multiple open braces on a line the with no closing brace
spaces_of_nest array keeps getting '0' added to it. This means that when
we pop off of this array we are saying that we should be in position zero
for the next line. This is an issue because we don't always want to be
in position 0 after a closing brace.
Example:
```
[[[
]
]
]
```
In the above example the 'spaces_of_nest' array looks like this after
the first line is entered: [0,0,0]. We really want to be indented 4
spaces for the 1st closing brace 2 for the 2nd and 0 for the 3rd. i.e.
we want it to be: [0,2,4].
We also saw this issue with a heredoc inside of an array.
```
[<<FOO]
hello
FOO
```
https://github.com/ruby/irb/commit/80c69c8272
|
|
This commit fixes the check_newline_depth_difference method to multiple
open braces on one line into account. Before this change we were
subtracting from the depth in check_newline_depth_difference on
every open brace. This is the right thing to do if the opening and
closing brace are on the same line. For example in a method definition we
have an opening and closing parentheses we want to add 1 to our depth,
and then remove it.
```
def foo()
end
```
However this isn't the correct behavior when the brace spans multiple
lines. If a brace spans multiple lines we don't want to subtract from
check_newline_depth_difference and we want to treat the braces the same
way as we do `end` and allow check_corresponding_token_depth to pop the
correct depth.
Example of bad behavior:
```
def foo()
[
]
puts 'bar'
end
```
Example of desired behavior:
```
def foo()
[
]
puts 'bar'
end
```
https://github.com/ruby/irb/commit/7dc8af01e0
|
|
Follow up of the previous commit
https://github.com/ruby/irb/commit/ab207353d3
|
|
Fixes #47
https://github.com/ruby/irb/commit/6b8eca4635
|
|
|
|
This reverts commit 5e275dd2af4d9d24cdb1cfc0f232f348dae9c2cd.
...The @1 type numberd parameter is reverted from Ruby syntax.
|
|
|
|
|
|
meth do # the preceding token of "do" has EXPR_CMDARG
end
meth() do # the preceding token of "do" has EXPR_ENDFN
end
|
|
|
|
Co-authored-by: Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
|
|
A "do" what has followed a token what has EXPR_CMDARG is for a block,
and in other cases "do" is for "while", "until" or "for".
|
|
RubyVM is specific to CRuby and not supported on JRuby. This is
the equivalent operation.
|
|
|
|
|
|
|
|
|
|
Example:
[
1, # this is not continuation line
2
]
|
|
|
|
v =
3 # auto indent
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
v =
if true # starting token at head of 2nd line
3
end # closing token
|
|
if true
3; end # this isn't auto-indented
|
|
v =
if true
3
end # this "end" is auto-indented correctly
|
|
|
|
|
|
|
|
|
|
|
|
Upgrade IRB to https://github.com/ruby/irb/commit/41ea43a4a732e094acfa1b0fc1473fdcda9e6227
Mostly backport changes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pp Ripper.lex('{ "a": 3 }')
=>
[[[1, 0], :on_lbrace, "{", EXPR_BEG|EXPR_LABEL],
[[1, 1], :on_sp, " ", EXPR_BEG|EXPR_LABEL],
[[1, 2], :on_tstring_beg, "\"", EXPR_BEG|EXPR_LABEL],
[[1, 3], :on_tstring_content, "a", EXPR_BEG|EXPR_LABEL],
[[1, 4], :on_label_end, "\":", EXPR_BEG|EXPR_LABEL],
[[1, 6], :on_sp, " ", EXPR_BEG|EXPR_LABEL],
[[1, 7], :on_int, "3", EXPR_END],
[[1, 8], :on_sp, " ", EXPR_END],
[[1, 9], :on_rbrace, "}", EXPR_END]]
|
|
|
|
|
|
|
|
The debug option of IRB is deleted because it's just for IRB's pure Ruby
parser.
|
|
Accidentally merged when 89271d4a3733bc5e70e9c56b4bd12f277e699c42
"Adjusted indents".
|