Commit 7bf5bd08

7bf5bd08eab3Merged

Yukihiro "Matz" Matsumoto <[email protected]> · 7 months ago · 8 files · +4 added · ~4 modified

Description

feat: built-in regexp support using standalone regexp engine

Integrate the mruby-regexp engine (re_compile.c, re_exec.c, re_utf8.c) as a standalone library (lib/regexp/), removing all mruby runtime dependencies (mrb_state, mrb_malloc → malloc/free).

Codegen support for:

  • /pattern/ literals (compiled at program start)
  • =~ operator with captures ($1-$9)
  • match? method (returns bool)
  • gsub(/re/, str) and sub(/re/, str)
  • scan(/re/) with block
  • split(/re/)

The spinel wrapper auto-detects regexp usage and links libspre.a. No -lonig flag needed. Test bm_regexp now passes (59/60 total).

Co-Authored-By: Claude Opus 4.6 (1M context) [email protected]

Details

Commit
7bf5bd08eab3
Parent
464d7e3640a5

.gitignoremodifiedView file

@@ -18,3 +18,4 @@
1818 /spinel_parse_bin
1919 /perf.data
2020 /perf.data.old
21+/lib/regexp/libspre.a