Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a8c5b2b
[DOC] Tweaks for String#lstrip
BurdetteLamar Sep 12, 2025
fbeeb89
[DOC] Tweaks for String#match? (#14477)
BurdetteLamar Sep 12, 2025
95ae42c
[DOC] Tweaks for String#match (#14476)
BurdetteLamar Sep 12, 2025
adcde78
Use IMEMO_NEW in rb_imemo_tmpbuf_new
peterzhu2118 Sep 11, 2025
5a2cedd
Just touch the timestamp for prism/srcs.mk when no baseruby
nobu Sep 12, 2025
8a30594
[ruby/openssl] pkey: fix loading public keys with early OpenSSL 3.0.x…
rhenium Sep 12, 2025
691a554
Restore test example for argument forwarding
etiennebarrie Sep 12, 2025
a35ceee
Revert "Just touch the timestamp for prism/srcs.mk when no baseruby"
k0kubun Sep 12, 2025
d8e9ec6
ZJIT: Add specific dynamic send type counters (#14528)
st0012 Sep 12, 2025
dd3aa0a
[ruby/prism] Add field documentation for MatchRequiredNode
herwinw Jun 28, 2024
9fddf5a
[ruby/prism] Add pattern match documentation example to LocalVariable…
herwinw Jun 28, 2024
8efa670
[ruby/prism] Add field documentation for ArrayPatternNode
herwinw Jun 28, 2024
22702a1
[ruby/prism] Add field documentation for HashPatternNode
herwinw Jun 28, 2024
bfd6da7
[ruby/prism] Add field documentation for FindPatternNode
herwinw Jun 28, 2024
aaeeac4
[ruby/prism] Add field documentation for PinnedVariableNode
herwinw Jun 29, 2024
dcfd98b
[ruby/prism] Add field documentation for PinnedExpressionNode
herwinw Jul 2, 2024
0803b9a
[ruby/prism] Document lifetime of `pm_options_t`
amomchilov Sep 16, 2024
2c9afcc
[ruby/prism] Support leading logical operators
kddnewton Dec 21, 2024
a9b35b3
Remove useless field in rb_imemo_tmpbuf_t
peterzhu2118 Sep 12, 2025
120d3b1
[ruby/prism] Add links to code refs in docs
amomchilov Aug 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ext/openssl/ossl_pkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ ossl_pkey_read(BIO *bio, const char *input_type, int selection, VALUE pass,
while (1) {
if (OSSL_DECODER_from_bio(dctx, bio) == 1)
break;
if (ERR_GET_REASON(ERR_peek_error()) != ERR_R_UNSUPPORTED)
// Error queue may not be populated in OpenSSL < 3.0.11 and < 3.1.3
// https://github.com/openssl/openssl/pull/21603
unsigned long err = ERR_peek_error();
if (err && ERR_GET_REASON(err) != ERR_R_UNSUPPORTED)
break;
if (BIO_eof(bio) == 1) {
*retryable = 1;
Expand Down
6 changes: 1 addition & 5 deletions imemo.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ rb_imemo_new(enum imemo_type type, VALUE v0, size_t size)
static rb_imemo_tmpbuf_t *
rb_imemo_tmpbuf_new(void)
{
size_t size = sizeof(struct rb_imemo_tmpbuf_struct);
VALUE flags = T_IMEMO | (imemo_tmpbuf << FL_USHIFT);
NEWOBJ_OF(obj, struct rb_imemo_tmpbuf_struct, 0, flags, size, 0);

return obj;
return IMEMO_NEW(rb_imemo_tmpbuf_t, imemo_tmpbuf, 0);
}

void *
Expand Down
1 change: 0 additions & 1 deletion internal/imemo.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ struct vm_ifunc {

struct rb_imemo_tmpbuf_struct {
VALUE flags;
VALUE reserved;
VALUE *ptr; /* malloc'ed buffer */
struct rb_imemo_tmpbuf_struct *next; /* next imemo */
size_t cnt; /* buffer size in VALUE */
Expand Down
198 changes: 195 additions & 3 deletions prism/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -992,8 +992,19 @@ nodes:
- name: constant
type: node?
kind:
- ConstantReadNode
- ConstantPathNode
- ConstantReadNode
comment: |
Represents the optional constant preceding the Array

foo in Bar[]
^^^

foo in Bar[1, 2, 3]
^^^

foo in Bar::Baz[1, 2, 3]
^^^^^^^^
- name: requireds
type: node[]
kind: pattern expression
Expand Down Expand Up @@ -2409,23 +2420,68 @@ nodes:
- name: constant
type: node?
kind:
- ConstantReadNode
- ConstantPathNode
- ConstantReadNode
comment: |
Represents the optional constant preceding the pattern

foo in Foo(*bar, baz, *qux)
^^^
- name: left
type: node
kind: SplatNode
comment: |
Represents the first wildcard node in the pattern.

foo in *bar, baz, *qux
^^^^

foo in Foo(*bar, baz, *qux)
^^^^
- name: requireds
type: node[]
kind: pattern expression
comment: |
Represents the nodes in between the wildcards.

foo in *bar, baz, *qux
^^^

foo in Foo(*bar, baz, 1, *qux)
^^^^^^
- name: right
type: node
kind:
- SplatNode
- on error: MissingNode
comment: |
Represents the second wildcard node in the pattern.

foo in *bar, baz, *qux
^^^^

foo in Foo(*bar, baz, *qux)
^^^^
- name: opening_loc
type: location?
comment: |
The location of the opening brace.

foo in [*bar, baz, *qux]
^

foo in Foo(*bar, baz, *qux)
^
- name: closing_loc
type: location?
comment: |
The location of the closing brace.

foo in [*bar, baz, *qux]
^

foo in Foo(*bar, baz, *qux)
^
comment: |
Represents a find pattern in pattern matching.

Expand All @@ -2437,6 +2493,9 @@ nodes:

foo in Foo(*bar, baz, *qux)
^^^^^^^^^^^^^^^^^^^^

foo => *bar, baz, *qux
^^^^^^^^^^^^^^^
- name: FlipFlopNode
flags: RangeFlags
fields:
Expand Down Expand Up @@ -2714,20 +2773,60 @@ nodes:
- name: constant
type: node?
kind:
- ConstantReadNode
- ConstantPathNode
- ConstantReadNode
comment: |
Represents the optional constant preceding the Hash.

foo => Bar[a: 1, b: 2]
^^^

foo => Bar::Baz[a: 1, b: 2]
^^^^^^^^
- name: elements
type: node[]
kind: AssocNode
comment: |
Represents the explicit named hash keys and values.

foo => { a: 1, b:, ** }
^^^^^^^^
- name: rest
type: node?
kind:
- AssocSplatNode
- NoKeywordsParameterNode
comment: |
Represents the rest of the Hash keys and values. This can be named, unnamed, or explicitly forbidden via `**nil`, this last one results in a `NoKeywordsParameterNode`.

foo => { a: 1, b:, **c }
^^^

foo => { a: 1, b:, ** }
^^

foo => { a: 1, b:, **nil }
^^^^^
- name: opening_loc
type: location?
comment: |
The location of the opening brace.

foo => { a: 1 }
^

foo => Bar[a: 1]
^
- name: closing_loc
type: location?
comment: |
The location of the closing brace.

foo => { a: 1 }
^

foo => Bar[a: 1]
^
comment: |
Represents a hash pattern in pattern matching.

Expand All @@ -2736,6 +2835,12 @@ nodes:

foo => { a: 1, b: 2, **c }
^^^^^^^^^^^^^^^^^^^

foo => Bar[a: 1, b: 2]
^^^^^^^^^^^^^^^

foo in { a: 1, b: 2 }
^^^^^^^^^^^^^^
- name: IfNode
fields:
- name: if_keyword_loc
Expand Down Expand Up @@ -3388,6 +3493,9 @@ nodes:

foo, bar = baz
^^^ ^^^

foo => baz
^^^
- name: LocalVariableWriteNode
fields:
- name: name
Expand Down Expand Up @@ -3478,11 +3586,65 @@ nodes:
- name: value
type: node
kind: non-void expression
comment: |
Represents the left-hand side of the operator.

foo => bar
^^^
- name: pattern
type: node
kind: pattern expression
comment: |
Represents the right-hand side of the operator. The type of the node depends on the expression.

Anything that looks like a local variable name (including `_`) will result in a `LocalVariableTargetNode`.

foo => a # This is equivalent to writing `a = foo`
^

Using an explicit `Array` or combining expressions with `,` will result in a `ArrayPatternNode`. This can be preceded by a constant.

foo => [a]
^^^

foo => a, b
^^^^

foo => Bar[a, b]
^^^^^^^^^

If the array pattern contains at least two wildcard matches, a `FindPatternNode` is created instead.

foo => *, 1, *a
^^^^^

Using an explicit `Hash` or a constant with square brackets and hash keys in the square brackets will result in a `HashPatternNode`.

foo => { a: 1, b: }

foo => Bar[a: 1, b:]

foo => Bar[**]

To use any variable that needs run time evaluation, pinning is required. This results in a `PinnedVariableNode`

foo => ^a
^^

Similar, any expression can be used with pinning. This results in a `PinnedExpressionNode`.

foo => ^(a + 1)

Anything else will result in the regular node for that expression, for example a `ConstantReadNode`.

foo => CONST
- name: operator_loc
type: location
comment: |
The location of the operator.

foo => bar
^^
comment: |
Represents the use of the `=>` operator.

Expand Down Expand Up @@ -3912,12 +4074,32 @@ nodes:
- name: expression
type: node
kind: non-void expression
comment: |
The expression used in the pinned expression

foo in ^(bar)
^^^
- name: operator_loc
type: location
comment: |
The location of the `^` operator

foo in ^(bar)
^
- name: lparen_loc
type: location
comment: |
The location of the opening parenthesis.

foo in ^(bar)
^
- name: rparen_loc
type: location
comment: |
The location of the closing parenthesis.

foo in ^(bar)
^
comment: |
Represents the use of the `^` operator for pinning an expression in a pattern matching expression.

Expand All @@ -3936,8 +4118,18 @@ nodes:
- NumberedReferenceReadNode # foo in ^$1
- ItLocalVariableReadNode # proc { 1 in ^it }
- on error: MissingNode # foo in ^Bar
comment: |
The variable used in the pinned expression

foo in ^bar
^^^
- name: operator_loc
type: location
comment: |
The location of the `^` operator

foo in ^bar
^
comment: |
Represents the use of the `^` operator for pinning a variable in a pattern matching expression.

Expand Down
Loading