| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
This `last_state` is set to `lex.state` just before the `switch`
statement, and `token_flush` nor `nextc` never change the state.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
```ruby
if false
puts 'false'
else if true
puts 'true'
end # -:5: warning: mismatched indentations at 'end' with 'if' at 3
end
```
[Feature #15990]
|
| |
|
|
|
|
| |
It has unintentionally passed since 2.5.
|
| |
|
|
|
|
|
|
|
| |
As a comment token includes the newline, so delayed newline token
just follows it should not be dispatched. [Bug #11485]
Co-Authored-By: Jeremy Evans <code@jeremyevans.net>
|
|
|
|
|
|
| |
* parse.y (f_rest_marg): extract named and unnamed rest parameter
in parenthesized method arguments, and should not be warned as
unused.
|
| |
|
| |
|
|
|
|
|
| |
* parse.y (parser_yylex): return END_OF_INPUT at unterminated here
document instead of an error. [Bug #15962]
|
|
|
|
|
|
| |
* parse.y (value_expr_check): `then` or `else` only `if` is not a
void value expression, as the counterpart is evaluated as `nil`.
[Bug #15932]
|
|
|
|
|
|
| |
* parse.y (value_expr_check): if either of `then` or `else`
statements is not a void value expression, the whole `if` is not
also a void value expression. [Bug #15932]
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* string.c (str_replace_shared_without_enc): free previous buffer
before replaced.
* parse.y (gettable): make sure in advance that the `__FILE__`
object shares a fstring, to get rid of replacement with the
fstring later.
TODO: this hack may be needed in other places.
[Bug #15916]
Co-Authored-By: luke-gru (Luke Gruber) <luke.gru@gmail.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
I'll rename it and squash this commit later,
just wanted to make sure I couldn't lose it
(took a long time to come up with).
|
|
|
|
| |
https://twitter.com/yukihiro_matz/status/1139454774640726019
|
| |
|
|
|
|
| |
To allow arguments without parentheses.
|
| |
|
| |
|
|
|
|
| |
https://hackerone.com/reports/605262
|
|
|
|
|
| |
Fix the name of the macro variable introduced in 0872ea5330
from NODE_SPECIAL_EXCESSED_COMMA to NODE_SPECIAL_EXCESSIVE_COMMA.
|
|
|
|
|
|
| |
`(ID)1` was assigned to NODE_ARGS#rest_arg for `{|x,| }`.
This change removes the magic number by introducing an explicit macro
variable for it: NODE_SPECIAL_EXCESSED_COMMA.
|
|
|
|
|
|
|
| |
Terminate the input from a TTY by 2 ^D at the middle of line, like
as many programs, `cat`, `perl` and so on, do. By the first ^D,
the line will be sent without a newline, and then EOF will be send
by the next ^D.
|
|
|
|
|
| |
* parse.y (tok_hex): flush token after dispatching the "invalid
hex escape" parse error.
|
|
|
|
|
|
| |
* parse.y (here_document): adjust token to the here-doc identifier
in compile_error when a here-document misses the closing
identifier.
|
|
|
|
|
| |
* parse.y: continue parsing the rest of the here-document starting
line, after the terminator was not found.
|
|
|
|
|
| |
* parse.y (parse_atmark): return EXPR_END or EXPR_ENDFN, depending
on the previous state, even incomplete names consistently.
|
| |
|
|
|
|
|
| |
* parse.y (warn_space_char_code): warn whitespace characters
escaped with meta/control prefix.
|
| |
|
|
|
|
|
| |
* parse.y (parse_atmark): numbered parameter name is not allowed
as a symbol regardless the context.
|
| |
|
|
|
|
|
| |
* parse.y (ripper_token): added Ripper#token which returns the
current token string. [EXPERIMENTAL]
|
| |
|
|
|
|
|
|
|
| |
* parse.y (here_document): broke the terminator condition down
into each piece, the positional condition, resetting the
dedented here-document indentation, and matching identifier.
suppress a false warning by icc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* parse.y (parser_yylex): adjust the error indicator of unexpected
fraction part.
before:
~~~
1.2.3
^~~
~~~
after:
~~~
1.2.3
^~
~~~
|
|
|
|
|
|
| |
* parse.y (parser_yyerror, parser_compile_error): revert
r67224 (e5d10cda07b23682e5e4e64d1324e4d3247d4785) "Flush erred
token".
|
| |
|
|
|
|
|
|
|
|
|
| |
Heredocs are parsed line-by-line, so we need to keep track of the
temporary encoding of the string. Previously, a heredoc would
only detect mixed encoding errors if they were on the same line,
this changes things so they will be caught on different lines.
Fixes [Bug #15839]
|
| |
|
| |
|
| |
|