From 4fe5bc6f3867096965270c90f2e1e5df77b8825f Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 28 Jun 2026 00:39:51 +0200 Subject: terex is the new regular expression engine now and replaces PCRE (GRegex) * terex is based on Henry Spencer's regular expression engine for Tcl. It is a hybrid NFA/DFA design which has better worst-time runtimes than the backtracking PCRE. Memory usage is also limited and can no longer increase catastrophically. * It should no longer be possible to crash SciTECO with pathological searches. * Since it reliably supports partial matches (REG_EXPECT) we can now enable the new backwards-search algorithm by default. This used to be broken because of a glib bug, which I already fixed. It would however take a long time until this ends up on the majority of glib installations. * Regexp executions can still be quite slow if you are looking for a pattern at the end of a huge file, which can hang the editor, but this can now at least theoretically be solved by adding hooks into terex to poll for interruptions. * We can now also get rid of a TECO-pattern to regexp translation step by directly generating terex tokens (TODO). * Performance-wise terex appears to be slower than PCRE for simple forward searches even when linking everything with optimzations (FIXME). * Having a stand-alone regular expression engine is also a huge step in getting rid of glib. See also: https://git.fmsbw.de/terex/about/ --- src/Makefile.am | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Makefile.am') diff --git a/src/Makefile.am b/src/Makefile.am index ff2e86b..8ac58c7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -13,7 +13,7 @@ include $(top_srcdir)/contrib/scintilla.am # FIXME: Common flags should be in configure.ac AM_CFLAGS = -std=gnu11 -Wall -Wno-initializer-overrides -Wno-unused-value -AM_CPPFLAGS += -I$(top_srcdir)/contrib/rb3ptr +AM_CPPFLAGS += -I$(top_srcdir)/contrib/rb3ptr -I$(top_srcdir)/contrib/terex AM_LDFLAGS = if STATIC_EXECUTABLES @@ -60,7 +60,8 @@ libsciteco_base_la_SOURCES = main.c sciteco.h list.h \ # NOTE: We cannot link in Scintilla (static library) into # a libtool convenience library libsciteco_base_la_LIBADD = $(LIBSCITECO_INTERFACE) \ - $(top_builddir)/contrib/rb3ptr/librb3ptr.la + $(top_builddir)/contrib/rb3ptr/librb3ptr.la \ + $(top_builddir)/contrib/terex/libterex.la if REPLACE_MALLOC libsciteco_base_la_LIBADD += $(top_builddir)/contrib/dlmalloc/libdlmalloc.la endif -- cgit v1.2.3