struct

Krikri::PythonPattern::Scan

Inherits Struct < Value < Object

The scan result: the PCRE2-ready pattern, the first Python-re error the scan can state exactly (nil when none), and the two positions python_pcre_error needs when PCRE2 itself rejects the pattern: the innermost unterminated '(' and the '[' of an unterminated character class, both in ORIGINAL pattern coordinates. Each \u/\U rewrite is remembered as {output char index, output length, source char index} so PCRE2 error positions can be mapped back through it.

Constructors

new(translated : String, error : String | Nil, unclosed_paren : Int32 | Nil, open_class_start : Int32 | Nil, rewrites : Array(Tuple(Int32, Int32, Int32)) | Nil)
Source

Instance methods

clone
Source
copy_with(translated _translated = @translated, error _error = @error, unclosed_paren _unclosed_paren = @unclosed_paren, open_class_start _open_class_start = @open_class_start, rewrites _rewrites = @rewrites)
Source
error
open_class_start
rewrites
translated
unclosed_paren