regex/core

sourceregex/core.sx

MAX_REGEXP_OBJECTS

pub val MAX_REGEXP_OBJECTS = 30

MAX_CHAR_CLASS_LEN

pub val MAX_CHAR_CLASS_LEN = 40

RegexHandle

type RegexHandle = { tokens: mut ref void, ccl_buf: mut ref u8 }

Fields

NameType
tokensmut ref void
ccl_bufmut ref u8

RegexMatchError

pub enum RegexMatchError = { NullPattern, NullText, NullMatchLength, InvalidCompiledPattern, CompileFailed }

Variants

  • NullPattern
  • NullText
  • NullMatchLength
  • InvalidCompiledPattern
  • CompileFailed

char_ptr

private
fn char_ptr(ptr: ref u8, offset: i64) ref u8

char_at

private
fn char_at(ptr: ref u8, offset: i64) u8

token_ptr

private
fn token_ptr(tokens: ref void, idx: i64) ref void

token_next

private
fn token_next(token: ref void, delta: i64) ref void

token_kind

private
fn token_kind(token: ref void) i64

set_token_kind

private
fn set_token_kind(token: ref void, kind: i64) void

token_ch

private
fn token_ch(token: ref void) u8

set_token_ch

private
fn set_token_ch(token: ref void, ch: u8) void

token_ccl

private
fn token_ccl(token: ref void) ref u8

set_token_ccl

private
fn set_token_ccl(token: ref void, ccl: ref u8) void

ccl_slot

private
fn ccl_slot(buf: ref u8, idx: i64) ref u8

alloc_in

private
fn alloc_in[T: allocators.GeneralAllocator](ac: T, size: i64) ref void

free_in

private
fn free_in[T: allocators.GeneralAllocator](ac: T, ptr: ref void) void

alloc_handle

private
fn alloc_handle[T: allocators.GeneralAllocator](ac: T) option[ref void]

re_free_with

pub fn re_free_with[T: allocators.GeneralAllocator](ac: T, pattern: ref void) void

re_free

pub fn re_free(pattern: ref void) void = trust { ... }

re_compile_with

pub fn re_compile_with[T: allocators.GeneralAllocator](ac: T, pattern: ref u8) option[ref void]

re_compile

pub fn re_compile(pattern: ref u8) option[ref void]

matchdigit

private
fn matchdigit(c: u8) bool

matchalpha

private
fn matchalpha(c: u8) bool

matchwhitespace

private
fn matchwhitespace(c: u8) bool

matchalphanum

private
fn matchalphanum(c: u8) bool

matchrange

private
fn matchrange(c: u8, str: ref u8) bool

matchdot

private
fn matchdot(c: u8) bool

ismetachar

private
fn ismetachar(c: u8) bool

matchmetachar

private
fn matchmetachar(c: u8, str: ref u8) bool

matchcharclass

private
fn matchcharclass(c: u8, str: ref u8) bool

matchone

private
fn matchone(token: ref void, c: u8) bool

matchpattern

private
fn matchpattern(pattern: ref void, text: ref u8, matchlength: mut ref i64) bool

matchstar

private
fn matchstar(token: ref void, pattern: ref void, text: ref u8, matchlength: mut ref i64) bool

matchplus

private
fn matchplus(token: ref void, pattern: ref void, text: ref u8, matchlength: mut ref i64) bool

matchquestion

private
fn matchquestion(token: ref void, pattern: ref void, text: ref u8, matchlength: mut ref i64) bool

re_matchp

pub fn re_matchp(pattern: ref void, text: ref u8, matchlength: mut ref i64) result[option[i64], RegexMatchError] = trust { ... }

re_match_with

pub fn re_match_with[T: allocators.GeneralAllocator](ac: T, pattern: ref u8, text: ref u8, matchlength: mut ref i64) result[option[i64], RegexMatchError]

re_match

pub fn re_match(pattern: ref u8, text: ref u8, matchlength: mut ref i64) result[option[i64], RegexMatchError]

kind_name

private
fn kind_name(kind: i64) ref u8

print_char

private
fn print_char(c: u8) void = trust { ... }

re_print

pub fn re_print(pattern: ref void) void