Ruby 4.1.0dev (2026-11-18 revision e5e6cd45db456b2a4d368f2a34598641319df630)
pm_regexp_preprocessor_t Struct Reference

The state of reading the escapes of a regular expression, which finds the encoding that its characters and escapes fix it to before its pattern is parsed. More...

Data Fields

const pm_regexp_t * regexp
 The regular expression, whose content is read.
const uint8_t * end
 The end of the content.
const pm_encoding_t * encoding
 The encoding that the content is read in.
const pm_encoding_t * fixed_encoding
 The encoding that the characters and escapes read so far fix the regular expression to, or NULL if none of them fixes it.
bool has_property
 Whether a property escape came before anything fixed the encoding, which fixes it to the encoding that the content is read in.
pm_buffer_t pattern
 The pattern that the content preprocesses to.
const uint8_t * written
 The end of the content that the pattern holds so far.
bool rewritten
 Whether the pattern differs from the content.
pm_regexp_offsets_t offsets
 Where the pattern stops lining up with the content.

Detailed Description

The state of reading the escapes of a regular expression, which finds the encoding that its characters and escapes fix it to before its pattern is parsed.

Definition at line 2731 of file regexp.c.

Field Documentation

◆ encoding

const pm_encoding_t* pm_regexp_preprocessor_t::encoding

The encoding that the content is read in.

Definition at line 2739 of file regexp.c.

◆ end

const uint8_t* pm_regexp_preprocessor_t::end

The end of the content.

Definition at line 2736 of file regexp.c.

◆ fixed_encoding

const pm_encoding_t* pm_regexp_preprocessor_t::fixed_encoding

The encoding that the characters and escapes read so far fix the regular expression to, or NULL if none of them fixes it.

Definition at line 2745 of file regexp.c.

◆ has_property

bool pm_regexp_preprocessor_t::has_property

Whether a property escape came before anything fixed the encoding, which fixes it to the encoding that the content is read in.

Definition at line 2751 of file regexp.c.

◆ offsets

pm_regexp_offsets_t pm_regexp_preprocessor_t::offsets

Where the pattern stops lining up with the content.

In each place, the content offset is in the pattern and the source offset is in the content.

Definition at line 2770 of file regexp.c.

◆ pattern

pm_buffer_t pm_regexp_preprocessor_t::pattern

The pattern that the content preprocesses to.

It is only written once it first differs from the content, which it does for few regular expressions. Until then, the content is the pattern.

Definition at line 2758 of file regexp.c.

◆ regexp

const pm_regexp_t* pm_regexp_preprocessor_t::regexp

The regular expression, whose content is read.

Definition at line 2733 of file regexp.c.

◆ rewritten

bool pm_regexp_preprocessor_t::rewritten

Whether the pattern differs from the content.

Definition at line 2764 of file regexp.c.

◆ written

const uint8_t* pm_regexp_preprocessor_t::written

The end of the content that the pattern holds so far.

Definition at line 2761 of file regexp.c.


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