Skip to main content

rustpython_sre_engine/
lib.rs

1#![no_std]
2
3extern crate alloc;
4
5pub mod constants;
6pub mod engine;
7pub mod string;
8
9pub use constants::{SRE_MAGIC, SreAtCode, SreCatCode, SreFlag, SreInfo, SreOpcode};
10pub use engine::{Request, SearchIter, State};
11pub use string::{StrDrive, StringCursor};
12
13pub const CODESIZE: usize = 4;
14
15#[cfg(target_pointer_width = "32")]
16pub const MAXREPEAT: usize = usize::MAX - 1;
17#[cfg(target_pointer_width = "64")]
18pub const MAXREPEAT: usize = u32::MAX as usize;
19
20#[cfg(target_pointer_width = "32")]
21pub const MAXGROUPS: usize = MAXREPEAT / 4 / 2;
22#[cfg(target_pointer_width = "64")]
23pub const MAXGROUPS: usize = MAXREPEAT / 2;