| Age | Commit message (Collapse) | Author |
|
Strings concatenated with backslash may end up being frozen when they
shouldn't be. This commit fixes the issue. It required a change
upstream in Prism, but also a change to the Prism compiler in CRuby.
https://github.com/ruby/prism/pull/3606
[Bug #21187]
|
|
[Backport #21187]
|
|
This reverts commit a495e6a44ce8cff17461b250e32ab63e409a642d.
This break extension builds:
```
/Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:321:in 'String#replace': can't modify frozen String: "$(SDKROOT)$(prefix)/include" (FrozenError)
from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:321:in 'RbConfig.expand'
from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:314:in 'block in RbConfig.expand'
from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:307:in 'String#gsub'
from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:307:in 'RbConfig.expand'
from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:314:in 'block in RbConfig.expand'
from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:307:in 'String#gsub'
from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:307:in 'RbConfig.expand'
from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:314:in 'block in RbConfig.expand'
from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:307:in 'String#gsub'
from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:307:in 'RbConfig.expand'
from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:325:in 'block in <module:RbConfig>'
from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:324:in 'Hash#each_value'
from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:324:in '<module:RbConfig>'
from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:11:in '<top (required)>'
from ./ext/extmk.rb:42:in 'Kernel#require'
from ./ext/extmk.rb:42:in '<main>'
make[1]: *** [ext/configure-ext.mk:70: ext/json/exts.mk] Error 1
```
|
|
|
|
(#13327)
* [ruby/prism] Accept a newline after the defined? keyword
[Bug #21197]
https://github.com/ruby/prism/commit/22be955ce9
* Fix a compilation error
Co-authored-by: Stan Lo <stan001212@gmail.com>
---------
Co-authored-by: Kevin Newton <kddnewton@gmail.com>
Co-authored-by: Stan Lo <stan001212@gmail.com>
|
|
[Backport #21197]"
This reverts commit e630a0f7ae909dafe2e1dbc47baf90cd795b4a5f.
|
|
[ruby/prism] Accept a newline after the defined? keyword
[Bug #21197]
https://github.com/ruby/prism/commit/22be955ce9
|
|
Fixes [Bug #21145]
https://github.com/ruby/prism/commit/be2d845639
|
|
|
|
|
|
[ruby/prism] Fix infinite loop in error recovery
When recovering from a depth error that occurs at the end of the
file, we need to break out of parsing statements.
Fixes [Bug #21114]
https://github.com/ruby/prism/commit/a32e268787
|
|
[ruby/prism] No writing to numbered parameters
Fixes [Bug #21117]
https://github.com/ruby/prism/commit/19d4bab5a0
|
|
[ruby/prism] Fix rescue modifier precedence
Fixes [Bug #21048]
https://github.com/ruby/prism/commit/07202005cb
|
|
ca81142eff98cccb03ff523322aefe4e7346fd0e: [Backport #21010]
[ruby/prism] Throw syntax error for endless method with `[]=`
Prism shoudld throw a syntax error for endless methods when the method
name uses brackets. Previously it would not. This matches the behavior
of parse.y.
Fixes https://bugs.ruby-lang.org/issues/21010
https://github.com/ruby/prism/commit/43c16a89ef
[ruby/prism] [Bug #21010] Reject endless method definition of `[]=`
Fixes: https://bugs.ruby-lang.org/issues/20785
https://github.com/ruby/prism/commit/192960ce5d
|
|
Partially: https://bugs.ruby-lang.org/issues/20785
https://github.com/ruby/prism/commit/71c9102d02
Notes:
Merged: https://github.com/ruby/ruby/pull/12358
|
|
https://github.com/ruby/prism/commit/4ce6bcf182
Notes:
Merged: https://github.com/ruby/ruby/pull/12358
|
|
Prism was already disallowing arguments after block args, but in
parse.y, any comma after a block arg is a syntax error. This moves the
error handling into `PM_TOKEN_UAMPERSAND` where we can check if the
current type is `PM_TOKEN_COMMA`then raise an error. I've also updated
the tests to include the examplesfrom ruby/prism#3112.
Fixes: ruby/prism#3112
https://github.com/ruby/prism/commit/754cf8eddc
Notes:
Merged: https://github.com/ruby/ruby/pull/12358
|
|
https://github.com/ruby/prism/commit/b283a72c88
Notes:
Merged: https://github.com/ruby/ruby/pull/12358
|
|
Ruby feature: https://bugs.ruby-lang.org/issues/20952
https://github.com/ruby/prism/commit/e612df5f36
|
|
Actually close [Bug #20952]
Notes:
Merged: https://github.com/ruby/ruby/pull/12343
|
|
Fixes [Bug #20952]
Notes:
Merged: https://github.com/ruby/ruby/pull/12342
|
|
%r regular expressions need to be decoded like strings. This commit
fixes %r decoding so it works like strings.
https://github.com/ruby/prism/commit/85bfd9c0cd
|
|
Raise an exception when the same numbered param is used inside a child
block. For example, the following code should be a syntax error:
```ruby
-> { _1 + -> { _1 } }
```
Fixes https://github.com/ruby/prism/pull/3291
https://github.com/ruby/prism/commit/d4fc441838
|
|
parse.y treats CRLF as a LF and basically "normalizes" them before
parsing. That means a string like `%\nfoo\r\n` is actually treated as
`%\nfoo\n` for the purposes of parsing. This happens on both the
opening side of the percent string as well as on the closing side. So
for example `%\r\nfoo\n` must be treated as `%\nfoo\n`.
To handle this in Prism, when we start a % string, we check if it starts
with `\r\n`, and then consider the terminator to actually be `\n`. Then
we check if there are `\r\n` as we lex the string and treat those as
`\n`, but only in the case the start was a `\n`.
Fixes: #3230
[Bug #20938]
https://github.com/ruby/prism/commit/e573ceaad6
Co-authored-by: John Hawthorn <jhawthorn@github.com>
Co-authored-by: eileencodes <eileencodes@gmail.com>
Co-authored-by: Kevin Newton <kddnewton@gmail.com>
|
|
If we hit an EOF token, and the character before the EOF is a newline,
we should make EOF token start at the previous newline. That way any
errors reported will occur on that line.
For example "foo(\n" should report an error on line 1 even though the
EOF technically occurs on line 2.
[Bug #20918]
https://bugs.ruby-lang.org/issues/20918
https://github.com/ruby/prism/commit/60bc43de8e
|
|
required
Partially fixes: #3171
https://github.com/ruby/prism/commit/d0d9699c27
|
|
match required
Partially fixes: https://github.com/ruby/prism/issues/3171
https://github.com/ruby/prism/commit/5c33fa5a1a
|
|
Fixes: https://github.com/ruby/prism/issues/3109
https://github.com/ruby/prism/commit/9ed989c30d
|
|
Parsing the regexp /\A{/ causes uses an uninitialized value because it
tries to parse it as a range quantifier, so it reads the character after
the closing curly bracket. This is using uninitialized values because
prism strings are not null terminated. This can be seen in the Valgrind
output:
==834710== Conditional jump or move depends on uninitialised value(s)
==834710== at 0x5DA010: pm_regexp_parse_range_quantifier (regexp.c:163)
==834710== by 0x5DA010: pm_regexp_parse_quantifier (regexp.c:243)
==834710== by 0x5DAD69: pm_regexp_parse_expression (regexp.c:738)
==834710== by 0x5DAD69: pm_regexp_parse_pattern (regexp.c:761)
==834710== by 0x5DAD69: pm_regexp_parse (regexp.c:773)
==834710== by 0x5A2EE7: parse_regular_expression_named_captures (prism.c:20886)
==834710== by 0x5A2EE7: parse_expression_infix (prism.c:21388)
==834710== by 0x5A5FA5: parse_expression (prism.c:21804)
==834710== by 0x5A64F3: parse_statements (prism.c:13858)
==834710== by 0x5A9730: parse_program (prism.c:22011)
==834710== by 0x576F0D: parse_input_success_p (extension.c:1062)
==834710== by 0x576F0D: parse_success_p (extension.c:1084)
This commit adds checks for the end of the string to
pm_regexp_parse_range_quantifier.
https://github.com/ruby/prism/commit/be6cbc23ef
|
|
https://github.com/ruby/prism/commit/70c1cd480f
|
|
https://github.com/ruby/prism/commit/232a02acef
|
|
|
|
https://github.com/ruby/prism/commit/5ea6042408
|
|
Introduce StringQuery to provide methods to access some metadata
about the Ruby lexer.
https://github.com/ruby/prism/commit/d3f55b67b9
|
|
Calculating code unit offsets for a source can be very expensive,
especially when the source is large. This commit introduces a new
class that wraps the source and desired encoding into a cache that
reuses pre-computed offsets. It performs quite a bit better.
There are still some problems with this approach, namely character
boundaries and the fact that the cache is unbounded, but both of
these may be addressed in subsequent commits.
https://github.com/ruby/prism/commit/2e3e1a4d4d
|
|
Fixes [Bug #20788]
https://github.com/ruby/prism/commit/27e91f21af
|
|
https://github.com/ruby/prism/commit/3a0b1c6110
|
|
https://github.com/ruby/prism/commit/343197e4ff
|
|
https://github.com/ruby/prism/commit/25a4cf6794
Co-authored-by: Kevin Newton <kddnewton@users.noreply.github.com>
|
|
https://github.com/ruby/prism/commit/dbd5c929d6
|
|
https://github.com/ruby/prism/commit/023e894b74
|
|
method call to handle -l CLI option
https://github.com/ruby/prism/commit/717e41c87d
|
|
https://github.com/ruby/prism/commit/80cd335222
|
|
https://github.com/ruby/prism/commit/7a0af49997
|
|
https://github.com/ruby/prism/commit/5dd36b979e
|
|
https://github.com/ruby/prism/commit/aee2de91a3
|
|
https://github.com/ruby/prism/commit/ab9d80987a
|
|
https://github.com/ruby/prism/commit/ccc746f918
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11753
|
|
https://github.com/ruby/prism/commit/498dd922d4
|