From bc6b0bee8fe4120642029daaa8ce6c069ef667b8 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Wed, 26 Aug 2015 17:29:32 -0400 Subject: Rework replacement API to rely on transformation Redesign library API around highly general regex-based transformations. Instead of specifying a string to substitute for each match, you now execute an entire function over the match (and over nonmatching regions as well). The resulting C++ code is much simpler, with more functionality pushed into Ur, and the engine now supports certain types of regex transformations needed to mimic Perl. --- src/lib.urp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/lib.urp') diff --git a/src/lib.urp b/src/lib.urp index 75bcd48..7fcdc82 100644 --- a/src/lib.urp +++ b/src/lib.urp @@ -1,12 +1,15 @@ ffi regex__FFI include regex__FFI.h link -lurweb_regex -jsFunc Regex__FFI.succeeded=UrWeb.Regex.succeeded -jsFunc Regex__FFI.n_subexpression_matches=UrWeb.Regex.nSubexpressionMatches -jsFunc Regex__FFI.subexpression_match=UrWeb.Regex.subexpressionMatch +jsFunc Regex__FFI.substring_start=UrWeb.Regex.Substring.start +jsFunc Regex__FFI.substring_length=UrWeb.Regex.Substring.length +jsFunc Regex__FFI.substring_list_length=UrWeb.Regex.Substring.List.length +jsFunc Regex__FFI.substring_list_get=UrWeb.Regex.Substring.List.get jsFunc Regex__FFI.do_match=UrWeb.Regex.doMatch -jsFunc Regex__FFI.replace=UrWeb.Regex.replace file /cgGvSqBi.js regex__FFI.js script /cgGvSqBi.js -regex \ No newline at end of file +$/list +$/option +$/string +regex -- cgit v1.2.3