| Age | Commit message (Collapse) | Author |
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12539
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12538
|
|
The following Location information has been added This is the information required for parse.y to be a universal parser:
```
❯ ruby --parser=prism --dump=parsetree -e "for a in b do end"
@ ProgramNode (location: (1,0)-(1,17))
+-- locals: [:a]
+-- statements:
@ StatementsNode (location: (1,0)-(1,17))
+-- body: (length: 1)
+-- @ ForNode (location: (1,0)-(1,17))
+-- index:
| @ LocalVariableTargetNode (location: (1,4)-(1,5))
| +-- name: :a
| +-- depth: 0
+-- collection:
| @ CallNode (location: (1,9)-(1,10))
| +-- CallNodeFlags: variable_call, ignore_visibility
| +-- receiver: nil
| +-- call_operator_loc: nil
| +-- name: :b
| +-- message_loc: (1,9)-(1,10) = "b"
| +-- opening_loc: nil
| +-- arguments: nil
| +-- closing_loc: nil
| +-- block: nil
+-- statements: nil
+-- for_keyword_loc: (1,0)-(1,3) = "for"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-- in_keyword_loc: (1,6)-(1,8) = "in"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-- do_keyword_loc: (1,11)-(1,13) = "do"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-- end_keyword_loc: (1,14)-(1,17) = "end"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
|
|
Previously, since the opt_aset_with optimization was introduced,
use of the opt_aset_with optimization inside multiple assignment
would result in a segfault or incorrect instructions.
Fixes [Bug #21012]
Co-authored-by: Nobuyoshi Nakada <nobu.nakada@gmail.com>
Notes:
Merged: https://github.com/ruby/ruby/pull/12528
Merged-By: jeremyevans <code@jeremyevans.net>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12531
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12530
|
|
The iseq location object has a slot for node ids. parse.y was correctly
populating that field but Prism was not. This commit populates the field
with the ast node id for that iseq
[Bug #21014]
Notes:
Merged: https://github.com/ruby/ruby/pull/12527
|
|
After switching to `Float`-mode when summing `Numeric` objects,
normalization for `Float` is still needed.
Notes:
Merged: https://github.com/ruby/ruby/pull/12522
|
|
(#12518)
[Bug #21006] Fix defined_expr compilation of method call with parenthesized receiver
|
|
Fixes [Bug #21001]
Notes:
Merged: https://github.com/ruby/ruby/pull/12513
|
|
Fixes [Bug #21003]
Notes:
Merged: https://github.com/ruby/ruby/pull/12512
|
|
There are warnings emitted from test_flip2_locations and test_flip3_locations.
This commit changes ast_parse to suppress all warnings.
warning: integer literal in flip-flop
warning: string literal in flip-flop
Notes:
Merged: https://github.com/ruby/ruby/pull/12509
|
|
Previously, the code for dropping surplus arguments when yielding
into blocks erroneously attempted to drop keyword arguments when there
is in fact no surplus arguments. Fix the condition and test that
supplying the exact number of keyword arguments as require compiles
without fallback.
Notes:
Merged: https://github.com/ruby/ruby/pull/12499
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11986
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11986
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11986
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11986
|
|
The following Location information has been added This is the information required for parse.y to be a universal parser:
```
❯ ruby --parser=prism --dump=parsetree -e '/foo/'
@ ProgramNode (location: (1,0)-(1,5))
+-- locals: []
+-- statements:
@ StatementsNode (location: (1,0)-(1,5))
+-- body: (length: 1)
+-- @ RegularExpressionNode (location: (1,0)-(1,5))
+-- RegularExpressionFlags: forced_us_ascii_encoding
+-- opening_loc: (1,0)-(1,1) = "/"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-- content_loc: (1,1)-(1,4) = "foo"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-- closing_loc: (1,4)-(1,5) = "/"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-- unescaped: "foo"
```
|
|
The following Location information has been added This is the information required for parse.y to be a universal parser:
```
❯ ruby --parser=prism --dump=parsetree -e "-> (a, b) do foo end"
@ ProgramNode (location: (1,0)-(1,20))
+-- locals: []
+-- statements:
@ StatementsNode (location: (1,0)-(1,20))
+-- body: (length: 1)
+-- @ LambdaNode (location: (1,0)-(1,20))
+-- locals: [:a, :b]
+-- operator_loc: (1,0)-(1,2) = "->"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-- opening_loc: (1,10)-(1,12) = "do"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-- closing_loc: (1,17)-(1,20) = "end"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: (snip)
```
|
|
The following Location information has been added This is the information required for parse.y to be a universal parser:
```
❯ ruby --parser=prism --dump=parsetree -e 'def foo; yield end'
@ ProgramNode (location: (1,0)-(1,18))
+-- locals: []
+-- statements:
@ StatementsNode (location: (1,0)-(1,18))
+-- body: (length: 1)
+-- @ DefNode (location: (1,0)-(1,18))
+-- name: :foo
+-- name_loc: (1,4)-(1,7) = "foo"
+-- receiver: nil
+-- parameters: nil
+-- body:
| @ StatementsNode (location: (1,9)-(1,14))
| +-- body: (length: 1)
| +-- @ YieldNode (location: (1,9)-(1,14))
| +-- keyword_loc: (1,9)-(1,14) = "yield"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| +-- lparen_loc: nil
^^^^^^^^^^^^^^^^^^^
| +-- arguments: nil
| +-- rparen_loc: nil
^^^^^^^^^^^^^^^^^^^
+-- locals: []
+-- def_keyword_loc: (1,0)-(1,3) = "def"
+-- operator_loc: nil
+-- lparen_loc: nil
+-- rparen_loc: nil
+-- equal_loc: nil
+-- end_keyword_loc: (1,15)-(1,18) = "end"
```
|
|
The following Location information has been added This is the information required for parse.y to be a universal parser:
```
❯ ruby --parser=prism --dump=parsetree -e '"#{foo}"'
@ ProgramNode (location: (1,0)-(1,8))
+-- locals: []
+-- statements:
@ StatementsNode (location: (1,0)-(1,8))
+-- body: (length: 1)
+-- @ InterpolatedStringNode (location: (1,0)-(1,8))
+-- InterpolatedStringNodeFlags: nil
+-- opening_loc: (1,0)-(1,1) = "\""
+-- parts: (length: 1)
| +-- @ EmbeddedStatementsNode (location: (1,1)-(1,7))
| +-- opening_loc: (1,1)-(1,3) = "\#{"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| +-- statements:
| | @ StatementsNode (location: (1,3)-(1,6))
| | +-- body: (length: 1)
| | +-- @ CallNode (location: (1,3)-(1,6))
| | +-- CallNodeFlags: variable_call, ignore_visibility
| | +-- receiver: nil
| | +-- call_operator_loc: nil
| | +-- name: :foo
| | +-- message_loc: (1,3)-(1,6) = "foo"
| | +-- opening_loc: nil
| | +-- arguments: nil
| | +-- closing_loc: nil
| | +-- block: nil
| +-- closing_loc: (1,6)-(1,7) = "}"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-- closing_loc: (1,7)-(1,8) = "\""
```
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11712
|
|
- Change generate_case_mapping_tests to
generate_single_byte_case_mapping_tests
(all encodings using this method happen to be single-byte)
- Change precalculation of codepoints by converting from
specific encoding, not from Unicode. This reduces creation time.
(See https://github.com/ruby/ruby/pull/7425 for a related proposal
and some additional comments.)
|
|
The following Location information has been added This is the information required for parse.y to be a universal parser:
```
❯ ruby --parser=prism --dump=parsetree -y -e "if a; elsif b; else end"
@ ProgramNode (location: (1,0)-(1,23))
+-- locals: []
+-- statements:
@ StatementsNode (location: (1,0)-(1,23))
+-- body: (length: 1)
+-- @ IfNode (location: (1,0)-(1,23))
+-- if_keyword_loc: (1,0)-(1,2) = "if"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-- predicate:
| @ CallNode (location: (1,3)-(1,4))
| +-- CallNodeFlags: variable_call, ignore_visibility
| +-- receiver: nil
| +-- call_operator_loc: nil
| +-- name: :a
| +-- message_loc: (1,3)-(1,4) = "a"
| +-- opening_loc: nil
| +-- arguments: nil
| +-- closing_loc: nil
| +-- block: nil
+-- then_keyword_loc: nil
^^^^^^^^^^^^^^^^^^^^^^^^^
+-- statements: nil
+-- subsequent:
| @ IfNode (location: (1,6)-(1,23))
| +-- if_keyword_loc: (1,6)-(1,11) = "elsif"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| +-- predicate:
| | @ CallNode (location: (1,12)-(1,13))
| | +-- CallNodeFlags: variable_call, ignore_visibility
| | +-- receiver: nil
| | +-- call_operator_loc: nil
| | +-- name: :b
| | +-- message_loc: (1,12)-(1,13) = "b"
| | +-- opening_loc: nil
| | +-- arguments: nil
| | +-- closing_loc: nil
| | +-- block: nil
| +-- then_keyword_loc: nil
^^^^^^^^^^^^^^^^^^^^^^^^^
| +-- statements: nil
| +-- subsequent:
| | @ ElseNode (location: (1,15)-(1,23))
| | +-- else_keyword_loc: (1,15)-(1,19) = "else"
| | +-- statements: nil
| | +-- end_keyword_loc: (1,20)-(1,23) = "end"
| +-- end_keyword_loc: (1,20)-(1,23) = "end"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-- end_keyword_loc: (1,20)-(1,23) = "end"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12483
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12497
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12489
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12487
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12485
|
|
Ensures we can handle expressions like `defined?(a {}.b)`.
Notes:
Merged: https://github.com/ruby/ruby/pull/12475
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12474
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12472
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12471
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12470
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12470
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12452
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12451
|
|
This change will be merged into 3.5 along with other encoding, command
line, environment variables, etc.
Revert following commits:
- bd831bcca534955533d9135d8c2f22d7ae5b9aa8
[Bug #20929] Win32: Use `wcsftime`
- 1c15f641cc2bb88fa88123a11036ed58fbf9aa6d
[Bug #20929] Win32: Encode timezone name in UTF-8
- 78762b52185aa80ee55c0d49b495aceed863dce2
[Bug #20929] Fix `assert_zone_encoding`
Notes:
Merged: https://github.com/ruby/ruby/pull/12448
|
|
After a ractor is started (multi-ractor mode), any calls to
require_internal will hang the process due to deadlock. For example,
loading a new encoding will deadlock after a ractor starts.
Fixes [Bug #19562]
Notes:
Merged: https://github.com/ruby/ruby/pull/7656
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12438
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12435
|
|
Revert "[Bug #20965] Define `it` like an ordinary argument (#12398)"
Reverts ruby/ruby#12398 as per https://bugs.ruby-lang.org/issues/20970#note-6 and https://bugs.ruby-lang.org/issues/20965#note-7.
We need more time to design the intended behavior, and it's too late for Ruby 3.4.
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
|
|
|
|
Fixes [Bug #20916]
Notes:
Merged: https://github.com/ruby/ruby/pull/12417
|
|
If we have local variables outside of the eval, the local variables names
are IDs. We convert these IDs to char * using rb_id2name. However, these
char * are actually Ruby strings, which may be embedded. This means that
it is not safe to rb_id2name and call any potential GC entrypoints because
if a GC compaction runs, the embedded string may move and the pointer will
change.
For example, if you compile with `-DRGENGC_CHECK_MODE=1`, then the following
script will crash:
GC.auto_compact = :empty
GC.stress = true
o = Object.new
eval("def o.m(k: 0) k end")
The crash message is:
test.rb:6: [BUG] Local with constant_id 1 does not exist
ruby 3.4.0dev (2024-12-17T18:34:57Z prism-local-compac.. 434346726c) +PRISM [arm64-darwin24]
-- C level backtrace information -------------------------------------------
miniruby(rb_print_backtrace+0x24) [0x10312fec4] vm_dump.c:823
miniruby(rb_print_backtrace) (null):0
miniruby(rb_vm_bugreport+0x2d4) [0x1031301b8] vm_dump.c:1155
miniruby(rb_bug_without_die_internal+0xa8) [0x102dd6a94] error.c:1097
miniruby(rb_bug+0x28) [0x102dd6b00] error.c:1115
miniruby(pm_lookup_local_index+0xec) [0x102d61e4c] prism_compile.c:1237
miniruby(pm_compile_node+0x45d0) [0x102d252f4] prism_compile.c:9334
miniruby(pm_compile_node+0x1864) [0x102d22588] prism_compile.c:8650
miniruby(pm_compile_node+0x65ec) [0x102d27310] prism_compile.c:9897
miniruby(pm_compile_scope_node+0x3008) [0x102d77bcc] prism_compile.c:6584
miniruby(pm_compile_node+0x5ec4) [0x102d26be8] prism_compile.c:9768
miniruby(pm_iseq_compile_node+0xac) [0x102d20bf0] prism_compile.c:10069
miniruby(pm_iseq_new_with_opt_try+0x2c) [0x102e7d088] iseq.c:1029
miniruby(rb_protect+0x108) [0x102dea9bc] eval.c:1033
miniruby(pm_iseq_new_with_opt+0x264) [0x102e7c444] iseq.c:1082
miniruby(pm_iseq_new_eval+0xec) [0x102e7c8e0] iseq.c:961
miniruby(pm_eval_make_iseq+0x594) [0x1031209cc] vm_eval.c:1770
miniruby(eval_make_iseq+0x54) [0x103120068] vm_eval.c:1799
Notes:
Merged: https://github.com/ruby/ruby/pull/12374
|
|
Fixes [Bug #20973]
Notes:
Merged: https://github.com/ruby/ruby/pull/12408
|
|
Put a pop as needed. This example currently causes [BUG]:
$ ruby --parser=prism -e'1.times{"".freeze;nil}'
-e:1: [BUG] Stack consistency error (sp: 15, bp: 14)
ruby 3.4.0dev (2024-12-20T00:48:01Z master 978df259ca) +PRISM [x86_64-linux]
Notes:
Merged: https://github.com/ruby/ruby/pull/12410
|
|
It used to quote only part of the method name because NUL byte in
the method terminates the C string:
```
(irb)> "abcdef".encode("UTF-16LE").bytes
=> [97, 0, 98, 0, 99, 0, 100, 0, 101, 0, 102, 0]
```
```
expected: /abcdef/
actual: warning: Skipping set of ruby2_keywords flag for a (method not defined in Ruby)\n".
```
Notes:
Merged: https://github.com/ruby/ruby/pull/12396
Merged-By: XrXr
|
|
Also fixes [Bug #20955]
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
|