summaryrefslogtreecommitdiff
path: root/doc/manual.txt
diff options
context:
space:
mode:
authorReuben Thomas <rrt@sc3d.org>2010-09-12 17:38:04 +0200
committerReuben Thomas <rrt@sc3d.org>2010-09-12 22:42:04 +0200
commit247b99d4e7f0ac1c7856d6f9b65cea1cf88ff898 (patch)
tree23cdc0deeca7998c22360103d3420835bbfd4cf5 /doc/manual.txt
parentcfeb0ba81b624a15001da525ca902ba6e138c816 (diff)
downloadlrexlib-247b99d4e7f0ac1c7856d6f9b65cea1cf88ff898.tar.gz
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.
Diffstat (limited to 'doc/manual.txt')
-rw-r--r--doc/manual.txt39
1 files changed, 10 insertions, 29 deletions
diff --git a/doc/manual.txt b/doc/manual.txt
index 0237b44..cda6f26 100644
--- a/doc/manual.txt
+++ b/doc/manual.txt
@@ -399,11 +399,12 @@ constants in the used library. They are formed as follows:
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 ``reverse`` which causes the search to be
- performed backwards.
+* **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, 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.
------------------------------------------------------------
@@ -622,37 +623,17 @@ GNU-only functions and methods
new
---
-:funcdef:`rex.new (patt, [cf], [syn], [tr])`
+:funcdef:`rex.new (patt, [cf], [tr])`
-The *syntax* parameter (*syn*) must be one of the predefined strings that are
-formed from the RE_SYNTAX_xxx identifiers defined in regex.h, by means of
-omitting the RE_SYNTAX\_ part. For example, RE_SYNTAX_GREP becomes ``"GREP"`` on
-the Lua side. The default value, used when the parameter is not supplied or
-``nil``, is either ``"POSIX_EXTENDED"`` (at start-up), or the value set by the
-last setsyntax_ call.
+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.
-setsyntax
----------
-
-:funcdef:`rex_gnu.setsyntax (syntax)`
-
-This function sets the default syntax for the GNU library (see the ``new``
-method above for the interpretation of the *syntax* parameter). The specified
-syntax will be further used for compiling string regex patterns by all relevant
-functions, unless the *syn* argument is passed to those functions explicitly.
-
-**Returns:** nothing
-
-**Examples:**
-
- 1. ``rex_gnu.setsyntax ("POSIX") -- use POSIX regex syntax as the default``
- 2. ``rex_gnu.setsyntax ("EMACS") -- use Emacs regex syntax as the default``
-
Oniguruma-only functions and methods
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~