Ruby: pm_regexp_token_buffer_t Struct Reference

Ruby 4.0.6p0 (2026-07-14 revision 03b6d3f8898a28604fe6cb00eae3226b821168f4)

Data Fields
pm_regexp_token_buffer_t Struct Reference

In order to properly set a regular expression's encoding and to validate the byte sequence for the underlying encoding we must process any escape sequences. More...

## Data Fields
pm_token_buffer_t | base
| The embedded base buffer.
pm_buffer_t | regexp_buffer
| The buffer holding the regexp source.

## Detailed Description

In order to properly set a regular expression's encoding and to validate the byte sequence for the underlying encoding we must process any escape sequences.

The unescaped byte sequence will be stored in buffer just like for other string-like types. However, we also need to store the regular expression's source string. That string may be different from what we see during lexing because some escape sequences rewrite the source.

This value will only be initialized for regular expressions and only if we receive an escape sequence. It will contain the regular expression's source string's byte sequence.

Definition at line 9491 of file prism.c.

## Field Documentation

## ◆ base

pm_token_buffer_t pm_regexp_token_buffer_t::base

The embedded base buffer.

Definition at line 9493 of file prism.c.

## ◆ regexp_buffer

pm_buffer_t pm_regexp_token_buffer_t::regexp_buffer

The buffer holding the regexp source.

Definition at line 9496 of file prism.c.

The documentation for this struct was generated from the following file:

- prism/prism.c