diff -Nru lua-rexlib-2.6.0/.gitignore lua-rexlib-2.7.2/.gitignore --- lua-rexlib-2.6.0/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ lua-rexlib-2.7.2/.gitignore 2013-01-08 19:41:59.000000000 +0000 @@ -0,0 +1,9 @@ +*.[oa] +*~ +*.so.* +*.so +ChangeLog +*.zip +release-notes +/*.rockspec +/luarocks diff -Nru lua-rexlib-2.6.0/ChangeLog lua-rexlib-2.7.2/ChangeLog --- lua-rexlib-2.6.0/ChangeLog 2012-04-12 17:44:43.000000000 +0000 +++ lua-rexlib-2.7.2/ChangeLog 1970-01-01 00:00:00.000000000 +0000 @@ -1,1950 +0,0 @@ -2012-04-12 Reuben Thomas - - * src/tre/Makefile: Temporarily remove ltre_w.c from being built by - 2.6.0 release. - -2012-04-12 Shmuel Zeigerman - - * NEWS: Update NEWS. - -2012-04-11 Reuben Thomas - - * src/defaults.mak: Unix makefiles: bump version to 2.6.0. - -2012-04-10 Shmuel Zeigerman - - * LICENSE, NEWS, README.rst, doc/license.html, doc/manual.txt, - src/algo.h, windows/mingw/_mingw.mak: Update docs towards the - release. - -2012-04-06 Shmuel Zeigerman - - * src/tre/ltre.c, src/tre/ltre_w.c, test/runtest.lua: Fix and - refactor. - -2012-04-06 Shmuel Zeigerman - - * : commit 9441e6762ced48005b0dd64cfafbd96ad02ef5ba Author: Shmuel - Zeigerman Date: Fri Apr 6 11:32:12 2012 +0300 - -2012-04-05 Reuben Thomas - - * src/common.mak, src/defaults.mak: Parametrize Lua interpreter for - Lua 5.2 support. - -2012-04-04 Shmuel Zeigerman - - * src/algo.h, windows/mingw/Makefile, windows/mingw/_mingw.mak, - windows/mingw/rex_gnu.mak, windows/mingw/rex_onig.mak, - windows/mingw/rex_pcre.mak, windows/mingw/rex_spencer.mak, - windows/mingw/rex_tre.mak: Add macro REX_CREATEGLOBALVAR. - -2012-04-03 Shmuel Zeigerman - - * src/algo.h, src/common.c, src/common.h, src/gnu/lgnu.c, - src/oniguruma/lonig.c, src/pcre/lpcre.c, src/posix/lposix.c, - src/tre/ltre.c, test/runtest.lua, windows/mingw/_mingw.mak, - windows/mingw/rex_gnu.mak, windows/mingw/rex_onig.mak, - windows/mingw/rex_pcre.mak, windows/mingw/rex_spencer.mak, - windows/mingw/rex_tre.mak: Lua 5.2 compatibility. - -2012-02-28 Shmuel Zeigerman - - * windows/mingw/_mingw.mak, windows/mingw/rex_gnu.mak, - windows/mingw/rex_onig.mak, windows/mingw/rex_pcre.mak, - windows/mingw/rex_spencer.mak, windows/mingw/rex_tre.mak: MinGW - makefiles: removed -L. - -2012-02-17 Shmuel Zeigerman - - * src/algo.h, src/gnu/lgnu.c, src/oniguruma/lonig.c, - src/pcre/lpcre.c, src/posix/lposix.c, src/tre/ltre.c, - src/tre/ltre_w.c: Make internal function names more consistent. - -2012-02-13 Shmuel Zeigerman - - * src/common.c, src/common.h, src/tre/Makefile, src/tre/ltre_w.c, - test/tre_sets.lua, windows/mingw/_mingw.mak, - windows/mingw/rex_gnu.mak, windows/mingw/rex_onig.mak, - windows/mingw/rex_pcre.mak, windows/mingw/rex_spencer.mak, - windows/mingw/rex_tre.mak: TRE binding: add wide-character - functions. - -2012-02-13 Shmuel Zeigerman - - * doc/manual.txt, src/algo.h, src/common.c, src/gnu/lgnu.c, - src/oniguruma/lonig.c, src/pcre/lpcre.c, src/posix/lposix.c, - src/tre/Makefile, src/tre/ltre.c, test/common_sets.lua, - test/tre_sets.lua, windows/mingw/rex_tre.mak: Removed function - plainfind. - -2012-02-12 Shmuel Zeigerman - - * src/algo.h, src/common.c, src/common.h, src/tre/ltre_w.c, - test/tre_sets.lua: TRE binding: add wide-character functions. - -2012-02-12 Shmuel Zeigerman - - * test/tre_sets.lua: Test suite: avoid using sysutils library. - -2012-02-12 Shmuel Zeigerman - - * src/algo.h, src/tre/Makefile, src/tre/ltre.c, src/tre/ltre_w.c, - test/luatest.lua, test/runtest.lua, test/tre_sets.lua, - windows/mingw/_mingw.mak, windows/mingw/rex_tre.mak: 1. TRE binding: add wide-character functions. 2. Test suite: fix and refactor. - -2012-01-22 Shmuel Zeigerman - - * README.rst, doc/Makefile, windows/mingw/docs.mak: Fix hyperlinks - -2012-01-22 Shmuel Zeigerman - - * README.rst: Fix links in README.rst - -2012-01-22 Shmuel Zeigerman - - * README.rst: Fix links in README.rst - -2012-01-21 Shmuel Zeigerman - - * README, README.rst: Rename README to README.rst - -2012-01-07 Shmuel Zeigerman - - * src/oniguruma/lonig.c: Tidy up - -2011-12-22 Shmuel Zeigerman - - * src/pcre/lpcre_f.c: lpcre_f.c: added flags up to PCRE version 8.21 - -2011-12-22 Shmuel Zeigerman - - * src/gnu/lgnu.c, src/oniguruma/lonig.c, src/pcre/lpcre.c, - src/posix/lposix.c, src/tre/ltre.c: luaL_reg replaced with luaL_Reg - -2011-10-05 Shmuel Zeigerman - - * test/luatest.lua: luatest.lua: 1) bugfix; 2) don't use `module' - function; - -2011-09-10 Shmuel Zeigerman - - * src/pcre/lpcre_f.c: lpcre_f.c: added flags up to PCRE version - 8.13. - -2011-03-22 Reuben Thomas - - * src/common.mak: Improve portability to Darwin. - -2011-03-12 Reuben Thomas - - * src/gnu/lgnu.c: Fix double space. - -2011-02-08 Reuben Thomas - - * Makefile: Remove accidentally inserted lines. - -2010-12-15 Reuben Thomas - - * Makefile: Remind maintainer to make release manually on LuaForge. - -2010-12-15 Reuben Thomas - - * src/defaults.mak: Bump minor version. - -2010-12-15 Reuben Thomas - - * src/algo.h: Add a FIXME not to repeat version. - -2010-12-15 Reuben Thomas - - * NEWS: Update NEWS for 2.5.3. - -2010-12-15 shmuz - - * src/algo.h, src/pcre/lpcre_f.c: 1. fix rex.split (offset was out-of-range) 2. PCRE: add new flags from PCRE 8.11 - -2010-11-11 Reuben Thomas - - * Makefile: Add definition of missing VERSION. - -2010-11-11 Reuben Thomas - - * Makefile: Add release target. - -2010-11-11 Reuben Thomas - - * .gitignore: Add release-notes. - -2010-11-11 Reuben Thomas - - * Makefile: Suffix distribution zip's top-level directory with the - version number. - -2010-11-10 Reuben Thomas - - * Makefile: Exclude zip files from dist zip\! - -2010-11-10 Reuben Thomas - - * NEWS: Add NEWS for 2.5.2. - -2010-11-10 Reuben Thomas - - * src/defaults.mak: Bump version to 2.5.2. - -2010-11-10 Reuben Thomas - - * src/gnu/Makefile: Undo a mistakenly-committed change. - -2010-11-10 Reuben Thomas - - * src/common.c: Fix memory alignment bug. (Shmuel) - -2010-11-05 Reuben Thomas - - * doc/manual.txt: Remove duplicate information. (Shmuel) - -2010-10-26 Reuben Thomas - - * doc/Makefile, src/gnu/Makefile, windows/mingw/Makefile, - windows/mingw/_mingw.mak, windows/mingw/docs.mak, - windows/mingw/rex_gnu.mak, windows/mingw/rex_onig.mak, - windows/mingw/rex_pcre.mak, windows/mingw/rex_spencer.mak, - windows/mingw/rex_tre.mak: Improve portability of build system. - (Shmuel) - -2010-10-05 Reuben Thomas - - * : commit b9b9d1407309e189c551a9c689c94a2875ec6219 Author: Reuben - Thomas Date: Tue Oct 5 13:25:11 2010 +0100 - -2010-10-04 Reuben Thomas - - * windows/mingw/_mingw.mak: Remove useless comment. (Shmuel) - -2010-10-04 Reuben Thomas - - * Makefile, src/defaults.mak: Add minor version number MINORV for - building Zip files. - -2010-10-04 Reuben Thomas - - * NEWS, src/algo.h: Bump version and add news for 2.5.1. - -2010-10-04 Reuben Thomas - - * ChangeLog.old: Re-add old ChangeLog as ChangeLog.old. (Shmuel) - -2010-10-04 Reuben Thomas - - * README: Mention that TRE and Oniguruma bindings are incomplete. - (Shmuel) - -2010-10-04 Reuben Thomas - - * windows/mingw/Makefile, windows/mingw/_mingw.mak: Make new - libraries build on mingw and improve Makefile. (Shmuel) - -2010-10-04 Reuben Thomas - - * doc/manual.txt: Fix incorrect documentation. (Shmuel) - -2010-10-04 Reuben Thomas - - * test/emacs_sets.lua, test/gnu_sets.lua: Remove incorrect comments - and add a test. (Shmuel) - -2010-10-04 Reuben Thomas - - * src/gnu/regex.h, src/gnu/regex_internal.h: Remove GNU regex files. - (Shmuel) - -2010-10-04 Reuben Thomas - - * README: Fix typo. (Shmuel) - -2010-10-04 Reuben Thomas - - * Makefile: Don't copy generated file over original; exclude SCiTE - properties files from dist. - -2010-10-03 Reuben Thomas - - * test/gnu_sets.lua: Change name of flag in test. - -2010-10-03 Reuben Thomas - - * doc/.gitignore: Add index.txt. - -2010-10-03 Reuben Thomas - - * README, doc/Makefile, doc/index.txt: Use doc/index.txt as README. - -2010-10-03 Reuben Thomas - - * .gitignore: Remove README. - -2010-09-12 Reuben Thomas - - * NEWS: Update date in NEWS for 2.5.0 release. - -2010-09-12 Reuben Thomas - - * src/gnu/Makefile, src/gnu/lgnu.c, src/gnu/regex.h, - src/gnu/regex_internal.h: Add gnulib regex headers, and settings to - lgnu.c and Makefile to build against gnulib (but the actual building - must be done elsewhere at the moment). - -2010-09-12 Reuben Thomas - - * doc/manual.txt, src/gnu/lgnu.c, test/emacs_sets.lua: Remove - gnu_rex.setsyntax, reimplement syntax flags as compilation flags, - adding the per-feature flags (which is why we need them to be - numbers, not strings, so they can be combined). Hence, remove the special “syn” argument from the constructors, - and alter the tests accordingly. Improve the documentation of GNU regex in one or two places. Rename the “reverse” execution flag to “backward”, for - clarity. - -2010-09-10 Reuben Thomas - - * doc/manual.txt: Fix some erroneous markup fixing in last commit - but one. - -2010-09-10 Reuben Thomas - - * doc/manual.txt: Document the translation parameter for GNU regexs. - -2010-09-10 Reuben Thomas - - * doc/manual.txt: Improve documentation of syntax parameters, and - make some use of markup slightly more consistent. - -2010-08-20 Reuben Thomas - - * src/gnu/lgnu.c, src/pcre/lpcre.c, src/posix/lposix.c, - src/tre/ltre.c: Shorten if (p) free(p) to free(p) and fix a space - leak in gnu.c (call regfree). - -2010-08-01 Reuben Thomas - - * LICENSE, Makefile, NEWS, doc/Makefile, doc/SciTE.properties, - doc/html4css1.css, doc/index.txt, doc/license.html, - doc/lrexlib.css, src/algo.h, src/common.c, src/common.h, - src/common.mak, src/defaults.mak, src/gnu/Makefile, src/gnu/lgnu.c, - src/oniguruma/Makefile, src/oniguruma/lonig.c, - src/oniguruma/lonig_f.c, src/pcre/Makefile, src/pcre/lpcre.c, - src/pcre/lpcre_f.c, src/posix/Makefile, src/posix/lposix.c, - src/tre/Makefile, src/tre/ltre.c, test/README, - test/common_sets.lua, test/emacs_sets.lua, test/gnu_sets.lua, - test/luatest.lua, test/onig_sets.lua, test/pat2pcre.lua, - test/pcre_sets.lua, test/pcre_sets2.lua, test/posix_sets.lua, - test/runtest.lua, test/scite.properties, test/spencer_sets.lua, - windows/mingw/Makefile, windows/mingw/_mingw.mak, - windows/mingw/rex_onig.mak, windows/mingw/rex_pcre.mak, - windows/mingw/rex_spencer.mak: Fix permissions: remove spurious - executable permissions. - -2010-08-01 Reuben Thomas - - * NEWS: Write NEWS for 2.5.0. - -2010-08-01 Reuben Thomas - - * windows/mingw/rex_tre.mak: Add rex_tre.mak from Shmuel. - -2010-08-01 Reuben Thomas - - * doc/Makefile: Remove old commented-out -gt which is not documented - in rst2html(1). Change default name of app to rst2html in accordance with common - installed name. Add a clean target. - -2010-08-01 Reuben Thomas - - * doc/manual.txt: Fix up errors: mostly remove links that now point - to index.txt. - -2010-08-01 Reuben Thomas - - * doc/license.html: Update version and years in license.html. - -2010-08-01 Reuben Thomas - - * Makefile: Make dist depend on all, and build docs as part of all. - -2010-08-01 Reuben Thomas - - * .gitignore, Makefile, src/common.mak, src/defaults.mak: Write the - rest of the dist target to build a release zip. Move make variable V into defaults.mak, which can be included from - top-level Makefile, and used to name the zip. In release Zip, copy doc/index.txt to README. - -2010-08-01 Reuben Thomas - - * src/.cvsignore, src/gnu/.cvsignore, src/oniguruma/.cvsignore, - src/pcre/.cvsignore, src/posix/.cvsignore: Remove unneeded - .cvsignore files. - -2010-08-01 Reuben Thomas - - * .gitignore: Add distribution archive and ChangeLog to ignore list. - -2010-08-01 Reuben Thomas - - * doc/.cvsignore, doc/.gitignore: Make .gitignore from .cvsignore - -2010-08-01 Reuben Thomas - - * src/gnu/lgnu.c: Add initialiser to avoid compiler warnings. - -2010-08-01 Reuben Thomas - - * test/posix_sets.lua: Fix fixes to NOTBOL tests. Sorry, Shmuel. - -2010-08-01 Reuben Thomas - - * windows/mingw/rex_gnu.mak: Add mingw makefile for GNU, from - Shmuel. - -2010-08-01 Reuben Thomas - - * test/posix_sets.lua: Fix other NOTBOL tests (thanks, Shmuel!). - -2010-08-01 Reuben Thomas - - * win32bin/lrexlib/LICENSE, win32bin/pcre/LICENCE, - win32bin/readme.txt, win32bin/rxspencer/COPYRIGHT: Remove - out-of-date binary win32 builds, as agreed with Shmuel. - -2010-07-31 Reuben Thomas - - * doc/manual.txt: Document GNU library flags. - -2010-07-31 Reuben Thomas - - * src/algo.h, src/gnu/lgnu.c, src/oniguruma/lonig.c, - src/pcre/lpcre.c: Simplify collection of extra compilation - arguments. - -2010-07-31 Reuben Thomas - - * Makefile, src/common.mak: To be more compatible with GNU - autotools, make “check” target depend on “all”, and make - previous “build” target the new “all” target. Make the comment in top-level Makefile about where to look for user - settings include defaults.mak. - -2010-07-31 Reuben Thomas - - * src/gnu/lgnu.c, test/gnu_sets.lua: Implement reverse searching in - GNU, and add a test for it. - -2010-07-31 Reuben Thomas - - * test/gnu_sets.lua, test/posix_sets.lua: Fix two that use the - “not beginning of line” flag (POSIX & GNU). They erroneously had - the subject “^abc”, not “abc”, so would always pass (because - the pattern “^abc” would never match). Of course, they still - pass with the flag set, but I have confirmed that they now fail with - the flag removed (whereas before they passed). - -2010-07-31 Reuben Thomas - - * doc/index.txt, doc/manual.txt: Merge duplicate material between - index.txt and manual.txt. Fix names of GNU and TRE shared library files in manual.txt. - -2010-07-31 Reuben Thomas - - * README, doc/index.txt: Remove README (use index.txt instead). - -2010-07-31 Reuben Thomas - - * Makefile, src/common.mak, src/gnu/Makefile, - src/oniguruma/Makefile, src/pcre/Makefile, src/posix/Makefile, - src/tre/Makefile: Simplify the build system, adding the test target - to common.mak (and renaming it “check” for compatibility with - GNU autotools), and using a list of library names to perform the - top-level build, check and clean targets, rather than hand-written - targets for each library. - -2010-07-31 Reuben Thomas - - * ChangeLog, Makefile: Remove ChangeLog from repository; use git2cl - to generate it. - -2010-07-31 Reuben Thomas - - * Makefile: Remove unnecessary .PHONY target. - -2010-07-31 Reuben Thomas - - * Makefile, src/gnu/Makefile, src/gnu/rex_gnu.mak, - src/oniguruma/Makefile, src/oniguruma/rex_onig.mak, - src/pcre/Makefile, src/pcre/rex_pcre.mak, src/posix/Makefile, - src/posix/rex_posix.mak, src/tre/Makefile, src/tre/rex_tre.mak: - Rename per-library makefiles to Makefile. - -2010-07-31 Reuben Thomas - - * src/gnu/lgnu.c: Use custom eflags codes so we can add one for - backwards searching, and add a reverse flag to TGnu. - -2010-07-30 Reuben Thomas - - * src/gnu/lgnu.c: Remove a couple of eflags which can’t be used as - eflags (oops). Remove the commented-out reverse-search functions and methods - (we’ll use an extra argument to the existing functions and methods - instead). - -2010-07-30 Reuben Thomas - - * src/algo.h: Simplify some code, and fix some formatting. - -2010-07-30 Reuben Thomas - - * test/gnu_sets.lua: Add test for execution flags. - -2010-07-30 Reuben Thomas - - * src/algo.h: Update Lua function prototypes in comments. - -2010-07-30 Reuben Thomas - - * src/gnu/lgnu.c: Add execution flags for GNU. - -2010-07-30 Reuben Thomas - - * src/algo.h: Bump a missed version to 2.5. - -2010-07-30 Reuben Thomas - - * doc/manual.txt: Move the documentation of the library-specific - compile-time arguments into the documentation of each library’s - new method; just refer to “larg” (library arguments) elsewhere. Add some missing documentation for GNU. Make the layout of the argument tables a little more consistent. - -2010-07-30 Reuben Thomas - - * test/gnu_sets.lua, test/runtest.lua: Add GNU-specific test (of - translation tables). - -2010-07-30 Reuben Thomas - - * src/gnu/lgnu.c: Tweak for clarity. - -2010-07-30 Reuben Thomas - - * src/gnu/lgnu.c: Fix typo in commit - b7161ee8963352d140cd35f9d26d345d58047227. - -2010-07-30 Reuben Thomas - - * Makefile: Add TRE targets and add TRE and GNU targets to global - targets. - -2010-07-30 Reuben Thomas - - * src/tre/rex_tre.mak: Fix some bitrot in rex_tre.mak. - -2010-07-30 Reuben Thomas - - * src/pcre/lpcre.c, src/tre/ltre.c: Fix up some uses of ALG_NOMATCH - missed earlier. - -2010-07-30 Reuben Thomas - - * doc/manual.txt: Add URL for GNU regex. - -2010-07-30 Reuben Thomas - - * test/README: Don't bother listing possible libraries; they're - obvious, and this is just another list to keep up to date. - -2010-07-30 Reuben Thomas - - * src/algo.h, src/gnu/lgnu.c, src/oniguruma/lonig.c, - src/pcre/lpcre.c, src/posix/lposix.c, src/tre/ltre.c: Change - ALG_NOMATCH to a macro that takes an argument, like ALG_ISMATCH, - because the GNU API can return two different error codes. - -2010-07-29 Reuben Thomas - - * src/gnu/lgnu.c, test/emacs_sets.lua: Implement per-regex syntax. - Use this in the tests, but because most of the test harnesses are - not set up for extra compile-time arguments, discard most of the - tests in emacs_sets. Shmuel was happy with this idea; it’s similar - to what other bindings do. Remove per-regex cflags, as the GNU API doesn’t have any. - -2010-07-26 Reuben Thomas - - * doc/manual.txt, src/algo.h, src/common.h, src/gnu/lgnu.c, - test/emacs_sets.lua, test/runtest.lua: Various improvements to GNU - regex support: 1. Change default syntax to POSIX_EXTENDED, as agreed with Shmuel. 2. Add setsyntax function to set the syntax. Use it to run a much smaller emacs_sets.lua, while using common_sets.lua (with normal syntax) as the main test. This commit also introduces preliminary untested code to support - translation arrays, and code to parse a syntax argument so per-regex - syntax can be selected. - -2010-07-26 Reuben Thomas - - * doc/manual.txt: Merge TRE and GNU documentation into manual. - -2010-07-26 Reuben Thomas - - * .gitignore: Ignore common backup and object file names. - -2010-07-20 rrt - - * LICENSE, README, doc/index.txt, doc/manual.txt, src/common.mak: - Bump version to 2.5. Fix Shmuel’s email address in index.txt. Add some very preliminary documentation for the GNU regex library. - -2010-07-20 rrt - - * Makefile: Fix clean_gnu and test_gnu to use the right env var - (thanks, Shmuel!). - -2010-07-19 rrt - - * Makefile, src/gnu/.cvsignore, src/gnu/lgnu.c, - src/gnu/rex_gnu.mak, test/emacs_sets.lua, test/runtest.lua: Add a - new regex engine: GNU regex. This checkin contains simply a first rough cut of the new code, - which passes the existing tests (but rewritten for Emacs syntax, in - emacs_sets.lua). Documentation and complete code to expose the unique features of GNU - regex is yet to come. - -2010-07-06 shmuz - - * ChangeLog, src/oniguruma/lonig.c: Casts to suppress compiler - warnings. - -2010-07-05 shmuz - - * ChangeLog, src/pcre/lpcre_f.c: lpcre_f.c: added flags up to PCRE - version 8.10. - -2010-03-12 shmuz - - * README: email address updated - -2010-03-12 rrt - - * README: Mention TRE in README. - -2010-01-19 shmuz - - * ChangeLog, src/algo.h, src/common.h, src/oniguruma/lonig.c, - src/pcre/lpcre.c: several files: luaL_typerror renamed to - luaL_typeerror (as in Lua 5.2). common.h: added a macro for - handling luaL_typeerror and luaL_typerror. - -2009-11-29 shmuz - - * ChangeLog, src/tre/ltre.c: * ltre.c: changes to adapt to TRE 0.8 1) #include (was: ). 2) added tre_ prefix to all TRE functions. - -2009-11-09 shmuz - - * ChangeLog, src/pcre/lpcre_f.c: lpcre_f.c: added flags up to PCRE - version 8.00. - -2008-08-16 shmuz - - * src/algo.h: eliminate a warning on 64 bit systems: cast to pointer - from integer of different size - -2008-08-05 shmuz - - * README: The definition of Lrexlib edited. - -2008-08-05 shmuz - - * doc/index.txt: The definition of Lrexlib edited. - -2008-08-04 shmuz - - * test/README: prepare to release 2.4.0 - -2008-08-04 shmuz - - * ChangeLog, NEWS, doc/manual.txt, src/oniguruma/lonig.c, - src/oniguruma/lonig_f.c: prepare to release 2.4.0 - -2008-08-01 shmuz - - * doc/manual.txt: corrections - -2008-08-01 shmuz - - * Makefile, test/runtest.lua: force-reload the tested library; - makefile reverted; - -2008-07-31 niklas - - * Makefile: Unset LUA_INIT before running tests to avoid problems - -2008-07-30 niklas - - * doc/manual.txt: English fixes. - -2008-07-30 niklas - - * src/oniguruma/.cvsignore, src/pcre/.cvsignore, - src/posix/.cvsignore: Add .cvsignore files to ignore .so's. - -2008-07-30 niklas - - * doc/.cvsignore: Add .cvsignore file for generated HTML files - -2008-07-30 niklas - - * src/oniguruma/lonig.c, src/oniguruma/lonig_f.c: Remove a stray - _cdecl. Change stricmp (non-standard name) to strcasecmp (POSIX 2001 name). Change include path for oniguruma.h. If installed under - /usr/include/oniguruma, an additional -I flag is needed; on Ubuntu - (and hence presumably Debian) the include files are stored directly - under /usr/include. - -2008-07-30 niklas - - * src/oniguruma/rex_onig.mak, src/pcre/rex_pcre.mak, - src/posix/rex_posix.mak: Fix makefile paths for common files. - -2008-07-30 shmuz - - * windows/mingw/Makefile, windows/mingw/rex_onig.mak, - windows/mingw/rex_pcre.mak, windows/mingw/rex_spencer.mak: Changes - related to Oniguruma addition and directory layout change. - -2008-07-30 shmuz - - * Makefile, doc/manual.txt, src/algo.h, src/common.h, - test/onig_sets.lua, test/runtest.lua: Changes related to Oniguruma - addition and directory layout change. - -2008-07-30 shmuz - - * src/oniguruma/lonig.c, src/oniguruma/lonig_f.c, - src/oniguruma/rex_onig.mak, src/pcre/lpcre.c, src/pcre/lpcre_f.c, - src/pcre/rex_pcre.mak, src/posix/lposix.c, src/posix/rex_posix.mak, - src/tre/ltre.c, src/tre/rex_tre.mak: 1) Moving files: each binding to its dedicated directory. 2) Oniguruma binding added. - -2008-07-30 shmuz - - * src/lpcre.c, src/lpcre_f.c, src/lposix.c, src/ltre.c, - src/rex_pcre.mak, src/rex_posix.mak, src/rex_tre.mak, - src/scite.properties: Moving files: each binding to its dedicated - directory. - -2008-06-22 shmuz - - * test/luatest.lua: a little fix - -2008-06-15 shmuz - - * doc/manual.txt: one sentence reworded - -2008-06-15 shmuz - - * doc/index.txt, doc/license.html, doc/manual.txt: update version - and copyright strings (prepare to release 2.4) - -2008-06-14 shmuz - - * LICENSE, README: update version and copyright strings (prepare to - release 2.4) - -2008-06-14 shmuz - - * ChangeLog, src/algo.h, src/common.h, src/common.mak, src/lpcre.c, - src/lposix.c, src/ltre.c, test/common_sets.lua: [API extension] All - functions receiving string-type regex accept a compiled regex too. - If this is the case, cf and lo arguments are ignored (should be - either supplied as nils or omitted). - -2008-05-31 shmuz - - * NEWS: release 2.3.0 - -2008-05-30 shmuz - - * doc/index.txt, doc/manual.txt: update version and copyright - strings (prepare to release 2.3) - -2008-05-30 shmuz - - * windows/mingw/rex_pcre.mak, windows/mingw/rex_spencer.mak: name of - the Lua DLL to link to made configurable - -2008-05-30 shmuz - - * doc/lrexlib.css: reverted; didn't like the current version; - -2008-05-28 shmuz - - * LICENSE, NEWS, README, doc/license.html, src/common.mak: update - version and copyright strings (prepare to release 2.3) - -2008-05-28 shmuz - - * test/runtest.lua: little fix - -2008-05-28 shmuz - - * windows/mingw/Makefile, windows/mingw/_mingw.mak, - windows/mingw/rex_pcre.mak, windows/mingw/rex_spencer.mak: files - added (as part of directory rename) - -2008-05-28 shmuz - - * windows/dev-cpp/Makefile, windows/dev-cpp/_devcpp.mak, - windows/dev-cpp/rex_pcre.mak, windows/dev-cpp/rex_spencer.mak: - directory removed (as part of its rename) - -2008-05-09 shmuz - - * ChangeLog, src/lpcre_f.c: Added a new flag from PCRE-7.7. - -2008-05-02 shmuz - - * test/runtest.lua: GNU regex test added to the list of available - tests. - -2008-04-08 shmuz - - * src/lpcre.c: cosmetics - -2008-03-30 shmuz - - * ChangeLog: [no log message] - -2008-03-30 shmuz - - * doc/index.txt: Lrexlib version changed to 2.3. - -2008-03-30 shmuz - - * doc/manual.txt: Two new methods (match and find). Lrexlib version - changed to 2.3. - -2008-03-30 shmuz - - * test/common_sets.lua: Add tests for new methods (match and find). - -2008-03-30 shmuz - - * src/algo.h, src/lpcre.c, src/lposix.c, src/ltre.c: Add two new - methods (find and match). Refactoring. - -2008-03-25 shmuz - - * ChangeLog: [no log message] - -2008-03-25 shmuz - - * test/common_sets.lua: set_f_plainfind: add tests with empty - patterns. - -2008-03-25 shmuz - - * src/algo.h: plainfind_func: optimize for speed. plainfind_func: - treat empty patterns as valid. - -2008-03-25 shmuz - - * test/luatest.lua: refactoring - -2008-01-12 rrt - - * doc/manual.txt: Fix English. - -2007-12-29 shmuz - - * NEWS: release 2.2.2 - -2007-12-27 shmuz - - * test/runtest.lua: small fix - -2007-12-27 shmuz - - * ChangeLog: [no log message] - -2007-12-27 shmuz - - * Makefile: add -d../src to testing commands, for testing the - freshly built libraries rather than the installed ones - -2007-12-27 shmuz - - * test/runtest.lua: add new command-line switch -d that - will prepend to package.cpath - -2007-12-27 shmuz - - * test/common_sets.lua, test/pcre_sets.lua, test/pcre_sets2.lua, - test/spencer_sets.lua: move tests with NULs in subject from - common_sets.lua into other set files - -2007-12-19 shmuz - - * ChangeLog: spelling - -2007-12-19 shmuz - - * ChangeLog: spelling - -2007-12-19 shmuz - - * src/common.mak: express "ld" and "-shared" via variables - -2007-12-19 shmuz - - * Makefile: separate PCRE and POSIX targets - -2007-12-19 shmuz - - * src/algo.h, src/lpcre.c, src/lposix.c, src/ltre.c: refactoring - (ALG_GETCFLAGS redefined) - -2007-12-19 shmuz - - * ChangeLog: [no log message] - -2007-10-25 shmuz - - * ChangeLog: [no log message] - -2007-10-25 shmuz - - * src/algo.h: version string updated to "Lrexlib 2.2.1" - -2007-10-24 shmuz - - * NEWS: release 2.2.1 - -2007-09-26 shmuz - - * src/lpcre_f.c: refactoring - -2007-09-25 shmuz - - * ChangeLog, src/lpcre_f.c: added new flags from PCRE-7.4 - -2007-09-20 shmuz - - * ChangeLog: [no log message] - -2007-09-20 shmuz - - * ChangeLog: [no log message] - -2007-09-20 shmuz - - * test/common_sets.lua: (set_m_exec): one test added - -2007-09-20 shmuz - - * src/algo.h: (generic_tfind): bugfix - -2007-09-20 shmuz - - * src/lpcre_f.c: added a new flag from PCRE-7.3 - -2007-06-18 shmuz - - * NEWS: release 2.2.0 - -2007-06-18 rrt - - * doc/manual.txt: Fix English - -2007-06-12 shmuz - - * doc/index.txt: removed link to Lua lisence - -2007-06-11 shmuz - - * NEWS: [no log message] - -2007-06-10 shmuz - - * ChangeLog, Makefile, NEWS, src/algo.h, windows/dev-cpp/Makefile, - windows/dev-cpp/_devcpp.mak, windows/dev-cpp/rex_pcre.mak, - windows/dev-cpp/rex_spencer.mak: [no log message] - -2007-06-08 shmuz - - * ChangeLog: [no log message] - -2007-06-08 shmuz - - * doc/manual.txt: minor correction - -2007-06-08 shmuz - - * test/pcre_sets.lua: locale tests commented out - -2007-06-08 shmuz - - * src/algo_t.h: the contents moved to file common.h - -2007-06-08 shmuz - - * src/algo.h, src/common.h, src/lpcre.c, src/lposix.c, src/ltre.c, - src/rex_pcre.mak, src/rex_posix.mak, src/rex_tre.mak: updated due to - removal of file algo_t.h - -2007-05-04 shmuz - - * src/rex_pcre.mak, src/rex_posix.mak, src/rex_tre.mak: added - dependency on algo_t.h - -2007-05-03 shmuz - - * NEWS: update - -2007-05-03 shmuz - - * src/lpcre.c: refactoring - -2007-05-03 shmuz - - * doc/manual.txt: small fix - -2007-05-03 shmuz - - * test/pcre_sets.lua: several tests fixed - -2007-05-03 shmuz - - * ChangeLog, doc/manual.txt, src/lpcre.c: settables: removed API - function. - -2007-05-02 shmuz - - * doc/Makefile: add .py extension to work under Windows - -2007-05-02 rrt - - * doc/Makefile, doc/index.html, doc/manual.html: Remove generated - HTML files from CVS, and make Makefile work a bit more widely - compatible. - -2007-05-02 shmuz - - * doc/Makefile: [no log message] - -2007-05-02 shmuz - - * src/algo.h, src/lpcre.c, src/lposix.c, src/ltre.c: refactoring - (adding ALG_ prefix to many macros) - -2007-05-02 rrt - - * ChangeLog: Cosmetic fix to ChangeLog only - -2007-05-02 shmuz - - * src/algo_t.h: make struct definitions visible to the file parts - lying above the line #include algo.h. - -2007-05-02 shmuz - - * test/pcre_sets.lua: tests with PCRE cflags as a string - -2007-05-02 shmuz - - * src/lposix.c, src/ltre.c: refactoring - -2007-05-02 shmuz - - * src/lpcre_f.c: added a new flag from PCRE-7.1. - -2007-05-02 shmuz - - * src/lpcre.c: [API extension]: cflags may be specified by a string. - -2007-05-02 shmuz - - * src/algo.h: move part of the file to algo_t.h - -2007-05-02 shmuz - - * doc/manual.html, doc/manual.txt: describe PCRE cflags as a string - -2007-05-02 shmuz - - * ChangeLog: [no log message] - -2007-04-22 rrt - - * Makefile: "make all" now runs tests; add "make build" just to - build. - -2007-04-21 shmuz - - * ChangeLog: [no log message] - -2007-04-21 shmuz - - * test/luatest.lua: (eq): no more relying on tostring giving different strings for - different tables. - -2007-04-21 rrt - - * src/defaults.mak: I committed my modified settings by mistake; - reinstate the defaults. - -2007-04-21 rrt - - * src/lpcre.c: Avoid compiler warning about differing signs in - pointer targets. - -2007-04-20 rrt - - * src/common.mak, src/rex_pcre.mak, src/rex_posix.mak, - src/rex_tre.mak: Make per-library INC and LIB variables work again. - -2007-04-20 rrt - - * src/common.mak, src/defaults.mak, src/rex_pcre.mak, - src/rex_posix.mak, src/rex_tre.mak: Place all common parts of the - makefiles in defaults.mak (settings, basically the same as old - common.mak) and common.mak (rules). - -2007-04-20 shmuz - - * ChangeLog, src/common.c, src/common.h, src/ltre.c: ltre.c - (get_int_field, set_int_field): moved to common.c. - -2007-04-20 shmuz - - * src/common.c, src/common.h: ltre.c (get_int_field, set_int_field): - moved to common.c. - -2007-04-20 shmuz - - * ChangeLog: [no log message] - -2007-04-20 shmuz - - * ChangeLog: [no log message] - -2007-04-20 shmuz - - * Makefile: a little fix - -2007-04-19 rrt - - * Makefile, src/rex_tre.mak: Add build system support for TRE on - POSIX systems. - -2007-04-19 shmuz - - * ChangeLog: [no log message] - -2007-04-19 shmuz - - * doc/index.html, doc/manual.html, doc/manual.txt, src/algo.h, - src/common.c, src/common.h, src/lpcre.c, src/lposix.c, src/ltre.c, - test/common_sets.lua, test/pcre_sets.lua, test/pcre_sets2.lua, - test/runtest.lua: many changes -- see Changelog - -2007-04-18 rrt - - * src/algo.h, src/lpcre.c, src/lposix.c, src/ltre.c: Fix some - compiler warnings. - -2007-03-19 shmuz - - * src/rex_pcre.mak, src/rex_posix.mak: algo.h: added to - prerequisites - -2007-03-19 shmuz - - * ChangeLog, src/algo.h, src/lpcre.c, src/lposix.c, src/ltre.c: - improved userdata validity check - -2007-03-18 rrt - - * doc/lrexlib.css: Add line to bottom of table too - -2007-03-18 rrt - - * doc/lrexlib.css: Make the table borders more like - publication-quality - -2007-03-17 shmuz - - * src/algo.h, src/ltre.c, test/spencer_sets.lua: many changes: see - ChangeLog - -2007-03-17 shmuz - - * ChangeLog, LICENSE, README, doc/index.txt, doc/license.html, - doc/manual.html, doc/manual.txt, src/common.c, src/common.h, - src/lpcre.c, src/lpcre_f.c, src/lposix.c, src/rex_pcre.mak, - src/rex_posix.mak, src/scite.properties, test/common_sets.lua, - test/pcre_sets.lua, test/pcre_sets2.lua: many changes: see ChangeLog - -2007-02-14 shmuz - - * LICENSE, README, src/rex_pcre.mak, src/rex_posix.mak: version - number updated to 2.1 - -2007-02-13 shmuz - - * doc/index.html, doc/index.txt, doc/license.html: added files for - Lrexlib homepage - -2007-02-13 shmuz - - * NEWS, src/common.c, win32bin/readme.txt: release 2.1.0 - -2007-02-12 shmuz - - * ChangeLog, doc/manual.html, doc/manual.txt, src/common.c, - src/common.h, src/lpcre.c, src/lpcre_f.c, src/lposix.c, - test/pcre_sets.lua, test/posix_sets.lua: API change (error - handling): see ChangeLog - -2007-01-30 shmuz - - * NEWS, win32bin/readme.txt: release 2.0.2 - -2007-01-30 shmuz - - * doc/manual.html, doc/manual.txt: added description of defaults for - compilation and execution flags - -2007-01-29 shmuz - - * src/lposix.c: 2 bugs fixed: see ChangeLog - -2007-01-29 shmuz - - * src/common.h: REX_VERSION updated to "2.0.2" - -2007-01-29 shmuz - - * ChangeLog: [no log message] - -2007-01-27 shmuz - - * ChangeLog: [no log message] - -2007-01-27 shmuz - - * src/lpcre.c, src/lposix.c: gsub: bugfix (luaL_error -> lua_error) - -2007-01-18 shmuz - - * ChangeLog, src/common.c, src/common.h, src/lpcre.c, src/lposix.c: - refactoring - -2007-01-13 shmuz - - * ChangeLog, src/common.c, src/common.h, src/lpcre.c, src/lposix.c: - refactoring - -2007-01-12 shmuz - - * : binaries corresonding to Lrexlib-2.0.1 - -2007-01-12 shmuz - - * src/lpcre.c, src/lposix.c: _VERSION updated to 2.0.1 - -2007-01-12 shmuz - - * src/common.c, src/common.h: A memory deallocation bug fixed. - -2007-01-12 shmuz - - * ChangeLog, NEWS, win32bin/readme.txt: [no log message] - -2007-01-10 shmuz - - * ChangeLog, doc/manual.html, doc/manual.txt: [no log message] - -2007-01-10 shmuz - - * src/lpcre.c, src/lposix.c: refactoring - -2007-01-04 shmuz - - * test/Spencer/runtest.lua, test/Spencer/test.lua, - test/Spencer/tests: Must be of little interest to Lrexlib users - -2007-01-04 rrt - - * ChangeLog: Say what I did today. - -2007-01-04 shmuz - - * NEWS: The date of release 2.0 put in. - -2007-01-04 rrt - - * Makefile: Simplify test target - -2007-01-04 rrt - - * README: Minor cosmetic fixes. - -2007-01-04 rrt - - * test/README: Clarify (oops, we can test more than one library!). - -2007-01-04 rrt - - * Makefile: Add top-level test target. Make targets in this file .PHONY (needed for test, harmless good - practice for the others). - -2007-01-04 rrt - - * test/README: Clarify syntax - -2007-01-04 rrt - - * Makefile: Add some documentation, simplify the all target, and add - a clean target. - -2007-01-04 rrt - - * src/common.mak, src/rex_pcre.mak, src/rex_posix.mak: Factor out - common bits of makefiles into common.mak. Remove -llualib from LIB_LUA suggested non-default values, as this - is gone in 5.1 in a default build. - -2007-01-04 rrt - - * src/.cvsignore: Add .cvsignore pattern for shared libraries - -2007-01-04 shmuz - - * ChangeLog: [no log message] - -2007-01-04 shmuz - - * src/common.c, src/common.h, src/lpcre.c, src/lpcre_f.c, - src/lposix.c, test/Spencer/test.lua, test/common_sets.lua, - test/luatest.lua, test/pat2pcre.lua, test/pcre_sets.lua, - test/pcre_sets2.lua, test/posix_sets.lua, test/runtest.lua: - copyright notices changed to reference the file LICENSE - -2007-01-04 shmuz - - * ChangeLog, test/README: [no log message] - -2007-01-04 shmuz - - * test/runtest.lua: extended the command-line interface - -2007-01-04 shmuz - - * src/lpcre.c: Lpcre_gsub: unnecessary (though harmless) assignment - removed - -2007-01-03 rrt - - * Makefile: Bare-bones top-level makefile. - -2007-01-02 shmuz - - * win32bin/lrexlib/LICENSE, win32bin/pcre/LICENCE, - win32bin/readme.txt, win32bin/rxspencer/COPYRIGHT: Win-32 binaries: - initial commit - -2007-01-02 shmuz - - * doc/SciTE.properties, doc/lrexlib.css, src/common.c, - src/common.h, src/lpcre.c, src/lpcre_f.c, src/lposix.c, - src/rex_pcre.mak, src/rex_posix.mak, src/scite.properties, - test/README, test/Spencer/runtest.lua, test/Spencer/test.lua, - test/common_sets.lua, test/luatest.lua, test/pat2pcre.lua, - test/pcre_sets.lua, test/pcre_sets2.lua, test/posix_sets.lua, - test/runtest.lua, test/scite.properties: lots of changes: see - December-2006 records in ChangeLog - -2007-01-02 shmuz - - * test/pcre_test.lua, test/posix_test.lua, test/scite.properties: - replaced by other files - -2007-01-02 shmuz - - * test/all_test.lua: renamed to runtest.lua - -2007-01-02 shmuz - - * test/framework.lua: renamed to luatest.lua - -2007-01-02 shmuz - - * doc/manual.html, doc/manual.txt: Lrexlib Reference Manual - -2007-01-02 shmuz - - * doc/readme.rst, doc/rex_pcre.rst, doc/rex_posix.rst: files - replaced by the Reference Manual - -2007-01-02 shmuz - - * ChangeLog, LICENSE, NEWS, README, windows/dev-cpp/rex_pcre.mak, - windows/dev-cpp/rex_spencer.mak: [no log message] - -2007-01-02 shmuz - - * windows/dev-cpp/rex_pcre.dev, windows/dev-cpp/rex_pcre_nr.dev, - windows/dev-cpp/rex_posix1.dev: *.dev files removed - makefiles will - be used instead - -2007-01-02 shmuz - - * windows/bcc32/config.mak, windows/bcc32/make_bcc.mak, - windows/bcc32/makedef.lua, windows/bcc32/readme.txt: files removed - since Borland C++ 5.5.1 does not support "long long" - -2007-01-02 shmuz - - * lua/SciTE.properties, lua/generic_gsub.lua, lua/gsub_test.lua, - lua/pat2pcre.lua, lua/rex.html, lua/rex.lua: files removed since - everything is written in C now - -2006-12-02 shmuz - - * lua/rex_.lua: unnecessary duplication of rex.lua - -2006-12-02 shmuz - - * src/lpcre.c: TExecData renamed to TCallout. LpcreSetExecData - renamed to SetupCallout. - -2006-12-02 shmuz - - * ChangeLog: [no log message] - -2006-11-29 shmuz - - * ChangeLog: [no log message] - -2006-11-29 shmuz - - * lua/generic_gsub.lua, lua/rex.lua, src/lpcre.c, src/lposix.c, - test/Spencer/test.lua, test/all_test.lua, test/pcre_test.lua, - test/posix_test.lua: Method renamed: oldmatch to tfind. Method - renamed: oldgmatch to tgfind. - -2006-11-29 shmuz - - * src/lpcre.c, src/lposix.c: refactoring - -2006-11-29 shmuz - - * ChangeLog: [no log message] - -2006-11-29 shmuz - - * test/framework.lua, test/pcre_test.lua, test/posix_test.lua: - refactoring - -2006-11-29 shmuz - - * src/lpcre.c: Lpcre_dfa_exec: one Lmalloc call instead of two. - -2006-11-29 shmuz - - * ChangeLog: [no log message] - -2006-11-27 shmuz - - * test/all_test.lua, test/framework.lua, test/pcre_test.lua, - test/posix_test.lua: every test returns number of failures - -2006-11-27 shmuz - - * src/common.c: plainfind_func: rewritten to not use memicmp - -2006-11-27 shmuz - - * ChangeLog: [no log message] - -2006-11-26 shmuz - - * ChangeLog: correction - -2006-11-26 shmuz - - * src/lpcre.c: 1. functions Check_arg_ renamed to Checkarg_ 2. added 2 arguments to dfa_exec method - -2006-11-26 shmuz - - * src/lposix.c: functions Check_arg_ renamed to Checkarg_ - -2006-11-26 shmuz - - * test/pcre_test.lua: added tests for dfa_exec method - -2006-11-26 shmuz - - * test/framework.lua: cosmetics - -2006-11-26 shmuz - - * src/common.h: macro DIM removed - -2006-11-26 shmuz - - * ChangeLog: [no log message] - -2006-11-25 shmuz - - * src/rex_posix.mak: version changed to 2.0 - -2006-11-25 shmuz - - * src/rex_pcre.mak: 1. added a new source file 2. version changed to 2.0 - -2006-11-25 shmuz - - * src/lpcre.c: function Lpcre_get_flags moved to lpcre_f.c - -2006-11-25 shmuz - - * ChangeLog: [no log message] - -2006-11-25 shmuz - - * windows/bcc32/make_bcc.mak, windows/dev-cpp/rex_pcre.dev, - windows/dev-cpp/rex_pcre_nr.dev: updated due to new file lpcre_f.c - -2006-11-25 shmuz - - * src/lpcre_f.c: function Lpcre_get_flags moved to a separate file - -2006-11-25 shmuz - - * test/all_test.lua: test all libraries in batch - -2006-11-25 shmuz - - * test/pcre_test.lua, test/posix_test.lua: tests added; files made - modules - -2006-11-25 shmuz - - * src/lpcre.c, src/lposix.c: alpha -> beta - -2006-11-25 shmuz - - * lua/generic_gsub.lua, test/framework.lua: refactoring - -2006-11-25 shmuz - - * ChangeLog: [no log message] - -2006-11-23 shmuz - - * test/framework.lua: cosmetic fix - -2006-11-23 shmuz - - * ChangeLog: [no log message] - -2006-11-23 shmuz - - * lua/rex.lua, lua/rex_.lua: gsub: 6th and 7th arguments swapped - -2006-11-23 shmuz - - * ChangeLog: [no log message] - -2006-11-23 shmuz - - * test/framework.lua, test/pcre_test.lua, test/posix_test.lua: - refactoring - -2006-11-22 shmuz - - * test/posix_test.lua: tests for POSIX rexlibs binding - -2006-11-22 shmuz - - * test/pcre_test.lua: Corrections due to changes in API - -2006-11-22 shmuz - - * src/lposix.c: Two bugs fixed - -2006-11-22 shmuz - - * src/lpcre.c: 1. Check_arg_findmatch_func: 5th and 6th arguments swapped. 2. Check_arg_gmatch_func: 4th and 5th arguments swapped. - -2006-11-22 shmuz - - * ChangeLog: [no log message] - -2006-11-21 shmuz - - * test/pcre_test.lua: test added: named subpatterns - -2006-11-20 shmuz - - * ChangeLog: updated - -2006-11-20 shmuz - - * test/test1.lua: replaced by other files - -2006-11-20 shmuz - - * test/framework.lua.tortoise.removed, - test/pcre_test.lua.tortoise.removed, - test/scite.properties.tortoise.removed, - test/test1.lua.tortoise.removed: these files shouldn't be here! - -2006-11-20 shmuz - - * test/framework.lua.tortoise.removed, - test/pcre_test.lua.tortoise.removed, - test/scite.properties.tortoise.removed, - test/test1.lua.tortoise.removed: removed by my fault - -2006-11-20 shmuz - - * src/lpcre.c: reordering methods and functions - -2006-11-20 shmuz - - * test/scite.properties: fighting Windows line endings - -2006-11-20 shmuz - - * test/pcre_test.lua: tests for PCRE binding - -2006-11-20 shmuz - - * test/framework.lua: framework for testing Lrexlib functions and - methods - -2006-11-20 shmuz - - * windows/dev-cpp/rex_pcre.dev, windows/dev-cpp/rex_pcre_nr.dev, - windows/dev-cpp/rex_posix1.dev: set linker option "strip executable" - -2006-11-20 shmuz - - * src/common.c, src/common.h, src/lpcre.c, src/lposix.c: - rex.plainfind (Lua-side) - function added - -2006-11-20 shmuz - - * ChangeLog: updated - -2006-11-19 shmuz - - * src/lpcre.c: callout: further improvement - -2006-11-19 shmuz - - * src/lpcre.c: 1. Lpcre_config: new function (pcre.config from Lua side). 2. Callout handling improved. - -2006-11-19 shmuz - - * src/lposix.c: typo fixed - -2006-11-19 shmuz - - * ChangeLog: updated - -2006-11-18 shmuz - - * src/lpcre.c, src/lposix.c, windows/bcc32/config.mak, - windows/bcc32/makedef.lua, windows/bcc32/readme.txt: line endings - fixed - -2006-11-18 shmuz - - * test/Spencer/test.lua: corrected names of functions and methods - changed in Lrexlib - -2006-11-18 shmuz - - * windows/bcc32/make_bcc.mak: deleted -DCOMPAT51, added -D$(CMDLINE) - -2006-11-18 shmuz - - * test/test1.lua: main test suite for lrexlib functions and methods - -2006-11-18 shmuz - - * lua/rex_.lua: same as rex.lua but uses reg:find instead of - reg:oldmatch - -2006-11-18 shmuz - - * lua/pat2pcre.lua: new module; was part of gsub_test.lua - -2006-11-18 shmuz - - * src/common.c, src/common.h: common functions moved here - -2006-11-18 shmuz - - * src/lpcre.c, src/lposix.c: old 'gmatch' method put back; renamed - into 'oldgmatch' - -2006-11-18 shmuz - - * lua/gsub_test.lua: PatternLua2Pcre: function moved to a separate - file - -2006-11-18 shmuz - - * lua/generic_gsub.lua: split_rep_string: function simplified - -2006-11-18 shmuz - - * ChangeLog: updated - -2006-11-15 shmuz - - * src/lpcre.c, src/lposix.c: 1. match method renamed into oldmatch 2. added lua-string-compatible find, match and gmatch - -2006-11-15 shmuz - - * lua/rex.lua: 1. deleted everything except rex.gsub 2. rex.oldmatch is used instead of rex.match - -2006-11-15 shmuz - - * lua/generic_gsub.lua: rex.oldmatch is used instead of rex.match - -2006-11-15 shmuz - - * ChangeLog: updated - -2006-11-13 shmuz - - * windows/dev-cpp/rex_pcre.dev, windows/dev-cpp/rex_pcre_nr.dev, - windows/dev-cpp/rex_posix1.dev: corrected relative paths to source - directory - -2006-11-13 shmuz - - * src/scite.properties: pcre directory corrected: 6.4 to 6.7 - -2006-11-13 shmuz - - * src/lpcre.c, src/lposix.c: gmatch function and metamethod were - added - -2006-11-13 shmuz - - * lua/rex.lua: gmatch function and metamethod were deleted - -2006-11-13 shmuz - - * ChangeLog: updated - -2006-11-12 shmuz - - * lua/rex.lua: gmatch metamethod added - -2006-11-12 shmuz - - * test/empty.txt: this file is not needed - -2006-11-12 shmuz - - * doc/readme.html, doc/rex_pcre.html, doc/rex_posix.html: - auto-generated files shouldn't be under version control - -2006-11-12 shmuz - - * ChangeLog: [no log message] - -2006-11-09 shmuz - - * lua/bit.lua, lua/bit_test.lua: bitlib will be used - -2006-11-08 rrt - - * lua/bit_test.lua, lua/testbit.lua: Rename testbit.lua to - bit_test.lua for consistency - -2006-11-08 shmuz - - * lua/bit.lua, lua/generic_gsub.lua, lua/gsub_test.lua, - lua/rex.lua, lua/testbit.lua: my first commit - -2006-11-06 rrt - - * lua/rex.lua: Explain bitwise OR requirement - -2006-11-06 rrt - - * lua/rex.html: Explain bit.lua - -2006-11-06 rrt - - * README: Improve bug reporting sentence - -2006-11-05 rrt - - * ChangeLog: Changes from Shmuel - -2006-11-05 rrt - - * lua/bit.lua: Add bit.lua for pure Lua bit.bor (Shmuel) - -2006-11-05 rrt - - * lua/rex.lua: Improve error message - -2006-11-05 rrt - - * lua/generic_gsub.lua, lua/gsub.lua, lua/gsub_test.lua, - lua/rex.lua: Rename gsub.lua to generic_gsub.lua and make a module - (Shmuel) - -2006-11-05 rrt - - * lua/new_gsub.lua: Removed by Shmuel - -2006-11-05 rrt - - * lua/rex.html, lua/rex.lua: Update documentation, with a little - more tidying. Cosmetic improvements to comments in rex.lua. - -2006-11-05 rrt - - * lua/rex.lua, src/lpcre.c, src/lposix.c: Remove C gmatch functions, - replacing them with an iterator written in Lua. Make function calls in rex.lua all have a space between the function - name and the open parenthesis. - -2006-11-04 rrt - - * lua/find.lua: find now identical with rex.lua - -2006-11-04 rrt - - * ChangeLog, lua/find.lua, lua/gsub.lua, lua/gsub_test.lua, - lua/new_gsub.lua, lua/rex.lua: Bug-fixes from Shmuel. - -2006-11-03 rrt - - * lua/rex.lua: Tidy up slightly as per comments from Shmuel. - -2006-11-03 rrt - - * lua/rex.html: Tidy up the HTML manually a bit (thanks Shmuel for - the notes). - -2006-11-03 rrt - - * lua/find.lua, lua/gsub.lua, lua/gsub_test.lua, lua/new_gsub.lua: - Re-add Shmuel's Lua files for integration. - -2006-11-03 rrt - - * windows/dev-cpp/rex_pcre.dev, windows/dev-cpp/rex_pcre_nr.dev, - windows/dev-cpp/rex_posix1.dev: Re-add 5.1 project files, no longer - in lua-5.1 subdir. - -2006-11-03 rrt - - * test/Spencer/runtest.lua, test/Spencer/test.lua, - test/Spencer/tests: Add Spencer tests - -2006-11-03 rrt - - * windows/dev-cpp/lua-5.1/rex_pcre.dev, - windows/dev-cpp/lua-5.1/rex_pcre_nr.dev, - windows/dev-cpp/lua-5.1/rex_posix1.dev: Remove lua-5.1 directory; we - only support 5.1 now - -2006-11-03 rrt - - * windows/dev-cpp/lua-5.0/rex_pcre.dev, - windows/dev-cpp/lua-5.0/rex_pcre_nr.dev, - windows/dev-cpp/lua-5.0/rex_posix1.dev: Remove Lua 5.0 support - -2006-11-03 rrt - - * ChangeLog, README, doc/SciTE.properties, doc/readme.html, - doc/readme.rst, src/common.c, src/common.h, src/lpcre.c, - src/lposix.c, src/rex_pcre.mak, src/rex_posix.mak, - src/scite.properties, windows/bcc32/config.mak, - windows/bcc32/make_bcc.mak, windows/bcc32/readme.txt: Merge changes - from Shmuel - -2006-11-03 niklas - - * README: 1.20 will support only 5.1, not 5.x. Mention the rex Lua module. - -2006-11-03 rrt - - * lua/5.1/SciTE.properties, lua/5.1/gsub.lua, - lua/5.1/gsub_test.lua, lua/5.1/new_gsub.lua, lua/SciTE.properties, - lua/rex.html, lua/rex.lua: We're only supporting 5.1 now, so remove - the 5.1 directory. Replace extant Lua code with version from stdlib; add generated HTML - docs (checked in because the ldoc script isn't (yet?) in lrexlib). - -2006-11-03 rrt - - * lua/5.0/SciTE.properties, lua/5.0/gsub.lua, - lua/5.0/gsub_test.lua, lua/5.0/new_gsub.lua: Remove Lua 5.0 support - -2006-09-24 rrt - - * README: Remove example code, which is now available in the - distribution in much more functional form. Bump version to 1.20, and update copyright dates. Change "5.0" to "5.x". - -2006-04-04 rrt - - * src/common.c, src/common.h, src/lpcre.c, src/lposix.c: Add - copyright to common.h. Change #includes of Lua headers to "" rather than <> to cope better - with the (common?) case of being used in a Lua source tree. - -2006-04-04 rrt - - * src/common.c, src/lpcre.c, src/lposix.c: Tidy up copyright lines - (indeed, use the word "copyright"!). Improve a comment in common.c - -2006-04-01 rrt - - * ChangeLog: Note today's commits. - -2006-04-01 rrt - - * ChangeLog: Tiny bit more formatting! - -2006-04-01 rrt - - * ChangeLog: More reformatting. - -2006-04-01 rrt - - * ChangeLog: Reformatted using Emacs Change Log mode. - -2006-04-01 rrt - - * src/lpcre.c: Remove unnecessary limit variable from Lpcre_gmatch; - remove trailing whitespace. - -2006-04-01 rrt - - * src/common.c, src/lposix.c: Remove trailing whitespace - -2006-03-20 rrt - - * lua/5.0/SciTE.properties, lua/5.0/gsub.lua, - lua/5.0/gsub_test.lua, lua/5.0/new_gsub.lua, - lua/5.1/SciTE.properties, lua/5.1/gsub.lua, lua/5.1/gsub_test.lua, - lua/5.1/new_gsub.lua, lua/gsub-5.0.lua, lua/gsub-5.1.lua: New - version from Shmuel - -2006-01-21 rrt - - * README, doc/lrexlib.css, doc/readme.rst, doc/rex_pcre.rst, - doc/rex_posix.rst, lua/gsub-5.0.lua, lua/gsub-5.1.lua, - src/common.c, src/common.h, src/lpcre.c, src/lposix.c, - src/scite.properties: Change non-Windows text files to Unix line - endings - -2006-01-21 rrt - - * Initial revision - diff -Nru lua-rexlib-2.6.0/LICENSE lua-rexlib-2.7.2/LICENSE --- lua-rexlib-2.6.0/LICENSE 2012-04-12 17:24:49.000000000 +0000 +++ lua-rexlib-2.7.2/LICENSE 2013-01-08 19:41:59.000000000 +0000 @@ -1,5 +1,5 @@ -License of Lrexlib release 2.6 ------------------------------- +License of Lrexlib release +-------------------------- Copyright (C) Reuben Thomas 2000-2012 Copyright (C) Shmuel Zeigerman 2004-2012 diff -Nru lua-rexlib-2.6.0/Makefile lua-rexlib-2.7.2/Makefile --- lua-rexlib-2.6.0/Makefile 2011-02-07 15:52:07.000000000 +0000 +++ lua-rexlib-2.7.2/Makefile 2013-01-08 19:41:59.000000000 +0000 @@ -1,41 +1,54 @@ # Makefile for lrexlib -# See src/*/Makefile and src/defaults.mak for user-definable settings - -include src/defaults.mak - -REGNAMES = gnu pcre posix oniguruma tre +VERSION = 2.7.2 PROJECT = lrexlib -VERSION = $(V).$(MINORV) PROJECT_VERSIONED = $(PROJECT)-$(VERSION) -DISTFILE = $(PROJECT_VERSIONED).zip -all: - @for i in $(REGNAMES); do \ - make -C src/$$i; \ - done - @make -C doc +# Commands +LUA = lua +LUAROCKS = luarocks +CP = cp -a +RM = rm +RST2HTML = rst2html +REGNAMES = gnu pcre posix oniguruma tre +LUAROCKS_COMMAND = make + -check: all - @for i in $(REGNAMES); do \ - make -C src/$$i check; \ +.SUFFIXES: .txt .html + +HTML = doc/index.html doc/manual.html + +.txt.html: + $(RST2HTML) --stylesheet-path=doc/lrexlib.css --link-stylesheet --initial-header-level=2 --date --time $< $@ + +build: + $(MAKE) install LUAROCKS="$(LUAROCKS) --tree=luarocks" + +install: rockspecs + for i in *.rockspec; do \ + $(LUAROCKS) $(LUAROCKS_COMMAND) $$i; \ done -clean: - @for i in $(REGNAMES); do \ - make -C src/$$i clean; \ +rockspecs: + rm -f *.rockspec + $(LUA) mkrockspecs.lua $(VERSION) + +doc/index.txt: README.rst + $(CP) $< $@ + +check: build + for i in $(REGNAMES); do \ + LUA_PATH="test/?.lua;$(LUA_PATH)" $(LUA) test/runtest.lua -dsrc/$$i $$i; \ done - @make -C doc clean -dist: all - git2cl > ChangeLog - cd .. && rm -f $(DISTFILE) && zip $(DISTFILE) -r $(PROJECT) -x "lrexlib/.git/*" "*.gitignore" "*.o" "*.a" "*.so" "*.so.*" "*.zip" "*SciTE.properties" "*scite.properties" && mv $(DISTFILE) $(PROJECT) && cd $(PROJECT) && unzip $(DISTFILE) && mv $(PROJECT) $(PROJECT_VERSIONED) && rm -f $(DISTFILE) && zip $(DISTFILE) -r $(PROJECT_VERSIONED) && rm -rf $(PROJECT_VERSIONED) +clean: + $(RM) $(HTML) doc/index.txt *.rockspec -release: +release: check agrep -d 'Release' $(VERSION) NEWS | tail -n +3 | head -n -2 > release-notes && \ git diff --exit-code && \ git tag -a -m "Release tag" rel-`echo $(VERSION) | sed -e 's/\./-/g'` && \ - git push && \ - woger lua-l $(PROJECT) "$(PROJECT)" $(VERSION) "Lua binding for regex libraries" release-notes - @cat release-notes && echo "Don't forget to release on LuaForge!" + git push && git push --tags && \ + $(MAKE) build LUAROCKS_COMMAND=build && \ + woger lua package=$(PROJECT) package_name=$(PROJECT) version=$(VERSION) description="Lua binding for regex libraries" notes=release-notes home="https://github.com/rrthomas/$(PROJECT)" rm -f release-notes diff -Nru lua-rexlib-2.6.0/NEWS lua-rexlib-2.7.2/NEWS --- lua-rexlib-2.6.0/NEWS 2012-04-12 17:24:49.000000000 +0000 +++ lua-rexlib-2.7.2/NEWS 2013-01-08 19:41:59.000000000 +0000 @@ -1,3 +1,29 @@ +2013-01-08 Release 2.7.2 + + * Fixed the use of alternative allocators, and a memory leak. + * Simplify the build system further. + * Change rockspec to build from git now that github no longer + supports downloads. + +2012-10-18 Release 2.7.1 + + * Fixed Lua 5.1 compatibility, broken in 2.7.0. + * Added ability to specify no replacement to gsub with a nil or + false replacement argument. + +2012-10-04 Release 2.7.0 + + * Added support for searching raw memory buffers (e.g. made with + alien). + * Fixed possible invalid code generation in C (thanks, Michael + Tautschnig). + * Generate LuaRock rockspecs for all modules. + * Greatly simplify UNIX build system, relying on LuaRocks. + * Allow POSIX REG_STARTEND to be used on any system supporting it. + * Add a test set for POSIX regex engine (thanks, Enrico Tassi). + * Simplify some code. + * Always use Lua state memory allocator. + 2012-04-13 Release 2.6.0 * Added support for Lua 5.2. diff -Nru lua-rexlib-2.6.0/README.rst lua-rexlib-2.7.2/README.rst --- lua-rexlib-2.6.0/README.rst 2012-04-12 17:24:49.000000000 +0000 +++ lua-rexlib-2.7.2/README.rst 2013-01-08 19:41:59.000000000 +0000 @@ -1,8 +1,8 @@ -Lrexlib 2.6 -=========== +Lrexlib +======= | by Reuben Thomas (rrt@sc3d.org) -| and Shmuel Zeigerman (shmuz@013net.net) [maintainer] +| and Shmuel Zeigerman (shmuz@013net.net) **Lrexlib** provides bindings of five regular expression library APIs (POSIX_, PCRE_, GNU_, TRE_ and Oniguruma_) to Lua_ 5.1 and Lua 5.2. @@ -29,6 +29,18 @@ ----------------------------------------------------------- +Installation +------------ + +Lrexlib is installed with LuaRocks_, using the command:: + + luarocks install lrexlib-FLAVOUR + +where **FLAVOUR** is one of PCRE, POSIX, oniguruma, TRE, GNU + +.. _LuaRocks: http://www.luarocks.org + + Links ----- diff -Nru lua-rexlib-2.6.0/debian/changelog lua-rexlib-2.7.2/debian/changelog --- lua-rexlib-2.6.0/debian/changelog 2012-04-30 15:23:46.000000000 +0000 +++ lua-rexlib-2.7.2/debian/changelog 2013-08-16 22:43:30.000000000 +0000 @@ -1,3 +1,18 @@ +lua-rexlib (2.7.2-2) unstable; urgency=low + + * Add copyright notice about doc/*.css (thanks "a new ftptrainee") + + -- Enrico Tassi Sat, 17 Aug 2013 00:38:18 +0200 + +lua-rexlib (2.7.2-1) unstable; urgency=low + + * New upstream release + * Packaging moved to git + * Removed transitional packages + * New package for GNU variant of regexp + + -- Enrico Tassi Mon, 30 Apr 2012 17:26:22 +0200 + lua-rexlib (2.6.0-2) unstable; urgency=low * Cleaned up debian/rules diff -Nru lua-rexlib-2.6.0/debian/control lua-rexlib-2.7.2/debian/control --- lua-rexlib-2.6.0/debian/control 2012-04-18 15:41:48.000000000 +0000 +++ lua-rexlib-2.7.2/debian/control 2013-08-16 22:43:30.000000000 +0000 @@ -4,18 +4,16 @@ Maintainer: Enrico Tassi Build-Depends: debhelper (>= 9), libpcre3-dev, libonig-dev, libtre-dev, dh-lua (>= 12) Standards-Version: 3.9.3 -Vcs-Svn: svn://svn.debian.org/pkg-lua/packages/lua-rexlib -Vcs-Browser: http://svn.debian.org/viewsvn/pkg-lua/packages/lua-rexlib Homepage: http://lrexlib.luaforge.net/ +Vcs-Git: git://git.debian.org/git/pkg-lua/lua-rexlib.git +Vcs-Browser: http://git.debian.org/?p=pkg-lua/lua-rexlib.git Package: lua-rex-pcre Architecture: any Multi-Arch: same Pre-Depends: multiarch-support Depends: ${shlibs:Depends}, ${misc:Depends} -Replaces: liblua5.1-rex-pcre0 (<< 2.6.0-1~) -Breaks: liblua5.1-rex-pcre0 (<< 2.6.0-1~) -Provides: liblua5.1-rex-pcre0, ${lua:Provides} +Provides: ${lua:Provides} XB-Lua-Versions: ${lua:Versions} Description: Perl regular expressions library for the Lua language This package provides bindings for Perl regular expressions to the Lua @@ -27,9 +25,7 @@ Multi-Arch: same Pre-Depends: multiarch-support Depends: lua-rex-pcre (= ${binary:Version}), ${misc:Depends} -Replaces: liblua5.1-rex-pcre-dev (<< 2.6.0-1~) -Breaks: liblua5.1-rex-pcre-dev (<< 2.6.0-1~) -Provides: liblua5.1-rex-pcre-dev, ${lua:Provides} +Provides: ${lua:Provides} XB-Lua-Versions: ${lua:Versions} Description: PCRE development files for the Lua language This package contains the development files of the PCRE lrexlib Lua @@ -41,9 +37,7 @@ Multi-Arch: same Pre-Depends: multiarch-support Depends: ${shlibs:Depends}, ${misc:Depends} -Replaces: liblua5.1-rex-posix0 (<< 2.6.0-1~) -Breaks: liblua5.1-rex-posix0 (<< 2.6.0-1~) -Provides: liblua5.1-rex-posix0, ${lua:Provides} +Provides: ${lua:Provides} XB-Lua-Versions: ${lua:Versions} Description: POSIX regular expressions library for the Lua language This package provides bindings for POSIX regular expressions to the Lua @@ -55,9 +49,7 @@ Multi-Arch: same Pre-Depends: multiarch-support Depends: lua-rex-posix (= ${binary:Version}), ${misc:Depends} -Replaces: liblua5.1-rex-posix-dev (<< 2.6.0-1~) -Breaks: liblua5.1-rex-posix-dev (<< 2.6.0-1~) -Provides: liblua5.1-rex-posix-dev, ${lua:Provides} +Provides: ${lua:Provides} XB-Lua-Versions: ${lua:Versions} Description: POSIX regex development files for the Lua language This package contains the development files of the POSIX lrexlib Lua @@ -69,9 +61,7 @@ Multi-Arch: same Pre-Depends: multiarch-support Depends: ${shlibs:Depends}, ${misc:Depends} -Replaces: liblua5.1-rex-onig0 (<< 2.6.0-1~) -Breaks: liblua5.1-rex-onig0 (<< 2.6.0-1~) -Provides: liblua5.1-rex-onig0, ${lua:Provides} +Provides: ${lua:Provides} XB-Lua-Versions: ${lua:Versions} Description: Onig regular expressions library for the Lua language This package provides bindings for Oniguruma regular expressions to the Lua @@ -83,9 +73,7 @@ Multi-Arch: same Pre-Depends: multiarch-support Depends: lua-rex-onig (= ${binary:Version}), ${misc:Depends} -Replaces: liblua5.1-rex-onig-dev (<< 2.6.0-1~) -Breaks: liblua5.1-rex-onig-dev (<< 2.6.0-1~) -Provides: liblua5.1-rex-onig-dev, ${lua:Provides} +Provides: ${lua:Provides} XB-Lua-Versions: ${lua:Versions} Description: Onig regex development files for the Lua language This package contains the development files of the Onig lrexlib Lua @@ -116,6 +104,30 @@ bindings, useful to create a statically linked binary (like a C application or a standalone Lua interpreter). +Package: lua-rex-gnu +Architecture: any +Multi-Arch: same +Pre-Depends: multiarch-support +Depends: ${shlibs:Depends}, ${misc:Depends} +Provides: ${lua:Provides} +XB-Lua-Versions: ${lua:Versions} +Description: GNU regular expressions library for the Lua language + This package provides bindings for GNU regular expressions to the Lua + language. + +Package: lua-rex-gnu-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Pre-Depends: multiarch-support +Depends: lua-rex-gnu (= ${binary:Version}), ${misc:Depends} +Provides: ${lua:Provides} +XB-Lua-Versions: ${lua:Versions} +Description: GNU development files for the Lua language + This package contains the development files of the GNU lrexlib Lua + bindings, useful to create a statically linked binary (like a C application or + a standalone Lua interpreter). + Package: lua-rex-doc Architecture: all Section: doc @@ -123,58 +135,3 @@ Description: documentation of the rex library for the Lua language Documentation of all lua-rex-* modules is shipped in this package. - -Package: liblua5.1-rex-pcre0 -Section: oldlibs -Priority: extra -Architecture: all -Depends: ${misc:Depends}, lua-rex-pcre -Description: Transitional package for lua-rex-pcre - This is a transitional package to ease upgrades to the lua-rex-pcre - package. It can safely be removed. - -Package: liblua5.1-rex-pcre-dev -Section: oldlibs -Priority: extra -Architecture: all -Depends: ${misc:Depends}, lua-rex-pcre-dev -Description: Transitional package for lua-rex-pcre-dev - This is a transitional package to ease upgrades to the lua-rex-pcre-dev - package. It can safely be removed. - -Package: liblua5.1-rex-posix0 -Section: oldlibs -Priority: extra -Architecture: all -Depends: ${misc:Depends}, lua-rex-posix -Description: Transitional package for lua-rex-posix - This is a transitional package to ease upgrades to the lua-rex-posix - package. It can safely be removed. - -Package: liblua5.1-rex-posix-dev -Section: oldlibs -Priority: extra -Architecture: all -Depends: ${misc:Depends}, lua-rex-posix-dev -Description: Transitional package for lua-rex-posix-dev - This is a transitional package to ease upgrades to the lua-rex-posix-dev - package. It can safely be removed. - -Package: liblua5.1-rex-onig-dev -Section: oldlibs -Priority: extra -Architecture: all -Depends: ${misc:Depends}, lua-rex-onig-dev -Description: Transitional package for lua-rex-onig-dev - This is a transitional package to ease upgrades to the lua-rex-onig-dev - package. It can safely be removed. - -Package: liblua5.1-rex-onig0 -Section: oldlibs -Priority: extra -Architecture: all -Depends: ${misc:Depends}, lua-rex-onig -Description: Transitional package for lua-rex-onig - This is a transitional package to ease upgrades to the lua-rex-onig - package. It can safely be removed. - diff -Nru lua-rexlib-2.6.0/debian/copyright lua-rexlib-2.7.2/debian/copyright --- lua-rexlib-2.6.0/debian/copyright 2012-04-16 15:03:39.000000000 +0000 +++ lua-rexlib-2.7.2/debian/copyright 2013-08-16 22:43:30.000000000 +0000 @@ -4,11 +4,14 @@ Source: https://github.com/rrthomas/lrexlib/ Files: * -Copyright: 2000-2012, Reuben Thomas -Copyright: 2004-2012, Shmuel Zeigerman -License: MIT/X - -License: MIT/X +Copyright: + 2000-2012, Reuben Thomas + 2004-2012, Shmuel Zeigerman +Comment: In the Lua community this license is better known as "MIT". + Unfortunately other variants of this license are also known as "MIT". + To obtain a machine intepretable copyright file Debian prefers to name this + version of the MIT license using the non ambiguous term "Expat". +License: Expat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the @@ -31,3 +34,12 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +Files: doc/html4css1.css +Copyright: David Goodger +License: public-domain + This stylesheet has been placed in the public domain. + +Files: doc/lrexlib.css +Copyright: Shmuel Zeigerman +License: public-domain + This stylesheet has been placed in the public domain. diff -Nru lua-rexlib-2.6.0/debian/lua5.1.gnu.dh-lua.conf lua-rexlib-2.7.2/debian/lua5.1.gnu.dh-lua.conf --- lua-rexlib-2.6.0/debian/lua5.1.gnu.dh-lua.conf 1970-01-01 00:00:00.000000000 +0000 +++ lua-rexlib-2.7.2/debian/lua5.1.gnu.dh-lua.conf 2013-08-16 22:43:30.000000000 +0000 @@ -0,0 +1,4 @@ +PKG_NAME=rex.gnu +CLIB_OBJS=src/common.lo src/gnu/lgnu.lo +LUA_MODNAME=rex_gnu +LUA_TEST=cd test/ && @@LUA@@ runtest.lua -v gnu diff -Nru lua-rexlib-2.6.0/debian/lua5.1.onig.dh-lua.conf lua-rexlib-2.7.2/debian/lua5.1.onig.dh-lua.conf --- lua-rexlib-2.6.0/debian/lua5.1.onig.dh-lua.conf 2012-04-18 15:46:08.000000000 +0000 +++ lua-rexlib-2.7.2/debian/lua5.1.onig.dh-lua.conf 2013-08-16 22:43:30.000000000 +0000 @@ -7,7 +7,7 @@ LUA_HEADER= LUA_SOURCES= LUA_MODNAME=rex_onig -LUA_TEST=cd test/ && @@LUA@@ runtest.lua -v onig +LUA_TEST=cd test/ && @@LUA@@ runtest.lua -v oniguruma PKG_VERSION=$(shell dpkg-parsechangelog|grep ^Ver|cut -d ' ' -f 2|cut -d '-' -f 1) PKG_LIBS_PRIVATE= diff -Nru lua-rexlib-2.6.0/debian/lua5.2.gnu.dh-lua.conf lua-rexlib-2.7.2/debian/lua5.2.gnu.dh-lua.conf --- lua-rexlib-2.6.0/debian/lua5.2.gnu.dh-lua.conf 1970-01-01 00:00:00.000000000 +0000 +++ lua-rexlib-2.7.2/debian/lua5.2.gnu.dh-lua.conf 2013-08-16 22:43:30.000000000 +0000 @@ -0,0 +1,4 @@ +PKG_NAME=rex.gnu +CLIB_OBJS=src/common.lo src/gnu/lgnu.lo +LUA_MODNAME=rex_gnu +LUA_TEST=cd test/ && @@LUA@@ runtest.lua -v gnu diff -Nru lua-rexlib-2.6.0/debian/lua5.2.onig.dh-lua.conf lua-rexlib-2.7.2/debian/lua5.2.onig.dh-lua.conf --- lua-rexlib-2.6.0/debian/lua5.2.onig.dh-lua.conf 2012-04-18 15:46:08.000000000 +0000 +++ lua-rexlib-2.7.2/debian/lua5.2.onig.dh-lua.conf 2013-08-16 22:43:30.000000000 +0000 @@ -7,7 +7,7 @@ LUA_HEADER= LUA_SOURCES= LUA_MODNAME=rex_onig -LUA_TEST=cd test/ && @@LUA@@ runtest.lua -v onig +LUA_TEST=cd test/ && @@LUA@@ runtest.lua -v oniguruma PKG_VERSION=$(shell dpkg-parsechangelog|grep ^Ver|cut -d ' ' -f 2|cut -d '-' -f 1) PKG_LIBS_PRIVATE= diff -Nru lua-rexlib-2.6.0/debian/patches/series lua-rexlib-2.7.2/debian/patches/series --- lua-rexlib-2.6.0/debian/patches/series 2012-04-16 15:00:59.000000000 +0000 +++ lua-rexlib-2.7.2/debian/patches/series 2013-08-16 22:43:30.000000000 +0000 @@ -1 +0,0 @@ -test.patch diff -Nru lua-rexlib-2.6.0/debian/patches/test.patch lua-rexlib-2.7.2/debian/patches/test.patch --- lua-rexlib-2.6.0/debian/patches/test.patch 2012-04-16 15:01:55.000000000 +0000 +++ lua-rexlib-2.7.2/debian/patches/test.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -Index: lua-rexlib-2.6.0/test/runtest.lua -=================================================================== ---- lua-rexlib-2.6.0.orig/test/runtest.lua 2012-04-12 19:24:49.000000000 +0200 -+++ lua-rexlib-2.6.0/test/runtest.lua 2012-04-16 17:01:43.000000000 +0200 -@@ -37,6 +37,7 @@ - end - - local avail_tests = { -+ posix = { lib = "rex_posix", "common_sets", "posix_sets" }, - gnu = { lib = "rex_gnu", "common_sets", "emacs_sets", "gnu_sets" }, - onig = { lib = "rex_onig", "common_sets", "onig_sets", }, - pcre = { lib = "rex_pcre", "common_sets", "pcre_sets", "pcre_sets2", }, diff -Nru lua-rexlib-2.6.0/debian/rules lua-rexlib-2.7.2/debian/rules --- lua-rexlib-2.6.0/debian/rules 2012-04-18 15:41:33.000000000 +0000 +++ lua-rexlib-2.7.2/debian/rules 2013-08-16 22:43:30.000000000 +0000 @@ -1,4 +1,9 @@ #!/usr/bin/make -f +VERSION=$(shell grep "^VERSION *=" Makefile | cut -d = -f 2 | sed 's/ //g') + %: - dh $@ --buildsystem=lua --with lua + DEB_CFLAGS_MAINT_APPEND=-DVERSION='"\"$(VERSION)\""' dh $@ --buildsystem=lua --with lua + +override_dh_installdocs: + dh_installdocs -X.gitignore diff -Nru lua-rexlib-2.6.0/doc/.gitignore lua-rexlib-2.7.2/doc/.gitignore --- lua-rexlib-2.6.0/doc/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ lua-rexlib-2.7.2/doc/.gitignore 2013-01-08 19:41:59.000000000 +0000 @@ -0,0 +1,3 @@ +index.txt +index.html +manual.html diff -Nru lua-rexlib-2.6.0/doc/Makefile lua-rexlib-2.7.2/doc/Makefile --- lua-rexlib-2.6.0/doc/Makefile 2012-02-14 19:06:48.000000000 +0000 +++ lua-rexlib-2.7.2/doc/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -# Documentation Makefile - -APP = rst2html -CP = cp -a -RM = rm -IDX = ../README.rst - -.SUFFIXES: .txt .html - -CSS = --stylesheet-path=lrexlib.css --link-stylesheet -HDR = --initial-header-level=2 -DT = --date --time - -PAGES = index.html manual.html - -.txt.html: - $(APP) $(CSS) $(HDR) $(DT) $< $@ - -all: $(PAGES) - -index.txt: $(IDX) - $(CP) $< $@ - -clean: - $(RM) $(PAGES) index.txt diff -Nru lua-rexlib-2.6.0/doc/SciTE.properties lua-rexlib-2.7.2/doc/SciTE.properties --- lua-rexlib-2.6.0/doc/SciTE.properties 1970-01-01 00:00:00.000000000 +0000 +++ lua-rexlib-2.7.2/doc/SciTE.properties 2013-01-08 19:41:59.000000000 +0000 @@ -0,0 +1,4 @@ +eol.mode=LF + +command.compile.*.txt=make -B $(FileName).html +command.build.*.txt=make diff -Nru lua-rexlib-2.6.0/doc/index.html lua-rexlib-2.7.2/doc/index.html --- lua-rexlib-2.6.0/doc/index.html 2012-04-12 17:37:56.000000000 +0000 +++ lua-rexlib-2.7.2/doc/index.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ - - - - - - -Lrexlib 2.6 - - - -
-

Lrexlib 2.6

- -
-
by Reuben Thomas (rrt@sc3d.org)
-
and Shmuel Zeigerman (shmuz@013net.net) [maintainer]
-
-

Lrexlib provides bindings of five regular expression library APIs -(POSIX, PCRE, GNU, TRE and Oniguruma) to Lua 5.1 and Lua 5.2. -The bindings for TRE and Oniguruma are not currently complete.

-

Lrexlib is copyright Reuben Thomas 2000-2012 and copyright Shmuel -Zeigerman 2004-2012, and is released under the same license as Lua, -the MIT license (otherwise known as the revised BSD license). There -is no warranty.

-

Please report bugs and make suggestions to the maintainer, or use the -LuaForge trackers and mailing lists.

-

Thanks to Thatcher Ulrich for bug and warning fixes, and to Nick -Gammon for adding support for PCRE named subpatterns.

-
- -
- - - diff -Nru lua-rexlib-2.6.0/doc/index.txt lua-rexlib-2.7.2/doc/index.txt --- lua-rexlib-2.6.0/doc/index.txt 2012-04-12 17:24:49.000000000 +0000 +++ lua-rexlib-2.7.2/doc/index.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -Lrexlib 2.6 -=========== - -| by Reuben Thomas (rrt@sc3d.org) -| and Shmuel Zeigerman (shmuz@013net.net) [maintainer] - -**Lrexlib** provides bindings of five regular expression library APIs -(POSIX_, PCRE_, GNU_, TRE_ and Oniguruma_) to Lua_ 5.1 and Lua 5.2. -The bindings for TRE and Oniguruma are not currently complete. - -**Lrexlib** is copyright Reuben Thomas 2000-2012 and copyright Shmuel -Zeigerman 2004-2012, and is released under the same license as Lua, -the MIT_ license (otherwise known as the revised BSD license). There -is no warranty. - -.. _POSIX: http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html -.. _PCRE: http://www.pcre.org/pcre.txt -.. _GNU: ftp://ftp.gnu.org/old-gnu/regex/ -.. _Oniguruma: http://www.geocities.jp/kosako3/oniguruma/doc/RE.txt -.. _TRE: http://laurikari.net/tre/documentation/ -.. _Lua: http://www.lua.org -.. _MIT: http://www.opensource.org/licenses/mit-license.php - -Please report bugs and make suggestions to the maintainer, or use the -LuaForge trackers and mailing lists. - -Thanks to Thatcher Ulrich for bug and warning fixes, and to Nick -Gammon for adding support for PCRE named subpatterns. - ------------------------------------------------------------ - -Links ------ - -- License_ -- `Reference Manual`_ -- `LuaForge Project Page`_ -- Download_ - -.. _License: http://rrthomas.github.com/lrexlib/license.html -.. _Reference Manual: http://rrthomas.github.com/lrexlib/manual.html -.. _LuaForge Project Page: http://luaforge.net/projects/lrexlib/ -.. _Download: https://github.com/rrthomas/lrexlib/downloads diff -Nru lua-rexlib-2.6.0/doc/license.html lua-rexlib-2.7.2/doc/license.html --- lua-rexlib-2.6.0/doc/license.html 2012-04-12 17:24:49.000000000 +0000 +++ lua-rexlib-2.7.2/doc/license.html 2013-01-08 19:41:59.000000000 +0000 @@ -5,7 +5,7 @@ -

Lrexlib 2.6

+

Lrexlib

Copyright © Reuben Thomas 2000-2012
Copyright © Shmuel Zeigerman 2004-2012 diff -Nru lua-rexlib-2.6.0/doc/manual.html lua-rexlib-2.7.2/doc/manual.html --- lua-rexlib-2.6.0/doc/manual.html 2012-04-12 17:37:56.000000000 +0000 +++ lua-rexlib-2.7.2/doc/manual.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,1337 +0,0 @@ - - - - - - -Lrexlib 2.6 Reference Manual - - - -

-

Lrexlib 2.6 Reference Manual

- - -
-

Lrexlib builds into shared libraries called by default rex_posix.so, -rex_pcre.so, rex_gnu.so, rex_tre.so and rex_onig.so, which can be used with -require.

-
-
-

Notes

-
    -
  1. Most functions and methods in Lrexlib have mandatory and optional arguments. -There are no dependencies between arguments in Lrexlib's functions and -methods. Any optional argument can be supplied as nil (or omitted if it -is a trailing argument), the library will then use the default value for that -argument.

    -
  2. -
  3. This document uses the following syntax for optional arguments: they are -bracketed separately, and commas are left outside brackets, e.g.:

    -
    -MyFunc (arg1, arg2, [arg3], [arg4])
    -
    -
  4. -
  5. Throughout this document (unless it causes ambiguity), the identifier rex -is used in place of either rex_posix, rex_pcre, rex_gnu, rex_onig or -rex_tre, which are the default namespaces for the corresponding libraries.

    -
  6. -
  7. All functions that take a regular expression pattern as an argument will -generate an error if that pattern is found invalid by the regex library.

    -
  8. -
  9. All functions that take a string-type regex argument accept a compiled regex -too. In this case, the cf and larg arguments are ignored (should -be either supplied as nils or omitted).

    -
  10. -
-
    -
  1. The default value for compilation flags (cf) that Lrexlib uses when -the parameter is not supplied or nil is:

    -
    -
      -
    • REG_EXTENDED for POSIX and TRE
    • -
    • 0 for PCRE
    • -
    • ONIG_OPTION_NONE for Oniguruma
    • -
    • SYNTAX_POSIX_EXTENDED for GNU
    • -
    -
    -

    PCRE, Oniguruma: cf may also be supplied as a string, whose -characters stand for compilation flags. Combinations of the following -characters (case sensitive) are supported:

    -
    - ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Character

    -

    PCRE flag

    -

    Oniguruma flag

    -

    i

    -

    PCRE_CASELESS

    -

    ONIG_OPTION_IGNORECASE

    -

    m

    -

    PCRE_MULTILINE

    -

    ONIG_OPTION_NEGATE_SINGLELINE

    -

    s

    -

    PCRE_DOTALL

    -

    ONIG_OPTION_MULTILINE

    -

    x

    -

    PCRE_EXTENDED

    -

    ONIG_OPTION_EXTEND

    -

    U

    -

    PCRE_UNGREEDY

    -

    n/a

    -

    X

    -

    PCRE_EXTRA

    -

    n/a

    -
    -
    -
  2. -
-
    -
  1. The default value for execution flags (ef) that Lrexlib uses when -the parameter is not supplied or nil, is:

    -
    -
      -
    • 0 for standard POSIX regex library
    • -
    • REG_STARTEND for those POSIX regex libraries that support it, -e.g. Spencer's.
    • -
    • 0 for PCRE, Oniguruma and TRE
    • -
    -
    -
  2. -
-
    -
  1. The notation larg... is used to indicate optional library-specific -arguments, which are documented in the new method of each library.
  2. -
-
-
-
-

Functions and methods common to all bindings

-
-

match

-

rex.match (subj, patt, [init], [cf], [ef], [larg...])

-

or

-

r:match (subj, [init], [ef])

-

The function searches for the first match of the regexp patt in the string -subj, starting from offset init, subject to flags cf and ef.

-
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterDescriptionTypeDefault Value
rregex object produced by newuserdatan/a
subjsubjectstringn/a
pattregular expression patternstring -or -userdatan/a
[init]start offset in the subject -(can be negative)number1
[cf]compilation flags (bitwise OR)numbercf
[ef]execution flags (bitwise OR)numberef
[larg...]library-specific arguments  
-
-
-
Returns on success:
-
    -
  1. All substring matches ("captures"), in the order they appear in the -pattern. false is returned for sub-patterns that did not participate in -the match. If the pattern specified no captures then the whole matched -substring is returned.
  2. -
-
-
Returns on failure:
-
    -
  1. nil
  2. -
-
-
-
-
-
-

find

-

rex.find (subj, patt, [init], [cf], [ef], [larg...])

-

or

-

r:find (subj, [init], [ef])

-

The function searches for the first match of the regexp patt in the string -subj, starting from offset init, subject to flags cf and ef.

-
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterDescriptionTypeDefault Value
rregex object produced by newuserdatan/a
subjsubjectstringn/a
pattregular expression patternstring -or -userdatan/a
[init]start offset in the subject -(can be negative)number1
[cf]compilation flags (bitwise OR)numbercf
[ef]execution flags (bitwise OR)numberef
[larg...]library-specific arguments  
-
-
-
Returns on success:
-
    -
  1. The start point of the match (a number).
  2. -
  3. The end point of the match (a number).
  4. -
  5. All substring matches ("captures"), in the order they appear in the -pattern. false is returned for sub-patterns that did not participate in -the match.
  6. -
-
-
Returns on failure:
-
    -
  1. nil
  2. -
-
-
-
-
-
-

gmatch

-

rex.gmatch (subj, patt, [cf], [ef], [larg...])

-

The function is intended for use in the generic for Lua construct. -It returns an iterator for repeated matching of the pattern patt in -the string subj, subject to flags cf and ef.

-
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterDescriptionTypeDefault Value
subjsubjectstringn/a
pattregular expression patternstring -or -userdatan/a
[cf]compilation flags (bitwise OR)numbercf
[ef]execution flags (bitwise OR)numberef
[larg...]library-specific arguments  
-
-

The iterator function is called by Lua. On every iteration (that is, on every -match), it returns all captures in the order they appear in the pattern (or the -entire match if the pattern specified no captures). The iteration will continue -till the subject fails to match.

-
-
-
-

gsub

-

rex.gsub (subj, patt, repl, [n], [cf], [ef], [larg...])

-

This function searches for all matches of the pattern patt in the string -subj and replaces them according to the parameters repl and n (see details -below).

-
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterDescriptionTypeDefault Value
subjsubjectstringn/a
pattregular expression patternstring or userdatan/a
replsubstitution sourcestring, function or tablen/a
[n]maximum number of matches to search -for, or control function, or nilnumber or functionnil
[cf]compilation flags (bitwise OR)numbercf
[ef]execution flags (bitwise OR)numberef
[larg...]library-specific arguments  
-
-
-
Returns:
-
    -
  1. The subject string with the substitutions made.
  2. -
  3. Number of matches found.
  4. -
  5. Number of substitutions made.
  6. -
-
-
Details:
-

The parameter repl can be either a string, a function or a table. -On each match made, it is converted into a value repl_out that may be used -for the replacement.

-

repl_out is generated differently depending on the type of repl:

-
    -
  1. If repl is a string then it is treated as a template for substitution, -where the %X occurences in repl are handled in a special way, depending -on the value of the character X:
  2. -
-
-
    -
  • if X represents a digit, then each %X occurence is substituted by the -value of the X-th submatch (capture), with the following cases handled -specially:
      -
    • each %0 is substituted by the entire match
    • -
    • if the pattern contains no captures, then each %1 is substituted by the -entire match
    • -
    • any other %X where X is greater than the number of captures in the -pattern will generate an error ("invalid capture index")
    • -
    • if the pattern does contain a capture with number X but that capture -didn't participate in the match, then %X is substituted by an empty -string
    • -
    -
  • -
  • if X is any non-digit character then %X is substituted by X
  • -
-

All parts of repl other than %X are copied to repl_out verbatim.

-
-
    -
  1. If repl is a function then it is called on each match with the -submatches passed as parameters (if there are no submatches then the entire -match is passed as the only parameter). repl_out is the return value of -the repl call, and is interpreted as follows:
  2. -
-
-
    -
  • if it is a string or a number (coerced to a string), then the replacement -value is that string;
  • -
  • if it is a nil or a false, then no replacement is to be done;
  • -
-
-
    -
  1. If repl is a table then repl_out is repl [m1], where m1 is the first -submatch (or the entire match if there are no submatches), following the -same rules as for the return value of repl call, described in the above -paragraph.
  2. -
-

Note: Under some circumstances, the value of repl_out may be ignored; see -below.

-

gsub behaves differently depending on the type of n:

-
    -
  1. If n is a number then it is treated as the maximum number of matches -to search for (an omitted or nil value means an unlimited number of -matches). On each match, the replacement value is the repl_out string -(see above).
  2. -
-
-
-
-
    -
  1. If n is a function, then it is called on each match, after repl_out is -produced (so if repl is a function, it will be called prior to the n -call).

    -

    n receives 3 arguments and returns 2 values. Its arguments are:

    -
    -
      -
    1. The start offset of the match (a number)
    2. -
    3. The end offset of the match (a number)
    4. -
    5. repl_out
    6. -
    -
    -

    The type of its first return controls the replacement produced by gsub for -the current match:

    -
    -
      -
    • true -- replace/don't replace, according to repl_out;
    • -
    • nil/false -- don't replace;
    • -
    • a string (or a number coerced to a string) -- replace by that string;
    • -
    -
    -

    The type of its second return controls gsub behavior after the current -match is handled:

    -
    -
      -
    • nil/false -- no changes: n will be called on the next match;
    • -
    • true -- search for an unlimited number of matches; n will not be -called again;
    • -
    • a number -- maximum number of matches to search for, beginning from the -next match; n will not be called again;
    • -
    -
    -
  2. -
-
-
-
-
-

split

-

rex.split (subj, sep, [cf], [ef], [larg...])

-

The function is intended for use in the generic for Lua construct. -It is used for splitting a subject string subj into parts (sections). -The sep parameter is a regular expression pattern representing -separators between the sections.

-

The function returns an iterator for repeated matching of the pattern sep in -the string subj, subject to flags cf and ef.

-
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterDescriptionTypeDefault Value
subjsubjectstringn/a
sepseparator (regular expression -pattern)string -or -userdatan/a
[cf]compilation flags (bitwise OR)numbercf
[ef]execution flags (bitwise OR)numberef
[larg...]library-specific arguments  
-
-

On every iteration pass, the iterator returns:

-
-
    -
  1. A subject section (can be an empty string), followed by
  2. -
  3. All captures in the order they appear in the sep pattern (or the entire -match if the sep pattern specified no captures). If there is no match -(this can occur only in the last iteration), then nothing is returned after -the subject section.
  4. -
-
-

The iteration will continue till the end of the subject. Unlike gmatch, there -will always be at least one iteration pass, even if there are no matches in the -subject.

-
-
-
-

flags

-

rex.flags ([tb])

-

This function returns a table containing the numeric values of the constants -defined by the used regex library, with the keys being the (string) names of the -constants. If the table argument tb is supplied then it is used as the output -table, otherwise a new table is created.

-

The constants contained in the returned table can then be used in most functions -and methods where compilation flags or execution flags can be specified. -They can also be used for comparing with return codes of some functions and -methods for determining the reason of failure. For details, see the relevant -regex library's documentation.

-
- ------ - - - - - - - - - - - - - - -
ParameterDescriptionTypeDefault Value
[tb]a table for placing results intotablenil
-
-
-
Returns:
-
    -
  1. A table filled with the results.
  2. -
-
-
-

Notes: -The keys in the tb table are formed from the names of the corresponding -constants in the used library. They are formed as follows:

-
    -
  • POSIX, TRE: prefix REG_ is omitted, e.g. REG_ICASE becomes "ICASE".
  • -
  • PCRE: prefix PCRE_ is omitted, e.g. PCRE_CASELESS becomes -"CASELESS".
  • -
  • Oniguruma: names of constants are converted to strings with no alteration, -but for ONIG_OPTION_xxx constants, alias strings are created additionally, -e.g., the value of ONIG_OPTION_IGNORECASE constant becomes accessible via -either of two keys: "ONIG_OPTION_IGNORECASE" and "IGNORECASE".
  • -
  • GNU: the GNU library provides the flags not_bol, which stops a -beginning-of-line anchor from matching at the start of a string, not_eol, -which stops an end-of-line anchor from matching at the end of a string, and -backward which causes the search to be performed backwards (that is, the -pattern is matched from positions starting at the end of the string; however, -the matches themselves are still made forwards), as well as the RE_xxx syntax -specifiers (as defined in regex.h), omitting the RE_ prefix. For example, -RE_SYNTAX_GREP becomes SYNTAX_GREP in Lua.
  • -
-
-
-
-

new

-

rex.new (patt, [cf], [larg...])

-

The function compiles regular expression patt into a regular expression object -whose internal representation is corresponding to the library used. The returned -result then can be used by the methods, e.g. tfind, exec, etc. Regular -expression objects are automatically garbage collected. See the library-specific -documentation below for details of the library-specific arguments larg..., if -any.

-
- ------ - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterDescriptionTypeDefault Value
pattregular expression patternstringn/a
[cf]compilation flags (bitwise OR)numbercf
[larg...]library-specific arguments  
-
-
-
Returns:
-
    -
  1. Compiled regular expression (a userdata).
  2. -
-
-
-
-
-
-

tfind

-

r:tfind (subj, [init], [ef])

-

The method searches for the first match of the compiled regexp r in the -string subj, starting from offset init, subject to execution flags ef.

-
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterDescriptionTypeDefault Value
rregex object produced by newuserdatan/a
subjsubjectstringn/a
[init]start offset in the subject -(can be negative)number1
[ef]execution flags (bitwise OR)numberef
-
-
-
Returns on success:
-
    -
  1. The start point of the match (a number).
  2. -
  3. The end point of the match (a number).
  4. -
  5. Substring matches ("captures" in Lua terminology) are returned as a third -result, in a table. This table contains false in the positions where the -corresponding sub-pattern did not participate in the match.
      -
    1. PCRE, Oniguruma: if named subpatterns are used then the table -also contains substring matches keyed by their correspondent subpattern -names (strings).
    2. -
    -
  6. -
-
-
Returns on failure:
-
    -
  1. nil
  2. -
-
-
-
-
-
-

exec

-

r:exec (subj, [init], [ef])

-

The method searches for the first match of the compiled regexp r in the -string subj, starting from offset init, subject to execution flags ef.

-
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterDescriptionTypeDefault Value
rregex object produced by newuserdatan/a
subjsubjectstringn/a
[init]start offset in the subject -(can be negative)number1
[ef]execution flags (bitwise OR)numberef
-
-
-
Returns on success:
-
    -
  1. The start point of the first match (a number).
  2. -
  3. The end point of the first match (a number).
  4. -
  5. The offsets of substring matches ("captures" in Lua terminology) are -returned as a third result, in a table. This table contains false in the -positions where the corresponding sub-pattern did not participate in the -match.
      -
    1. PCRE, Oniguruma: if named subpatterns are used then the table -also contains substring matches keyed by their correspondent subpattern -names (strings).
    2. -
    -
  6. -
-
-
Returns on failure:
-
    -
  1. nil
  2. -
-
-
Example:
-
If the whole match is at offsets 10,20 and substring matches are at offsets -12,14 and 16,19 then the function returns the following: 10, 20, -{ 12,14,16,19 }.
-
-
-
-
-
-

PCRE-only functions and methods

-
-

new

-

rex.new (patt, [cf], [lo])

-

The locale (lo) can be either a string (e.g., "French_France.1252"), or a -userdata obtained from a call to maketables. The default value, used when the -parameter is not supplied or nil, is the built-in PCRE set of character -tables.

-
-
-

dfa_exec

-

[PCRE 6.0 and later. See pcre_dfa_exec in the PCRE docs.]

-

r:dfa_exec (subj, [init], [ef], [ovecsize], [wscount])

-

The method matches a compiled regular expression r against a given subject -string subj, using a DFA matching algorithm.

-
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterDescriptionTypeDefault Value
rregex object produced by newuserdatan/a
subjsubjectstringn/a
[init]start offset in the subject -(can be negative)number1
[ef]execution flags (bitwise OR)numberef
[ovecsize]size of the array for result offsetsnumber100
[wscount]number of elements in the working -space arraynumber50
-
-
-
Returns on success (either full or partial match):
-
    -
  1. The start point of the matches found (a number).
  2. -
  3. A table containing the end points of the matches found, the longer matches -first.
  4. -
  5. The return value of the underlying pcre_dfa_exec call (a number).
  6. -
-
-
Returns on failure (no match):
-
    -
  1. nil
  2. -
-
-
Example:
-
If there are 3 matches found starting at offset 10 and ending at offsets 15, 20 -and 25 then the function returns the following: 10, { 25,20,15 }, 3.
-
-
-
-
-

maketables

-

[See pcre_maketables in the PCRE docs.]

-

rex_pcre.maketables ()

-

Creates a set of character tables corresponding to the current locale and -returns it as a userdata. The returned value can be passed to any Lrexlib -function accepting the locale parameter.

-
-
-
-

config

-

[PCRE 4.0 and later. See pcre_config in the PCRE docs.]

-

rex_pcre.config ([tb])

-

This function returns a table containing the values of the configuration -parameters used at PCRE library build-time. Those parameters (numbers) are -keyed by their names (strings). If the table argument tb is supplied then it -is used as the output table, else a new table is created.

-
-
-
-

version

-

[See pcre_version in the PCRE docs.]

-

rex_pcre.version ()

-

This function returns a string containing the version of the used PCRE library -and its release date.

-
-
-
-
-

GNU-only functions and methods

-
-

new

-

rex.new (patt, [cf], [tr])

-

If the compilation flags (cf) are not supplied or nil, the default syntax -is SYNTAX_POSIX_EXTENDED. Note that this is not the same as passing a value -of zero, which is the same as SYNTAX_EMACS.

-

The translation parameter (tr) is a map of eight-bit character codes (0 to -255 inclusive) to 8-bit characters (strings). If this parameter is given, the -pattern is translated at compilation time, and each string to be matched is -translated when it is being matched.

-
-
-
-

Oniguruma-only functions and methods

-
-

new

-

rex.new (patt, [cf], [enc], [syn])

-

The encoding parameter (enc) must be one of the predefined strings that are -formed from the ONIG_ENCODING_xxx identifiers defined in oniguruma.h, by means -of omitting the ONIG_ENCODING_ part. For example, ONIG_ENCODING_UTF8 becomes -"UTF8" on the Lua side. The default value, used when the parameter is not -supplied or nil, is "ASCII".

-

If the caller-supplied value of this parameter is not one of the predefined -"encoding" string set, an error is raised.

-

The syntax parameter (syn) must be one of the predefined strings that are -formed from the ONIG_SYNTAX_xxx identifiers defined in oniguruma.h, by means of -omitting the ONIG_SYNTAX_ part. For example, ONIG_SYNTAX_JAVA becomes -"JAVA" on the Lua side. The default value, used when the parameter is not -supplied or nil, is either "RUBY" (at start-up), or the value set by the -last setdefaultsyntax call.

-

If the caller-supplied value of syntax parameter is not one of the predefined -"syntax" string set, an error is raised.

-
-
-

setdefaultsyntax

-

rex_onig.setdefaultsyntax (syntax)

-

This function sets the default syntax for the Oniguruma library, according to the -value of the string syntax. The specified syntax will be further used for -interpreting string regex patterns by all relevant functions, unless the syntax -argument is passed to those functions explicitly.

-

Returns: nothing

-

Examples:

-
-
    -
  1. rex_onig.setdefaultsyntax ("ASIS") -- use plain text syntax as the default
  2. -
  3. rex_onig.setdefaultsyntax ("PERL") -- use PERL regex syntax as the default
  4. -
-
-
-
-
-

version

-

[See onig_version in the Oniguruma docs.]

-

rex_onig.version ()

-

This function returns a string containing the version of the used Oniguruma -library.

-
-
-
-
-

TRE-only functions and methods

-
-

new

-

rex.new (patt, [cf])

-
-
-

atfind

-

r:atfind (subj, params, [init], [ef])

-

The method searches for the first match of the compiled regexp r in the -string subj, starting from offset init, subject to execution flags ef.

-
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterDescriptionTypeDefault Value
rregex object produced by newuserdatan/a
subjsubjectstringn/a
paramsApproximate matching parameters. -The values are integers. -The valid string key values are: -cost_ins, cost_del, -cost_subst, max_cost, -max_ins, max_del, -max_subst, max_errtable

n/a

-

(Default -value for -a missing -field is 0)

-
[init]start offset in the subject -(can be negative)number1
[ef]execution flags (bitwise OR)numberef
-
-
-
Returns on success:
-
    -
  1. The start point of the match (a number).
  2. -
  3. The end point of the match (a number).
  4. -
  5. Substring matches ("captures" in Lua terminology) are returned as a third -result, in the array part of a table. Positions where the corresponding -sub-pattern did not participate in the match contain false. -The hash part of the table contains additional information on the match, -in the following fields: cost, num_ins, num_del and num_subst.
  6. -
-
-
Returns on failure:
-
    -
  1. nil
  2. -
-
-
-
-
-
-

aexec

-

r:aexec (subj, params, [init], [ef])

-

The method searches for the first match of the compiled regexp r in the -string subj, starting from offset init, subject to execution flags ef.

-
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterDescriptionTypeDefault Value
rregex object produced by newuserdatan/a
subjsubjectstringn/a
paramsApproximate matching parameters. -The values are integers. -The valid string key values are: -cost_ins, cost_del, -cost_subst, max_cost, -max_ins, max_del, -max_subst, max_errtable

n/a

-

(Default -value for -a missing -field is 0)

-
[init]start offset in the subject -(can be negative)number1
[ef]execution flags (bitwise OR)numberef
-
-
-
Returns on success:
-
    -
  1. The start point of the first match (a number).
  2. -
  3. The end point of the first match (a number).
  4. -
  5. The offsets of substring matches ("captures" in Lua terminology) are -returned as a third result, in the array part of a table. Positions where -the corresponding sub-pattern did not participate in the match contain -false. The hash part of the table contains additional information on -the match, in the following fields: cost, num_ins, num_del and -num_subst.
  6. -
-
-
Returns on failure:
-
    -
  1. nil
  2. -
-
-
-
-
-
-

have_approx

-

r:have_approx ()

-

The method returns true if the compiled pattern uses approximate matching, -and false if not.

-
-
-
-

have_backrefs

-

r:have_backrefs ()

-

The method returns true if the compiled pattern has back references, -and false if not.

-
-
-
-

config

-

[See tre_config in the TRE docs.]

-

rex_tre.config ([tb])

-

This function returns a table containing the values of the configuration -parameters used at TRE library build-time. Those parameters are -keyed by their names. If the table argument tb is supplied then it -is used as the output table, else a new table is created.

-
-
-
-

rex_tre.version

-

[See tre_version in the TRE docs.]

-

rex_tre.version ()

-

This function returns a string containing the version of the used TRE library.

-
-
-
-
-

Incompatibilities with previous versions

-

Incompatibilities between versions 2.6 and 2.5:

-
-
    -
  1. Removed function plainfind.
  2. -
  3. Global variables (e.g. rex_posix, rex_pcre, etc.) are not created -by default. This can be changed at the stage of compilation by adding --DREX_CREATEGLOBALVAR to CFLAGS.
  4. -
-
-

Incompatibilities between versions 2.2 and 2.1:

-
-
    -
  1. gsub: a special "break" return of repl function is deprecated.
  2. -
  3. (PCRE) gsub, gmatch: after finding an empty match at the current -position, the functions try to find a non-empty match anchored to the same -position.
  4. -
-
-

Incompatibilities between versions 2.1 and 2.0:

-
-
    -
  1. match, find, tfind, exec, dfa_exec: only one value (a nil) is -returned when the subject does not match the pattern. Any other failure -generates an error.
  2. -
-
-

Incompatibilities between versions 2.0 and 1.19:

-
-
    -
  1. Lua 5.1 is required
  2. -
  3. Functions newPCRE and newPOSIX renamed to new
  4. -
  5. Functions flagsPCRE and flagsPOSIX renamed to flags
  6. -
  7. Function versionPCRE renamed to version
  8. -
  9. Method match renamed to tfind
  10. -
  11. Method gmatch removed (similar functionality is provided by function -gmatch)
  12. -
  13. Methods tfind and exec: 2 values are returned on failure
  14. -
  15. (PCRE) exec: the returned table may additionally contain named -subpatterns
  16. -
-
-
-
- - - diff -Nru lua-rexlib-2.6.0/doc/manual.txt lua-rexlib-2.7.2/doc/manual.txt --- lua-rexlib-2.6.0/doc/manual.txt 2012-04-12 17:24:49.000000000 +0000 +++ lua-rexlib-2.7.2/doc/manual.txt 2013-01-08 19:41:59.000000000 +0000 @@ -1,7 +1,7 @@ .. role:: funcdef(literal) -Lrexlib 2.6 Reference Manual -============================ +Lrexlib Reference Manual +======================== .. contents:: Table of Contents @@ -38,9 +38,19 @@ too. In this case, the cf_ and larg_ arguments are ignored (should be either supplied as nils or omitted). +6. All functions that take a string-type subject accept a table (in Lua >= 5.2) + or userdata that has a ``topointer`` method and ``__len`` metamethod, and + take the subject to be a block of memory starting at the address returned by + ``subject:topointer()`` and of length ``#subject``. This works with buffers + objects from the alien library (https://github.com/mascarenhas/alien). Note + that special attention is needed with POSIX regex libraries that do not + support ``REG_STARTEND``, and hence need NUL-terminated subjects: the NUL is + not included in the string length, so alien buffers must be wrapped to + report a length that excludes the NUL. + .. _cf: -6. The default value for *compilation flags* (*cf*) that Lrexlib uses when +7. The default value for *compilation flags* (*cf*) that Lrexlib uses when the parameter is not supplied or ``nil`` is: * REG_EXTENDED for POSIX and TRE @@ -65,7 +75,7 @@ .. _ef: -7. The default value for *execution flags* (*ef*) that Lrexlib uses when +8. The default value for *execution flags* (*ef*) that Lrexlib uses when the parameter is not supplied or ``nil``, is: * 0 for standard POSIX regex library @@ -75,7 +85,7 @@ .. _larg: -8. The notation *larg...* is used to indicate optional library-specific +9. The notation *larg...* is used to indicate optional library-specific arguments, which are documented in the ``new`` method of each library. ------------------------------------------------------------ @@ -220,7 +230,8 @@ +---------+-----------------------------------+-------------------------+-------------+ | patt |regular expression pattern |string or userdata | n/a | +---------+-----------------------------------+-------------------------+-------------+ - | repl |substitution source |string, function or table| n/a | + | repl |substitution source |string, function, table, | n/a | + | | |``false`` or ``nil`` | | +---------+-----------------------------------+-------------------------+-------------+ | [n] |maximum number of matches to search| number or function | ``nil`` | | |for, or control function, or nil | | | @@ -238,9 +249,9 @@ 3. Number of substitutions made. **Details:** - The parameter *repl* can be either a string, a function or a table. - On each match made, it is converted into a value *repl_out* that may be used - for the replacement. + The parameter *repl* can be either a string, a function, a table, + ``false`` or ``nil``. On each match made, it is converted into a + value *repl_out* that may be used for the replacement. *repl_out* is generated differently depending on the type of *repl*: @@ -279,6 +290,11 @@ same rules as for the return value of *repl* call, described in the above paragraph. + 4. If *repl* is ``false`` or ``nil``, no replacement is done. Note + that, unusually for Lua, if ``repl`` is absent, it is not taken + to be ``nil``. This is to prevent programming errors caused by + inadvertently missing out *repl*. + Note: Under some circumstances, the value of *repl_out* may be ignored; see below_. diff -Nru lua-rexlib-2.6.0/mkrockspecs.lua lua-rexlib-2.7.2/mkrockspecs.lua --- lua-rexlib-2.6.0/mkrockspecs.lua 1970-01-01 00:00:00.000000000 +0000 +++ lua-rexlib-2.7.2/mkrockspecs.lua 2013-01-08 19:41:59.000000000 +0000 @@ -0,0 +1,48 @@ +-- Generate the rockspecs + +require "std" + +if select ("#", ...) < 1 then + io.stderr:write "Usage: mkrockspecs VERSION\n" + os.exit () +end + +version = select (1, ...) + +function format (x, indent) + indent = indent or "" + if type (x) == "table" then + local s = "{\n" + for i, v in pairs (x) do + if type (i) ~= "number" then + s = s..indent..i.." = "..format (v, indent.." ")..",\n" + end + end + for i, v in ipairs (x) do + s = s..indent..format (v, indent.." ")..",\n" + end + return s..indent:sub(1, -3).."}" + elseif type (x) == "string" then + return string.format ("%q", x) + else + return tostring (x) + end +end + +for f, spec in pairs (loadfile ("rockspecs.lua") ()) do + if f ~= "default" then + local specfile = "lrexlib-"..f:lower ().."-"..version.."-1.rockspec" + h = io.open (specfile, "w") + assert (h) + flavour = f -- a global, visible in loadfile + local specs = loadfile ("rockspecs.lua") () -- reload to get current flavour interpolated + local spec = table.merge (specs.default, specs[f]) + local s = "" + for i, v in pairs (spec) do + s = s..i.." = "..format (v, " ").."\n" + end + h:write (s) + h:close () + os.execute ("luarocks lint " .. specfile) + end +end diff -Nru lua-rexlib-2.6.0/rockspecs.lua lua-rexlib-2.7.2/rockspecs.lua --- lua-rexlib-2.6.0/rockspecs.lua 1970-01-01 00:00:00.000000000 +0000 +++ lua-rexlib-2.7.2/rockspecs.lua 2013-01-08 19:41:59.000000000 +0000 @@ -0,0 +1,133 @@ +-- Rockspec data + +-- Variables to be interpolated: +-- +-- flavour: regex library +-- version + +local flavours = {"PCRE", "POSIX", "oniguruma", "TRE", "GNU"} +local version_dashed = version:gsub ("%.", "-") + +-- FIXME: When Lua 5.1 support is dropped, use an env argument with +-- loadfile instead of wrapping in a table +return { + +default = { + package = "Lrexlib-"..flavour, + version = version.."-1", + source = { + url = "git://github.com/rrthomas/lrexlib.git", + tag = "rel-"..version_dashed, + }, + description = { + summary = "Regular expression library binding ("..flavour.." flavour).", + detailed = [[ +Lrexlib is a regular expression library for Lua 5.1 and 5.2, which +provides bindings for several regular expression libraries. +This rock provides the ]]..flavour..[[ bindings.]], + homepage = "http://github.com/rrthomas/lrexlib", + license = "MIT/X11" + }, + dependencies = { + "lua >= 5.1" + }, +}, + +PCRE = { + external_dependencies = { + PCRE = { + header = "pcre.h", + library = "pcre" + } + }, + build = { + type = "builtin", + modules = { + rex_pcre = { + defines = {"VERSION=\""..version.."\""}, + sources = {"src/common.c", "src/pcre/lpcre.c", "src/pcre/lpcre_f.c"}, + libraries = {"pcre"}, + incdirs = {"$(PCRE_INCDIR)"}, + libdirs = {"$(PCRE_LIBDIR)"} + } + } + } +}, + +POSIX = { + external_dependencies = { + POSIX = { + header = "regex.h", + } + }, + build = { + type = "builtin", + modules = { + rex_posix = { + defines = {"VERSION=\""..version.."\""}, + sources = {"src/common.c", "src/posix/lposix.c"} + } + } + } +}, + +oniguruma = { + external_dependencies = { + ONIG = { + header = "oniguruma.h", + library = "onig" + } + }, + build = { + type = "builtin", + modules = { + rex_onig = { + defines = {"VERSION=\""..version.."\""}, + sources = {"src/common.c", "src/oniguruma/lonig.c", "src/oniguruma/lonig_f.c"}, + libraries = {"onig"}, + incdirs = {"$(ONIG_INCDIR)"}, + libdirs = {"$(ONIG_LIBDIR)"} + } + } + } +}, + +TRE = { + external_dependencies = { + TRE = { + header = "tre/tre.h", + library = "tre" + } + }, + build = { + type = "builtin", + modules = { + rex_tre = { + defines = {"VERSION=\""..version.."\""}, + sources = {"src/common.c", "src/tre/ltre.c" --[[, "src/tre/tre_w.c"]]}, + libraries = {"tre"}, + incdirs = {"$(TRE_INCDIR)"}, + libdirs = {"$(TRE_LIBDIR)"} + } + } + } +}, + +GNU = { + external_dependencies = { + GNU = { + header = "regex.h", + } + }, + build = { + type = "builtin", + modules = { + rex_gnu = { + defines = {"VERSION=\""..version.."\""}, + sources = {"src/common.c", "src/gnu/lgnu.c"} + } + } + } +}, + +} -- close wrapper table diff -Nru lua-rexlib-2.6.0/src/algo.h lua-rexlib-2.7.2/src/algo.h --- lua-rexlib-2.6.0/src/algo.h 2012-04-12 17:24:49.000000000 +0000 +++ lua-rexlib-2.7.2/src/algo.h 2013-01-08 19:41:59.000000000 +0000 @@ -3,8 +3,7 @@ #include "common.h" -/* FIXME: Get version from defaults.mak */ -#define REX_VERSION "Lrexlib 2.6.0" +#define REX_VERSION "Lrexlib " VERSION /* Forward declarations */ static void gmatch_pushsubject (lua_State *L, TArgExec *argE); @@ -115,6 +114,40 @@ } +static void check_subject (lua_State *L, int pos, TArgExec *argE) +{ + int stype; + argE->text = lua_tolstring (L, pos, &argE->textlen); + stype = lua_type (L, pos); + if (stype != LUA_TSTRING && stype != LUA_TTABLE && stype != LUA_TUSERDATA) { + luaL_typerror (L, pos, "string, table or userdata"); + } else if (argE->text == NULL) { + int type; + lua_getfield (L, pos, "topointer"); + if (lua_type (L, -1) != LUA_TFUNCTION) + luaL_error (L, "subject has no topointer method"); + lua_pushvalue (L, pos); + lua_call (L, 1, 1); + type = lua_type (L, -1); + if (type != LUA_TLIGHTUSERDATA) + luaL_error (L, "subject's topointer method returned %s (expected lightuserdata)", + lua_typename (L, type)); + argE->text = lua_touserdata (L, -1); + lua_pop (L, 1); +#if LUA_VERSION_NUM == 501 + lua_objlen (L, pos); +#else + lua_len (L, pos); +#endif + type = lua_type (L, -1); + if (type != LUA_TNUMBER) + luaL_error (L, "subject's length is %s (expected number)", + lua_typename (L, type)); + argE->textlen = lua_tointeger (L, -1); + lua_pop (L, 1); + } +} + static void check_pattern (lua_State *L, int pos, TArgComp *argC) { if (lua_isstring (L, pos)) { @@ -134,13 +167,15 @@ /* function gsub (s, patt, f, [n], [cf], [ef], [larg...]) */ static void checkarg_gsub (lua_State *L, TArgComp *argC, TArgExec *argE) { - argE->text = luaL_checklstring (L, 1, &argE->textlen); + check_subject (L, 1, argE); check_pattern (L, 2, argC); lua_tostring (L, 3); /* converts number (if any) to string */ argE->reptype = lua_type (L, 3); if (argE->reptype != LUA_TSTRING && argE->reptype != LUA_TTABLE && - argE->reptype != LUA_TFUNCTION) { - luaL_typerror (L, 3, "string, table or function"); + argE->reptype != LUA_TFUNCTION && argE->reptype != LUA_TNIL && + (argE->reptype != LUA_TBOOLEAN || + (argE->reptype == LUA_TBOOLEAN && lua_toboolean (L, 3)))) { + luaL_typerror (L, 3, "string, table, function, false or nil"); } argE->funcpos = 3; argE->funcpos2 = 4; @@ -154,7 +189,7 @@ /* function find (s, patt, [st], [cf], [ef], [larg...]) */ /* function match (s, patt, [st], [cf], [ef], [larg...]) */ static void checkarg_find_func (lua_State *L, TArgComp *argC, TArgExec *argE) { - argE->text = luaL_checklstring (L, 1, &argE->textlen); + check_subject (L, 1, argE); check_pattern (L, 2, argC); argE->startoffset = get_startoffset (L, 3, argE->textlen); argC->cflags = ALG_GETCFLAGS (L, 4); @@ -166,7 +201,7 @@ /* function gmatch (s, patt, [cf], [ef], [larg...]) */ /* function split (s, patt, [cf], [ef], [larg...]) */ static void checkarg_gmatch_split (lua_State *L, TArgComp *argC, TArgExec *argE) { - argE->text = luaL_checklstring (L, 1, &argE->textlen); + check_subject (L, 1, argE); check_pattern (L, 2, argC); argC->cflags = ALG_GETCFLAGS (L, 3); argE->eflags = luaL_optint (L, 4, ALG_EFLAGS_DFLT); @@ -180,7 +215,7 @@ /* method r:match (s, [st], [ef]) */ static void checkarg_find_method (lua_State *L, TArgExec *argE, TUserdata **ud) { *ud = check_ud (L); - argE->text = luaL_checklstring (L, 2, &argE->textlen); + check_subject (L, 2, argE); argE->startoffset = get_startoffset (L, 3, argE->textlen); argE->eflags = luaL_optint (L, 4, ALG_EFLAGS_DFLT); } @@ -301,7 +336,11 @@ } } /*----------------------------------------------------------------*/ - if (argE.reptype != LUA_TSTRING) { + else if (argE.reptype == LUA_TNIL || argE.reptype == LUA_TBOOLEAN) { + buffer_addlstring (pBuf, argE.text + from, to - from); + } + /*----------------------------------------------------------------*/ + if (argE.reptype == LUA_TTABLE || argE.reptype == LUA_TFUNCTION) { if (lua_tostring (L, -1)) { buffer_addvalue (pBuf, -1); curr_subst = 1; diff -Nru lua-rexlib-2.6.0/src/common.c lua-rexlib-2.7.2/src/common.c --- lua-rexlib-2.6.0/src/common.c 2012-04-05 12:35:46.000000000 +0000 +++ lua-rexlib-2.7.2/src/common.c 2013-01-08 19:41:59.000000000 +0000 @@ -28,10 +28,21 @@ } void *Lmalloc(lua_State *L, size_t size) { - void *p = malloc(size); - if(p == NULL) - luaL_error(L, "malloc failed"); - return p; + void *ud; + lua_Alloc lalloc = lua_getallocf(L, &ud); + return lalloc(ud, NULL, 0, size); +} + +void *Lrealloc(lua_State *L, void *p, size_t osize, size_t nsize) { + void *ud; + lua_Alloc lalloc = lua_getallocf(L, &ud); + return lalloc(ud, p, osize, nsize); +} + +void Lfree(lua_State *L, void *p, size_t osize) { + void *ud; + lua_Alloc lalloc = lua_getallocf(L, &ud); + lalloc(ud, p, osize, 0); } /* This function fills a table with string-number pairs. @@ -97,7 +108,6 @@ * ************* * Auto-extensible array of characters for building long strings incrementally. * * Differs from luaL_Buffer in that: - * * it does not use Lua facilities (except luaL_error when malloc fails) * * its operations do not change Lua stack top position * * buffer_addvalue does not extract the value from Lua stack * * buffer_pushresult does not have to be the last operation @@ -116,7 +126,7 @@ enum { ID_NUMBER, ID_STRING }; void buffer_init (TBuffer *buf, size_t sz, lua_State *L, TFreeList *fl) { - buf->arr = (char*) malloc (sz); + buf->arr = Lmalloc(L, sz); if (!buf->arr) { freelist_free (fl); luaL_error (L, "malloc failed"); @@ -129,7 +139,7 @@ } void buffer_free (TBuffer *buf) { - free (buf->arr); + Lfree(buf->L, buf->arr, buf->size); } void buffer_clear (TBuffer *buf) { @@ -147,7 +157,7 @@ void buffer_addlstring (TBuffer *buf, const void *src, size_t sz) { size_t newtop = buf->top + sz; if (newtop > buf->size) { - char *p = (char*) realloc (buf->arr, 2 * newtop); /* 2x expansion */ + char *p = (char*) Lrealloc (buf->L, buf->arr, buf->size, 2 * newtop); /* 2x expansion */ if (!p) { freelist_free (buf->freelist); luaL_error (buf->L, "realloc failed"); diff -Nru lua-rexlib-2.6.0/src/common.h lua-rexlib-2.7.2/src/common.h --- lua-rexlib-2.6.0/src/common.h 2012-04-05 12:35:46.000000000 +0000 +++ lua-rexlib-2.7.2/src/common.h 2013-01-08 19:41:59.000000000 +0000 @@ -92,5 +92,7 @@ int get_flags (lua_State *L, const flag_pair **arr); const char *get_flag_key (const flag_pair *fp, int val); void *Lmalloc (lua_State *L, size_t size); +void *Lrealloc (lua_State *L, void *p, size_t osize, size_t nsize); +void Lfree (lua_State *L, void *p, size_t size); #endif diff -Nru lua-rexlib-2.6.0/src/common.mak lua-rexlib-2.7.2/src/common.mak --- lua-rexlib-2.6.0/src/common.mak 2012-04-05 12:39:17.000000000 +0000 +++ lua-rexlib-2.7.2/src/common.mak 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -# Rules for lrexlib - -TRG = rex_$(REGNAME) -DEFS = -DREX_OPENLIB=luaopen_$(TRG) -DREX_LIBNAME=\"$(TRG)\" -CFLAGS = $(MYCFLAGS) $(DEFS) $(INC) -TRG_AR = lib$(TRG).a -TRG_SO = $(TRG).so -LD = $(CC) -LDFLAGS= -shared -# For Darwin: -#LDFLAGS= -bundle -undefined dynamic_lookup - -all: $(TRG_AR) $(TRG_SO) - -$(TRG_AR): $(OBJ) - $(AR) $@ $^ - -$(TRG_SO): $(OBJ) - $(LD) -o $@.$V $(LDFLAGS) $^ $(LIB) $(LIB_LUA) - ln -fs $@.$V $@ - -clean: - rm -f $(OBJ) $(TRG_AR) $(TRG_SO)* - -check: all - LUA_INIT= LUA_PATH=../../test/?.lua $(LUA) ../../test/runtest.lua -d. $(REGNAME) diff -Nru lua-rexlib-2.6.0/src/defaults.mak lua-rexlib-2.7.2/src/defaults.mak --- lua-rexlib-2.6.0/src/defaults.mak 2012-04-12 17:24:49.000000000 +0000 +++ lua-rexlib-2.7.2/src/defaults.mak 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -# default settings for lrexlib - -V = 2.6 -MINORV = 0 - -LUA = lua -INC_LUA = -LIB_LUA = - -# If the default settings don't work for your system, -# try to uncomment and edit the settings below. -#INC_LUA = -I/usr/include/lua5.1 -#LIB_LUA = -llua - -MYCFLAGS = -W -Wall -g $(INC_LUA) $(INC_PCRE) -AR = ar rcu -CC = gcc diff -Nru lua-rexlib-2.6.0/src/gnu/Makefile lua-rexlib-2.7.2/src/gnu/Makefile --- lua-rexlib-2.6.0/src/gnu/Makefile 2011-02-23 23:39:52.000000000 +0000 +++ lua-rexlib-2.7.2/src/gnu/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -# makefile for rex_gnu library - -include ../defaults.mak - -# === USER SETTINGS === -# =========================================================================== - -# These are default values. -INC = -LIB = - -# If the default settings don't work for your system, -# try to uncomment and edit the settings below. -# The default settings below work with a libgnu.a in the current directory, -# copied from any libgnu.a built with the regex module. -INC = -I. -DREX_GNU_INCLUDE='"regex.h"' -LIB = -L. -lgnu - -# Regex library name -REGNAME = gnu - -# =========================================================================== -# === END OF USER SETTINGS === - -OBJ = lgnu.o ../common.o - -include ../common.mak - -# static GNU regexp library binding -ar_gnu: $(TRG_AR) - -# dynamic GNU regexp library binding -so_gnu: $(TRG_SO) - -# Dependencies -lgnu.o: lgnu.c ../common.h ../algo.h -../common.o: ../common.c ../common.h - -# (End of Makefile) diff -Nru lua-rexlib-2.6.0/src/gnu/lgnu.c lua-rexlib-2.7.2/src/gnu/lgnu.c --- lua-rexlib-2.6.0/src/gnu/lgnu.c 2012-04-05 12:35:46.000000000 +0000 +++ lua-rexlib-2.7.2/src/gnu/lgnu.c 2013-01-08 19:41:59.000000000 +0000 @@ -105,7 +105,9 @@ if (lua_isnoneornil (L, pos)) return NULL; - translate = (const unsigned char *) Lmalloc (L, ALG_TRANSLATE_SIZE); + translate = (const unsigned char *) malloc (ALG_TRANSLATE_SIZE); + if (!translate) + luaL_error (L, "malloc failed"); memset ((unsigned char *) translate, 0, ALG_TRANSLATE_SIZE); /* initialize all members to 0 */ for (i = 0; i <= UCHAR_MAX; i++) { lua_pushinteger (L, i); diff -Nru lua-rexlib-2.6.0/src/gnu/regex.h lua-rexlib-2.7.2/src/gnu/regex.h --- lua-rexlib-2.6.0/src/gnu/regex.h 2010-09-19 16:01:56.000000000 +0000 +++ lua-rexlib-2.7.2/src/gnu/regex.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,680 +0,0 @@ -/* Definitions for data structures and routines for the regular - expression library. - Copyright (C) 1985, 1989, 1990, 1991, 1992, 1993, 1995, 1996, 1997, 1998, - 2000, 2001, 2002, 2003, 2005, 2006, 2009, 2010 Free Software Foundation, - Inc. - This file is part of the GNU C Library. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef _REGEX_H -#define _REGEX_H 1 - -#include - -/* Allow the use in C++ code. */ -#ifdef __cplusplus -extern "C" { -#endif - -/* Define __USE_GNU_REGEX to declare GNU extensions that violate the - POSIX name space rules. */ -#undef __USE_GNU_REGEX -#if (defined _GNU_SOURCE \ - || (!defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE \ - && !defined _XOPEN_SOURCE)) -# define __USE_GNU_REGEX 1 -#endif - -#ifdef _REGEX_LARGE_OFFSETS - -/* Use types and values that are wide enough to represent signed and - unsigned byte offsets in memory. This currently works only when - the regex code is used outside of the GNU C library; it is not yet - supported within glibc itself, and glibc users should not define - _REGEX_LARGE_OFFSETS. */ - -/* The type of the offset of a byte within a string. - For historical reasons POSIX 1003.1-2004 requires that regoff_t be - at least as wide as off_t. However, many common POSIX platforms set - regoff_t to the more-sensible ssize_t and the Open Group has - signalled its intention to change the requirement to be that - regoff_t be at least as wide as ptrdiff_t and ssize_t; see XBD ERN - 60 (2005-08-25). We don't know of any hosts where ssize_t or - ptrdiff_t is wider than ssize_t, so ssize_t is safe. */ -typedef ssize_t regoff_t; - -/* The type of nonnegative object indexes. Traditionally, GNU regex - uses 'int' for these. Code that uses __re_idx_t should work - regardless of whether the type is signed. */ -typedef size_t __re_idx_t; - -/* The type of object sizes. */ -typedef size_t __re_size_t; - -/* The type of object sizes, in places where the traditional code - uses unsigned long int. */ -typedef size_t __re_long_size_t; - -#else - -/* Use types that are binary-compatible with the traditional GNU regex - implementation, which mishandles strings longer than INT_MAX. */ - -typedef int regoff_t; -typedef int __re_idx_t; -typedef unsigned int __re_size_t; -typedef unsigned long int __re_long_size_t; - -#endif - -/* The following two types have to be signed and unsigned integer type - wide enough to hold a value of a pointer. For most ANSI compilers - ptrdiff_t and size_t should be likely OK. Still size of these two - types is 2 for Microsoft C. Ugh... */ -typedef long int s_reg_t; -typedef unsigned long int active_reg_t; - -/* The following bits are used to determine the regexp syntax we - recognize. The set/not-set meanings are chosen so that Emacs syntax - remains the value 0. The bits are given in alphabetical order, and - the definitions shifted by one from the previous bit; thus, when we - add or remove a bit, only one other definition need change. */ -typedef unsigned long int reg_syntax_t; - -#ifdef __USE_GNU_REGEX - -/* If this bit is not set, then \ inside a bracket expression is literal. - If set, then such a \ quotes the following character. */ -# define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1) - -/* If this bit is not set, then + and ? are operators, and \+ and \? are - literals. - If set, then \+ and \? are operators and + and ? are literals. */ -# define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1) - -/* If this bit is set, then character classes are supported. They are: - [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:], - [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:]. - If not set, then character classes are not supported. */ -# define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1) - -/* If this bit is set, then ^ and $ are always anchors (outside bracket - expressions, of course). - If this bit is not set, then it depends: - ^ is an anchor if it is at the beginning of a regular - expression or after an open-group or an alternation operator; - $ is an anchor if it is at the end of a regular expression, or - before a close-group or an alternation operator. - - This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because - POSIX draft 11.2 says that * etc. in leading positions is undefined. - We already implemented a previous draft which made those constructs - invalid, though, so we haven't changed the code back. */ -# define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1) - -/* If this bit is set, then special characters are always special - regardless of where they are in the pattern. - If this bit is not set, then special characters are special only in - some contexts; otherwise they are ordinary. Specifically, - * + ? and intervals are only special when not after the beginning, - open-group, or alternation operator. */ -# define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1) - -/* If this bit is set, then *, +, ?, and { cannot be first in an re or - immediately after an alternation or begin-group operator. */ -# define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1) - -/* If this bit is set, then . matches newline. - If not set, then it doesn't. */ -# define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1) - -/* If this bit is set, then . doesn't match NUL. - If not set, then it does. */ -# define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1) - -/* If this bit is set, nonmatching lists [^...] do not match newline. - If not set, they do. */ -# define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1) - -/* If this bit is set, either \{...\} or {...} defines an - interval, depending on RE_NO_BK_BRACES. - If not set, \{, \}, {, and } are literals. */ -# define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1) - -/* If this bit is set, +, ? and | aren't recognized as operators. - If not set, they are. */ -# define RE_LIMITED_OPS (RE_INTERVALS << 1) - -/* If this bit is set, newline is an alternation operator. - If not set, newline is literal. */ -# define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1) - -/* If this bit is set, then `{...}' defines an interval, and \{ and \} - are literals. - If not set, then `\{...\}' defines an interval. */ -# define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1) - -/* If this bit is set, (...) defines a group, and \( and \) are literals. - If not set, \(...\) defines a group, and ( and ) are literals. */ -# define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1) - -/* If this bit is set, then \ matches . - If not set, then \ is a back-reference. */ -# define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1) - -/* If this bit is set, then | is an alternation operator, and \| is literal. - If not set, then \| is an alternation operator, and | is literal. */ -# define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1) - -/* If this bit is set, then an ending range point collating higher - than the starting range point, as in [z-a], is invalid. - If not set, then when ending range point collates higher than the - starting range point, the range is ignored. */ -# define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1) - -/* If this bit is set, then an unmatched ) is ordinary. - If not set, then an unmatched ) is invalid. */ -# define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1) - -/* If this bit is set, succeed as soon as we match the whole pattern, - without further backtracking. */ -# define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1) - -/* If this bit is set, do not process the GNU regex operators. - If not set, then the GNU regex operators are recognized. */ -# define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING << 1) - -/* If this bit is set, turn on internal regex debugging. - If not set, and debugging was on, turn it off. - This only works if regex.c is compiled -DDEBUG. - We define this bit always, so that all that's needed to turn on - debugging is to recompile regex.c; the calling code can always have - this bit set, and it won't affect anything in the normal case. */ -# define RE_DEBUG (RE_NO_GNU_OPS << 1) - -/* If this bit is set, a syntactically invalid interval is treated as - a string of ordinary characters. For example, the ERE 'a{1' is - treated as 'a\{1'. */ -# define RE_INVALID_INTERVAL_ORD (RE_DEBUG << 1) - -/* If this bit is set, then ignore case when matching. - If not set, then case is significant. */ -# define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1) - -/* This bit is used internally like RE_CONTEXT_INDEP_ANCHORS but only - for ^, because it is difficult to scan the regex backwards to find - whether ^ should be special. */ -# define RE_CARET_ANCHORS_HERE (RE_ICASE << 1) - -/* If this bit is set, then \{ cannot be first in a regex or - immediately after an alternation, open-group or \} operator. */ -# define RE_CONTEXT_INVALID_DUP (RE_CARET_ANCHORS_HERE << 1) - -/* If this bit is set, then no_sub will be set to 1 during - re_compile_pattern. */ -# define RE_NO_SUB (RE_CONTEXT_INVALID_DUP << 1) - -/* If this bit is set, then all special characters are ignored - by re_compile_pattern. */ -# define RE_PLAIN (RE_NO_SUB << 1) - -#endif /* defined __USE_GNU_REGEX */ - -/* This global variable defines the particular regexp syntax to use (for - some interfaces). When a regexp is compiled, the syntax used is - stored in the pattern buffer, so changing this does not affect - already-compiled regexps. */ -extern reg_syntax_t re_syntax_options; - -#ifdef __USE_GNU_REGEX -/* Define combinations of the above bits for the standard possibilities. - (The [[[ comments delimit what gets put into the Texinfo file, so - don't delete them!) */ -/* [[[begin syntaxes]]] */ -# define RE_SYNTAX_EMACS 0 - -# define RE_SYNTAX_AWK \ - (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \ - | RE_NO_BK_PARENS | RE_NO_BK_REFS \ - | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \ - | RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \ - | RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS) - -# define RE_SYNTAX_GNU_AWK \ - ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG) \ - & ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS \ - | RE_CONTEXT_INVALID_OPS )) - -# define RE_SYNTAX_POSIX_AWK \ - (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \ - | RE_INTERVALS | RE_NO_GNU_OPS) - -# define RE_SYNTAX_GREP \ - (RE_BK_PLUS_QM | RE_CHAR_CLASSES \ - | RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \ - | RE_NEWLINE_ALT) - -# define RE_SYNTAX_EGREP \ - (RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \ - | RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \ - | RE_NEWLINE_ALT | RE_NO_BK_PARENS \ - | RE_NO_BK_VBAR) - -# define RE_SYNTAX_POSIX_EGREP \ - (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES \ - | RE_INVALID_INTERVAL_ORD) - -/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */ -# define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC - -# define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC - -/* Syntax bits common to both basic and extended POSIX regex syntax. */ -# define _RE_SYNTAX_POSIX_COMMON \ - (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \ - | RE_INTERVALS | RE_NO_EMPTY_RANGES) - -# define RE_SYNTAX_POSIX_BASIC \ - (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM | RE_CONTEXT_INVALID_DUP) - -/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes - RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this - isn't minimal, since other operators, such as \`, aren't disabled. */ -# define RE_SYNTAX_POSIX_MINIMAL_BASIC \ - (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS) - -# define RE_SYNTAX_POSIX_EXTENDED \ - (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \ - | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \ - | RE_NO_BK_PARENS | RE_NO_BK_VBAR \ - | RE_CONTEXT_INVALID_OPS | RE_UNMATCHED_RIGHT_PAREN_ORD) - -/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INDEP_OPS is - removed and RE_NO_BK_REFS is added. */ -# define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \ - (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \ - | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \ - | RE_NO_BK_PARENS | RE_NO_BK_REFS \ - | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD) -/* [[[end syntaxes]]] */ - -#endif /* defined __USE_GNU_REGEX */ - -#ifdef __USE_GNU_REGEX - -/* Maximum number of duplicates an interval can allow. POSIX-conforming - systems might define this in , but we want our - value, so remove any previous define. */ -# ifdef RE_DUP_MAX -# undef RE_DUP_MAX -# endif - -/* RE_DUP_MAX is 2**15 - 1 because an earlier implementation stored - the counter as a 2-byte signed integer. This is no longer true, so - RE_DUP_MAX could be increased to (INT_MAX / 10 - 1), or to - ((SIZE_MAX - 2) / 10 - 1) if _REGEX_LARGE_OFFSETS is defined. - However, there would be a huge performance problem if someone - actually used a pattern like a\{214748363\}, so RE_DUP_MAX retains - its historical value. */ -# define RE_DUP_MAX (0x7fff) - -#endif /* defined __USE_GNU_REGEX */ - - -/* POSIX `cflags' bits (i.e., information for `regcomp'). */ - -/* If this bit is set, then use extended regular expression syntax. - If not set, then use basic regular expression syntax. */ -#define REG_EXTENDED 1 - -/* If this bit is set, then ignore case when matching. - If not set, then case is significant. */ -#define REG_ICASE (1 << 1) - -/* If this bit is set, then anchors do not match at newline - characters in the string. - If not set, then anchors do match at newlines. */ -#define REG_NEWLINE (1 << 2) - -/* If this bit is set, then report only success or fail in regexec. - If not set, then returns differ between not matching and errors. */ -#define REG_NOSUB (1 << 3) - - -/* POSIX `eflags' bits (i.e., information for regexec). */ - -/* If this bit is set, then the beginning-of-line operator doesn't match - the beginning of the string (presumably because it's not the - beginning of a line). - If not set, then the beginning-of-line operator does match the - beginning of the string. */ -#define REG_NOTBOL 1 - -/* Like REG_NOTBOL, except for the end-of-line. */ -#define REG_NOTEOL (1 << 1) - -/* Use PMATCH[0] to delimit the start and end of the search in the - buffer. */ -#define REG_STARTEND (1 << 2) - - -/* If any error codes are removed, changed, or added, update the - `__re_error_msgid' table in regcomp.c. */ - -typedef enum -{ - _REG_ENOSYS = -1, /* This will never happen for this implementation. */ - _REG_NOERROR = 0, /* Success. */ - _REG_NOMATCH, /* Didn't find a match (for regexec). */ - - /* POSIX regcomp return error codes. (In the order listed in the - standard.) */ - _REG_BADPAT, /* Invalid pattern. */ - _REG_ECOLLATE, /* Invalid collating element. */ - _REG_ECTYPE, /* Invalid character class name. */ - _REG_EESCAPE, /* Trailing backslash. */ - _REG_ESUBREG, /* Invalid back reference. */ - _REG_EBRACK, /* Unmatched left bracket. */ - _REG_EPAREN, /* Parenthesis imbalance. */ - _REG_EBRACE, /* Unmatched \{. */ - _REG_BADBR, /* Invalid contents of \{\}. */ - _REG_ERANGE, /* Invalid range end. */ - _REG_ESPACE, /* Ran out of memory. */ - _REG_BADRPT, /* No preceding re for repetition op. */ - - /* Error codes we've added. */ - _REG_EEND, /* Premature end. */ - _REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */ - _REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */ -} reg_errcode_t; - -#ifdef _XOPEN_SOURCE -# define REG_ENOSYS _REG_ENOSYS -#endif -#define REG_NOERROR _REG_NOERROR -#define REG_NOMATCH _REG_NOMATCH -#define REG_BADPAT _REG_BADPAT -#define REG_ECOLLATE _REG_ECOLLATE -#define REG_ECTYPE _REG_ECTYPE -#define REG_EESCAPE _REG_EESCAPE -#define REG_ESUBREG _REG_ESUBREG -#define REG_EBRACK _REG_EBRACK -#define REG_EPAREN _REG_EPAREN -#define REG_EBRACE _REG_EBRACE -#define REG_BADBR _REG_BADBR -#define REG_ERANGE _REG_ERANGE -#define REG_ESPACE _REG_ESPACE -#define REG_BADRPT _REG_BADRPT -#define REG_EEND _REG_EEND -#define REG_ESIZE _REG_ESIZE -#define REG_ERPAREN _REG_ERPAREN - -/* struct re_pattern_buffer normally uses member names like `buffer' - that POSIX does not allow. In POSIX mode these members have names - with leading `re_' (e.g., `re_buffer'). */ -#ifdef __USE_GNU_REGEX -# define _REG_RE_NAME(id) id -# define _REG_RM_NAME(id) id -#else -# define _REG_RE_NAME(id) re_##id -# define _REG_RM_NAME(id) rm_##id -#endif - -/* The user can specify the type of the re_translate member by - defining the macro RE_TRANSLATE_TYPE, which defaults to unsigned - char *. This pollutes the POSIX name space, so in POSIX mode just - use unsigned char *. */ -#ifdef __USE_GNU_REGEX -# ifndef RE_TRANSLATE_TYPE -# define RE_TRANSLATE_TYPE unsigned char * -# endif -# define REG_TRANSLATE_TYPE RE_TRANSLATE_TYPE -#else -# define REG_TRANSLATE_TYPE unsigned char * -#endif - -/* This data structure represents a compiled pattern. Before calling - the pattern compiler, the fields `buffer', `allocated', `fastmap', - `translate', and `no_sub' can be set. After the pattern has been - compiled, the `re_nsub' field is available. All other fields are - private to the regex routines. */ - -struct re_pattern_buffer -{ - /* Space that holds the compiled pattern. It is declared as - `unsigned char *' because its elements are sometimes used as - array indexes. */ - unsigned char *_REG_RE_NAME (buffer); - - /* Number of bytes to which `buffer' points. */ - __re_long_size_t _REG_RE_NAME (allocated); - - /* Number of bytes actually used in `buffer'. */ - __re_long_size_t _REG_RE_NAME (used); - - /* Syntax setting with which the pattern was compiled. */ - reg_syntax_t _REG_RE_NAME (syntax); - - /* Pointer to a fastmap, if any, otherwise zero. re_search uses the - fastmap, if there is one, to skip over impossible starting points - for matches. */ - char *_REG_RE_NAME (fastmap); - - /* Either a translate table to apply to all characters before - comparing them, or zero for no translation. The translation is - applied to a pattern when it is compiled and to a string when it - is matched. */ - REG_TRANSLATE_TYPE _REG_RE_NAME (translate); - - /* Number of subexpressions found by the compiler. */ - size_t re_nsub; - - /* Zero if this pattern cannot match the empty string, one else. - Well, in truth it's used only in `re_search_2', to see whether or - not we should use the fastmap, so we don't set this absolutely - perfectly; see `re_compile_fastmap' (the `duplicate' case). */ - unsigned int _REG_RE_NAME (can_be_null) : 1; - - /* If REGS_UNALLOCATED, allocate space in the `regs' structure - for `max (RE_NREGS, re_nsub + 1)' groups. - If REGS_REALLOCATE, reallocate space if necessary. - If REGS_FIXED, use what's there. */ -#ifdef __USE_GNU_REGEX -# define REGS_UNALLOCATED 0 -# define REGS_REALLOCATE 1 -# define REGS_FIXED 2 -#endif - unsigned int _REG_RE_NAME (regs_allocated) : 2; - - /* Set to zero when `re_compile_pattern' compiles a pattern; set to - one by `re_compile_fastmap' if it updates the fastmap. */ - unsigned int _REG_RE_NAME (fastmap_accurate) : 1; - - /* If set, `re_match_2' does not return information about - subexpressions. */ - unsigned int _REG_RE_NAME (no_sub) : 1; - - /* If set, a beginning-of-line anchor doesn't match at the beginning - of the string. */ - unsigned int _REG_RE_NAME (not_bol) : 1; - - /* Similarly for an end-of-line anchor. */ - unsigned int _REG_RE_NAME (not_eol) : 1; - - /* If true, an anchor at a newline matches. */ - unsigned int _REG_RE_NAME (newline_anchor) : 1; - -/* [[[end pattern_buffer]]] */ -}; - -typedef struct re_pattern_buffer regex_t; - -/* This is the structure we store register match data in. See - regex.texinfo for a full description of what registers match. */ -struct re_registers -{ - __re_size_t _REG_RM_NAME (num_regs); - regoff_t *_REG_RM_NAME (start); - regoff_t *_REG_RM_NAME (end); -}; - - -/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer, - `re_match_2' returns information about at least this many registers - the first time a `regs' structure is passed. */ -#if !defined RE_NREGS && defined __USE_GNU_REGEX -# define RE_NREGS 30 -#endif - - -/* POSIX specification for registers. Aside from the different names than - `re_registers', POSIX uses an array of structures, instead of a - structure of arrays. */ -typedef struct -{ - regoff_t rm_so; /* Byte offset from string's start to substring's start. */ - regoff_t rm_eo; /* Byte offset from string's start to substring's end. */ -} regmatch_t; - -/* Declarations for routines. */ - -/* Sets the current default syntax to SYNTAX, and return the old syntax. - You can also simply assign to the `re_syntax_options' variable. */ -extern reg_syntax_t re_set_syntax (reg_syntax_t __syntax); - -/* Compile the regular expression PATTERN, with length LENGTH - and syntax given by the global `re_syntax_options', into the buffer - BUFFER. Return NULL if successful, and an error string if not. */ -extern const char *re_compile_pattern (const char *__pattern, size_t __length, - struct re_pattern_buffer *__buffer); - - -/* Compile a fastmap for the compiled pattern in BUFFER; used to - accelerate searches. Return 0 if successful and -2 if was an - internal error. */ -extern int re_compile_fastmap (struct re_pattern_buffer *__buffer); - - -/* Search in the string STRING (with length LENGTH) for the pattern - compiled into BUFFER. Start searching at position START, for RANGE - characters. Return the starting position of the match, -1 for no - match, or -2 for an internal error. Also return register - information in REGS (if REGS and BUFFER->no_sub are nonzero). */ -extern regoff_t re_search (struct re_pattern_buffer *__buffer, - const char *__string, __re_idx_t __length, - __re_idx_t __start, regoff_t __range, - struct re_registers *__regs); - - -/* Like `re_search', but search in the concatenation of STRING1 and - STRING2. Also, stop searching at index START + STOP. */ -extern regoff_t re_search_2 (struct re_pattern_buffer *__buffer, - const char *__string1, __re_idx_t __length1, - const char *__string2, __re_idx_t __length2, - __re_idx_t __start, regoff_t __range, - struct re_registers *__regs, - __re_idx_t __stop); - - -/* Like `re_search', but return how many characters in STRING the regexp - in BUFFER matched, starting at position START. */ -extern regoff_t re_match (struct re_pattern_buffer *__buffer, - const char *__string, __re_idx_t __length, - __re_idx_t __start, struct re_registers *__regs); - - -/* Relates to `re_match' as `re_search_2' relates to `re_search'. */ -extern regoff_t re_match_2 (struct re_pattern_buffer *__buffer, - const char *__string1, __re_idx_t __length1, - const char *__string2, __re_idx_t __length2, - __re_idx_t __start, struct re_registers *__regs, - __re_idx_t __stop); - - -/* Set REGS to hold NUM_REGS registers, storing them in STARTS and - ENDS. Subsequent matches using BUFFER and REGS will use this memory - for recording register information. STARTS and ENDS must be - allocated with malloc, and must each be at least `NUM_REGS * sizeof - (regoff_t)' bytes long. - - If NUM_REGS == 0, then subsequent matches should allocate their own - register data. - - Unless this function is called, the first search or match using - BUFFER will allocate its own register data, without freeing the old - data. */ -extern void re_set_registers (struct re_pattern_buffer *__buffer, - struct re_registers *__regs, - __re_size_t __num_regs, - regoff_t *__starts, regoff_t *__ends); - -#if defined _REGEX_RE_COMP || defined _LIBC -# ifndef _CRAY -/* 4.2 bsd compatibility. */ -extern char *re_comp (const char *); -extern int re_exec (const char *); -# endif -#endif - -/* GCC 2.95 and later have "__restrict"; C99 compilers have - "restrict", and "configure" may have defined "restrict". - Other compilers use __restrict, __restrict__, and _Restrict, and - 'configure' might #define 'restrict' to those words, so pick a - different name. */ -#ifndef _Restrict_ -# if 199901L <= __STDC_VERSION__ -# define _Restrict_ restrict -# elif 2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__) -# define _Restrict_ __restrict -# else -# define _Restrict_ -# endif -#endif -/* gcc 3.1 and up support the [restrict] syntax. Don't trust - sys/cdefs.h's definition of __restrict_arr, though, as it - mishandles gcc -ansi -pedantic. */ -#ifndef _Restrict_arr_ -# if ((199901L <= __STDC_VERSION__ \ - || ((3 < __GNUC__ || (3 == __GNUC__ && 1 <= __GNUC_MINOR__)) \ - && !__STRICT_ANSI__)) \ - && !defined __GNUG__) -# define _Restrict_arr_ _Restrict_ -# else -# define _Restrict_arr_ -# endif -#endif - -/* POSIX compatibility. */ -extern int regcomp (regex_t *_Restrict_ __preg, - const char *_Restrict_ __pattern, - int __cflags); - -extern int regexec (const regex_t *_Restrict_ __preg, - const char *_Restrict_ __string, size_t __nmatch, - regmatch_t __pmatch[_Restrict_arr_], - int __eflags); - -extern size_t regerror (int __errcode, const regex_t *_Restrict_ __preg, - char *_Restrict_ __errbuf, size_t __errbuf_size); - -extern void regfree (regex_t *__preg); - - -#ifdef __cplusplus -} -#endif /* C++ */ - -#endif /* regex.h */ diff -Nru lua-rexlib-2.6.0/src/oniguruma/Makefile lua-rexlib-2.7.2/src/oniguruma/Makefile --- lua-rexlib-2.6.0/src/oniguruma/Makefile 2010-10-03 17:38:27.000000000 +0000 +++ lua-rexlib-2.7.2/src/oniguruma/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -# makefile for rex_onig library - -include ../defaults.mak - -# === USER SETTINGS === -# =========================================================================== - -# These are default values. -INC = -LIB = -lonig - -# If the default settings don't work for your system, -# try to uncomment and edit the settings below. -#INC = -#LIB = -lonig - -# Target name -REGNAME = onig - -# =========================================================================== -# === END OF USER SETTINGS === - -OBJ = lonig.o lonig_f.o ../common.o - -include ../common.mak - -# static Oniguruma regexp library binding -ar_onig: $(TRG_AR) - -# dynamic Oniguruma regexp library binding -so_onig: $(TRG_SO) - -# Dependencies -lonig.o: lonig.c ../common.h ../algo.h -lonig_f.o: lonig_f.c ../common.h -../common.o: ../common.c ../common.h - -# (End of Makefile) diff -Nru lua-rexlib-2.6.0/src/oniguruma/lonig.c lua-rexlib-2.7.2/src/oniguruma/lonig.c --- lua-rexlib-2.6.0/src/oniguruma/lonig.c 2012-04-05 12:35:46.000000000 +0000 +++ lua-rexlib-2.7.2/src/oniguruma/lonig.c 2013-01-08 19:41:59.000000000 +0000 @@ -46,7 +46,7 @@ lua_pushlstring (L, (text) + ALG_SUBBEG(ud,n), ALG_SUBLEN(ud,n)) #define ALG_PUSHSUB_OR_FALSE(L,ud,text,n) \ - (ALG_SUBVALID(ud,n) ? ALG_PUSHSUB (L,ud,text,n) : lua_pushboolean (L,0)) + (ALG_SUBVALID(ud,n) ? (void) ALG_PUSHSUB (L,ud,text,n) : lua_pushboolean (L,0)) #define ALG_PUSHSTART(L,ud,offs,n) lua_pushinteger(L, (offs) + ALG_SUBBEG(ud,n) + 1) #define ALG_PUSHEND(L,ud,offs,n) lua_pushinteger(L, (offs) + ALG_SUBEND(ud,n)) diff -Nru lua-rexlib-2.6.0/src/pcre/Makefile lua-rexlib-2.7.2/src/pcre/Makefile --- lua-rexlib-2.6.0/src/pcre/Makefile 2010-10-03 17:38:27.000000000 +0000 +++ lua-rexlib-2.7.2/src/pcre/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -# makefile for rex_pcre library - -include ../defaults.mak - -# === USER SETTINGS === -# =========================================================================== - -# These are default values. -INC = -LIB = -lpcre - -# If the default settings don't work for your system, -# try to uncomment and edit the settings below. -#INC = -#LIB = -lpcre - -# Target name -REGNAME = pcre - -# =========================================================================== -# === END OF USER SETTINGS === - -OBJ = lpcre.o lpcre_f.o ../common.o - -include ../common.mak - -# static PCRE regexp library binding -ar_pcre: $(TRG_AR) - -# dynamic PCRE regexp library binding -so_pcre: $(TRG_SO) - -# Dependencies -lpcre.o: lpcre.c ../common.h ../algo.h -lpcre_f.o: lpcre_f.c ../common.h -../common.o: ../common.c ../common.h - -# (End of Makefile) diff -Nru lua-rexlib-2.6.0/src/pcre/lpcre.c lua-rexlib-2.7.2/src/pcre/lpcre.c --- lua-rexlib-2.6.0/src/pcre/lpcre.c 2012-04-05 12:35:46.000000000 +0000 +++ lua-rexlib-2.7.2/src/pcre/lpcre.c 2013-01-08 19:41:59.000000000 +0000 @@ -221,6 +221,8 @@ pcre_fullinfo (ud->pr, ud->extra, PCRE_INFO_CAPTURECOUNT, &ud->ncapt); /* need (2 ints per capture, plus one for substring match) * 3/2 */ ud->match = (int *) Lmalloc (L, (ALG_NSUB(ud) + 1) * 3 * sizeof (int)); + if (!ud->match) + luaL_error (L, "malloc failed"); if (pud) *pud = ud; return 1; @@ -258,9 +260,13 @@ TPcre *ud; int res; int *buf, *ovector, *wspace; + size_t bufsize; checkarg_dfa_exec (L, &argE, &ud); - buf = (int*) Lmalloc (L, (argE.ovecsize + argE.wscount) * sizeof(int)); + bufsize = (argE.ovecsize + argE.wscount) * sizeof(int); + buf = (int*) Lmalloc (L, bufsize); + if (!buf) + luaL_error (L, "malloc failed"); ovector = buf; wspace = buf + argE.ovecsize; @@ -277,11 +283,11 @@ lua_rawseti (L, -2, i+1); } lua_pushinteger (L, res); /* 3-rd return value */ - free (buf); + Lfree (L, buf, bufsize); return 3; } else { - free (buf); + Lfree (L, buf, bufsize); if (ALG_NOMATCH (res)) return lua_pushnil (L), 1; else @@ -337,7 +343,7 @@ if (ud->pr) pcre_free (ud->pr); if (ud->extra) pcre_free (ud->extra); if (ud->tables) pcre_free ((void *)ud->tables); - free (ud->match); + Lfree (L, ud->match, (ALG_NSUB(ud) + 1) * 3 * sizeof (int)); } return 0; } diff -Nru lua-rexlib-2.6.0/src/posix/Makefile lua-rexlib-2.7.2/src/posix/Makefile --- lua-rexlib-2.6.0/src/posix/Makefile 2010-10-03 17:38:27.000000000 +0000 +++ lua-rexlib-2.7.2/src/posix/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -# makefile for rex_posix library - -include ../defaults.mak - -# === USER SETTINGS === -# =========================================================================== - -# These are default values. -INC = -LIB = - -# If the default settings don't work for your system, -# try to uncomment and edit the settings below. -#INC = -#LIB = -lc - -# WARNING: -# If you want to use a POSIX regex library that is not the system -# default, make sure you set both the INC and LIB variables correctly, -# as if a header file and library are used which do not match, you may -# well get segmentation faults (or worse). - -# The following lines work for the rxspencer library, when installed -# under /usr (note the above warning!) -#INC = -I/usr/include/rxspencer -#LIB = -lrxspencer - -# Target name -REGNAME = posix - -# =========================================================================== -# === END OF USER SETTINGS === - -OBJ = lposix.o ../common.o - -include ../common.mak - -# static POSIX regexp library binding -ar_posix: $(TRG_AR) - -# dynamic POSIX regexp library binding -so_posix: $(TRG_SO) - -# Dependencies -lposix.o: lposix.c ../common.h ../algo.h -../common.o: ../common.c ../common.h - -# (End of Makefile) diff -Nru lua-rexlib-2.6.0/src/posix/lposix.c lua-rexlib-2.7.2/src/posix/lposix.c --- lua-rexlib-2.6.0/src/posix/lposix.c 2012-04-05 12:35:46.000000000 +0000 +++ lua-rexlib-2.7.2/src/posix/lposix.c 2013-01-08 19:41:59.000000000 +0000 @@ -26,10 +26,11 @@ #define REX_TYPENAME REX_LIBNAME"_regex" -/* Test if regex.h corresponds to the extended POSIX library, i.e. H.Spencer's. +/* Test if regex.h corresponds to the extended POSIX library, i.e. H. Spencer's. This test may not work as intended if regex.h introduced REG_BASIC, etc. via enum rather than #define. If that's the case, add -DREX_POSIX_EXT in the makefile/command line. + The same applies to REG_STARTEND. */ #ifndef REX_POSIX_EXT # if defined(REG_BASIC) && defined(REG_STARTEND) @@ -38,7 +39,7 @@ #endif #define ALG_CFLAGS_DFLT REG_EXTENDED -#ifdef REX_POSIX_EXT +#ifdef REG_STARTEND # define ALG_EFLAGS_DFLT REG_STARTEND #else # define ALG_EFLAGS_DFLT 0 @@ -109,6 +110,8 @@ if (argC->cflags & REG_NOSUB) ud->r.re_nsub = 0; ud->match = (regmatch_t *) Lmalloc (L, (ALG_NSUB(ud) + 1) * sizeof (regmatch_t)); + if (!ud->match) + luaL_error (L, "malloc failed"); lua_pushvalue (L, ALG_ENVIRONINDEX); lua_setmetatable (L, -2); @@ -116,23 +119,11 @@ return 1; } -#ifdef REX_POSIX_EXT -static void CheckStartEnd (TArgExec *argE, TPosix *ud) { - if (argE->eflags & REG_STARTEND) { - ud->match[0].rm_so = argE->startoffset; - ud->match[0].rm_eo = argE->textlen; - argE->startoffset = 0; - } - else - argE->text += argE->startoffset; -} -#endif - static int gmatch_exec (TUserdata *ud, TArgExec *argE) { if (argE->startoffset > 0) argE->eflags |= REG_NOTBOL; -#ifdef REX_POSIX_EXT +#ifdef REG_STARTEND if (argE->eflags & REG_STARTEND) { ALG_SUBBEG(ud,0) = 0; ALG_SUBEND(ud,0) = argE->textlen - argE->startoffset; @@ -144,27 +135,29 @@ } static void gmatch_pushsubject (lua_State *L, TArgExec *argE) { -#ifdef REX_POSIX_EXT +#ifdef REG_STARTEND if (argE->eflags & REG_STARTEND) lua_pushlstring (L, argE->text, argE->textlen); else - lua_pushlstring (L, argE->text, strlen (argE->text)); -#else - lua_pushlstring (L, argE->text, strlen (argE->text)); #endif + lua_pushstring (L, argE->text); } static int findmatch_exec (TPosix *ud, TArgExec *argE) { -#ifdef REX_POSIX_EXT - CheckStartEnd (argE, ud); -#else - argE->text += argE->startoffset; +#ifdef REG_STARTEND + if (argE->eflags & REG_STARTEND) { + ud->match[0].rm_so = argE->startoffset; + ud->match[0].rm_eo = argE->textlen; + argE->startoffset = 0; + } + else #endif + argE->text += argE->startoffset; return regexec (&ud->r, argE->text, ALG_NSUB(ud) + 1, ud->match, argE->eflags); } static int gsub_exec (TPosix *ud, TArgExec *argE, int st) { -#ifdef REX_POSIX_EXT +#ifdef REG_STARTEND if(argE->eflags & REG_STARTEND) { ALG_SUBBEG(ud,0) = 0; ALG_SUBEND(ud,0) = argE->textlen - st; @@ -176,7 +169,7 @@ } static int split_exec (TPosix *ud, TArgExec *argE, int offset) { -#ifdef REX_POSIX_EXT +#ifdef REG_STARTEND if (argE->eflags & REG_STARTEND) { ALG_SUBBEG(ud,0) = 0; ALG_SUBEND(ud,0) = argE->textlen - offset; @@ -193,7 +186,7 @@ if (ud->freed == 0) { /* precaution against "manual" __gc calling */ ud->freed = 1; regfree (&ud->r); - free (ud->match); + Lfree (L, ud->match, (ALG_NSUB(ud) + 1) * sizeof (regmatch_t)); } return 0; } @@ -213,6 +206,8 @@ { "BASIC", REG_BASIC }, { "NOSPEC", REG_NOSPEC }, { "PEND", REG_PEND }, +#endif +#ifdef REG_STARTEND { "STARTEND", REG_STARTEND }, #endif { "EXTENDED", REG_EXTENDED }, diff -Nru lua-rexlib-2.6.0/src/tre/Makefile lua-rexlib-2.7.2/src/tre/Makefile --- lua-rexlib-2.6.0/src/tre/Makefile 2012-04-12 17:43:34.000000000 +0000 +++ lua-rexlib-2.7.2/src/tre/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -# makefile for rex_tre library - -include ../defaults.mak - -# === USER SETTINGS === -# =========================================================================== - -# These are default values. -INC = -LIB = -ltre - -# If the default settings don't work for your system, -# try to uncomment and edit the settings below. -#INC = -I/usr/include -#LIB = -lc - -# WARNING: -# Make sure you set both the INC and LIB variables correctly, as -# otherwise you risk using a header file and library that do not -# match, and you may well get segmentation faults (or worse). - -# Target name -REGNAME = tre - -# =========================================================================== -# === END OF USER SETTINGS === - -OBJ = ltre.o ../common.o # ltre_w.o - -include ../common.mak - -# static TRE regexp library binding -ar_tre: $(TRG_AR) - -# dynamic TRE regexp library binding -so_tre: $(TRG_SO) - -# Dependencies -ltre.o: ltre.c ../common.h ../algo.h -ltre_w.o: ltre_w.c ../common.h ../algo.h -../common.o: ../common.c ../common.h - -# (End of Makefile) diff -Nru lua-rexlib-2.6.0/src/tre/ltre.c lua-rexlib-2.7.2/src/tre/ltre.c --- lua-rexlib-2.6.0/src/tre/ltre.c 2012-04-12 17:24:49.000000000 +0000 +++ lua-rexlib-2.7.2/src/tre/ltre.c 2013-01-08 19:41:59.000000000 +0000 @@ -108,6 +108,8 @@ if (argC->cflags & REG_NOSUB) ud->r.re_nsub = 0; ud->match = (regmatch_t *) Lmalloc (L, (ALG_NSUB(ud) + 1) * sizeof (regmatch_t)); + if (!ud->match) + luaL_error (L, "malloc failed"); lua_pushvalue (L, ALG_ENVIRONINDEX); lua_setmetatable (L, -2); @@ -209,7 +211,7 @@ if (ud->freed == 0) { /* precaution against "manual" __gc calling */ ud->freed = 1; tre_regfree (&ud->r); - free (ud->match); + Lfree (L, ud->match, (ALG_NSUB(ud) + 1) * sizeof (regmatch_t)); } return 0; } diff -Nru lua-rexlib-2.6.0/src/tre/ltre_w.c lua-rexlib-2.7.2/src/tre/ltre_w.c --- lua-rexlib-2.6.0/src/tre/ltre_w.c 2012-04-12 17:24:49.000000000 +0000 +++ lua-rexlib-2.7.2/src/tre/ltre_w.c 2013-01-08 19:41:59.000000000 +0000 @@ -111,6 +111,8 @@ if (argC->cflags & REG_NOSUB) ud->r.re_nsub = 0; ud->match = (regmatch_t *) Lmalloc (L, (ALG_NSUB(ud) + 1) * sizeof (regmatch_t)); + if (!ud->match) + luaL_error (L, "malloc failed"); lua_pushvalue (L, ALG_ENVIRONINDEX); lua_setmetatable (L, -2); diff -Nru lua-rexlib-2.6.0/test/luatest.lua lua-rexlib-2.7.2/test/luatest.lua --- lua-rexlib-2.6.0/test/luatest.lua 2012-02-14 19:06:48.000000000 +0000 +++ lua-rexlib-2.7.2/test/luatest.lua 2013-01-08 19:41:59.000000000 +0000 @@ -73,6 +73,22 @@ if t[1] then table.remove (t, 1) res = t + if alien then + local subject = test[1][1] + local buf = alien.buffer (#subject) + if #subject > 0 then + alien.memmove (buf:topointer (), subject, #subject) + end + test[1][1] = buf + local t = packNT (pcall (func, unpackNT (test[1]))) + if t[1] then + table.remove (t, 1) + res = t + else + print "alien test failed" + res = t[2] --> error_message + end + end else res = t[2] --> error_message end @@ -87,6 +103,7 @@ -- 3) test results table or error_message local function test_method (test, constructor, name) local res1, res2 + local subject = test[2][1] local ok, r = pcall (constructor, unpackNT (test[1])) if ok then local t = packNT (pcall (r[name], r, unpackNT (test[2]))) diff -Nru lua-rexlib-2.6.0/test/onig_sets.lua lua-rexlib-2.7.2/test/onig_sets.lua --- lua-rexlib-2.6.0/test/onig_sets.lua 2010-10-03 17:38:27.000000000 +0000 +++ lua-rexlib-2.7.2/test/onig_sets.lua 1970-01-01 00:00:00.000000000 +0000 @@ -1,147 +0,0 @@ --- See Copyright Notice in the file LICENSE - -local luatest = require "luatest" -local N = luatest.NT - -local function norm(a) return a==nil and N or a end - -local function fill (n, m) - local t = {} - for i = n, m, -1 do table.insert (t, i) end - return t -end - -local function set_named_subpatterns (lib, flg) - return { - Name = "Named Subpatterns", - Func = function (methodname, subj, patt, name1, name2) - local r = lib.new (patt) - local _,_,caps = r[methodname] (r, subj) - return norm(caps[name1]), norm(caps[name2]) - end, - --{} - { {"tfind", "abcd", "(?.)b.(?d)", "dog", "cat"}, {"a","d"} }, - { {"exec", "abcd", "(?.)b.(?d)", "dog", "cat"}, {"a","d"} }, - } -end - -local function set_f_find (lib, flg) - local cp1251 = - "Ũ" - local loc = "CP1251" - return { - Name = "Function find", - Func = lib.find, - --{subj, patt, st,cf,ef,lo}, { results } - { {"abcd", ".+", 5}, { N } }, -- failing st - { {"abcd", ".*?"}, { 1,0 } }, -- non-greedy - { {"abc", "aBC", N,flg.IGNORECASE}, { 1,3 } }, -- cf - { {"abc", "aBC", N,"i" }, { 1,3 } }, -- cf - { {cp1251, "[[:upper:]]+", N,N,N, loc}, { 1,33} }, -- locale - { {cp1251, "[[:lower:]]+", N,N,N, loc}, {34,66} }, -- locale - { {cp1251, "\\w+", N,N,N, loc}, {1, 66} }, -- locale -} -end - -local function set_f_match (lib, flg) - return { - Name = "Function match", - Func = lib.match, - --{subj, patt, st,cf,ef,lo}, { results } - { {"abcd", ".+", 5}, { N }}, -- failing st - { {"abcd", ".*?"}, { "" }}, -- non-greedy - { {"abc", "aBC", N,flg.IGNORECASE}, {"abc" }}, -- cf - { {"abc", "aBC", N,"i" }, {"abc" }}, -- cf -} -end - -local function set_f_gmatch (lib, flg) - -- gmatch (s, p, [cf], [ef]) - local pCSV = "(^[^,]*)|,([^,]*)" - local F = false - local function test_gmatch (subj, patt) - local out, guard = {}, 10 - for a, b in lib.gmatch (subj, patt) do - table.insert (out, { norm(a), norm(b) }) - guard = guard - 1 - if guard == 0 then break end - end - return unpack (out) - end - return { - Name = "Function gmatch", - Func = test_gmatch, - --{ subj patt results } - { {"a\0c", "." }, {{"a",N},{"\0",N},{"c",N}} },--nuls in subj - { {"", pCSV}, {{"",F}} }, - { {"12", pCSV}, {{"12",F}} }, - ----{ {",", pCSV}, {{"", F},{F,""}} }, - { {"12,,45", pCSV}, {{"12",F},{F,""},{F,"45"}} }, - ----{ {",,12,45,,ab,", pCSV}, {{"",F},{F,""},{F,"12"},{F,"45"},{F,""},{F,"ab"},{F,""}} }, - } -end - -local function set_f_split (lib, flg) - -- split (s, p, [cf], [ef]) - local function test_split (subj, patt) - local out, guard = {}, 10 - for a, b, c in lib.split (subj, patt) do - table.insert (out, { norm(a), norm(b), norm(c) }) - guard = guard - 1 - if guard == 0 then break end - end - return unpack (out) - end - return { - Name = "Function split", - Func = test_split, - --{ subj patt results } - { {"a,\0,c", ","}, {{"a",",",N},{"\0",",",N},{"c",N,N}, } },--nuls in subj - { {"ab", "$"}, {{"ab","",N}, {"",N,N}, } }, - { {"ab", "^|$"}, {{"", "", N}, {"ab","",N}, {"",N,N}, } }, - { {"ab45ab","(?<=ab).*?"}, {{"ab","",N}, {"45ab","",N},{"",N,N}, } }, - { {"ab", "\\b"}, {{"", "", N}, {"ab","",N}, {"",N,N}, } }, - } -end - -local function set_m_exec (lib, flg) - return { - Name = "Method exec", - Method = "exec", ---{patt,cf,lo}, {subj,st,ef} { results } - { {".+"}, {"abcd",5}, { N } }, -- failing st - { {".*?"}, {"abcd"}, {1,0,{}} }, -- non-greedy - { {"aBC",flg.IGNORECASE}, {"abc"}, {1,3,{}} }, -- cf - { {"aBC","i" }, {"abc"}, {1,3,{}} }, -- cf -} -end - -local function set_m_tfind (lib, flg) - return { - Name = "Method tfind", - Method = "tfind", ---{patt,cf,lo}, {subj,st,ef} { results } - { {".+"}, {"abcd",5}, { N } }, -- failing st - { {".*?"}, {"abcd"}, {1,0,{}} }, -- non-greedy - { {"aBC",flg.IGNORECASE}, {"abc"}, {1,3,{}} }, -- cf - { {"aBC","i" }, {"abc"}, {1,3,{}} }, -- cf -} -end - -return function (libname) - local lib = require (libname) - local flags = lib.flags () - local sets = { - set_f_match (lib, flags), - set_f_find (lib, flags), - set_f_gmatch (lib, flags), - set_f_split (lib, flags), - set_m_exec (lib, flags), - set_m_tfind (lib, flags), - } - local MAJOR = tonumber(lib.version():match("%d+")) - if MAJOR >= 0 then - table.insert (sets, set_named_subpatterns (lib, flags)) - end - return sets -end diff -Nru lua-rexlib-2.6.0/test/oniguruma_sets.lua lua-rexlib-2.7.2/test/oniguruma_sets.lua --- lua-rexlib-2.6.0/test/oniguruma_sets.lua 1970-01-01 00:00:00.000000000 +0000 +++ lua-rexlib-2.7.2/test/oniguruma_sets.lua 2013-01-08 19:41:59.000000000 +0000 @@ -0,0 +1,147 @@ +-- See Copyright Notice in the file LICENSE + +local luatest = require "luatest" +local N = luatest.NT + +local function norm(a) return a==nil and N or a end + +local function fill (n, m) + local t = {} + for i = n, m, -1 do table.insert (t, i) end + return t +end + +local function set_named_subpatterns (lib, flg) + return { + Name = "Named Subpatterns", + Func = function (subj, methodname, patt, name1, name2) + local r = lib.new (patt) + local _,_,caps = r[methodname] (r, subj) + return norm(caps[name1]), norm(caps[name2]) + end, + --{} N.B. subject is always first element + { {"abcd", "tfind", "(?.)b.(?d)", "dog", "cat"}, {"a","d"} }, + { {"abcd", "exec", "(?.)b.(?d)", "dog", "cat"}, {"a","d"} }, + } +end + +local function set_f_find (lib, flg) + local cp1251 = + "Ũ" + local loc = "CP1251" + return { + Name = "Function find", + Func = lib.find, + --{subj, patt, st,cf,ef,lo}, { results } + { {"abcd", ".+", 5}, { N } }, -- failing st + { {"abcd", ".*?"}, { 1,0 } }, -- non-greedy + { {"abc", "aBC", N,flg.IGNORECASE}, { 1,3 } }, -- cf + { {"abc", "aBC", N,"i" }, { 1,3 } }, -- cf + { {cp1251, "[[:upper:]]+", N,N,N, loc}, { 1,33} }, -- locale + { {cp1251, "[[:lower:]]+", N,N,N, loc}, {34,66} }, -- locale + { {cp1251, "\\w+", N,N,N, loc}, {1, 66} }, -- locale +} +end + +local function set_f_match (lib, flg) + return { + Name = "Function match", + Func = lib.match, + --{subj, patt, st,cf,ef,lo}, { results } + { {"abcd", ".+", 5}, { N }}, -- failing st + { {"abcd", ".*?"}, { "" }}, -- non-greedy + { {"abc", "aBC", N,flg.IGNORECASE}, {"abc" }}, -- cf + { {"abc", "aBC", N,"i" }, {"abc" }}, -- cf +} +end + +local function set_f_gmatch (lib, flg) + -- gmatch (s, p, [cf], [ef]) + local pCSV = "(^[^,]*)|,([^,]*)" + local F = false + local function test_gmatch (subj, patt) + local out, guard = {}, 10 + for a, b in lib.gmatch (subj, patt) do + table.insert (out, { norm(a), norm(b) }) + guard = guard - 1 + if guard == 0 then break end + end + return unpack (out) + end + return { + Name = "Function gmatch", + Func = test_gmatch, + --{ subj patt results } + { {"a\0c", "." }, {{"a",N},{"\0",N},{"c",N}} },--nuls in subj + { {"", pCSV}, {{"",F}} }, + { {"12", pCSV}, {{"12",F}} }, + ----{ {",", pCSV}, {{"", F},{F,""}} }, + { {"12,,45", pCSV}, {{"12",F},{F,""},{F,"45"}} }, + ----{ {",,12,45,,ab,", pCSV}, {{"",F},{F,""},{F,"12"},{F,"45"},{F,""},{F,"ab"},{F,""}} }, + } +end + +local function set_f_split (lib, flg) + -- split (s, p, [cf], [ef]) + local function test_split (subj, patt) + local out, guard = {}, 10 + for a, b, c in lib.split (subj, patt) do + table.insert (out, { norm(a), norm(b), norm(c) }) + guard = guard - 1 + if guard == 0 then break end + end + return unpack (out) + end + return { + Name = "Function split", + Func = test_split, + --{ subj patt results } + { {"a,\0,c", ","}, {{"a",",",N},{"\0",",",N},{"c",N,N}, } },--nuls in subj + { {"ab", "$"}, {{"ab","",N}, {"",N,N}, } }, + { {"ab", "^|$"}, {{"", "", N}, {"ab","",N}, {"",N,N}, } }, + { {"ab45ab","(?<=ab).*?"}, {{"ab","",N}, {"45ab","",N},{"",N,N}, } }, + { {"ab", "\\b"}, {{"", "", N}, {"ab","",N}, {"",N,N}, } }, + } +end + +local function set_m_exec (lib, flg) + return { + Name = "Method exec", + Method = "exec", +--{patt,cf,lo}, {subj,st,ef} { results } + { {".+"}, {"abcd",5}, { N } }, -- failing st + { {".*?"}, {"abcd"}, {1,0,{}} }, -- non-greedy + { {"aBC",flg.IGNORECASE}, {"abc"}, {1,3,{}} }, -- cf + { {"aBC","i" }, {"abc"}, {1,3,{}} }, -- cf +} +end + +local function set_m_tfind (lib, flg) + return { + Name = "Method tfind", + Method = "tfind", +--{patt,cf,lo}, {subj,st,ef} { results } + { {".+"}, {"abcd",5}, { N } }, -- failing st + { {".*?"}, {"abcd"}, {1,0,{}} }, -- non-greedy + { {"aBC",flg.IGNORECASE}, {"abc"}, {1,3,{}} }, -- cf + { {"aBC","i" }, {"abc"}, {1,3,{}} }, -- cf +} +end + +return function (libname) + local lib = require (libname) + local flags = lib.flags () + local sets = { + set_f_match (lib, flags), + set_f_find (lib, flags), + set_f_gmatch (lib, flags), + set_f_split (lib, flags), + set_m_exec (lib, flags), + set_m_tfind (lib, flags), + } + local MAJOR = tonumber(lib.version():match("%d+")) + if MAJOR >= 0 then + table.insert (sets, set_named_subpatterns (lib, flags)) + end + return sets +end diff -Nru lua-rexlib-2.6.0/test/pcre_sets.lua lua-rexlib-2.7.2/test/pcre_sets.lua --- lua-rexlib-2.6.0/test/pcre_sets.lua 2010-10-03 17:38:27.000000000 +0000 +++ lua-rexlib-2.7.2/test/pcre_sets.lua 2013-01-08 19:41:59.000000000 +0000 @@ -14,14 +14,14 @@ local function set_named_subpatterns (lib, flg) return { Name = "Named Subpatterns", - Func = function (methodname, subj, patt, name1, name2) + Func = function (subj, methodname, patt, name1, name2) local r = lib.new (patt) local _,_,caps = r[methodname] (r, subj) return norm(caps[name1]), norm(caps[name2]) end, - --{} - { {"tfind", "abcd", "(?P.)b.(?Pd)", "dog", "cat"}, {"a","d"} }, - { {"exec", "abcd", "(?P.)b.(?Pd)", "dog", "cat"}, {"a","d"} }, + --{} N.B. subject is always first element + { {"abcd", "tfind", "(?P.)b.(?Pd)", "dog", "cat"}, {"a","d"} }, + { {"abcd", "exec", "(?P.)b.(?Pd)", "dog", "cat"}, {"a","d"} }, } end diff -Nru lua-rexlib-2.6.0/test/runtest.lua lua-rexlib-2.7.2/test/runtest.lua --- lua-rexlib-2.6.0/test/runtest.lua 2012-04-12 17:24:49.000000000 +0000 +++ lua-rexlib-2.7.2/test/runtest.lua 2013-01-08 19:41:59.000000000 +0000 @@ -1,5 +1,13 @@ -- See Copyright Notice in the file LICENSE +-- See if we have alien, so we can do tests with buffer subjects +local ok +ok, alien = pcall (require, "alien") +if not ok then + io.stderr:write ("Warning: alien not found, so cannot run tests with buffer subjects\n") + alien = nil +end + do local path = "./?.lua;" if package.path:sub(1, #path) ~= path then @@ -16,6 +24,13 @@ local lib = require (libname) local f = require (setfile) local sets = f (libname) + + local realalien = alien + if libname == "rex_posix" and not lib.flags ().STARTEND and alien then + alien = nil + io.stderr:write ("Cannot run posix tests with alien without REG_STARTEND\n") + end + local n = 0 -- number of failures for _, set in ipairs (sets) do if verbose then @@ -33,15 +48,17 @@ if verbose then print "" end + alien = realalien return n end local avail_tests = { - gnu = { lib = "rex_gnu", "common_sets", "emacs_sets", "gnu_sets" }, - onig = { lib = "rex_onig", "common_sets", "onig_sets", }, - pcre = { lib = "rex_pcre", "common_sets", "pcre_sets", "pcre_sets2", }, - spencer = { lib = "rex_spencer", "common_sets", "posix_sets", "spencer_sets" }, - tre = { lib = "rex_tre", "common_sets", "posix_sets", "spencer_sets", --[["tre_sets"]] }, + posix = { lib = "rex_posix", "common_sets", "posix_sets" }, + gnu = { lib = "rex_gnu", "common_sets", "emacs_sets", "gnu_sets" }, + oniguruma = { lib = "rex_onig", "common_sets", "oniguruma_sets", }, + pcre = { lib = "rex_pcre", "common_sets", "pcre_sets", "pcre_sets2", }, + spencer = { lib = "rex_spencer", "common_sets", "posix_sets", "spencer_sets" }, + tre = { lib = "rex_tre", "common_sets", "posix_sets", "spencer_sets", --[["tre_sets"]] }, } do diff -Nru lua-rexlib-2.6.0/test/scite.properties lua-rexlib-2.7.2/test/scite.properties --- lua-rexlib-2.6.0/test/scite.properties 1970-01-01 00:00:00.000000000 +0000 +++ lua-rexlib-2.7.2/test/scite.properties 2013-01-08 19:41:59.000000000 +0000 @@ -0,0 +1,2 @@ +eol.mode=LF + diff -Nru lua-rexlib-2.6.0/windows/mingw/Makefile lua-rexlib-2.7.2/windows/mingw/Makefile --- lua-rexlib-2.6.0/windows/mingw/Makefile 2012-04-05 12:35:46.000000000 +0000 +++ lua-rexlib-2.7.2/windows/mingw/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -# Makefile for lrexlib - -MKFILES = \ - rex_gnu.mak \ - rex_onig.mak \ - rex_pcre.mak \ - rex_spencer.mak \ - rex_tre.mak - -LOOP = @for %%d in ($(MKFILES)) do $(MAKE) -f %%d - -all: build test - -build: - $(LOOP) - -test: - $(LOOP) test - -install: - $(LOOP) install - -clean: - del *.o *.def *.dll - -.PHONY: all build test install clean diff -Nru lua-rexlib-2.6.0/windows/mingw/_mingw.mak lua-rexlib-2.7.2/windows/mingw/_mingw.mak --- lua-rexlib-2.6.0/windows/mingw/_mingw.mak 2012-04-12 17:24:49.000000000 +0000 +++ lua-rexlib-2.7.2/windows/mingw/_mingw.mak 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -# Use with GNU Make. - -# User Settings ------------------------------------------------------------ - -# Target Lua version (51 for Lua 5.1; 52 for Lua 5.2). -LUAVERSION = 51 - -# INSTALLPATH : Path to install the built DLL. -# LUADLL : Name of Lua DLL to link to (.dll should be omitted). -# LUAEXE : Name of Lua interpreter. -# LUAINC : Path of Lua include files. - -ifeq ($(LUAVERSION),51) - INSTALLPATH = s:\exe\lib32\lua51 - LUADLL = lua5.1 - LUAEXE = lua.exe - LUAINC = s:\progr\work\system\include\lua51 - MYCFLAGS += -DREX_CREATEGLOBALVAR -else - INSTALLPATH = s:\exe\lib32\lua52 - LUADLL = lua52 - LUAEXE = lua52.exe - LUAINC = s:\progr\work\system\include\lua52 -# MYCFLAGS += -DREX_CREATEGLOBALVAR -endif - -# -------------------------------------------------------------------------- - -BIN = $(PROJECT).dll -BININSTALL = $(INSTALLPATH)\$(BIN) -CC = gcc -CFLAGS = -W -Wall -O2 $(INCS) -DREX_OPENLIB=luaopen_$(PROJECT) \ - -DREX_LIBNAME=\"$(PROJECT)\" $(MYCFLAGS) -DEFFILE = $(PROJECT).def -EXPORTED = luaopen_$(PROJECT) -INCS = -I$(LUAINC) $(MYINCS) -LIBS = -l$(LUADLL) $(MYLIBS) -s -SRCPATH = ..\..\src -TESTPATH = ..\..\test - -.PHONY: all install test clean - -vpath %.c $(SRCPATH);$(SRCPATH)\$(PROJDIR) -vpath %.h $(SRCPATH);$(SRCPATH)\$(PROJDIR) - -all: $(BIN) - -clean: - del $(OBJ) $(BIN) $(DEFFILE) - -install: $(BININSTALL) - -test: - cd $(TESTPATH) && $(LUAEXE) runtest.lua $(TESTNAME) -d$(CURDIR) - -$(BIN): $(OBJ) $(DEFFILE) - $(CC) $(DEFFILE) $(OBJ) $(LIBS) -o $@ -shared - -$(DEFFILE): - echo EXPORTS > $@ - for %%d in ($(EXPORTED)) do echo %%d>> $@ - -$(BININSTALL): $(BIN) - copy /Y $< $@ diff -Nru lua-rexlib-2.6.0/windows/mingw/docs.mak lua-rexlib-2.7.2/windows/mingw/docs.mak --- lua-rexlib-2.6.0/windows/mingw/docs.mak 2012-02-14 19:06:48.000000000 +0000 +++ lua-rexlib-2.7.2/windows/mingw/docs.mak 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -# Documentation Makefile - -APP = rst2html.py -CP = "copy /y" -RM = del -IDX = ..\README.rst - -ALLVAR = APP=$(APP) CP=$(CP) RM=$(RM) IDX=$(IDX) - -.PHONY: all clean - -all clean: - cd ..\..\doc && $(MAKE) $(ALLVAR) $@ diff -Nru lua-rexlib-2.6.0/windows/mingw/rex_gnu.mak lua-rexlib-2.7.2/windows/mingw/rex_gnu.mak --- lua-rexlib-2.6.0/windows/mingw/rex_gnu.mak 2012-04-05 12:35:46.000000000 +0000 +++ lua-rexlib-2.7.2/windows/mingw/rex_gnu.mak 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -# Project: rex_gnu - -# User Settings ------------------------------------------------------------ -# path of GNU include files -REGEXINC = s:\progr\work\system\include\gnuregex -# -------------------------------------------------------------------------- - -PROJECT = rex_gnu -MYINCS = -I$(REGEXINC) -MYLIBS = -lregex2 -OBJ = lgnu.o common.o -PROJDIR = gnu -TESTNAME = gnu - -include _mingw.mak - -lgnu.o : common.h algo.h -common.o : common.h diff -Nru lua-rexlib-2.6.0/windows/mingw/rex_onig.mak lua-rexlib-2.7.2/windows/mingw/rex_onig.mak --- lua-rexlib-2.6.0/windows/mingw/rex_onig.mak 2012-04-05 12:35:46.000000000 +0000 +++ lua-rexlib-2.7.2/windows/mingw/rex_onig.mak 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -# Project: rex_onig - -# User Settings ------------------------------------------------------------ -# path of Oniguruma include files -REGEXINC = s:\progr\work\system\include -# -------------------------------------------------------------------------- - -PROJECT = rex_onig -MYINCS = -I$(REGEXINC) -MYLIBS = -lonig -Wl,--enable-auto-import -OBJ = lonig.o lonig_f.o common.o -PROJDIR = oniguruma -TESTNAME = onig - -include _mingw.mak - -lonig.o : common.h algo.h -lonig_f.o : common.h -common.o : common.h diff -Nru lua-rexlib-2.6.0/windows/mingw/rex_pcre.mak lua-rexlib-2.7.2/windows/mingw/rex_pcre.mak --- lua-rexlib-2.6.0/windows/mingw/rex_pcre.mak 2012-04-05 12:35:46.000000000 +0000 +++ lua-rexlib-2.7.2/windows/mingw/rex_pcre.mak 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -# Project: rex_pcre - -# User Settings ------------------------------------------------------------ -# path of PCRE include files -REGEXINC = s:\progr\work\system\include -# -------------------------------------------------------------------------- - -PROJECT = rex_pcre -MYINCS = -I$(REGEXINC) -MYLIBS = -lpcre -OBJ = lpcre.o lpcre_f.o common.o -PROJDIR = pcre -TESTNAME = pcre - -include _mingw.mak - -lpcre.o : common.h algo.h -lpcre_f.o : common.h -common.o : common.h diff -Nru lua-rexlib-2.6.0/windows/mingw/rex_spencer.mak lua-rexlib-2.7.2/windows/mingw/rex_spencer.mak --- lua-rexlib-2.6.0/windows/mingw/rex_spencer.mak 2012-04-05 12:35:46.000000000 +0000 +++ lua-rexlib-2.7.2/windows/mingw/rex_spencer.mak 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -# Project: rex_spencer - -# User Settings ------------------------------------------------------------ -# path of Spencer's include files -REGEXINC = s:\progr\work\system\include\rxspencer -# -------------------------------------------------------------------------- - -PROJECT = rex_spencer -MYINCS = -I$(REGEXINC) -MYLIBS = -lrxspencer -OBJ = lposix.o common.o -PROJDIR = posix -TESTNAME = spencer - -include _mingw.mak - -lposix.o : common.h algo.h -common.o : common.h diff -Nru lua-rexlib-2.6.0/windows/mingw/rex_tre.mak lua-rexlib-2.7.2/windows/mingw/rex_tre.mak --- lua-rexlib-2.6.0/windows/mingw/rex_tre.mak 2012-04-12 17:24:49.000000000 +0000 +++ lua-rexlib-2.7.2/windows/mingw/rex_tre.mak 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -# Project: rex_tre - -# User Settings ------------------------------------------------------------ -# path of TRE include files -REGEXINC = s:\progr\work\system\include -# -------------------------------------------------------------------------- - -PROJECT = rex_tre -MYINCS = -I$(REGEXINC) -MYLIBS = -ltre -OBJ = ltre.o common.o -PROJDIR = tre -TESTNAME = tre - -# Uncomment the following line to add wide-character functions (in alpha state). -# ADDWIDECHARFUNCS = 1 -ifdef ADDWIDECHARFUNCS - OBJ += ltre_w.o - MYCFLAGS += -DREX_ADDWIDECHARFUNCS -endif - -include _mingw.mak - -ltre.o : common.h algo.h -ltre_w.o : common.h algo.h -common.o : common.h