1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00

upgrade to Oniguruma 6.1.2

This commit is contained in:
Anatol Belski
2016-11-25 22:00:53 +01:00
parent 35a3c6e2b9
commit 2a76d2282a
93 changed files with 44509 additions and 18136 deletions

View File

@@ -108,49 +108,61 @@ int main() { return foo(10, "", 3.14); }
PHP_MBSTRING_ADD_BUILD_DIR([oniguruma])
PHP_MBSTRING_ADD_BUILD_DIR([oniguruma/enc])
PHP_MBSTRING_ADD_INCLUDE([oniguruma])
PHP_MBSTRING_ADD_CONFIG_HEADER([oniguruma/config.h])
PHP_MBSTRING_ADD_CONFIG_HEADER([oniguruma/src/config.h])
PHP_MBSTRING_ADD_SOURCES([
oniguruma/regcomp.c
oniguruma/regerror.c
oniguruma/regexec.c
oniguruma/reggnu.c
oniguruma/regparse.c
oniguruma/regenc.c
oniguruma/regext.c
oniguruma/regsyntax.c
oniguruma/regtrav.c
oniguruma/regversion.c
oniguruma/st.c
oniguruma/enc/unicode.c
oniguruma/enc/ascii.c
oniguruma/enc/utf8.c
oniguruma/enc/euc_jp.c
oniguruma/enc/euc_tw.c
oniguruma/enc/euc_kr.c
oniguruma/enc/sjis.c
oniguruma/enc/iso8859_1.c
oniguruma/enc/iso8859_2.c
oniguruma/enc/iso8859_3.c
oniguruma/enc/iso8859_4.c
oniguruma/enc/iso8859_5.c
oniguruma/enc/iso8859_6.c
oniguruma/enc/iso8859_7.c
oniguruma/enc/iso8859_8.c
oniguruma/enc/iso8859_9.c
oniguruma/enc/iso8859_10.c
oniguruma/enc/iso8859_11.c
oniguruma/enc/iso8859_13.c
oniguruma/enc/iso8859_14.c
oniguruma/enc/iso8859_15.c
oniguruma/enc/iso8859_16.c
oniguruma/enc/koi8.c
oniguruma/enc/koi8_r.c
oniguruma/enc/big5.c
oniguruma/enc/utf16_be.c
oniguruma/enc/utf16_le.c
oniguruma/enc/utf32_be.c
oniguruma/enc/utf32_le.c
oniguruma/src/ascii.c
oniguruma/src/big5.c
oniguruma/src/cp1251.c
oniguruma/src/euc_jp.c
oniguruma/src/euc_jp_prop.c
oniguruma/src/euc_kr.c
oniguruma/src/euc_tw.c
oniguruma/src/gb18030.c
oniguruma/src/iso8859_1.c
oniguruma/src/iso8859_10.c
oniguruma/src/iso8859_11.c
oniguruma/src/iso8859_13.c
oniguruma/src/iso8859_14.c
oniguruma/src/iso8859_15.c
oniguruma/src/iso8859_16.c
oniguruma/src/iso8859_2.c
oniguruma/src/iso8859_3.c
oniguruma/src/iso8859_4.c
oniguruma/src/iso8859_5.c
oniguruma/src/iso8859_6.c
oniguruma/src/iso8859_7.c
oniguruma/src/iso8859_8.c
oniguruma/src/iso8859_9.c
oniguruma/src/koi8.c
oniguruma/src/koi8_r.c
oniguruma/src/onig_init.c
oniguruma/src/regcomp.c
oniguruma/src/regenc.c
oniguruma/src/regerror.c
oniguruma/src/regexec.c
oniguruma/src/regext.c
oniguruma/src/reggnu.c
oniguruma/src/regparse.c
oniguruma/src/regposerr.c
oniguruma/src/regposix.c
oniguruma/src/regsyntax.c
oniguruma/src/regtrav.c
oniguruma/src/regversion.c
oniguruma/src/sjis.c
oniguruma/src/sjis_prop.c
oniguruma/src/st.c
oniguruma/src/unicode.c
oniguruma/src/unicode_fold1_key.c
oniguruma/src/unicode_fold2_key.c
oniguruma/src/unicode_fold3_key.c
oniguruma/src/unicode_unfold_key.c
oniguruma/src/utf16_be.c
oniguruma/src/utf16_le.c
oniguruma/src/utf32_be.c
oniguruma/src/utf32_le.c
oniguruma/src/utf8.c
])
cp $ext_builddir/oniguruma/src/oniguruma.h $ext_builddir/oniguruma/oniguruma.h
PHP_MBSTRING_ADD_INSTALL_HEADERS([oniguruma/oniguruma.h])
else
dnl

View File

@@ -10,6 +10,9 @@ if (PHP_MBSTRING != "no") {
EXTENSION("mbstring", "mbstring.c php_unicode.c mb_gpc.c", PHP_MBSTRING_SHARED);
FSO.CopyFile("ext\\mbstring\\oniguruma\\src\\oniguruma.h",
"ext\\mbstring\\oniguruma\\oniguruma.h", true);
if (PHP_LIBMBFL != "no" &&
CHECK_HEADER_ADD_INCLUDE("mbfl/mbfilter.h", "CFLAGS_LIBMBFL", PHP_LIBMBFL + "\\include") &&
CHECK_LIB("mbfl.lib", "libmbfl", PHP_LIBMBFL + "\\lib")) {
@@ -74,8 +77,13 @@ if (PHP_MBSTRING != "no") {
AC_DEFINE('HAVE_MBSTR_RU', 1, 'RU');
AC_DEFINE('HAVE_MBSTR_TW', 1, 'TW');
FSO.CopyFile("ext\\mbstring\\oniguruma\\win32\\config.h",
"ext\\mbstring\\oniguruma\\config.h", true);
if (X64) {
FSO.CopyFile("ext\\mbstring\\oniguruma\\src\\config.h.win64",
"ext\\mbstring\\oniguruma\\src\\config.h", true);
} else {
FSO.CopyFile("ext\\mbstring\\oniguruma\\src\\config.h.win32",
"ext\\mbstring\\oniguruma\\src\\config.h", true);
}
if (PHP_MBREGEX != "no") {
AC_DEFINE('HAVE_STDARG_PROTOTYPES', 1, 'have stdarg.h');
@@ -84,16 +92,7 @@ if (PHP_MBSTRING != "no") {
if (PHP_MBREGEX_BACKTRACK != "no") {
AC_DEFINE('USE_COMBINATION_EXPLOSION_CHECK', 1);
}
ADD_SOURCES("ext/mbstring/oniguruma", "regcomp.c regerror.c \
regenc.c regexec.c reggnu.c regparse.c regposerr.c \
regext.c regsyntax.c regtrav.c regversion.c st.c", "mbstring");
ADD_SOURCES("ext/mbstring/oniguruma/enc", "ascii.c big5.c \
euc_jp.c euc_kr.c euc_tw.c iso8859_1.c iso8859_2.c \
iso8859_3.c iso8859_4.c iso8859_5.c iso8859_6.c \
iso8859_7.c iso8859_8.c iso8859_9.c iso8859_10.c \
iso8859_11.c iso8859_13.c iso8859_14.c iso8859_15.c iso8859_16.c \
koi8.c koi8_r.c sjis.c utf8.c unicode.c utf16_be.c utf16_le.c \
utf32_be.c utf32_le.c gb18030.c", "mbstring");
ADD_SOURCES("ext/mbstring/oniguruma/src", "ascii.c big5.c cp1251.c euc_jp.c euc_jp_prop.c euc_kr.c euc_tw.c gb18030.c iso8859_1.c iso8859_10.c iso8859_11.c iso8859_13.c iso8859_14.c iso8859_15.c iso8859_16.c iso8859_2.c iso8859_3.c iso8859_4.c iso8859_5.c iso8859_6.c iso8859_7.c iso8859_8.c iso8859_9.c koi8.c koi8_r.c mktable.c onig_init.c regcomp.c regenc.c regerror.c regexec.c regext.c reggnu.c regparse.c regposerr.c regposix.c regsyntax.c regtrav.c regversion.c sjis.c sjis_prop.c st.c unicode.c unicode_fold1_key.c unicode_fold2_key.c unicode_fold3_key.c unicode_unfold_key.c utf16_be.c utf16_le.c utf32_be.c utf32_le.c utf8.c", "mbstring");
ADD_SOURCES("ext/mbstring", "php_mbregex.c", "mbstring");
PHP_INSTALL_HEADERS("ext/mbstring", "php_mbregex.h");
}

View File

@@ -1 +1 @@
sndgk393 AT ybb DOT ne DOT jp (K.Kosako)
<kkosako0@gmail.com> (K.Kosako)

View File

@@ -2,7 +2,7 @@ Oniguruma LICENSE
-----------------
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2015 K.Kosako <kkosako0@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

View File

@@ -1,5 +1,63 @@
History
2016/11/07: Version 6.1.2
2016/10/25: allow word bound, word begin and word end in look-behind.
2016/10/19: add ONIG_OPTION_CHECK_VALIDITY_OF_STRING option.
2016/10/16: fix use after free node.
2016/10/10: fix memory leaks after parsing regexp error.
2016/09/22: implement many of is_valid_mbc_string().
2016/09/02: Version 6.1.1
2016/08/31: fix segfault /W.?{888}{888}{888}\x00/ (found by libfuzzer)
2016/08/31: fix error unmatched close parenthesis for %{(.*?)} #23
2016/08/29: Version 6.1.0
2016/08/28: add contributed/libfuzzer-onig.cpp (thanks hannob)
2016/08/28: update LTVERSION 4:0:0
2016/08/28: NEW API: onigenc_is_valid_mbc_string().
2016/08/27: add is_valid_mbc_string() member into OnigEncodingType.
2016/08/27: fix out of bounds read.
2016/08/26: fix out of bounds read.
2016/08/25: disable USE_INVALID_CODE_SCHEME.
2016/08/24: fix out of bounds read.
2016/08/23: doc/RE improved.
2016/08/22: add onig_scan() into doc/API.
2016/08/22: fix bug: Out of bounds read in onig_strcpy() #17
2016/08/21: fix bug: infinite loop of backreference and group.
2016/08/21: fix out of bounds read in mbc_to_code() #16
2016/08/18: doc/RE refinements.
2016/08/16: add onig_scan() (NEW API)
2016/08/16: reimplement match stack allocation for case too many repeat
and too many captures in regexp.
2016/08/15: number of captures <= 32767 for bytecode representation.
2016/07/17: don't use int_map_backward for thread-safe.
2016/07/04: fix case of enclosed option in look-behind.
2016/07/04: fix ignore case in look-behind.
2016/05/23: fix memory leak in onig_unicode_define_user_property()
2016/05/20: declare variables at the top of scope. (thanks nmaya)
2016/05/09: Version 6.0.0
2016/05/05: add NEW API: onig_unicode_define_user_property()
2016/05/04: update Unicode data to 8.0.0
2016/05/02: change OnigCodePoint type to unsigned int.
2016/05/02: add doc/UNICODE_PROPERTIES.
2016/04/19: add error code ONIGERR_FAIL_TO_INITIALIZE.
2016/04/18: add make_win64/32.bat.
2016/04/18: fix bug of uninitialized regex_t value on error.
2016/04/16: reimplement Unicode case folding.
2016/04/11: update LTVERSION = 3.0.0
2016/04/05: remove all THREAD_ macro.
2016/04/05: add init member into OnigEncoding. (add onig_initialize())
2016/03/28: remove state member of regex.
2016/03/25: move source files into src/
2016/03/23: rename configre.in to configure.ac.
2015/11/17: fix memory leak. (thanks pigzang)
2015/07/13: change mail address.
2014/12/12: Version 5.9.6
2013/11/27: [impl] add onigenc_end_unicode(). (thanks Takenori Imoto)
@@ -288,7 +346,7 @@ History
2006/10/10: [impl] remove OP_WORD_SB and OP_WORD_MB.
2006/10/10: [impl] remove OP_EXACT1_IC and OP_EXACTN_IC from match_at().
2006/10/10: [impl] should free new_str in expand_case_fold_string().
2006/10/06: [dist] add test entrys to sample/encode.c.
2006/10/06: [dist] add test entries to sample/encode.c.
2006/10/06: [impl] re-implement caseless match (case-fold).
2006/10/06: [impl] expand string node by case fold variations.
add expand_case_fold_string().
@@ -857,7 +915,7 @@ History
2004/11/16: [impl] add get_type_cc_node method to OnigEncodingType.
2004/11/15: [impl] add st.h and st.c from Ruby 1.9.
use st-hash always.
2004/11/12: [impl] change menber 'not' of CClassNode to 'flags'.
2004/11/12: [impl] change member 'not' of CClassNode to 'flags'.
add flags FLAG_CCLASS_NOT and FLAG_CCLASS_SHARE.
2004/11/12: [impl] add onig_is_in_code_range_array() to enc/unicode.c.
2004/11/12: [impl] fix CRWord in enc/unicode.c and MBWord in enc/utf8.c.
@@ -902,7 +960,7 @@ History
2004/10/18: [impl] (thanks Imai Yasumasa)
enclose #include <sys/types.h> by #ifndef __BORLANDC__.
2004/10/18: [bug] (thanks Imai Yasumasa)
memory acess violation in select_opt_exact_info().
memory access violation in select_opt_exact_info().
2004/09/25: [dist] fix doc/API and doc/API.ja.
2004/09/25: [bug] fix OP_SEMI_END_BUF process in match_at() for
the case USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE
@@ -1113,7 +1171,7 @@ History
2004/04/15: [new] add onig_get_ambig_flag().
2004/04/14: [bug] (thanks Isao Sonobe)
undefined bytecode error happens if ONIG_OPTION_FIND_LONGEST
is setted.
is set.
should finish matching process if find-condition
is fail at OP_END in match_at().
2004/04/12: [impl] add ambig_flag to regex_t.
@@ -1671,7 +1729,7 @@ History
2003/03/12: [spec] change named backref and subexp call format.
backref: \k<name>, call: \g<name> (thanks akr)
2003/03/11: [inst] add regparse.[ch] in win32/Makefile.
2003/03/11: [bug] if UNALIGNED_WORD_ACCESS isn't setted
2003/03/11: [bug] if UNALIGNED_WORD_ACCESS isn't set,
then compile error in unset_addr_list_fix(). (thanks knu)
2003/03/10: [impl] divide regcomp.c to regcomp.c, regparse.c and regparse.h.
2003/03/10: [bug] should handle multi-byte code name in fetch_name().
@@ -1738,7 +1796,7 @@ History
2003/02/28: [impl] add opcode OP_CALL, OP_RETURN.
add stack type STK_CALL_FRAME, STK_RETURN, STK_MEM_END.
2003/02/26: [spec] add new syntax behavior REG_SYN_STRICT_CHECK_BACKREF_NUMBER.
if it is setted, then error /(\1)/, /\1(..)/ etc...
if it is set, then error /(\1)/, /\1(..)/ etc...
2003/02/26: [spec] if backref number is greater than max group number,
then return compile error. (REGERR_INVALID_BACKREF_NUMBER)
2003/02/26: [tune] bad implemented N_ALT case in get_min_match_length().

View File

@@ -0,0 +1,370 @@
Installation Instructions
*************************
Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without warranty of any kind.
Basic Installation
==================
Briefly, the shell command `./configure && make && make install'
should configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package. Some packages provide this
`INSTALL' file but do not implement all of the features documented
below. The lack of an optional feature in a given package is not
necessarily a bug. More recommendations for GNU packages can be found
in *note Makefile Conventions: (standards)Makefile Conventions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package, generally using the just-built uninstalled binaries.
4. Type `make install' to install the programs and any data files and
documentation. When installing into a prefix owned by root, it is
recommended that the package be configured and built as a regular
user, and only the `make install' phase executed with root
privileges.
5. Optionally, type `make installcheck' to repeat any self-tests, but
this time using the binaries in their final installed location.
This target does not install anything. Running this target as a
regular user, particularly if the prior `make install' required
root privileges, verifies that the installation completed
correctly.
6. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
7. Often, you can also type `make uninstall' to remove the installed
files again. In practice, not all packages have tested that
uninstallation works correctly, even though it is required by the
GNU Coding Standards.
8. Some packages, particularly those that use Automake, provide `make
distcheck', which can by used by developers to test that all other
targets like `make install' and `make uninstall' work correctly.
This target is generally not run by end users.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'. This
is known as a "VPATH" build.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple `-arch' options to the
compiler but only a single `-arch' option to the preprocessor. Like
this:
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CPP="gcc -E" CXXCPP="g++ -E"
This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results
using the `lipo' tool if you have problems.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX', where PREFIX must be an
absolute file name.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them. In general, the
default for these options is expressed in terms of `${prefix}', so that
specifying just `--prefix' will affect all of the other directory
specifications that were not explicitly provided.
The most portable way to affect installation locations is to pass the
correct locations to `configure'; however, many packages provide one or
both of the following shortcuts of passing variable assignments to the
`make install' command line to change installation locations without
having to reconfigure or recompile.
The first method involves providing an override variable for each
affected directory. For example, `make install
prefix=/alternate/directory' will choose an alternate location for all
directory configuration variables that were expressed in terms of
`${prefix}'. Any directories that were specified during `configure',
but not in terms of `${prefix}', must each be overridden at install
time for the entire installation to be relocated. The approach of
makefile variable overrides for each directory variable is required by
the GNU Coding Standards, and ideally causes no recompilation.
However, some platforms have known limitations with the semantics of
shared libraries that end up requiring recompilation when using this
method, particularly noticeable in packages that use GNU Libtool.
The second method involves providing the `DESTDIR' variable. For
example, `make install DESTDIR=/alternate/directory' will prepend
`/alternate/directory' before all installation names. The approach of
`DESTDIR' overrides is not required by the GNU Coding Standards, and
does not work on platforms that have drive letters. On the other hand,
it does better at avoiding recompilation issues, and works well even
when some directory options were not specified in terms of `${prefix}'
at `configure' time.
Optional Features
=================
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Some packages offer the ability to configure how verbose the
execution of `make' will be. For these packages, running `./configure
--enable-silent-rules' sets the default to minimal output, which can be
overridden with `make V=1'; while running `./configure
--disable-silent-rules' sets the default to verbose, which can be
overridden with `make V=0'.
Particular systems
==================
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
HP-UX `make' updates targets which have the same time stamps as
their prerequisites, which makes it generally unusable when shipped
generated files such as `configure' are involved. Use GNU `make'
instead.
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its `<wchar.h>' header file. The option `-nodtk' can be used as
a workaround. If GNU CC is not installed, it is therefore recommended
to try
./configure CC="cc"
and if that doesn't work, try
./configure CC="cc -nodtk"
On Solaris, don't put `/usr/ucb' early in your `PATH'. This
directory contains several dysfunctional programs; working variants of
these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
in your `PATH', put it _after_ `/usr/bin'.
On Haiku, software installed for all users goes in `/boot/common',
not `/usr/local'. It is recommended to use the following options:
./configure --prefix=/boot/common
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS
KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf limitation. Until the limitation is lifted, you can use
this workaround:
CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of all of the options to `configure', and exit.
`--help=short'
`--help=recursive'
Print a summary of the options unique to this package's
`configure', and exit. The `short' variant lists options used
only in the top level, while the `recursive' variant lists options
also present in any nested packages.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--prefix=DIR'
Use DIR as the installation prefix. *note Installation Names::
for more details, including other options available for fine-tuning
the installation locations.
`--no-create'
`-n'
Run the configure checks, but stop before creating any output
files.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

View File

View File

@@ -1,8 +1,8 @@
README 2007/05/31
README 2016/05/06
Oniguruma ---- (C) K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
Oniguruma ---- (C) K.Kosako <kkosako0@gmail.com>
http://www.geocities.jp/kosako3/oniguruma/
https://github.com/kkos/oniguruma
Oniguruma is a regular expressions library.
The characteristics of this library is that different character encoding
@@ -30,18 +30,16 @@ Install
Case 1: Unix and Cygwin platform
1. ./configure
2. make
3. make install
1. autoreconf -vfi (* case: configure script is not found.)
2. ./configure
3. make
4. make install
* uninstall
make uninstall
* test (ASCII/EUC-JP)
make atest
* configuration check
onig-config --cflags
@@ -51,18 +49,19 @@ Install
Case 2: Win32 platform (VC++)
Case 2: Windows 64/32bit platform (Visual Studio)
1. copy win32\Makefile Makefile
2. copy win32\config.h config.h
3. nmake
execute make_win64 or make_win32
onig_s.lib: static link library
onig.dll: dynamic link library
src/onig_s.lib: static link library
src/onig.dll: dynamic link library
* test (ASCII/Shift_JIS)
4. copy win32\testc.c testc.c
5. nmake ctest
1. cd src
2. copy ..\windows\testc.c .
3. nmake -f Makefile.windows ctest
(I have checked by Visual Studio Community 2015)
@@ -103,6 +102,7 @@ Sample Programs
sample/posix.c POSIX API sample.
sample/sql.c example of the variable meta characters.
(SQL-like pattern matching)
sample/user_property.c example of user defined Unicode property.
Test Programs
sample/syntax.c Perl, Java and ASIS syntax test.
@@ -136,39 +136,39 @@ Source Files
regposerr.c POSIX error message function.
regposix.c POSIX API functions.
enc/mktable.c character type table generator.
enc/ascii.c ASCII encoding.
enc/euc_jp.c EUC-JP encoding.
enc/euc_tw.c EUC-TW encoding.
enc/euc_kr.c EUC-KR, EUC-CN encoding.
enc/sjis.c Shift_JIS encoding.
enc/big5.c Big5 encoding.
enc/gb18030.c GB18030 encoding.
enc/koi8.c KOI8 encoding.
enc/koi8_r.c KOI8-R encoding.
enc/cp1251.c CP1251 encoding.
enc/iso8859_1.c ISO-8859-1 encoding. (Latin-1)
enc/iso8859_2.c ISO-8859-2 encoding. (Latin-2)
enc/iso8859_3.c ISO-8859-3 encoding. (Latin-3)
enc/iso8859_4.c ISO-8859-4 encoding. (Latin-4)
enc/iso8859_5.c ISO-8859-5 encoding. (Cyrillic)
enc/iso8859_6.c ISO-8859-6 encoding. (Arabic)
enc/iso8859_7.c ISO-8859-7 encoding. (Greek)
enc/iso8859_8.c ISO-8859-8 encoding. (Hebrew)
enc/iso8859_9.c ISO-8859-9 encoding. (Latin-5 or Turkish)
enc/iso8859_10.c ISO-8859-10 encoding. (Latin-6 or Nordic)
enc/iso8859_11.c ISO-8859-11 encoding. (Thai)
enc/iso8859_13.c ISO-8859-13 encoding. (Latin-7 or Baltic Rim)
enc/iso8859_14.c ISO-8859-14 encoding. (Latin-8 or Celtic)
enc/iso8859_15.c ISO-8859-15 encoding. (Latin-9 or West European with Euro)
enc/iso8859_16.c ISO-8859-16 encoding.
mktable.c character type table generator.
ascii.c ASCII encoding.
euc_jp.c EUC-JP encoding.
euc_tw.c EUC-TW encoding.
euc_kr.c EUC-KR, EUC-CN encoding.
sjis.c Shift_JIS encoding.
big5.c Big5 encoding.
gb18030.c GB18030 encoding.
koi8.c KOI8 encoding.
koi8_r.c KOI8-R encoding.
cp1251.c CP1251 encoding.
iso8859_1.c ISO-8859-1 encoding. (Latin-1)
iso8859_2.c ISO-8859-2 encoding. (Latin-2)
iso8859_3.c ISO-8859-3 encoding. (Latin-3)
iso8859_4.c ISO-8859-4 encoding. (Latin-4)
iso8859_5.c ISO-8859-5 encoding. (Cyrillic)
iso8859_6.c ISO-8859-6 encoding. (Arabic)
iso8859_7.c ISO-8859-7 encoding. (Greek)
iso8859_8.c ISO-8859-8 encoding. (Hebrew)
iso8859_9.c ISO-8859-9 encoding. (Latin-5 or Turkish)
iso8859_10.c ISO-8859-10 encoding. (Latin-6 or Nordic)
iso8859_11.c ISO-8859-11 encoding. (Thai)
iso8859_13.c ISO-8859-13 encoding. (Latin-7 or Baltic Rim)
iso8859_14.c ISO-8859-14 encoding. (Latin-8 or Celtic)
iso8859_15.c ISO-8859-15 encoding. (Latin-9 or West European with Euro)
iso8859_16.c ISO-8859-16 encoding.
(Latin-10 or South-Eastern European with Euro)
enc/utf8.c UTF-8 encoding.
enc/utf16_be.c UTF-16BE encoding.
enc/utf16_le.c UTF-16LE encoding.
enc/utf32_be.c UTF-32BE encoding.
enc/utf32_le.c UTF-32LE encoding.
enc/unicode.c Unicode information data.
utf8.c UTF-8 encoding.
utf16_be.c UTF-16BE encoding.
utf16_le.c UTF-16LE encoding.
utf32_be.c UTF-32BE encoding.
utf32_le.c UTF-32LE encoding.
unicode.c common codes of Unicode encoding.
win32/Makefile Makefile for Win32 (VC++)
win32/config.h config.h for Win32
@@ -186,4 +186,4 @@ ToDo
and I'm thankful to Akinori MUSHA.
Mail Address: K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
Mail Address: K.Kosako <kkosako0@gmail.com>

View File

@@ -1,8 +1,8 @@
README.ja 2007/05/31
README.ja 2016/05/06
鬼車 ---- (C) K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
鬼車 ---- (C) K.Kosako <kkosako0@gmail.com>
http://www.geocities.jp/kosako3/oniguruma/
https://github.com/kkos/oniguruma
鬼車は正規表現ライブラリである。
このライブラリの特長は、それぞれの正規表現オブジェクトごとに
@@ -23,26 +23,23 @@ http://www.geocities.jp/kosako3/oniguruma/
ライセンス
BSDライセンスに従う。
BSDライセンス
インストール
ケース1: UnixとCygwin環境
1. ./configure
2. make
3. make install
1. autoreconf -vfi (* configureスクリプトがないときだけ)
2. ./configure
3. make
4. make install
アンインストール
make uninstall
動作テスト (ASCII/EUC-JP)
make atest
構成確認
onig-config --cflags
@@ -52,18 +49,19 @@ http://www.geocities.jp/kosako3/oniguruma/
ケース2: Win32(VC++)環境
ケース2: Windows 64/32bit (Visual Studio)環境
1. copy win32\Makefile Makefile
2. copy win32\config.h config.h
3. nmake
make_win64 あるいは make_win32 を実行
onig_s.lib: static link library
onig.dll: dynamic link library
* 動作テスト (ASCII/Shift_JIS)
4. copy win32\testc.c testc.c
5. nmake ctest
* 動作テスト (ASCII/Shift_JIS)
1. cd src
2. copy ..\windows\testc.c .
3. nmake -f Makefile.windows ctest
(Visual Studio Community 2015 で動作確認)
@@ -109,6 +107,8 @@ http://www.geocities.jp/kosako3/oniguruma/
sample/listcap.c 捕獲履歴機能の使用例
sample/posix.c POSIX API使用例
sample/sql.c 可変メタ文字機能使用例 (SQL-like パターン)
sample/user_property.c ユーザ定義Unicodeプロパティの使用例
テストプログラム
sample/syntax.c Perl、Java、ASIS文法のテスト
@@ -142,39 +142,39 @@ http://www.geocities.jp/kosako3/oniguruma/
regposerr.c POSIX APIエラーメッセージ関数
regposix.c POSIX API関数
enc/mktable.c 文字タイプテーブル生成プログラム
enc/ascii.c ASCII エンコーディング
enc/euc_jp.c EUC-JP エンコーディング
enc/euc_tw.c EUC-TW エンコーディング
enc/euc_kr.c EUC-KR, EUC-CN エンコーディング
enc/sjis.c Shift_JIS エンコーディング
enc/big5.c Big5 エンコーディング
enc/gb18030.c GB18030 エンコーディング
enc/koi8.c KOI8 エンコーディング
enc/koi8_r.c KOI8-R エンコーディング
enc/cp1251.c CP1251 エンコーディング
enc/iso8859_1.c ISO-8859-1 (Latin-1)
enc/iso8859_2.c ISO-8859-2 (Latin-2)
enc/iso8859_3.c ISO-8859-3 (Latin-3)
enc/iso8859_4.c ISO-8859-4 (Latin-4)
enc/iso8859_5.c ISO-8859-5 (Cyrillic)
enc/iso8859_6.c ISO-8859-6 (Arabic)
enc/iso8859_7.c ISO-8859-7 (Greek)
enc/iso8859_8.c ISO-8859-8 (Hebrew)
enc/iso8859_9.c ISO-8859-9 (Latin-5 または Turkish)
enc/iso8859_10.c ISO-8859-10 (Latin-6 または Nordic)
enc/iso8859_11.c ISO-8859-11 (Thai)
enc/iso8859_13.c ISO-8859-13 (Latin-7 または Baltic Rim)
enc/iso8859_14.c ISO-8859-14 (Latin-8 または Celtic)
enc/iso8859_15.c ISO-8859-15 (Latin-9 または West European with Euro)
enc/iso8859_16.c ISO-8859-16
mktable.c 文字タイプテーブル生成プログラム
ascii.c ASCII エンコーディング
euc_jp.c EUC-JP エンコーディング
euc_tw.c EUC-TW エンコーディング
euc_kr.c EUC-KR, EUC-CN エンコーディング
sjis.c Shift_JIS エンコーディング
big5.c Big5 エンコーディング
gb18030.c GB18030 エンコーディング
koi8.c KOI8 エンコーディング
koi8_r.c KOI8-R エンコーディング
cp1251.c CP1251 エンコーディング
iso8859_1.c ISO-8859-1 (Latin-1)
iso8859_2.c ISO-8859-2 (Latin-2)
iso8859_3.c ISO-8859-3 (Latin-3)
iso8859_4.c ISO-8859-4 (Latin-4)
iso8859_5.c ISO-8859-5 (Cyrillic)
iso8859_6.c ISO-8859-6 (Arabic)
iso8859_7.c ISO-8859-7 (Greek)
iso8859_8.c ISO-8859-8 (Hebrew)
iso8859_9.c ISO-8859-9 (Latin-5 または Turkish)
iso8859_10.c ISO-8859-10 (Latin-6 または Nordic)
iso8859_11.c ISO-8859-11 (Thai)
iso8859_13.c ISO-8859-13 (Latin-7 または Baltic Rim)
iso8859_14.c ISO-8859-14 (Latin-8 または Celtic)
iso8859_15.c ISO-8859-15 (Latin-9 または West European with Euro)
iso8859_16.c ISO-8859-16
(Latin-10 または South-Eastern European with Euro)
enc/utf8.c UTF-8 エンコーディング
enc/utf16_be.c UTF-16BE エンコーディング
enc/utf16_le.c UTF-16LE エンコーディング
enc/utf32_be.c UTF-32BE エンコーディング
enc/utf32_le.c UTF-32LE エンコーディング
enc/unicode.c Unicode情報
utf8.c UTF-8 エンコーディング
utf16_be.c UTF-16BE エンコーディング
utf16_le.c UTF-16LE エンコーディング
utf32_be.c UTF-32BE エンコーディング
utf32_le.c UTF-32LE エンコーディング
unicode.c Unicodeエンコーディングの共通処理
win32/Makefile Win32用 Makefile (for VC++)
win32/config.h Win32用 config.h
@@ -192,4 +192,4 @@ http://www.geocities.jp/kosako3/oniguruma/
and I'm thankful to Akinori MUSHA.
アドレス: K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
アドレス: K.Kosako <kkosako0@gmail.com>

View File

@@ -0,0 +1,203 @@
Oniguruma
=========
https://github.com/kkos/oniguruma
Oniguruma is a regular expressions library.
The characteristics of this library is that different character encoding
for every regular expression object can be specified.
Supported character encodings:
ASCII, UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE,
EUC-JP, EUC-TW, EUC-KR, EUC-CN,
Shift_JIS, Big5, GB18030, KOI8-R, CP1251,
ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5,
ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-10,
ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16
* GB18030: contributed by KUBO Takehiro
* CP1251: contributed by Byte
New feature of version 6.1.2
--------------------------
* allow word bound, word begin and word end in look-behind.
* NEW option: ONIG_OPTION_CHECK_VALIDITY_OF_STRING
New feature of version 6.1
--------------------------
* improved doc/RE
* NEW API: onig_scan()
New feature of version 6.0
--------------------------
* Update Unicode 8.0 Property/Case-folding
* NEW API: onig_unicode_define_user_property()
License
-------
BSD license.
Install
-------
### Case 1: Unix and Cygwin platform
1. autoreconf -vfi (* case: configure script is not found.)
2. ./configure
3. make
4. make install
* uninstall
make uninstall
* configuration check
onig-config --cflags
onig-config --libs
onig-config --prefix
onig-config --exec-prefix
### Case 2: Windows 64/32bit platform (Visual Studio)
execute make_win64 or make_win32
onig_s.lib: static link library
onig.dll: dynamic link library
* test (ASCII/Shift_JIS)
1. cd src
2. copy ..\windows\testc.c .
3. nmake -f Makefile.windows ctest
(I have checked by Visual Studio Community 2015)
Regular Expressions
-------------------
See [doc/RE](doc/RE) or [doc/RE.ja](doc/RE.ja) for Japanese.
Usage
-----
Include oniguruma.h in your program. (Oniguruma API)
See doc/API for Oniguruma API.
If you want to disable UChar type (== unsigned char) definition
in oniguruma.h, define ONIG_ESCAPE_UCHAR_COLLISION and then
include oniguruma.h.
If you want to disable regex_t type definition in oniguruma.h,
define ONIG_ESCAPE_REGEX_T_COLLISION and then include oniguruma.h.
Example of the compiling/linking command line in Unix or Cygwin,
(prefix == /usr/local case)
cc sample.c -L/usr/local/lib -lonig
If you want to use static link library(onig_s.lib) in Win32,
add option -DONIG_EXTERN=extern to C compiler.
Sample Programs
---------------
|File |Description |
|:---------------------|:-----------------------------------------|
|sample/simple.c |example of the minimum (Oniguruma API) |
|sample/names.c |example of the named group callback. |
|sample/encode.c |example of some encodings. |
|sample/listcap.c |example of the capture history. |
|sample/posix.c |POSIX API sample. |
|sample/scan.c |example of using onig_scan(). |
|sample/sql.c |example of the variable meta characters. |
|sample/user_property.c|example of user defined Unicode property. |
Test Programs
|File |Description |
|:------------------|:--------------------------------------|
|sample/syntax.c |Perl, Java and ASIS syntax test. |
|sample/crnl.c |--enable-crnl-as-line-terminator test |
Source Files
------------
|File |Description |
|:------------------|:-------------------------------------------------------|
|oniguruma.h |Oniguruma API header file (public) |
|onig-config.in |configuration check program template |
|regenc.h |character encodings framework header file |
|regint.h |internal definitions |
|regparse.h |internal definitions for regparse.c and regcomp.c |
|regcomp.c |compiling and optimization functions |
|regenc.c |character encodings framework |
|regerror.c |error message function |
|regext.c |extended API functions (deluxe version API) |
|regexec.c |search and match functions |
|regparse.c |parsing functions. |
|regsyntax.c |pattern syntax functions and built-in syntax definitions|
|regtrav.c |capture history tree data traverse functions |
|regversion.c |version info function |
|st.h |hash table functions header file |
|st.c |hash table functions |
|oniggnu.h |GNU regex API header file (public) |
|reggnu.c |GNU regex API functions |
|onigposix.h |POSIX API header file (public) |
|regposerr.c |POSIX error message function |
|regposix.c |POSIX API functions |
|mktable.c |character type table generator |
|ascii.c |ASCII encoding |
|euc_jp.c |EUC-JP encoding |
|euc_tw.c |EUC-TW encoding |
|euc_kr.c |EUC-KR, EUC-CN encoding |
|sjis.c |Shift_JIS encoding |
|big5.c |Big5 encoding |
|gb18030.c |GB18030 encoding |
|koi8.c |KOI8 encoding |
|koi8_r.c |KOI8-R encoding |
|cp1251.c |CP1251 encoding |
|iso8859_1.c |ISO-8859-1 (Latin-1) |
|iso8859_2.c |ISO-8859-2 (Latin-2) |
|iso8859_3.c |ISO-8859-3 (Latin-3) |
|iso8859_4.c |ISO-8859-4 (Latin-4) |
|iso8859_5.c |ISO-8859-5 (Cyrillic) |
|iso8859_6.c |ISO-8859-6 (Arabic) |
|iso8859_7.c |ISO-8859-7 (Greek) |
|iso8859_8.c |ISO-8859-8 (Hebrew) |
|iso8859_9.c |ISO-8859-9 (Latin-5 or Turkish) |
|iso8859_10.c |ISO-8859-10 (Latin-6 or Nordic) |
|iso8859_11.c |ISO-8859-11 (Thai) |
|iso8859_13.c |ISO-8859-13 (Latin-7 or Baltic Rim) |
|iso8859_14.c |ISO-8859-14 (Latin-8 or Celtic) |
|iso8859_15.c |ISO-8859-15 (Latin-9 or West European with Euro) |
|iso8859_16.c |ISO-8859-16 (Latin-10) |
|utf8.c |UTF-8 encoding |
|utf16_be.c |UTF-16BE encoding |
|utf16_le.c |UTF-16LE encoding |
|utf32_be.c |UTF-32BE encoding |
|utf32_le.c |UTF-32LE encoding |
|unicode.c |common codes of Unicode encoding |
|unicode_fold_data.c|Unicode folding data |
|win32/Makefile |Makefile for Win32 (VC++) |
|win32/config.h |config.h for Win32 |

View File

@@ -1,121 +0,0 @@
/* config.h.in. Generated from configure.in by autoheader. */
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/
#undef CRAY_STACKSEG_END
/* Define to 1 if using `alloca.c'. */
#undef C_ALLOCA
/* Define to 1 if you have `alloca', as a function or macro. */
#undef HAVE_ALLOCA
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
*/
#undef HAVE_ALLOCA_H
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define if compilerr supports prototypes */
#undef HAVE_PROTOTYPES
/* Define if compiler supports stdarg prototypes */
#undef HAVE_STDARG_PROTOTYPES
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/times.h> header file. */
#undef HAVE_SYS_TIMES_H
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* The size of `int', as computed by sizeof. */
#undef SIZEOF_INT
/* The size of `long', as computed by sizeof. */
#undef SIZEOF_LONG
/* The size of `short', as computed by sizeof. */
#undef SIZEOF_SHORT
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at runtime.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
#undef STACK_DIRECTION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define if combination explosion check */
#undef USE_COMBINATION_EXPLOSION_CHECK
/* Define if enable CR+NL as line terminator */
#undef USE_CRNL_AS_LINE_TERMINATOR
/* Version number of package */
#undef VERSION
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t

View File

@@ -1,13 +1,19 @@
Oniguruma API Version 5.9.2 2008/02/19
Oniguruma API Version 6.1.0 2016/08/22
#include <oniguruma.h>
# int onig_init(void)
# int onig_initialize(OnigEncoding use_encodings[], int num_encodings)
Initialize library.
You don't have to call it explicitly, because it is called in onig_new().
You have to call it explicitly.
* onig_init() is deprecated.
arguments
1 use_encodings: array of encodings used in application.
2 num_encodings: number of encodings.
# int onig_error_code_to_str(UChar* err_buf, int err_code, ...)
@@ -250,6 +256,27 @@ Oniguruma API Version 5.9.2 2008/02/19
ONIG_OPTION_POSIX_REGION region argument is regmatch_t[] type of POSIX API.
# int onig_scan(regex_t* reg, const UChar* str, const UChar* end,
OnigRegion* region, OnigOptionType option,
int (*scan_callback)(int, int, OnigRegion*, void*),
void* callback_arg)
Scan string and callback with matching region.
normal return: number of matching times
error: error code
interruption: return value of callback function (!= 0)
arguments
1 reg: regex object
2 str: target string
3 end: terminate address of target string
4 region: address for return group match range info (NULL is allowed)
5 option: search time option
6 scan_callback: callback function (defined by user)
7 callback_arg: optional argument passed to callback
# OnigRegion* onig_region_new(void)
Create a region.
@@ -405,9 +432,9 @@ Oniguruma API Version 5.9.2 2008/02/19
1 region: match region data.
2 at: callback position.
ONIG_TRAVERSE_CALLBACK_AT_FIRST: callback first, then traverse childs.
ONIG_TRAVERSE_CALLBACK_AT_LAST: traverse childs first, then callback.
ONIG_TRAVERSE_CALLBACK_AT_BOTH: callback first, then traverse childs,
ONIG_TRAVERSE_CALLBACK_AT_FIRST: callback first, then traverse children.
ONIG_TRAVERSE_CALLBACK_AT_LAST: traverse children first, then callback.
ONIG_TRAVERSE_CALLBACK_AT_BOTH: callback first, then traverse children,
and at last callback again.
3 func: callback function.
@@ -526,7 +553,7 @@ Oniguruma API Version 5.9.2 2008/02/19
2 op, op2, behavior, options: value of element.
# void onig_copy_encoding(OnigEncoding to, OnigOnigEncoding from)
# void onig_copy_encoding(OnigEncoding to, OnigEncoding from)
Copy encoding.
@@ -585,6 +612,23 @@ Oniguruma API Version 5.9.2 2008/02/19
normal return: ONIG_NORMAL
# int onig_unicode_define_user_property(const char* name, OnigCodePoint* ranges))
Define new Unicode property.
(This function is not thread safe.)
arguments
1 name: property name (ASCII only. character ' ', '-', '_' are ignored.)
2 ranges: property code point ranges
(first element is number of ranges.)
[num-of-ranges, 1st-range-start, 1st-range-end, 2nd-range-start... ]
* Don't destroy the ranges after having called this function.
normal return: ONIG_NORMAL
# int onig_end(void)
The use of this library is finished.

View File

@@ -1,13 +1,18 @@
鬼車インターフェース Version 5.9.2 2008/02/19
鬼車インターフェース Version 6.1.0 2016/08/22
#include <oniguruma.h>
# int onig_init(void)
# int onig_initialize(OnigEncoding use_encodings[], int num_encodings)
ライブラリの初期化
最初に呼び出す必要がある。
onig_new()の中で呼び出されるので、この関数を明示的に呼び出さなくてもよい。
* onig_init() は廃止
引数
1 use_encodings: 使用する文字エンコーディングの配列
2 num_encodings: 文字エンコーディングの数
# int onig_error_code_to_str(UChar* err_buf, int err_code, ...)
@@ -251,6 +256,27 @@
ONIG_OPTION_POSIX_REGION region引数をPOSIX APIのregmatch_t[]にする
# int onig_scan(regex_t* reg, const UChar* str, const UChar* end,
OnigRegion* region, OnigOptionType option,
int (*scan_callback)(int, int, OnigRegion*, void*),
void* callback_arg)
正規表現で文字列をスキャンして、マッチングする毎にコールバック関数を呼び出す。
正常終了: マッチ回数 (0回も含める)
エラー: エラーコード (< 0)
中断: コールバック関数が0以外の戻り値を返したとき、その値を戻り値として中断
引数
1 reg: 正規表現オブジェクト
2 str: 検索対象文字列
3 end: 検索対象文字列の終端アドレス
4 region: マッチ領域情報(region) (NULLも許される)
5 option: 検索時オプション
6 scan_callback: コールバック関数
7 callback_arg: コールバック関数に渡される付加引数値
# OnigRegion* onig_region_new(void)
マッチ領域情報(region)を作成する。
@@ -533,7 +559,7 @@
2 op, op2, behavior, options: 要素の値
# void onig_copy_encoding(OnigEncoding to, OnigOnigEncoding from)
# void onig_copy_encoding(OnigEncoding to, OnigEncoding from)
文字エンコーディングをコピーする。
@@ -593,6 +619,23 @@
正常終了戻り値: ONIG_NORMAL
# int onig_unicode_define_user_property(const char* name, OnigCodePoint* ranges))
新しいUnicodeプロパティを定義する。
(この関数はスレッドセーフではない)
引数
1 name: プロパティ名 (ASCIIコードのみ。 文字 ' ', '-', '_' は無視される。)
2 ranges: プロパティコードポイント範囲
(最初の要素は範囲の数)
[num-of-ranges, 1st-range-start, 1st-range-end, 2nd-range-start... ]
* この関数を呼んだ後で、rangesを変更/破壊しないこと
正常終了戻り値: ONIG_NORMAL
# int onig_end(void)
ライブラリの使用を終了する。

View File

@@ -5,32 +5,7 @@ FAQ 2006/11/14
You can execute longest match by using ONIG_OPTION_FIND_LONGEST option
in onig_new().
2. Thread safe
In order to make thread safe, which of (A) or (B) must be done.
(A) Oniguruma Layer
Define the macro below in oniguruma/regint.h.
USE_MULTI_THREAD_SYSTEM
THREAD_ATOMIC_START
THREAD_ATOMIC_END
THREAD_PASS
THREAD_SYSTEM_INIT
THREAD_SYSTEM_END
(B) Application Layer
The plural threads should not do simultaneously that making
new regexp objects or re-compiling objects or freeing objects,
even if these objects are differ.
3. Mailing list
2. Mailing list
There is no mailing list about Oniguruma.

View File

@@ -1,4 +1,4 @@
FAQ 2007/07/23
FAQ 2016/04/06
1. 最長マッチ
@@ -6,36 +6,7 @@ FAQ 2007/07/23
を使用すれば最長マッチになる。
2. スレッドセーフ
スレッドセーフにするには、以下の(A)と(B)のどちらかを行なえば
よい。
(A) Oniguruma Layer
oniguruma/regint.hの中の以下のマクロを定義する。
USE_MULTI_THREAD_SYSTEM
THREAD_ATOMIC_START
THREAD_ATOMIC_END
THREAD_PASS
何らかの初期化/終了処理が必要であれば、以下のマクロに定義する。
THREAD_SYSTEM_INIT
THREAD_SYSTEM_END
(B) Application Layer
同時に複数のスレッドが、正規表現オブジェクトを作成する、
または解放する、ことを行なってはならない。
それらのオブジェクトが全く別のものであっても。
もう少し詳しい説明は、このドキュメントの中の
"スレッドセーフに関する補足"に書いておいた。
3. CR + LF
2. CR + LF
DOSの改行(CR(0x0c) + LF(0x0a)の連続)
@@ -44,87 +15,8 @@ FAQ 2007/07/23
/* #define USE_CRNL_AS_LINE_TERMINATOR */
4. メーリングリスト
3. メーリングリスト
鬼車に関するメーリングリストは存在しない。
//END
スレッドセーフに関する補足
スレッドセーフにするには、個別のアプリケーションの中で行うか、
Onigurumaライブラリの中で行うか、どちらかを選ぶことができます。
(Onigurumaを使用する側で対処するか、Onigurumaに対処させるか
どちらか片方で行う必要があるということです。)
これらの方法について、以下(A)と(B)で説明します。
マルチスレッドAPIは、それぞれのプラットフォームによっても
異なりますので、以下の説明の中で具体的に何を呼ぶのかを
書くことは無理です。実際に使用されるマルチスレッドAPIで、
対応する機能のものを指定してください。
(A) Onigurumaの中で対応する場合
oniguruma/regint.hの中で以下のマクロを定義して再コンパイルしてください。
USE_MULTI_THREAD_SYSTEM
単に有効にすればよいです。
THREAD_ATOMIC_START
THREAD_ATOMIC_END
THREAD_ATOMIC_STARTからTHREAD_ATOMIC_ENDで囲まれた
プログラムのコード部分をあるスレッドが実行中に、他の
スレッドに実行権が移動しないことを保障するものに定義
してください。
(名前の通り、囲まれたコード部分をスレッドアトミックに
するという意味)
THREAD_PASS
これを実行したスレッドから、他のスレッドに実行権を委譲
するものに定義をしてください。(再スケジュールを呼び出す
という意味)
対応する機能が全くなければ、空定義にしてください。
(参考例)
Rubyの場合を例にすると、
Rubyは自分自身で独自のスレッド機能を実装しています。
その機能を使用すると、以下のように定義すればよいことに
なります。
#define USE_MULTI_THREAD_SYSTEM
#define THREAD_SYSTEM_INIT
#define THREAD_SYSTEM_END
#define THREAD_ATOMIC_START DEFER_INTS
#define THREAD_ATOMIC_END ENABLE_INTS
#define THREAD_PASS rb_thread_schedule()
Rubyの場合、タイマ割り込みを使用して、スレッドの切り替えを
行っています。DEFER_INTSは割り込みハンドラの実行を一時的に
止めるためのマクロです。ENABLE_INTSマクロで割り込みハンドラ
の実行を許可します。
これによって、THREAD_ATOMIC_STARTからTHREAD_ATOMIC_END
で囲まれた部分の実行中に、他のスレッドに実行権が移動しません。
(B) アプリケーションの中で対応する場合
以下を保障するように、スレッドの実行を制御してください。
同時に複数のスレッドが、正規表現オブジェクトを作成する、または解放する、ことを
行なってはならない。それらのオブジェクトが全く別のものであっても。
onig_new(), onig_new_deluxe(), onig_free()のどれかの呼び出しを、
複数のスレッドが同時に実行することを避けてください。同時でなければ別にかまいません。
これは何故必要なのかというと、正規表現オブジェクトを作成する
過程で、内部で共通に参照するテーブルがあります。
このテーブルに対してのデータ登録処理が複数のスレッドで衝突して
異常な状態にならないために必要です。
// END

View File

@@ -1,35 +1,35 @@
Oniguruma Regular Expressions Version 5.9.1 2007/09/05
Oniguruma Regular Expressions Version 6.0.0 2016/08/18
syntax: ONIG_SYNTAX_RUBY (default)
1. Syntax elements
\ escape (enable or disable meta character meaning)
\ escape (enable or disable meta character)
| alternation
(...) group
[...] character class
[...] character class
2. Characters
\t horizontal tab (0x09)
\v vertical tab (0x0B)
\n newline (0x0A)
\r return (0x0D)
\b back space (0x08)
\f form feed (0x0C)
\a bell (0x07)
\e escape (0x1B)
\nnn octal char (encoded byte value)
\xHH hexadecimal char (encoded byte value)
\x{7HHHHHHH} wide hexadecimal char (character code point value)
\cx control char (character code point value)
\C-x control char (character code point value)
\M-x meta (x|0x80) (character code point value)
\M-\C-x meta control char (character code point value)
\t horizontal tab (0x09)
\v vertical tab (0x0B)
\n newline (line feed) (0x0A)
\r carriage return (0x0D)
\b backspace (0x08)
\f form feed (0x0C)
\a bell (0x07)
\e escape (0x1B)
\nnn octal char (encoded byte value)
\xHH hexadecimal char (encoded byte value)
\x{7HHHHHHH} wide hexadecimal char (character code point value)
\cx control char (character code point value)
\C-x control char (character code point value)
\M-x meta (x|0x80) (character code point value)
\M-\C-x meta control char (character code point value)
(* \b is effective in character class [...] only)
(* \b as backspace is effective in character class only)
3. Character types
@@ -39,12 +39,12 @@ syntax: ONIG_SYNTAX_RUBY (default)
\w word character
Not Unicode:
alphanumeric, "_" and multibyte char.
alphanumeric, "_" and multibyte char.
Unicode:
General_Category -- (Letter|Mark|Number|Connector_Punctuation)
\W non word char
\W non-word char
\s whitespace char
@@ -52,22 +52,22 @@ syntax: ONIG_SYNTAX_RUBY (default)
\t, \n, \v, \f, \r, \x20
Unicode:
0009, 000A, 000B, 000C, 000D, 0085(NEL),
0009, 000A, 000B, 000C, 000D, 0085(NEL),
General_Category -- Line_Separator
-- Paragraph_Separator
-- Space_Separator
\S non whitespace char
\S non-whitespace char
\d decimal digit char
Unicode: General_Category -- Decimal_Number
\D non decimal digit char
\D non-decimal-digit char
\h hexadecimal digit char [0-9a-fA-F]
\H non hexadecimal digit char
\H non-hexdigit char
Character Property
@@ -80,25 +80,13 @@ syntax: ONIG_SYNTAX_RUBY (default)
+ works on all encodings
Alnum, Alpha, Blank, Cntrl, Digit, Graph, Lower,
Print, Punct, Space, Upper, XDigit, Word, ASCII,
Print, Punct, Space, Upper, XDigit, Word, ASCII
+ works on EUC_JP, Shift_JIS
Hiragana, Katakana
+ works on UTF8, UTF16, UTF32
Any, Assigned, C, Cc, Cf, Cn, Co, Cs, L, Ll, Lm, Lo, Lt, Lu,
M, Mc, Me, Mn, N, Nd, Nl, No, P, Pc, Pd, Pe, Pf, Pi, Po, Ps,
S, Sc, Sk, Sm, So, Z, Zl, Zp, Zs,
Arabic, Armenian, Bengali, Bopomofo, Braille, Buginese,
Buhid, Canadian_Aboriginal, Cherokee, Common, Coptic,
Cypriot, Cyrillic, Deseret, Devanagari, Ethiopic, Georgian,
Glagolitic, Gothic, Greek, Gujarati, Gurmukhi, Han, Hangul,
Hanunoo, Hebrew, Hiragana, Inherited, Kannada, Katakana,
Kharoshthi, Khmer, Lao, Latin, Limbu, Linear_B, Malayalam,
Mongolian, Myanmar, New_Tai_Lue, Ogham, Old_Italic, Old_Persian,
Oriya, Osmanya, Runic, Shavian, Sinhala, Syloti_Nagri, Syriac,
Tagalog, Tagbanwa, Tai_Le, Tamil, Telugu, Thaana, Thai, Tibetan,
Tifinagh, Ugaritic, Yi
See doc/UNICODE_PROPERTIES.
@@ -109,9 +97,9 @@ syntax: ONIG_SYNTAX_RUBY (default)
? 1 or 0 times
* 0 or more times
+ 1 or more times
{n,m} at least n but not more than m times
{n,m} at least n but no more than m times
{n,} at least n times
{,n} at least 0 but not more than n times ({0,n})
{,n} at least 0 but no more than n times ({0,n})
{n} n times
reluctant
@@ -119,11 +107,11 @@ syntax: ONIG_SYNTAX_RUBY (default)
?? 1 or 0 times
*? 0 or more times
+? 1 or more times
{n,m}? at least n but not more than m times
{n,m}? at least n but not more than m times
{n,}? at least n times
{,n}? at least 0 but not more than n times (== {0,n}?)
possessive (greedy and does not backtrack after repeated)
possessive (greedy and does not backtrack once match)
?+ 1 or 0 times
*+ 0 or more times
@@ -139,24 +127,24 @@ syntax: ONIG_SYNTAX_RUBY (default)
^ beginning of the line
$ end of the line
\b word boundary
\B not word boundary
\B non-word boundary
\A beginning of string
\Z end of string, or before newline at the end
\z end of string
\G matching start position
\G where the current search attempt begins
6. Character class
^... negative class (lowest precedence operator)
^... negative class (lowest precedence)
x-y range from x to y
[...] set (character class in character class)
..&&.. intersection (low precedence at the next of ^)
..&&.. intersection (low precedence, only higher than ^)
ex. [a-w&&[^c-g]z] ==> ([a-w] AND ([^c-g] OR z)) ==> [abh-w]
* If you want to use '[', '-', ']' as a normal character
in a character class, you should escape these characters by '\'.
* If you want to use '[', '-', or ']' as a normal character
in character class, you should escape them with '\'.
POSIX bracket ([:xxxxx:], negate [:^xxxxx:])
@@ -208,79 +196,75 @@ syntax: ONIG_SYNTAX_RUBY (default)
(?imx-imx) option on/off
i: ignore case
m: multi-line (dot(.) match newline)
m: multi-line (dot (.) also matches newline)
x: extended form
(?imx-imx:subexp) option on/off for subexp
(?:subexp) not captured group
(subexp) captured group
(?:subexp) non-capturing group
(subexp) capturing group
(?=subexp) look-ahead
(?!subexp) negative look-ahead
(?<=subexp) look-behind
(?<!subexp) negative look-behind
Subexp of look-behind must be fixed character length.
But different character length is allowed in top level
alternatives only.
Subexp of look-behind must be fixed-width.
But top-level alternatives can be of various lengths.
ex. (?<=a|bc) is OK. (?<=aaa(?:b|cd)) is not allowed.
In negative-look-behind, captured group isn't allowed,
but shy group(?:) is allowed.
In negative look-behind, capturing group isn't allowed,
but non-capturing group (?:) is allowed.
(?>subexp) atomic group
don't backtrack in subexp.
no backtracks in subexp.
(?<name>subexp), (?'name'subexp)
define named group
(All characters of the name must be a word character.)
(Each character of the name must be a word character.)
Not only a name but a number is assigned like a captured
Not only a name but a number is assigned like a capturing
group.
Assigning the same name as two or more subexps is allowed.
In this case, a subexp call can not be performed although
the back reference is possible.
Assigning the same name to two or more subexps is allowed.
8. Back reference
8. Backreferences
\n back reference by group number (n >= 1)
\k<n> back reference by group number (n >= 1)
\k'n' back reference by group number (n >= 1)
\k<-n> back reference by relative group number (n >= 1)
\k'-n' back reference by relative group number (n >= 1)
\k<name> back reference by group name
\k'name' back reference by group name
When we say "backreference a group," it actually means, "re-match the same
text matched by the subexp in that group."
In the back reference by the multiplex definition name,
a subexp with a large number is referred to preferentially.
(When not matched, a group of the small number is referred to.)
\n \k<n> \k'n' (n >= 1) backreference the nth group in the regexp
\k<-n> \k'-n' (n >= 1) backreference the nth group counting
backwards from the referring position
\k<name> \k'name' backreference a group with the specified name
* Back reference by group number is forbidden if named group is defined
in the pattern and ONIG_OPTION_CAPTURE_GROUP is not setted.
When backreferencing with a name that is assigned to more than one groups,
the last group with the name is checked first, if not matched then the
previous one with the name, and so on, until there is a match.
* Backreference by number is forbidden if any named group is defined and
ONIG_OPTION_CAPTURE_GROUP is not set.
back reference with nest level
backreference with recursion level
level: 0, 1, 2, ...
(n >= 1, level >= 0)
\k<n+level> (n >= 1)
\k<n-level> (n >= 1)
\k'n+level' (n >= 1)
\k'n-level' (n >= 1)
\k<n+level> \k'n+level'
\k<n-level> \k'n-level'
\k<name+level>
\k<name-level>
\k'name+level'
\k'name-level'
\k<name+level> \k'name+level'
\k<name-level> \k'name-level'
Destinate relative nest level from back reference position.
Destine a group on the recursion level relative to the referring position.
ex 1.
/\A(?<a>|.|(?:(?<b>.)\g<a>\k<b>))\z/.match("reee")
/\A(?<a>|.|(?:(?<b>.)\g<a>\k<b+0>))\z/.match("reer")
\k<b+0> refers to the (?<b>.) on the same recursion level with it.
ex 2.
r = Regexp.compile(<<'__REGEXP__'.strip, Regexp::EXTENDED)
@@ -292,53 +276,56 @@ syntax: ONIG_SYNTAX_RUBY (default)
\g<element>
__REGEXP__
p r.match('<foo>f<bar>bbb</bar>f</foo>').captures
p r.match("<foo>f<bar>bbb</bar>f</foo>").captures
9. Subexp calls ("Tanaka Akira special")
9. Subexp call ("Tanaka Akira special")
When we say "call a group," it actually means, "re-execute the subexp in
that group."
\g<name> call by group name
\g'name' call by group name
\g<n> call by group number (n >= 1)
\g'n' call by group number (n >= 1)
\g<-n> call by relative group number (n >= 1)
\g'-n' call by relative group number (n >= 1)
\g<n> \g'n' (n >= 1) call the nth group
\g<-n> \g'-n' (n >= 1) call the nth group counting backwards from
the calling position
\g<name> \g'name' call the group with the specified name
* left-most recursive call is not allowed.
ex. (?<name>a|\g<name>b) => error
(?<name>a|b\g<name>c) => OK
* Left-most recursive calls are not allowed.
* Call by group number is forbidden if named group is defined in the pattern
and ONIG_OPTION_CAPTURE_GROUP is not setted.
ex. (?<name>a|\g<name>b) => error
(?<name>a|b\g<name>c) => OK
* If the option status of called group is different from calling position
then the group's option is effective.
* Calls with a name that is assigned to more than one groups are not
allowed.
ex. (?-i:\g<name>)(?i:(?<name>a)){0} match to "A"
* Call by number is forbidden if any named group is defined and
ONIG_OPTION_CAPTURE_GROUP is not set.
* The option status of the called group is always effective.
ex. /(?-i:\g<name>)(?i:(?<name>a)){0}/.match("A")
10. Captured group
Behavior of the no-named group (...) changes with the following conditions.
Behavior of an unnamed group (...) changes with the following conditions.
(But named group is not changed.)
case 1. /.../ (named group is not used, no option)
(...) is treated as a captured group.
(...) is treated as a capturing group.
case 2. /.../g (named group is not used, 'g' option)
(...) is treated as a no-captured group (?:...).
(...) is treated as a non-capturing group (?:...).
case 3. /..(?<name>..)../ (named group is used, no option)
(...) is treated as a no-captured group (?:...).
(...) is treated as a non-capturing group.
numbered-backref/call is not allowed.
case 4. /..(?<name>..)../G (named group is used, 'G' option)
(...) is treated as a captured group.
(...) is treated as a capturing group.
numbered-backref/call is allowed.
where
@@ -350,14 +337,14 @@ syntax: ONIG_SYNTAX_RUBY (default)
-----------------------------
A-1. Syntax depend options
A-1. Syntax-dependent options
+ ONIG_SYNTAX_RUBY
(?m): dot(.) match newline
(?m): dot (.) also matches newline
+ ONIG_SYNTAX_PERL and ONIG_SYNTAX_JAVA
(?s): dot(.) match newline
(?m): ^ match after newline, $ match before newline
(?s): dot (.) also matches newline
(?m): ^ matches after newline, $ matches before newline
A-2. Original extensions
@@ -368,7 +355,7 @@ A-2. Original extensions
+ subexp call \g<name>, \g<group-num>
A-3. Lacked features compare with perl 5.8.0
A-3. Missing features compared with perl 5.8.0
+ \N{name}
+ \l,\u,\L,\U, \X, \C
@@ -385,12 +372,12 @@ A-4. Differences with Japanized GNU regex(version 0.12) of Ruby 1.8
+ add character property (\p{property}, \P{property})
+ add hexadecimal digit char type (\h, \H)
+ add look-behind
(?<=fixed-char-length-pattern), (?<!fixed-char-length-pattern)
(?<=fixed-width-pattern), (?<!fixed-width-pattern)
+ add possessive quantifier. ?+, *+, ++
+ add operations in character class. [], &&
('[' must be escaped as an usual char in character class.)
+ add named group and subexp call.
+ octal or hexadecimal number sequence can be treated as
+ octal or hexadecimal number sequence can be treated as
a multibyte code char in character class if multibyte encoding
is specified.
(ex. [\xa1\xa2], [\xa1\xa7-\xa4\xa1])
@@ -401,29 +388,29 @@ A-4. Differences with Japanized GNU regex(version 0.12) of Ruby 1.8
ex. (?:(?i)a|b) is interpreted as (?:(?i:a|b)), not (?:(?i:a)|b).
+ isolated option is not transparent to previous pattern.
ex. a(?i)* is a syntax error pattern.
+ allowed incompleted left brace as an usual string.
+ allowed unpaired left brace as a normal character.
ex. /{/, /({)/, /a{2,3/ etc...
+ negative POSIX bracket [:^xxxx:] is supported.
+ POSIX bracket [:ascii:] is added.
+ repeat of look-ahead is not allowed.
ex. /(?=a)*/, /(?!b){5}/
+ Ignore case option is effective to numbered character.
+ Ignore case option is effective to escape sequence.
ex. /\x61/i =~ "A"
+ In the range quantifier, the number of the minimum is omissible.
+ In the range quantifier, the number of the minimum is optional.
/a{,n}/ == /a{0,n}/
The simultanious abbreviation of the number of times of the minimum
and the maximum is not allowed. (/a{,}/)
+ /a{n}?/ is not a non-greedy operator.
The omission of both minimum and maximum values is not allowed.
/a{,}/
+ /{n}?/ is not a reluctant quantifier.
/a{n}?/ == /(?:a{n})?/
+ invalid back reference is checked and cause error.
+ invalid back reference is checked and raises error.
/\1/, /(a)\2/
+ Zero-length match in infinite repeat stops the repeat,
+ Zero-width match in an infinite loop stops the repeat,
then changes of the capture group status are checked as stop condition.
/(?:()|())*\1\2/ =~ ""
/(?:\1a|())*/ =~ "a"
A-5. Disabled functions by default syntax
A-5. Features disabled in default syntax
+ capture history

View File

@@ -1,4 +1,4 @@
鬼車 正規表現 Version 5.9.1 2007/09/05
鬼車 正規表現 Version 6.0.0 2016/05/02
使用文法: ONIG_SYNTAX_RUBY (既定値)
@@ -86,19 +86,7 @@
Hiragana, Katakana
+ UTF8, UTF16, UTF32で有効
Any, Assigned, C, Cc, Cf, Cn, Co, Cs, L, Ll, Lm, Lo, Lt, Lu,
M, Mc, Me, Mn, N, Nd, Nl, No, P, Pc, Pd, Pe, Pf, Pi, Po, Ps,
S, Sc, Sk, Sm, So, Z, Zl, Zp, Zs,
Arabic, Armenian, Bengali, Bopomofo, Braille, Buginese,
Buhid, Canadian_Aboriginal, Cherokee, Common, Coptic,
Cypriot, Cyrillic, Deseret, Devanagari, Ethiopic, Georgian,
Glagolitic, Gothic, Greek, Gujarati, Gurmukhi, Han, Hangul,
Hanunoo, Hebrew, Hiragana, Inherited, Kannada, Katakana,
Kharoshthi, Khmer, Lao, Latin, Limbu, Linear_B, Malayalam,
Mongolian, Myanmar, New_Tai_Lue, Ogham, Old_Italic, Old_Persian,
Oriya, Osmanya, Runic, Shavian, Sinhala, Syloti_Nagri, Syriac,
Tagalog, Tagbanwa, Tai_Le, Tamil, Telugu, Thaana, Thai, Tibetan,
Tifinagh, Ugaritic, Yi
doc/UNICODE_PROPERTIES参照
@@ -395,7 +383,7 @@
退避修飾しなければならない)
+ 名前付き捕獲式集合と、部分式呼出し機能追加
+ 多バイト文字コードが指定されているとき、
文字集合の中で八進数または十六進数表現の連続は、多バイト符で表現された
文字集合の中で八進数または十六進数表現の連続は、多バイト符で表現された
一個の文字と解釈される
(例. [\xa1\xa2], [\xa1\xa7-\xa4\xa1])
+ 文字集合の中で、一バイト文字と多バイト文字の範囲指定は許される。

View File

@@ -0,0 +1,698 @@
Unicode Properties (from Unicode Version: 8.0.0)
1: Any
2: Assigned
3: C
4: Cc
5: Cf
6: Cn
7: Co
8: Cs
9: L
10: LC
11: Ll
12: Lm
13: Lo
14: Lt
15: Lu
16: M
17: Mc
18: Me
19: Mn
20: N
21: Nd
22: Nl
23: No
24: P
25: Pc
26: Pd
27: Pe
28: Pf
29: Pi
30: Po
31: Ps
32: S
33: Sc
34: Sk
35: Sm
36: So
37: Z
38: Zl
39: Zp
40: Zs
41: Math
42: Alphabetic
43: Lowercase
44: Uppercase
45: Cased
46: Case_Ignorable
47: Changes_When_Lowercased
48: Changes_When_Uppercased
49: Changes_When_Titlecased
50: Changes_When_Casefolded
51: Changes_When_Casemapped
52: ID_Start
53: ID_Continue
54: XID_Start
55: XID_Continue
56: Default_Ignorable_Code_Point
57: Grapheme_Extend
58: Grapheme_Base
59: Grapheme_Link
60: Common
61: Latin
62: Greek
63: Cyrillic
64: Armenian
65: Hebrew
66: Arabic
67: Syriac
68: Thaana
69: Devanagari
70: Bengali
71: Gurmukhi
72: Gujarati
73: Oriya
74: Tamil
75: Telugu
76: Kannada
77: Malayalam
78: Sinhala
79: Thai
80: Lao
81: Tibetan
82: Myanmar
83: Georgian
84: Hangul
85: Ethiopic
86: Cherokee
87: Canadian_Aboriginal
88: Ogham
89: Runic
90: Khmer
91: Mongolian
92: Hiragana
93: Katakana
94: Bopomofo
95: Han
96: Yi
97: Old_Italic
98: Gothic
99: Deseret
100: Inherited
101: Tagalog
102: Hanunoo
103: Buhid
104: Tagbanwa
105: Limbu
106: Tai_Le
107: Linear_B
108: Ugaritic
109: Shavian
110: Osmanya
111: Cypriot
112: Braille
113: Buginese
114: Coptic
115: New_Tai_Lue
116: Glagolitic
117: Tifinagh
118: Syloti_Nagri
119: Old_Persian
120: Kharoshthi
121: Balinese
122: Cuneiform
123: Phoenician
124: Phags_Pa
125: Nko
126: Sundanese
127: Lepcha
128: Ol_Chiki
129: Vai
130: Saurashtra
131: Kayah_Li
132: Rejang
133: Lycian
134: Carian
135: Lydian
136: Cham
137: Tai_Tham
138: Tai_Viet
139: Avestan
140: Egyptian_Hieroglyphs
141: Samaritan
142: Lisu
143: Bamum
144: Javanese
145: Meetei_Mayek
146: Imperial_Aramaic
147: Old_South_Arabian
148: Inscriptional_Parthian
149: Inscriptional_Pahlavi
150: Old_Turkic
151: Kaithi
152: Batak
153: Brahmi
154: Mandaic
155: Chakma
156: Meroitic_Cursive
157: Meroitic_Hieroglyphs
158: Miao
159: Sharada
160: Sora_Sompeng
161: Takri
162: Caucasian_Albanian
163: Bassa_Vah
164: Duployan
165: Elbasan
166: Grantha
167: Pahawh_Hmong
168: Khojki
169: Linear_A
170: Mahajani
171: Manichaean
172: Mende_Kikakui
173: Modi
174: Mro
175: Old_North_Arabian
176: Nabataean
177: Palmyrene
178: Pau_Cin_Hau
179: Old_Permic
180: Psalter_Pahlavi
181: Siddham
182: Khudawadi
183: Tirhuta
184: Warang_Citi
185: Ahom
186: Anatolian_Hieroglyphs
187: Hatran
188: Multani
189: Old_Hungarian
190: SignWriting
191: White_Space
192: Bidi_Control
193: Join_Control
194: Dash
195: Hyphen
196: Quotation_Mark
197: Terminal_Punctuation
198: Other_Math
199: Hex_Digit
200: ASCII_Hex_Digit
201: Other_Alphabetic
202: Ideographic
203: Diacritic
204: Extender
205: Other_Lowercase
206: Other_Uppercase
207: Noncharacter_Code_Point
208: Other_Grapheme_Extend
209: IDS_Binary_Operator
210: IDS_Trinary_Operator
211: Radical
212: Unified_Ideograph
213: Other_Default_Ignorable_Code_Point
214: Deprecated
215: Soft_Dotted
216: Logical_Order_Exception
217: Other_ID_Start
218: Other_ID_Continue
219: STerm
220: Variation_Selector
221: Pattern_White_Space
222: Pattern_Syntax
223: Unknown
224: Aghb
225: AHex
226: Arab
227: Armi
228: Armn
229: Avst
230: Bali
231: Bamu
232: Bass
233: Batk
234: Beng
235: Bidi_C
236: Bopo
237: Brah
238: Brai
239: Bugi
240: Buhd
241: Cakm
242: Cans
243: Cari
244: Cased_Letter
245: Cher
246: CI
247: Close_Punctuation
248: Combining_Mark
249: Connector_Punctuation
250: Control
251: Copt
252: Cprt
253: Currency_Symbol
254: CWCF
255: CWCM
256: CWL
257: CWT
258: CWU
259: Cyrl
260: Dash_Punctuation
261: Decimal_Number
262: Dep
263: Deva
264: DI
265: Dia
266: Dsrt
267: Dupl
268: Egyp
269: Elba
270: Enclosing_Mark
271: Ethi
272: Ext
273: Final_Punctuation
274: Format
275: Geor
276: Glag
277: Goth
278: Gran
279: Gr_Base
280: Grek
281: Gr_Ext
282: Gr_Link
283: Gujr
284: Guru
285: Hang
286: Hani
287: Hano
288: Hatr
289: Hebr
290: Hex
291: Hira
292: Hluw
293: Hmng
294: Hung
295: IDC
296: Ideo
297: IDS
298: IDSB
299: IDST
300: Initial_Punctuation
301: Ital
302: Java
303: Join_C
304: Kali
305: Kana
306: Khar
307: Khmr
308: Khoj
309: Knda
310: Kthi
311: Lana
312: Laoo
313: Latn
314: Lepc
315: Letter
316: Letter_Number
317: Limb
318: Lina
319: Linb
320: Line_Separator
321: LOE
322: Lowercase_Letter
323: Lyci
324: Lydi
325: Mahj
326: Mand
327: Mani
328: Mark
329: Math_Symbol
330: Mend
331: Merc
332: Mero
333: Mlym
334: Modifier_Letter
335: Modifier_Symbol
336: Mong
337: Mroo
338: Mtei
339: Mult
340: Mymr
341: Narb
342: Nbat
343: NChar
344: Nkoo
345: Nonspacing_Mark
346: Number
347: OAlpha
348: ODI
349: Ogam
350: OGr_Ext
351: OIDC
352: OIDS
353: Olck
354: OLower
355: OMath
356: Open_Punctuation
357: Orkh
358: Orya
359: Osma
360: Other
361: Other_Letter
362: Other_Number
363: Other_Punctuation
364: Other_Symbol
365: OUpper
366: Palm
367: Paragraph_Separator
368: Pat_Syn
369: Pat_WS
370: Pauc
371: Perm
372: Phag
373: Phli
374: Phlp
375: Phnx
376: Plrd
377: Private_Use
378: Prti
379: Punctuation
380: Qaac
381: Qaai
382: QMark
383: Rjng
384: Runr
385: Samr
386: Sarb
387: Saur
388: SD
389: Separator
390: Sgnw
391: Shaw
392: Shrd
393: Sidd
394: Sind
395: Sinh
396: Sora
397: Space_Separator
398: Spacing_Mark
399: Sund
400: Surrogate
401: Sylo
402: Symbol
403: Syrc
404: Tagb
405: Takr
406: Tale
407: Talu
408: Taml
409: Tavt
410: Telu
411: Term
412: Tfng
413: Tglg
414: Thaa
415: Tibt
416: Tirh
417: Titlecase_Letter
418: Ugar
419: UIdeo
420: Unassigned
421: Uppercase_Letter
422: Vaii
423: VS
424: Wara
425: WSpace
426: XIDC
427: XIDS
428: Xpeo
429: Xsux
430: Yiii
431: Zinh
432: Zyyy
433: Zzzz
434: In_Basic_Latin
435: In_Latin_1_Supplement
436: In_Latin_Extended_A
437: In_Latin_Extended_B
438: In_IPA_Extensions
439: In_Spacing_Modifier_Letters
440: In_Combining_Diacritical_Marks
441: In_Greek_and_Coptic
442: In_Cyrillic
443: In_Cyrillic_Supplement
444: In_Armenian
445: In_Hebrew
446: In_Arabic
447: In_Syriac
448: In_Arabic_Supplement
449: In_Thaana
450: In_NKo
451: In_Samaritan
452: In_Mandaic
453: In_Arabic_Extended_A
454: In_Devanagari
455: In_Bengali
456: In_Gurmukhi
457: In_Gujarati
458: In_Oriya
459: In_Tamil
460: In_Telugu
461: In_Kannada
462: In_Malayalam
463: In_Sinhala
464: In_Thai
465: In_Lao
466: In_Tibetan
467: In_Myanmar
468: In_Georgian
469: In_Hangul_Jamo
470: In_Ethiopic
471: In_Ethiopic_Supplement
472: In_Cherokee
473: In_Unified_Canadian_Aboriginal_Syllabics
474: In_Ogham
475: In_Runic
476: In_Tagalog
477: In_Hanunoo
478: In_Buhid
479: In_Tagbanwa
480: In_Khmer
481: In_Mongolian
482: In_Unified_Canadian_Aboriginal_Syllabics_Extended
483: In_Limbu
484: In_Tai_Le
485: In_New_Tai_Lue
486: In_Khmer_Symbols
487: In_Buginese
488: In_Tai_Tham
489: In_Combining_Diacritical_Marks_Extended
490: In_Balinese
491: In_Sundanese
492: In_Batak
493: In_Lepcha
494: In_Ol_Chiki
495: In_Sundanese_Supplement
496: In_Vedic_Extensions
497: In_Phonetic_Extensions
498: In_Phonetic_Extensions_Supplement
499: In_Combining_Diacritical_Marks_Supplement
500: In_Latin_Extended_Additional
501: In_Greek_Extended
502: In_General_Punctuation
503: In_Superscripts_and_Subscripts
504: In_Currency_Symbols
505: In_Combining_Diacritical_Marks_for_Symbols
506: In_Letterlike_Symbols
507: In_Number_Forms
508: In_Arrows
509: In_Mathematical_Operators
510: In_Miscellaneous_Technical
511: In_Control_Pictures
512: In_Optical_Character_Recognition
513: In_Enclosed_Alphanumerics
514: In_Box_Drawing
515: In_Block_Elements
516: In_Geometric_Shapes
517: In_Miscellaneous_Symbols
518: In_Dingbats
519: In_Miscellaneous_Mathematical_Symbols_A
520: In_Supplemental_Arrows_A
521: In_Braille_Patterns
522: In_Supplemental_Arrows_B
523: In_Miscellaneous_Mathematical_Symbols_B
524: In_Supplemental_Mathematical_Operators
525: In_Miscellaneous_Symbols_and_Arrows
526: In_Glagolitic
527: In_Latin_Extended_C
528: In_Coptic
529: In_Georgian_Supplement
530: In_Tifinagh
531: In_Ethiopic_Extended
532: In_Cyrillic_Extended_A
533: In_Supplemental_Punctuation
534: In_CJK_Radicals_Supplement
535: In_Kangxi_Radicals
536: In_Ideographic_Description_Characters
537: In_CJK_Symbols_and_Punctuation
538: In_Hiragana
539: In_Katakana
540: In_Bopomofo
541: In_Hangul_Compatibility_Jamo
542: In_Kanbun
543: In_Bopomofo_Extended
544: In_CJK_Strokes
545: In_Katakana_Phonetic_Extensions
546: In_Enclosed_CJK_Letters_and_Months
547: In_CJK_Compatibility
548: In_CJK_Unified_Ideographs_Extension_A
549: In_Yijing_Hexagram_Symbols
550: In_CJK_Unified_Ideographs
551: In_Yi_Syllables
552: In_Yi_Radicals
553: In_Lisu
554: In_Vai
555: In_Cyrillic_Extended_B
556: In_Bamum
557: In_Modifier_Tone_Letters
558: In_Latin_Extended_D
559: In_Syloti_Nagri
560: In_Common_Indic_Number_Forms
561: In_Phags_pa
562: In_Saurashtra
563: In_Devanagari_Extended
564: In_Kayah_Li
565: In_Rejang
566: In_Hangul_Jamo_Extended_A
567: In_Javanese
568: In_Myanmar_Extended_B
569: In_Cham
570: In_Myanmar_Extended_A
571: In_Tai_Viet
572: In_Meetei_Mayek_Extensions
573: In_Ethiopic_Extended_A
574: In_Latin_Extended_E
575: In_Cherokee_Supplement
576: In_Meetei_Mayek
577: In_Hangul_Syllables
578: In_Hangul_Jamo_Extended_B
579: In_High_Surrogates
580: In_High_Private_Use_Surrogates
581: In_Low_Surrogates
582: In_Private_Use_Area
583: In_CJK_Compatibility_Ideographs
584: In_Alphabetic_Presentation_Forms
585: In_Arabic_Presentation_Forms_A
586: In_Variation_Selectors
587: In_Vertical_Forms
588: In_Combining_Half_Marks
589: In_CJK_Compatibility_Forms
590: In_Small_Form_Variants
591: In_Arabic_Presentation_Forms_B
592: In_Halfwidth_and_Fullwidth_Forms
593: In_Specials
594: In_Linear_B_Syllabary
595: In_Linear_B_Ideograms
596: In_Aegean_Numbers
597: In_Ancient_Greek_Numbers
598: In_Ancient_Symbols
599: In_Phaistos_Disc
600: In_Lycian
601: In_Carian
602: In_Coptic_Epact_Numbers
603: In_Old_Italic
604: In_Gothic
605: In_Old_Permic
606: In_Ugaritic
607: In_Old_Persian
608: In_Deseret
609: In_Shavian
610: In_Osmanya
611: In_Elbasan
612: In_Caucasian_Albanian
613: In_Linear_A
614: In_Cypriot_Syllabary
615: In_Imperial_Aramaic
616: In_Palmyrene
617: In_Nabataean
618: In_Hatran
619: In_Phoenician
620: In_Lydian
621: In_Meroitic_Hieroglyphs
622: In_Meroitic_Cursive
623: In_Kharoshthi
624: In_Old_South_Arabian
625: In_Old_North_Arabian
626: In_Manichaean
627: In_Avestan
628: In_Inscriptional_Parthian
629: In_Inscriptional_Pahlavi
630: In_Psalter_Pahlavi
631: In_Old_Turkic
632: In_Old_Hungarian
633: In_Rumi_Numeral_Symbols
634: In_Brahmi
635: In_Kaithi
636: In_Sora_Sompeng
637: In_Chakma
638: In_Mahajani
639: In_Sharada
640: In_Sinhala_Archaic_Numbers
641: In_Khojki
642: In_Multani
643: In_Khudawadi
644: In_Grantha
645: In_Tirhuta
646: In_Siddham
647: In_Modi
648: In_Takri
649: In_Ahom
650: In_Warang_Citi
651: In_Pau_Cin_Hau
652: In_Cuneiform
653: In_Cuneiform_Numbers_and_Punctuation
654: In_Early_Dynastic_Cuneiform
655: In_Egyptian_Hieroglyphs
656: In_Anatolian_Hieroglyphs
657: In_Bamum_Supplement
658: In_Mro
659: In_Bassa_Vah
660: In_Pahawh_Hmong
661: In_Miao
662: In_Kana_Supplement
663: In_Duployan
664: In_Shorthand_Format_Controls
665: In_Byzantine_Musical_Symbols
666: In_Musical_Symbols
667: In_Ancient_Greek_Musical_Notation
668: In_Tai_Xuan_Jing_Symbols
669: In_Counting_Rod_Numerals
670: In_Mathematical_Alphanumeric_Symbols
671: In_Sutton_SignWriting
672: In_Mende_Kikakui
673: In_Arabic_Mathematical_Alphabetic_Symbols
674: In_Mahjong_Tiles
675: In_Domino_Tiles
676: In_Playing_Cards
677: In_Enclosed_Alphanumeric_Supplement
678: In_Enclosed_Ideographic_Supplement
679: In_Miscellaneous_Symbols_and_Pictographs
680: In_Emoticons
681: In_Ornamental_Dingbats
682: In_Transport_and_Map_Symbols
683: In_Alchemical_Symbols
684: In_Geometric_Shapes_Extended
685: In_Supplemental_Arrows_C
686: In_Supplemental_Symbols_and_Pictographs
687: In_CJK_Unified_Ideographs_Extension_B
688: In_CJK_Unified_Ideographs_Extension_C
689: In_CJK_Unified_Ideographs_Extension_D
690: In_CJK_Unified_Ideographs_Extension_E
691: In_CJK_Compatibility_Ideographs_Supplement
692: In_Tags
693: In_Variation_Selectors_Supplement
694: In_Supplementary_Private_Use_Area_A
695: In_Supplementary_Private_Use_Area_B
696: In_No_Block

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@
<h1>Oniguruma</h1> (<a href="index_ja.html">Japanese</a>)
<p>
(c) K.Kosako, updated at: 2014/12/12
(c) K.Kosako, updated at: 2016/11/07
</p>
<dl>
@@ -16,10 +16,10 @@
<dt><b>What's new</b>
</font>
<ul>
<li>2016/11/07: Version 6.1.2 released.</li>
<li>2016/09/02: Version 6.1.1 released.</li>
<li>2016/08/29: Version 6.1.0 released.</li>
<li>2014/12/12: Version 5.9.6 released.</li>
<li>2007/08/16: Version 4.7.1 released.</li>
<li>2007/06/20: Version 2.5.9 released.</li>
<li>2007/06/20: Maintainer of 2.x was changed.</li>
</ul>
</dl>
<hr>
@@ -58,17 +58,6 @@ ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16<br>
<li> Win32
</ul>
<br>
<dt><b>Download:</b>
<ul>
<li> <a href="archive/onig-5.9.6.tar.gz">Latest release version 5.9.6</a> (2014/12/12) <a href="HISTORY_5X.txt">Change Log</a>
<li> <a href="archive/onig-5.9.5.tar.gz">5.9.5</a> (2013/10/21)
<li> <a href="archive/onig-4.7.1.tar.gz">Latest release version 4.7.1</a> (2007/08/16) <a href="HISTORY_4X.txt">Change Log</a>
<li> <a href="archive/onig-4.7.0.tar.gz">4.7.0</a> (2007/06/18)
<li> <a href="archive/onigd2_5_9.tar.gz">Latest release version 2.5.9</a> (2007/06/20) <a href="HISTORY_2X.txt">Change Log</a>
</ul>
<br>
<font color="red">
Maintainer of 2.x was changed to Hannes Wyss &lt;hwyss AT ywesee.com&gt;.<br>
@@ -78,7 +67,7 @@ About 2.x, please contact him.<br>
* 2.x supports Ruby1.6/1.8.<br>
<br>
<dt><b>Documents:</b> (version 5.9.6)
<dt><b>Documents:</b> (version 6.1.0)
<ul>
<li> <a href="doc/RE.txt">Regular Expressions</a>
<a href="doc/RE.ja.txt">(Japanese: EUC-JP)</a>

View File

@@ -8,7 +8,7 @@
<h1>鬼車</h1>
<p>
(c) K.Kosako, 最終更新: 2014/12/12
(c) K.Kosako, 最終更新: 2016/11/07
</p>
<dl>
@@ -16,10 +16,10 @@
<dt><b>更新情報</b>
</font>
<ul>
<li>2016/11/07: Version 6.1.2 リリース</li>
<li>2016/09/02: Version 6.1.1 リリース</li>
<li>2016/08/29: Version 6.1.0 リリース</li>
<li>2014/12/12: Version 5.9.6 リリース</li>
<li>2007/08/16: Version 4.7.1 リリース</li>
<li>2007/06/20: Version 2.5.9 リリース</li>
<li>2007/06/20: 2.xの保守担当者を変更</li>
</ul>
</dl>
<hr>
@@ -58,17 +58,6 @@ ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16<br>
<li> Win32
</ul>
<br>
<dt><b>ダウンロード:</b>
<ul>
<li> <a href="archive/onig-5.9.6.tar.gz">5.9.6 最新版</a> (2014/12/12) <a href="HISTORY_5X.txt">更新履歴</a>
<li> <a href="archive/onig-5.9.5.tar.gz">5.9.5</a> (2013/10/21)
<li> <a href="archive/onig-4.7.1.tar.gz">4.7.1 最新版</a> (2007/08/16) <a href="HISTORY_4X.txt">更新履歴</a>
<li> <a href="archive/onig-4.7.0.tar.gz">4.7.0</a> (2007/06/18)
<li> <a href="archive/onigd2_5_9.tar.gz">2.5.9 最新版</a> (2007/06/20) <a href="HISTORY_2X.txt">更新履歴</a>
</ul>
<br>
<font color="red">
2.xの保守担当は、Hannes Wyss &lt;hwyss AT ywesee.com&gt;に交替しました。<br>
@@ -78,7 +67,7 @@ ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16<br>
* 2.xはRuby1.6/1.8組込みライブラリとして動作する。 (2006年末で保守を終了)<br>
<br>
<dt><b>ドキュメント:</b> (version 5.9.6)
<dt><b>ドキュメント:</b> (version 6.1.0)
<ul>
<li> <a href="doc/RE.txt">正規表現</a>
<a href="doc/RE.ja.txt">(日本語: EUC-JP)</a>

View File

@@ -4,7 +4,7 @@
oniguruma.h - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2009 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -34,9 +34,9 @@ extern "C" {
#endif
#define ONIGURUMA
#define ONIGURUMA_VERSION_MAJOR 5
#define ONIGURUMA_VERSION_MINOR 9
#define ONIGURUMA_VERSION_TEENY 6
#define ONIGURUMA_VERSION_MAJOR 6
#define ONIGURUMA_VERSION_MINOR 1
#define ONIGURUMA_VERSION_TEENY 2
#ifdef __cplusplus
# ifndef HAVE_PROTOTYPES
@@ -97,16 +97,15 @@ extern "C" {
#endif
#ifdef _WIN32
# include <windows.h>
typedef ULONG_PTR OnigCodePoint;
#else
typedef unsigned long OnigCodePoint;
#include <windows.h>
#endif
typedef unsigned int OnigCodePoint;
typedef unsigned char OnigUChar;
typedef unsigned int OnigCtype;
typedef unsigned int OnigDistance;
typedef unsigned int OnigLen;
#define ONIG_INFINITE_DISTANCE ~((OnigDistance )0)
#define ONIG_INFINITE_DISTANCE ~((OnigLen )0)
typedef unsigned int OnigCaseFoldType; /* case fold flag */
@@ -164,6 +163,9 @@ typedef struct OnigEncodingTypeST {
int (*get_ctype_code_range)(OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[]);
OnigUChar* (*left_adjust_char_head)(const OnigUChar* start, const OnigUChar* p);
int (*is_allowed_reverse_match)(const OnigUChar* p, const OnigUChar* end);
int (*init)(void);
int (*is_initialized)(void);
int (*is_valid_mbc_string)(const OnigUChar* s, const OnigUChar* end);
} OnigEncodingType;
typedef OnigEncodingType* OnigEncoding;
@@ -278,6 +280,8 @@ ONIG_EXTERN OnigEncodingType OnigEncodingGB18030;
(enc)->is_allowed_reverse_match(s,end)
#define ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc,start,s) \
(enc)->left_adjust_char_head(start, s)
#define ONIGENC_IS_VALID_MBC_STRING(enc,s,end) \
(enc)->is_valid_mbc_string(s,end)
#define ONIGENC_APPLY_ALL_CASE_FOLD(enc,case_fold_flag,f,arg) \
(enc)->apply_all_case_fold(case_fold_flag,f,arg)
#define ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc,case_fold_flag,p,end,acs) \
@@ -338,6 +342,8 @@ OnigUChar* onigenc_step_back P_((OnigEncoding enc, const OnigUChar* start, const
ONIG_EXTERN
int onigenc_init P_((void));
ONIG_EXTERN
int onig_initialize_encoding P_((OnigEncoding enc));
ONIG_EXTERN
int onigenc_set_default_encoding P_((OnigEncoding enc));
ONIG_EXTERN
OnigEncoding onigenc_get_default_encoding P_((void));
@@ -357,6 +363,8 @@ ONIG_EXTERN
int onigenc_strlen_null P_((OnigEncoding enc, const OnigUChar* p));
ONIG_EXTERN
int onigenc_str_bytelen_null P_((OnigEncoding enc, const OnigUChar* p));
ONIG_EXTERN
int onigenc_is_valid_mbc_string P_((OnigEncoding enc, const OnigUChar* s, const OnigUChar* end));
@@ -364,6 +372,7 @@ int onigenc_str_bytelen_null P_((OnigEncoding enc, const OnigUChar* p));
/* config parameters */
#define ONIG_NREGION 10
#define ONIG_MAX_CAPTURE_NUM 32767
#define ONIG_MAX_BACKREF_NUM 1000
#define ONIG_MAX_REPEAT_NUM 100000
#define ONIG_MAX_MULTI_BYTE_RANGES_NUM 10000
@@ -389,7 +398,8 @@ typedef unsigned int OnigOptionType;
#define ONIG_OPTION_NOTBOL (ONIG_OPTION_CAPTURE_GROUP << 1)
#define ONIG_OPTION_NOTEOL (ONIG_OPTION_NOTBOL << 1)
#define ONIG_OPTION_POSIX_REGION (ONIG_OPTION_NOTEOL << 1)
#define ONIG_OPTION_MAXBIT ONIG_OPTION_POSIX_REGION /* limit */
#define ONIG_OPTION_CHECK_VALIDITY_OF_STRING (ONIG_OPTION_POSIX_REGION << 1)
#define ONIG_OPTION_MAXBIT ONIG_OPTION_CHECK_VALIDITY_OF_STRING /* limit */
#define ONIG_OPTION_ON(options,regopt) ((options) |= (regopt))
#define ONIG_OPTION_OFF(options,regopt) ((options) &= ~(regopt))
@@ -535,6 +545,7 @@ ONIG_EXTERN OnigSyntaxType* OnigDefaultSyntax;
#define ONIGERR_MATCH_STACK_LIMIT_OVER -15
#define ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED -21
#define ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR -22
#define ONIGERR_FAIL_TO_INITIALIZE -23
/* general error */
#define ONIGERR_INVALID_ARGUMENT -30
/* syntax error */
@@ -571,6 +582,7 @@ ONIG_EXTERN OnigSyntaxType* OnigDefaultSyntax;
#define ONIGERR_TOO_BIG_BACKREF_NUMBER -207
#define ONIGERR_INVALID_BACKREF -208
#define ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED -209
#define ONIGERR_TOO_MANY_CAPTURES -210
#define ONIGERR_TOO_LONG_WIDE_CHAR_VALUE -212
#define ONIGERR_EMPTY_GROUP_NAME -214
#define ONIGERR_INVALID_GROUP_NAME -215
@@ -587,9 +599,12 @@ ONIG_EXTERN OnigSyntaxType* OnigDefaultSyntax;
#define ONIGERR_TOO_BIG_WIDE_CHAR_VALUE -401
#define ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION -402
#define ONIGERR_INVALID_COMBINATION_OF_OPTIONS -403
#define ONIGERR_TOO_MANY_USER_DEFINED_OBJECTS -404
#define ONIGERR_TOO_LONG_PROPERTY_NAME -405
#define ONIGERR_LIBRARY_IS_NOT_INITIALIZED -500
/* errors related to thread */
#define ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT -1001
/* #define ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT -1001 */
/* must be smaller than BIT_STATUS_BITS_NUM (unsigned int * 8) */
@@ -644,22 +659,12 @@ extern void onig_null_warn P_((const char* s));
#define ONIG_CHAR_TABLE_SIZE 256
/* regex_t state */
#define ONIG_STATE_NORMAL 0
#define ONIG_STATE_SEARCHING 1
#define ONIG_STATE_COMPILING -1
#define ONIG_STATE_MODIFY -2
#define ONIG_STATE(reg) \
((reg)->state > 0 ? ONIG_STATE_SEARCHING : (reg)->state)
typedef struct re_pattern_buffer {
/* common members of BBuf(bytes-buffer) */
unsigned char* p; /* compiled pattern */
unsigned int used; /* used space for p */
unsigned int alloc; /* allocated space for p */
int state; /* normal, searching, compiling */
int num_mem; /* used memory(...) num counted from 1 */
int num_repeat; /* OP_REPEAT/OP_REPEAT_NG id-counter */
int num_null_check; /* OP_NULL_CHECK_START/END id counter */
@@ -682,16 +687,16 @@ typedef struct re_pattern_buffer {
int optimize; /* optimize flag */
int threshold_len; /* search str-length for apply optimize */
int anchor; /* BEGIN_BUF, BEGIN_POS, (SEMI_)END_BUF */
OnigDistance anchor_dmin; /* (SEMI_)END_BUF anchor distance */
OnigDistance anchor_dmax; /* (SEMI_)END_BUF anchor distance */
OnigLen anchor_dmin; /* (SEMI_)END_BUF anchor distance */
OnigLen anchor_dmax; /* (SEMI_)END_BUF anchor distance */
int sub_anchor; /* start-anchor for exact or map */
unsigned char *exact;
unsigned char *exact_end;
unsigned char map[ONIG_CHAR_TABLE_SIZE]; /* used as BM skip or char-map */
int *int_map; /* BM skip for exact_len > 255 */
int *int_map_backward; /* BM skip for backward search */
OnigDistance dmin; /* min-distance of exact or map */
OnigDistance dmax; /* max-distance of exact or map */
OnigLen dmin; /* min-distance of exact or map */
OnigLen dmax; /* max-distance of exact or map */
/* regex_t link chain */
struct re_pattern_buffer* chain; /* escape compile-conflict */
@@ -714,6 +719,10 @@ typedef struct {
} OnigCompileInfo;
/* Oniguruma Native API */
ONIG_EXTERN
int onig_initialize P_((OnigEncoding encodings[], int n));
/* onig_init(): deprecated function. Use onig_initialize(). */
ONIG_EXTERN
int onig_init P_((void));
ONIG_EXTERN
@@ -734,9 +743,7 @@ void onig_free P_((OnigRegex));
ONIG_EXTERN
void onig_free_body P_((OnigRegex));
ONIG_EXTERN
int onig_recompile P_((OnigRegex, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));
ONIG_EXTERN
int onig_recompile_deluxe P_((OnigRegex reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));
int onig_scan(regex_t* reg, const OnigUChar* str, const OnigUChar* end, OnigRegion* region, OnigOptionType option, int (*scan_callback)(int, int, OnigRegion*, void*), void* callback_arg);
ONIG_EXTERN
int onig_search P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option));
ONIG_EXTERN
@@ -814,6 +821,8 @@ unsigned int onig_get_match_stack_limit_size P_((void));
ONIG_EXTERN
int onig_set_match_stack_limit_size P_((unsigned int size));
ONIG_EXTERN
int onig_unicode_define_user_property P_((const char* name, OnigCodePoint* ranges));
ONIG_EXTERN
int onig_end P_((void));
ONIG_EXTERN
const char* onig_version P_((void));

View File

@@ -2,7 +2,7 @@
ascii.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -54,5 +54,8 @@ OnigEncodingType OnigEncodingASCII = {
ascii_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match
onigenc_always_true_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
big5.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -54,6 +54,31 @@ big5_mbc_enc_len(const UChar* p)
return EncLen_BIG5[*p];
}
static int
is_valid_mbc_string(const UChar* p, const UChar* end)
{
while (p < end) {
if (*p < 0x80) {
p++;
}
else if (*p < 0xa1) {
return FALSE;
}
else if (*p < 0xff) {
p++;
if (p >= end) return FALSE;
if (*p < 0x40) return FALSE;
if (*p > 0x7e && *p < 0xa1) return FALSE;
if (*p == 0xff) return FALSE;
p++;
}
else
return FALSE;
}
return TRUE;
}
static OnigCodePoint
big5_mbc_to_code(const UChar* p, const UChar* end)
{
@@ -158,5 +183,8 @@ OnigEncodingType OnigEncodingBIG5 = {
big5_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
big5_left_adjust_char_head,
big5_is_allowed_reverse_match
big5_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
is_valid_mbc_string
};

View File

@@ -15,11 +15,7 @@
#define SIZEOF_VOIDP 4
#define SIZEOF_FLOAT 4
#define SIZEOF_DOUBLE 8
#ifdef _WIN64
#define SIZEOF_SIZE_T 8
#else
#define SIZEOF_SIZE_T 4
#endif
#define HAVE_PROTOTYPES 1
#define TOKEN_PASTE(x,y) x##y
#define HAVE_STDARG_PROTOTYPES 1

View File

@@ -0,0 +1,85 @@
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
#define HAVE_FLOAT_H 1
#define HAVE_OFF_T 1
#define SIZEOF_INT 4
#define SIZEOF_SHORT 2
#define SIZEOF_LONG 4
#define SIZEOF_LONG_LONG 0
#define SIZEOF___INT64 8
#define SIZEOF_OFF_T 4
#define SIZEOF_VOIDP 8
#define SIZEOF_FLOAT 4
#define SIZEOF_DOUBLE 8
#define SIZEOF_SIZE_T 8
#define HAVE_PROTOTYPES 1
#define TOKEN_PASTE(x,y) x##y
#define HAVE_STDARG_PROTOTYPES 1
#ifndef NORETURN
#if _MSC_VER > 1100
#define NORETURN(x) __declspec(noreturn) x
#else
#define NORETURN(x) x
#endif
#endif
#define HAVE_DECL_SYS_NERR 1
#define STDC_HEADERS 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_LIMITS_H 1
#define HAVE_FCNTL_H 1
#define HAVE_SYS_UTIME_H 1
#define HAVE_MEMORY_H 1
#define uid_t int
#define gid_t int
#define HAVE_STRUCT_STAT_ST_RDEV 1
#define HAVE_ST_RDEV 1
#define GETGROUPS_T int
#define RETSIGTYPE void
#define HAVE_ALLOCA 1
#define HAVE_DUP2 1
#define HAVE_MEMCMP 1
#define HAVE_MEMMOVE 1
#define HAVE_MKDIR 1
#define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_STRERROR 1
#define HAVE_STRFTIME 1
#define HAVE_STRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOD 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_FLOCK 1
#define HAVE_VSNPRINTF 1
#define HAVE_FINITE 1
#define HAVE_FMOD 1
#define HAVE_FREXP 1
#define HAVE_HYPOT 1
#define HAVE_MODF 1
#define HAVE_WAITPID 1
#define HAVE_CHSIZE 1
#define HAVE_TIMES 1
#define HAVE__SETJMP 1
#define HAVE_TELLDIR 1
#define HAVE_SEEKDIR 1
#define HAVE_MKTIME 1
#define HAVE_COSH 1
#define HAVE_SINH 1
#define HAVE_TANH 1
#define HAVE_EXECVE 1
#define HAVE_TZNAME 1
#define HAVE_DAYLIGHT 1
#define SETPGRP_VOID 1
#define inline __inline
#define NEED_IO_SEEK_BETWEEN_RW 1
#define RSHIFT(x,y) ((x)>>(int)y)
#define FILE_COUNT _cnt
#define FILE_READPTR _ptr
#define DEFAULT_KCODE KCODE_NONE
#define DLEXT ".so"
#define DLEXT2 ".dll"

View File

@@ -2,7 +2,7 @@
cp1251.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2006-2007 Byte <byte AT mail DOT kna DOT ru>
* Copyright (c) 2006-2016 Byte <byte AT mail DOT kna DOT ru>
* K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
@@ -196,5 +196,8 @@ OnigEncodingType OnigEncodingCP1251 = {
cp1251_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match
onigenc_always_true_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
euc_jp.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -56,6 +56,42 @@ mbc_enc_len(const UChar* p)
return EncLen_EUCJP[*p];
}
static int
is_valid_mbc_string(const UChar* p, const UChar* end)
{
while (p < end) {
if (*p < 0x80) {
p++;
}
else if (*p > 0xa0) {
if (*p == 0xff) return FALSE;
p++;
if (p >= end) return FALSE;
if (*p < 0xa1 || *p == 0xff) return FALSE;
p++;
}
else if (*p == 0x8e) {
p++;
if (p >= end) return FALSE;
if (*p < 0xa1 || *p > 0xdf) return FALSE;
p++;
}
else if (*p == 0x8f) {
p++;
if (p >= end) return FALSE;
if (*p < 0xa1 || *p == 0xff) return FALSE;
p++;
if (p >= end) return FALSE;
if (*p < 0xa1 || *p == 0xff) return FALSE;
p++;
}
else
return FALSE;
}
return TRUE;
}
static OnigCodePoint
mbc_to_code(const UChar* p, const UChar* end)
{
@@ -173,12 +209,6 @@ is_allowed_reverse_match(const UChar* s, const UChar* end ARG_UNUSED)
}
static int PropertyInited = 0;
static const OnigCodePoint** PropertyList;
static int PropertyListNum;
static int PropertyListSize;
static hash_table_type* PropertyNameTable;
static const OnigCodePoint CR_Hiragana[] = {
1,
0xa4a1, 0xa4f3
@@ -191,31 +221,27 @@ static const OnigCodePoint CR_Katakana[] = {
0xaab1, 0xaadd
}; /* CR_Katakana */
static int
init_property_list(void)
{
int r;
PROPERTY_LIST_ADD_PROP("Hiragana", CR_Hiragana);
PROPERTY_LIST_ADD_PROP("Katakana", CR_Katakana);
PropertyInited = 1;
end:
return r;
}
static const OnigCodePoint* PropertyList[] = {
CR_Hiragana,
CR_Katakana
};
static int
property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end)
{
hash_data_type ctype;
struct PropertyNameCtype* pc;
int len = end - p;
char q[32];
PROPERTY_LIST_INIT_CHECK;
if (onig_st_lookup_strend(PropertyNameTable, p, end, &ctype) == 0) {
return onigenc_minimum_property_name_to_ctype(enc, p, end);
if (len < sizeof(q) - 1) {
xmemcpy(q, p, (size_t )len);
q[len] = '\0';
pc = euc_jp_lookup_property_name(q, len);
if (pc != 0)
return pc->ctype;
}
return (int )ctype;
return ONIGERR_INVALID_CHAR_PROPERTY_NAME;
}
static int
@@ -231,10 +257,8 @@ is_code_ctype(OnigCodePoint code, unsigned int ctype)
}
}
else {
PROPERTY_LIST_INIT_CHECK;
ctype -= (ONIGENC_MAX_STD_CTYPE + 1);
if (ctype >= (unsigned int )PropertyListNum)
if (ctype >= (unsigned int )(sizeof(PropertyList)/sizeof(PropertyList[0])))
return ONIGERR_TYPE_BUG;
return onig_is_in_code_range((UChar* )PropertyList[ctype], code);
@@ -253,10 +277,8 @@ get_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out,
else {
*sb_out = 0x80;
PROPERTY_LIST_INIT_CHECK;
ctype -= (ONIGENC_MAX_STD_CTYPE + 1);
if (ctype >= (OnigCtype )PropertyListNum)
if (ctype >= (OnigCtype )sizeof(PropertyList)/sizeof(PropertyList[0]))
return ONIGERR_TYPE_BUG;
*ranges = PropertyList[ctype];
@@ -281,5 +303,8 @@ OnigEncodingType OnigEncodingEUC_JP = {
is_code_ctype,
get_ctype_code_range,
left_adjust_char_head,
is_allowed_reverse_match
is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
is_valid_mbc_string
};

View File

@@ -0,0 +1,158 @@
/* ANSI-C code produced by gperf version 3.0.4 */
/* Command-line: gperf -pt -T -L ANSI-C -N euc_jp_lookup_property_name --output-file euc_jp_prop.c euc_jp_prop.gperf */
/* Computed positions: -k'1,3' */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
&& ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
&& ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
&& ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
&& ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
&& ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
&& ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
&& ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
&& ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
&& ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
&& ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
&& ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
&& ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
&& ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
&& ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
&& ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
/* The character set is not based on ISO-646. */
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
#endif
#line 1 "euc_jp_prop.gperf"
#include <string.h>
#include "regenc.h"
#define TOTAL_KEYWORDS 16
#define MIN_WORD_LENGTH 4
#define MAX_WORD_LENGTH 8
#define MIN_HASH_VALUE 4
#define MAX_HASH_VALUE 55
/* maximum key range = 52, duplicates = 0 */
#ifdef __GNUC__
__inline
#else
#ifdef __cplusplus
inline
#endif
#endif
static unsigned int
hash (register const char *str, register unsigned int len)
{
static unsigned char asso_values[] =
{
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 0, 3, 10, 25, 56,
56, 30, 0, 56, 56, 0, 20, 56, 56, 56,
15, 56, 56, 20, 56, 30, 56, 0, 0, 56,
56, 56, 56, 56, 56, 56, 56, 15, 56, 56,
56, 56, 56, 25, 56, 10, 56, 56, 56, 56,
5, 56, 0, 56, 0, 56, 5, 56, 56, 20,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56
};
return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]];
}
#ifdef __GNUC__
__inline
#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
__attribute__ ((__gnu_inline__))
#endif
#endif
struct PropertyNameCtype *
euc_jp_lookup_property_name (register const char *str, register unsigned int len)
{
static struct PropertyNameCtype wordlist[] =
{
{""}, {""}, {""}, {""},
#line 23 "euc_jp_prop.gperf"
{"Word", 12},
#line 12 "euc_jp_prop.gperf"
{"Alpha", 1},
{""}, {""},
#line 26 "euc_jp_prop.gperf"
{"Hiragana", 15},
{""},
#line 24 "euc_jp_prop.gperf"
{"Alnum", 13},
{""}, {""},
#line 27 "euc_jp_prop.gperf"
{"Katakana", 16},
{""},
#line 25 "euc_jp_prop.gperf"
{"ASCII", 14},
#line 22 "euc_jp_prop.gperf"
{"XDigit", 11},
{""}, {""}, {""},
#line 14 "euc_jp_prop.gperf"
{"Cntrl", 3},
{""}, {""},
#line 13 "euc_jp_prop.gperf"
{"Blank", 2},
{""},
#line 19 "euc_jp_prop.gperf"
{"Punct", 8},
{""}, {""}, {""}, {""},
#line 18 "euc_jp_prop.gperf"
{"Print", 7},
{""}, {""}, {""}, {""},
#line 21 "euc_jp_prop.gperf"
{"Upper", 10},
{""}, {""}, {""}, {""},
#line 20 "euc_jp_prop.gperf"
{"Space", 9},
{""}, {""}, {""}, {""},
#line 17 "euc_jp_prop.gperf"
{"Lower", 6},
{""}, {""}, {""}, {""},
#line 16 "euc_jp_prop.gperf"
{"Graph", 5},
{""}, {""}, {""}, {""},
#line 15 "euc_jp_prop.gperf"
{"Digit", 4}
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
register int key = hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
{
register const char *s = wordlist[key].name;
if (*str == *s && !strcmp (str + 1, s + 1))
return &wordlist[key];
}
}
return 0;
}

View File

@@ -2,7 +2,7 @@
euc_kr.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -54,6 +54,30 @@ euckr_mbc_enc_len(const UChar* p)
return EncLen_EUCKR[*p];
}
static int
is_valid_mbc_string(const UChar* p, const UChar* end)
{
while (p < end) {
if (*p < 0x80) {
p++;
}
else if (*p < 0xa1) {
return FALSE;
}
else if (*p < 0xff) {
p++;
if (p >= end) return FALSE;
if (*p < 0xa1 || *p == 0xff)
return FALSE;
p++;
}
else
return FALSE;
}
return TRUE;
}
static OnigCodePoint
euckr_mbc_to_code(const UChar* p, const UChar* end)
{
@@ -134,7 +158,10 @@ OnigEncodingType OnigEncodingEUC_KR = {
euckr_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
euckr_left_adjust_char_head,
euckr_is_allowed_reverse_match
euckr_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
is_valid_mbc_string
};
/* Same with OnigEncodingEUC_KR except the name */
@@ -154,5 +181,8 @@ OnigEncodingType OnigEncodingEUC_CN = {
euckr_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
euckr_left_adjust_char_head,
euckr_is_allowed_reverse_match
euckr_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
euc_tw.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -54,6 +54,45 @@ euctw_mbc_enc_len(const UChar* p)
return EncLen_EUCTW[*p];
}
static int
is_valid_mbc_string(const UChar* p, const UChar* end)
{
while (p < end) {
if (*p < 0x80) {
p++;
}
else if (*p < 0xa1) {
if (*p == 0x8e) {
p++;
if (p >= end) return FALSE;
if (*p < 0xa1 || *p > 0xb0) return FALSE;
p++;
if (p >= end) return FALSE;
if (*p < 0xa1 || *p == 0xff)
return FALSE;
p++;
if (p >= end) return FALSE;
if (*p < 0xa1 || *p == 0xff)
return FALSE;
p++;
}
else
return FALSE;
}
else if (*p < 0xff) {
p++;
if (p >= end) return FALSE;
if (*p < 0xa1 || *p == 0xff)
return FALSE;
p++;
}
else
return FALSE;
}
return TRUE;
}
static OnigCodePoint
euctw_mbc_to_code(const UChar* p, const UChar* end)
{
@@ -125,5 +164,8 @@ OnigEncodingType OnigEncodingEUC_TW = {
euctw_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
euctw_left_adjust_char_head,
euctw_is_allowed_reverse_match
euctw_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
gb18030.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2005-2007 KUBO Takehiro <kubo AT jiubao DOT org>
* Copyright (c) 2005-2016 KUBO Takehiro <kubo AT jiubao DOT org>
* K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
@@ -75,6 +75,46 @@ gb18030_mbc_enc_len(const UChar* p)
return 2;
}
static int
is_valid_mbc_string(const UChar* p, const UChar* end)
{
while (p < end) {
if (*p < 0x80) {
p++;
}
else if (*p == 0x80 || *p == 0xff) {
return FALSE;
}
else {
p++;
if (p >= end) return FALSE;
if (*p < 0x40) {
if (*p < 0x30 || *p > 0x39)
return FALSE;
p++;
if (p >= end) return FALSE;
if (*p < 0x81 || *p == 0xff) return FALSE;
p++;
if (p >= end) return FALSE;
if (*p < 0x30 || *p > 0x39)
return FALSE;
p++;
}
else if (*p == 0x7f || *p == 0xff) {
return FALSE;
}
else {
p++;
}
}
}
return TRUE;
}
static OnigCodePoint
gb18030_mbc_to_code(const UChar* p, const UChar* end)
{
@@ -491,5 +531,8 @@ OnigEncodingType OnigEncodingGB18030 = {
gb18030_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
gb18030_left_adjust_char_head,
gb18030_is_allowed_reverse_match
gb18030_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
iso8859_1.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -268,5 +268,8 @@ OnigEncodingType OnigEncodingISO_8859_1 = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match
onigenc_always_true_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
iso8859_10.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -235,5 +235,8 @@ OnigEncodingType OnigEncodingISO_8859_10 = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match
onigenc_always_true_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
iso8859_11.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -92,5 +92,8 @@ OnigEncodingType OnigEncodingISO_8859_11 = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match
onigenc_always_true_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
iso8859_13.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -224,5 +224,8 @@ OnigEncodingType OnigEncodingISO_8859_13 = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match
onigenc_always_true_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
iso8859_14.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -237,5 +237,8 @@ OnigEncodingType OnigEncodingISO_8859_14 = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match
onigenc_always_true_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
iso8859_15.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -231,5 +231,8 @@ OnigEncodingType OnigEncodingISO_8859_15 = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match
onigenc_always_true_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
iso8859_16.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -233,5 +233,8 @@ OnigEncodingType OnigEncodingISO_8859_16 = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match
onigenc_always_true_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
iso8859_2.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -231,5 +231,8 @@ OnigEncodingType OnigEncodingISO_8859_2 = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match
onigenc_always_true_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
iso8859_3.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -231,5 +231,8 @@ OnigEncodingType OnigEncodingISO_8859_3 = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match
onigenc_always_true_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
iso8859_4.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -233,5 +233,8 @@ OnigEncodingType OnigEncodingISO_8859_4 = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match
onigenc_always_true_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
iso8859_5.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -222,5 +222,8 @@ OnigEncodingType OnigEncodingISO_8859_5 = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match
onigenc_always_true_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
iso8859_6.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -92,5 +92,8 @@ OnigEncodingType OnigEncodingISO_8859_6 = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match
onigenc_always_true_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
iso8859_7.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -218,5 +218,8 @@ OnigEncodingType OnigEncodingISO_8859_7 = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match
onigenc_always_true_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
iso8859_8.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -92,5 +92,8 @@ OnigEncodingType OnigEncodingISO_8859_8 = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match
onigenc_always_true_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
iso8859_9.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -224,5 +224,8 @@ OnigEncodingType OnigEncodingISO_8859_9 = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match
onigenc_always_true_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
koi8.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -246,5 +246,8 @@ OnigEncodingType OnigEncodingKOI8 = {
koi8_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match
onigenc_always_true_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
koi8_r.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -208,5 +208,8 @@ OnigEncodingType OnigEncodingKOI8_R = {
koi8_r_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match
onigenc_always_true_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string
};

View File

@@ -0,0 +1,45 @@
/**********************************************************************
onig_init.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include "oniguruma.h"
/* onig_init(): deprecated function */
extern int
onig_init(void)
{
#if 0
OnigEncoding encs[] = {
ONIG_ENCODING_UTF8
};
return onig_initialize(encs, sizeof(encs)/sizeof(encs[0]));
#else
return onig_initialize(0, 0);
#endif
}

View File

@@ -39,7 +39,7 @@ extern "C" {
#define REG_NEWLINE (1<<1)
#define REG_NOTBOL (1<<2)
#define REG_NOTEOL (1<<3)
#define REG_EXTENDED (1<<4) /* if not setted, Basic Onigular Expression */
#define REG_EXTENDED (1<<4) /* if not set, Basic Onigular Expression */
#define REG_NOSUB (1<<5)
/* POSIX error codes */
@@ -61,7 +61,7 @@ extern "C" {
#define REG_EONIG_INTERNAL 14
#define REG_EONIG_BADWC 15
#define REG_EONIG_BADARG 16
#define REG_EONIG_THREAD 17
/* #define REG_EONIG_THREAD 17 */
/* character encodings (for reg_set_encoding()) */
#define REG_POSIX_ENCODING_ASCII 0

View File

@@ -0,0 +1,836 @@
#ifndef ONIGURUMA_H
#define ONIGURUMA_H
/**********************************************************************
oniguruma.h - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifdef __cplusplus
extern "C" {
#endif
#define ONIGURUMA
#define ONIGURUMA_VERSION_MAJOR 6
#define ONIGURUMA_VERSION_MINOR 1
#define ONIGURUMA_VERSION_TEENY 2
#ifdef __cplusplus
# ifndef HAVE_PROTOTYPES
# define HAVE_PROTOTYPES 1
# endif
# ifndef HAVE_STDARG_PROTOTYPES
# define HAVE_STDARG_PROTOTYPES 1
# endif
#endif
/* escape Mac OS X/Xcode 2.4/gcc 4.0.1 problem */
#if defined(__APPLE__) && defined(__GNUC__) && __GNUC__ >= 4
# ifndef HAVE_STDARG_PROTOTYPES
# define HAVE_STDARG_PROTOTYPES 1
# endif
#endif
#ifdef HAVE_STDARG_H
# ifndef HAVE_STDARG_PROTOTYPES
# define HAVE_STDARG_PROTOTYPES 1
# endif
#endif
#ifndef P_
#if defined(__STDC__) || defined(_WIN32)
# define P_(args) args
#else
# define P_(args) ()
#endif
#endif
#ifndef PV_
#ifdef HAVE_STDARG_PROTOTYPES
# define PV_(args) args
#else
# define PV_(args) ()
#endif
#endif
#ifndef ONIG_EXTERN
#if defined(_WIN32) && !defined(__GNUC__)
#if defined(EXPORT) || defined(RUBY_EXPORT)
#define ONIG_EXTERN extern __declspec(dllexport)
#else
#define ONIG_EXTERN extern __declspec(dllimport)
#endif
#endif
#endif
#ifndef ONIG_EXTERN
#define ONIG_EXTERN extern
#endif
/* PART: character encoding */
#ifndef ONIG_ESCAPE_UCHAR_COLLISION
#define UChar OnigUChar
#endif
#ifdef _WIN32
#include <windows.h>
#endif
typedef unsigned int OnigCodePoint;
typedef unsigned char OnigUChar;
typedef unsigned int OnigCtype;
typedef unsigned int OnigLen;
#define ONIG_INFINITE_DISTANCE ~((OnigLen )0)
typedef unsigned int OnigCaseFoldType; /* case fold flag */
ONIG_EXTERN OnigCaseFoldType OnigDefaultCaseFoldFlag;
/* #define ONIGENC_CASE_FOLD_HIRAGANA_KATAKANA (1<<1) */
/* #define ONIGENC_CASE_FOLD_KATAKANA_WIDTH (1<<2) */
#define ONIGENC_CASE_FOLD_TURKISH_AZERI (1<<20)
#define INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR (1<<30)
#define ONIGENC_CASE_FOLD_MIN INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR
#define ONIGENC_CASE_FOLD_DEFAULT OnigDefaultCaseFoldFlag
#define ONIGENC_MAX_COMP_CASE_FOLD_CODE_LEN 3
#define ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM 13
/* 13 => Unicode:0x1ffc */
/* code range */
#define ONIGENC_CODE_RANGE_NUM(range) ((int )range[0])
#define ONIGENC_CODE_RANGE_FROM(range,i) range[((i)*2) + 1]
#define ONIGENC_CODE_RANGE_TO(range,i) range[((i)*2) + 2]
typedef struct {
int byte_len; /* argument(original) character(s) byte length */
int code_len; /* number of code */
OnigCodePoint code[ONIGENC_MAX_COMP_CASE_FOLD_CODE_LEN];
} OnigCaseFoldCodeItem;
typedef struct {
OnigCodePoint esc;
OnigCodePoint anychar;
OnigCodePoint anytime;
OnigCodePoint zero_or_one_time;
OnigCodePoint one_or_more_time;
OnigCodePoint anychar_anytime;
} OnigMetaCharTableType;
typedef int (*OnigApplyAllCaseFoldFunc)(OnigCodePoint from, OnigCodePoint* to, int to_len, void* arg);
typedef struct OnigEncodingTypeST {
int (*mbc_enc_len)(const OnigUChar* p);
const char* name;
int max_enc_len;
int min_enc_len;
int (*is_mbc_newline)(const OnigUChar* p, const OnigUChar* end);
OnigCodePoint (*mbc_to_code)(const OnigUChar* p, const OnigUChar* end);
int (*code_to_mbclen)(OnigCodePoint code);
int (*code_to_mbc)(OnigCodePoint code, OnigUChar *buf);
int (*mbc_case_fold)(OnigCaseFoldType flag, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to);
int (*apply_all_case_fold)(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg);
int (*get_case_fold_codes_by_str)(OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem acs[]);
int (*property_name_to_ctype)(struct OnigEncodingTypeST* enc, OnigUChar* p, OnigUChar* end);
int (*is_code_ctype)(OnigCodePoint code, OnigCtype ctype);
int (*get_ctype_code_range)(OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[]);
OnigUChar* (*left_adjust_char_head)(const OnigUChar* start, const OnigUChar* p);
int (*is_allowed_reverse_match)(const OnigUChar* p, const OnigUChar* end);
int (*init)(void);
int (*is_initialized)(void);
int (*is_valid_mbc_string)(const OnigUChar* s, const OnigUChar* end);
} OnigEncodingType;
typedef OnigEncodingType* OnigEncoding;
ONIG_EXTERN OnigEncodingType OnigEncodingASCII;
ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_1;
ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_2;
ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_3;
ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_4;
ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_5;
ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_6;
ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_7;
ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_8;
ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_9;
ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_10;
ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_11;
ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_13;
ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_14;
ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_15;
ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_16;
ONIG_EXTERN OnigEncodingType OnigEncodingUTF8;
ONIG_EXTERN OnigEncodingType OnigEncodingUTF16_BE;
ONIG_EXTERN OnigEncodingType OnigEncodingUTF16_LE;
ONIG_EXTERN OnigEncodingType OnigEncodingUTF32_BE;
ONIG_EXTERN OnigEncodingType OnigEncodingUTF32_LE;
ONIG_EXTERN OnigEncodingType OnigEncodingEUC_JP;
ONIG_EXTERN OnigEncodingType OnigEncodingEUC_TW;
ONIG_EXTERN OnigEncodingType OnigEncodingEUC_KR;
ONIG_EXTERN OnigEncodingType OnigEncodingEUC_CN;
ONIG_EXTERN OnigEncodingType OnigEncodingSJIS;
ONIG_EXTERN OnigEncodingType OnigEncodingKOI8;
ONIG_EXTERN OnigEncodingType OnigEncodingKOI8_R;
ONIG_EXTERN OnigEncodingType OnigEncodingCP1251;
ONIG_EXTERN OnigEncodingType OnigEncodingBIG5;
ONIG_EXTERN OnigEncodingType OnigEncodingGB18030;
#define ONIG_ENCODING_ASCII (&OnigEncodingASCII)
#define ONIG_ENCODING_ISO_8859_1 (&OnigEncodingISO_8859_1)
#define ONIG_ENCODING_ISO_8859_2 (&OnigEncodingISO_8859_2)
#define ONIG_ENCODING_ISO_8859_3 (&OnigEncodingISO_8859_3)
#define ONIG_ENCODING_ISO_8859_4 (&OnigEncodingISO_8859_4)
#define ONIG_ENCODING_ISO_8859_5 (&OnigEncodingISO_8859_5)
#define ONIG_ENCODING_ISO_8859_6 (&OnigEncodingISO_8859_6)
#define ONIG_ENCODING_ISO_8859_7 (&OnigEncodingISO_8859_7)
#define ONIG_ENCODING_ISO_8859_8 (&OnigEncodingISO_8859_8)
#define ONIG_ENCODING_ISO_8859_9 (&OnigEncodingISO_8859_9)
#define ONIG_ENCODING_ISO_8859_10 (&OnigEncodingISO_8859_10)
#define ONIG_ENCODING_ISO_8859_11 (&OnigEncodingISO_8859_11)
#define ONIG_ENCODING_ISO_8859_13 (&OnigEncodingISO_8859_13)
#define ONIG_ENCODING_ISO_8859_14 (&OnigEncodingISO_8859_14)
#define ONIG_ENCODING_ISO_8859_15 (&OnigEncodingISO_8859_15)
#define ONIG_ENCODING_ISO_8859_16 (&OnigEncodingISO_8859_16)
#define ONIG_ENCODING_UTF8 (&OnigEncodingUTF8)
#define ONIG_ENCODING_UTF16_BE (&OnigEncodingUTF16_BE)
#define ONIG_ENCODING_UTF16_LE (&OnigEncodingUTF16_LE)
#define ONIG_ENCODING_UTF32_BE (&OnigEncodingUTF32_BE)
#define ONIG_ENCODING_UTF32_LE (&OnigEncodingUTF32_LE)
#define ONIG_ENCODING_EUC_JP (&OnigEncodingEUC_JP)
#define ONIG_ENCODING_EUC_TW (&OnigEncodingEUC_TW)
#define ONIG_ENCODING_EUC_KR (&OnigEncodingEUC_KR)
#define ONIG_ENCODING_EUC_CN (&OnigEncodingEUC_CN)
#define ONIG_ENCODING_SJIS (&OnigEncodingSJIS)
#define ONIG_ENCODING_KOI8 (&OnigEncodingKOI8)
#define ONIG_ENCODING_KOI8_R (&OnigEncodingKOI8_R)
#define ONIG_ENCODING_CP1251 (&OnigEncodingCP1251)
#define ONIG_ENCODING_BIG5 (&OnigEncodingBIG5)
#define ONIG_ENCODING_GB18030 (&OnigEncodingGB18030)
#define ONIG_ENCODING_UNDEF ((OnigEncoding )0)
/* work size */
#define ONIGENC_CODE_TO_MBC_MAXLEN 7
#define ONIGENC_MBC_CASE_FOLD_MAXLEN 18
/* 18: 6(max-byte) * 3(case-fold chars) */
/* character types */
#define ONIGENC_CTYPE_NEWLINE 0
#define ONIGENC_CTYPE_ALPHA 1
#define ONIGENC_CTYPE_BLANK 2
#define ONIGENC_CTYPE_CNTRL 3
#define ONIGENC_CTYPE_DIGIT 4
#define ONIGENC_CTYPE_GRAPH 5
#define ONIGENC_CTYPE_LOWER 6
#define ONIGENC_CTYPE_PRINT 7
#define ONIGENC_CTYPE_PUNCT 8
#define ONIGENC_CTYPE_SPACE 9
#define ONIGENC_CTYPE_UPPER 10
#define ONIGENC_CTYPE_XDIGIT 11
#define ONIGENC_CTYPE_WORD 12
#define ONIGENC_CTYPE_ALNUM 13 /* alpha || digit */
#define ONIGENC_CTYPE_ASCII 14
#define ONIGENC_MAX_STD_CTYPE ONIGENC_CTYPE_ASCII
#define onig_enc_len(enc,p,end) ONIGENC_MBC_ENC_LEN(enc,p)
#define ONIGENC_IS_UNDEF(enc) ((enc) == ONIG_ENCODING_UNDEF)
#define ONIGENC_IS_SINGLEBYTE(enc) (ONIGENC_MBC_MAXLEN(enc) == 1)
#define ONIGENC_IS_MBC_HEAD(enc,p) (ONIGENC_MBC_ENC_LEN(enc,p) != 1)
#define ONIGENC_IS_MBC_ASCII(p) (*(p) < 128)
#define ONIGENC_IS_CODE_ASCII(code) ((code) < 128)
#define ONIGENC_IS_MBC_WORD(enc,s,end) \
ONIGENC_IS_CODE_WORD(enc,ONIGENC_MBC_TO_CODE(enc,s,end))
#define ONIGENC_NAME(enc) ((enc)->name)
#define ONIGENC_MBC_CASE_FOLD(enc,flag,pp,end,buf) \
(enc)->mbc_case_fold(flag,(const OnigUChar** )pp,end,buf)
#define ONIGENC_IS_ALLOWED_REVERSE_MATCH(enc,s,end) \
(enc)->is_allowed_reverse_match(s,end)
#define ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc,start,s) \
(enc)->left_adjust_char_head(start, s)
#define ONIGENC_IS_VALID_MBC_STRING(enc,s,end) \
(enc)->is_valid_mbc_string(s,end)
#define ONIGENC_APPLY_ALL_CASE_FOLD(enc,case_fold_flag,f,arg) \
(enc)->apply_all_case_fold(case_fold_flag,f,arg)
#define ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc,case_fold_flag,p,end,acs) \
(enc)->get_case_fold_codes_by_str(case_fold_flag,p,end,acs)
#define ONIGENC_STEP_BACK(enc,start,s,n) \
onigenc_step_back((enc),(start),(s),(n))
#define ONIGENC_MBC_ENC_LEN(enc,p) (enc)->mbc_enc_len(p)
#define ONIGENC_MBC_MAXLEN(enc) ((enc)->max_enc_len)
#define ONIGENC_MBC_MAXLEN_DIST(enc) ONIGENC_MBC_MAXLEN(enc)
#define ONIGENC_MBC_MINLEN(enc) ((enc)->min_enc_len)
#define ONIGENC_IS_MBC_NEWLINE(enc,p,end) (enc)->is_mbc_newline((p),(end))
#define ONIGENC_MBC_TO_CODE(enc,p,end) (enc)->mbc_to_code((p),(end))
#define ONIGENC_CODE_TO_MBCLEN(enc,code) (enc)->code_to_mbclen(code)
#define ONIGENC_CODE_TO_MBC(enc,code,buf) (enc)->code_to_mbc(code,buf)
#define ONIGENC_PROPERTY_NAME_TO_CTYPE(enc,p,end) \
(enc)->property_name_to_ctype(enc,p,end)
#define ONIGENC_IS_CODE_CTYPE(enc,code,ctype) (enc)->is_code_ctype(code,ctype)
#define ONIGENC_IS_CODE_NEWLINE(enc,code) \
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_NEWLINE)
#define ONIGENC_IS_CODE_GRAPH(enc,code) \
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_GRAPH)
#define ONIGENC_IS_CODE_PRINT(enc,code) \
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_PRINT)
#define ONIGENC_IS_CODE_ALNUM(enc,code) \
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_ALNUM)
#define ONIGENC_IS_CODE_ALPHA(enc,code) \
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_ALPHA)
#define ONIGENC_IS_CODE_LOWER(enc,code) \
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_LOWER)
#define ONIGENC_IS_CODE_UPPER(enc,code) \
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_UPPER)
#define ONIGENC_IS_CODE_CNTRL(enc,code) \
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_CNTRL)
#define ONIGENC_IS_CODE_PUNCT(enc,code) \
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_PUNCT)
#define ONIGENC_IS_CODE_SPACE(enc,code) \
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_SPACE)
#define ONIGENC_IS_CODE_BLANK(enc,code) \
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_BLANK)
#define ONIGENC_IS_CODE_DIGIT(enc,code) \
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_DIGIT)
#define ONIGENC_IS_CODE_XDIGIT(enc,code) \
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_XDIGIT)
#define ONIGENC_IS_CODE_WORD(enc,code) \
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_WORD)
#define ONIGENC_GET_CTYPE_CODE_RANGE(enc,ctype,sbout,ranges) \
(enc)->get_ctype_code_range(ctype,sbout,ranges)
ONIG_EXTERN
OnigUChar* onigenc_step_back P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, int n));
/* encoding API */
ONIG_EXTERN
int onigenc_init P_((void));
ONIG_EXTERN
int onig_initialize_encoding P_((OnigEncoding enc));
ONIG_EXTERN
int onigenc_set_default_encoding P_((OnigEncoding enc));
ONIG_EXTERN
OnigEncoding onigenc_get_default_encoding P_((void));
ONIG_EXTERN
void onigenc_set_default_caseconv_table P_((const OnigUChar* table));
ONIG_EXTERN
OnigUChar* onigenc_get_right_adjust_char_head_with_prev P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar** prev));
ONIG_EXTERN
OnigUChar* onigenc_get_prev_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s));
ONIG_EXTERN
OnigUChar* onigenc_get_left_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s));
ONIG_EXTERN
OnigUChar* onigenc_get_right_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s));
ONIG_EXTERN
int onigenc_strlen P_((OnigEncoding enc, const OnigUChar* p, const OnigUChar* end));
ONIG_EXTERN
int onigenc_strlen_null P_((OnigEncoding enc, const OnigUChar* p));
ONIG_EXTERN
int onigenc_str_bytelen_null P_((OnigEncoding enc, const OnigUChar* p));
ONIG_EXTERN
int onigenc_is_valid_mbc_string P_((OnigEncoding enc, const OnigUChar* s, const OnigUChar* end));
/* PART: regular expression */
/* config parameters */
#define ONIG_NREGION 10
#define ONIG_MAX_CAPTURE_NUM 32767
#define ONIG_MAX_BACKREF_NUM 1000
#define ONIG_MAX_REPEAT_NUM 100000
#define ONIG_MAX_MULTI_BYTE_RANGES_NUM 10000
/* constants */
#define ONIG_MAX_ERROR_MESSAGE_LEN 90
typedef unsigned int OnigOptionType;
#define ONIG_OPTION_DEFAULT ONIG_OPTION_NONE
/* options */
#define ONIG_OPTION_NONE 0U
#define ONIG_OPTION_IGNORECASE 1U
#define ONIG_OPTION_EXTEND (ONIG_OPTION_IGNORECASE << 1)
#define ONIG_OPTION_MULTILINE (ONIG_OPTION_EXTEND << 1)
#define ONIG_OPTION_SINGLELINE (ONIG_OPTION_MULTILINE << 1)
#define ONIG_OPTION_FIND_LONGEST (ONIG_OPTION_SINGLELINE << 1)
#define ONIG_OPTION_FIND_NOT_EMPTY (ONIG_OPTION_FIND_LONGEST << 1)
#define ONIG_OPTION_NEGATE_SINGLELINE (ONIG_OPTION_FIND_NOT_EMPTY << 1)
#define ONIG_OPTION_DONT_CAPTURE_GROUP (ONIG_OPTION_NEGATE_SINGLELINE << 1)
#define ONIG_OPTION_CAPTURE_GROUP (ONIG_OPTION_DONT_CAPTURE_GROUP << 1)
/* options (search time) */
#define ONIG_OPTION_NOTBOL (ONIG_OPTION_CAPTURE_GROUP << 1)
#define ONIG_OPTION_NOTEOL (ONIG_OPTION_NOTBOL << 1)
#define ONIG_OPTION_POSIX_REGION (ONIG_OPTION_NOTEOL << 1)
#define ONIG_OPTION_CHECK_VALIDITY_OF_STRING (ONIG_OPTION_POSIX_REGION << 1)
#define ONIG_OPTION_MAXBIT ONIG_OPTION_CHECK_VALIDITY_OF_STRING /* limit */
#define ONIG_OPTION_ON(options,regopt) ((options) |= (regopt))
#define ONIG_OPTION_OFF(options,regopt) ((options) &= ~(regopt))
#define ONIG_IS_OPTION_ON(options,option) ((options) & (option))
/* syntax */
typedef struct {
unsigned int op;
unsigned int op2;
unsigned int behavior;
OnigOptionType options; /* default option */
OnigMetaCharTableType meta_char_table;
} OnigSyntaxType;
ONIG_EXTERN OnigSyntaxType OnigSyntaxASIS;
ONIG_EXTERN OnigSyntaxType OnigSyntaxPosixBasic;
ONIG_EXTERN OnigSyntaxType OnigSyntaxPosixExtended;
ONIG_EXTERN OnigSyntaxType OnigSyntaxEmacs;
ONIG_EXTERN OnigSyntaxType OnigSyntaxGrep;
ONIG_EXTERN OnigSyntaxType OnigSyntaxGnuRegex;
ONIG_EXTERN OnigSyntaxType OnigSyntaxJava;
ONIG_EXTERN OnigSyntaxType OnigSyntaxPerl;
ONIG_EXTERN OnigSyntaxType OnigSyntaxPerl_NG;
ONIG_EXTERN OnigSyntaxType OnigSyntaxRuby;
/* predefined syntaxes (see regsyntax.c) */
#define ONIG_SYNTAX_ASIS (&OnigSyntaxASIS)
#define ONIG_SYNTAX_POSIX_BASIC (&OnigSyntaxPosixBasic)
#define ONIG_SYNTAX_POSIX_EXTENDED (&OnigSyntaxPosixExtended)
#define ONIG_SYNTAX_EMACS (&OnigSyntaxEmacs)
#define ONIG_SYNTAX_GREP (&OnigSyntaxGrep)
#define ONIG_SYNTAX_GNU_REGEX (&OnigSyntaxGnuRegex)
#define ONIG_SYNTAX_JAVA (&OnigSyntaxJava)
#define ONIG_SYNTAX_PERL (&OnigSyntaxPerl)
#define ONIG_SYNTAX_PERL_NG (&OnigSyntaxPerl_NG)
#define ONIG_SYNTAX_RUBY (&OnigSyntaxRuby)
/* default syntax */
ONIG_EXTERN OnigSyntaxType* OnigDefaultSyntax;
#define ONIG_SYNTAX_DEFAULT OnigDefaultSyntax
/* syntax (operators) */
#define ONIG_SYN_OP_VARIABLE_META_CHARACTERS (1U<<0)
#define ONIG_SYN_OP_DOT_ANYCHAR (1U<<1) /* . */
#define ONIG_SYN_OP_ASTERISK_ZERO_INF (1U<<2) /* * */
#define ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF (1U<<3)
#define ONIG_SYN_OP_PLUS_ONE_INF (1U<<4) /* + */
#define ONIG_SYN_OP_ESC_PLUS_ONE_INF (1U<<5)
#define ONIG_SYN_OP_QMARK_ZERO_ONE (1U<<6) /* ? */
#define ONIG_SYN_OP_ESC_QMARK_ZERO_ONE (1U<<7)
#define ONIG_SYN_OP_BRACE_INTERVAL (1U<<8) /* {lower,upper} */
#define ONIG_SYN_OP_ESC_BRACE_INTERVAL (1U<<9) /* \{lower,upper\} */
#define ONIG_SYN_OP_VBAR_ALT (1U<<10) /* | */
#define ONIG_SYN_OP_ESC_VBAR_ALT (1U<<11) /* \| */
#define ONIG_SYN_OP_LPAREN_SUBEXP (1U<<12) /* (...) */
#define ONIG_SYN_OP_ESC_LPAREN_SUBEXP (1U<<13) /* \(...\) */
#define ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR (1U<<14) /* \A, \Z, \z */
#define ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR (1U<<15) /* \G */
#define ONIG_SYN_OP_DECIMAL_BACKREF (1U<<16) /* \num */
#define ONIG_SYN_OP_BRACKET_CC (1U<<17) /* [...] */
#define ONIG_SYN_OP_ESC_W_WORD (1U<<18) /* \w, \W */
#define ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END (1U<<19) /* \<. \> */
#define ONIG_SYN_OP_ESC_B_WORD_BOUND (1U<<20) /* \b, \B */
#define ONIG_SYN_OP_ESC_S_WHITE_SPACE (1U<<21) /* \s, \S */
#define ONIG_SYN_OP_ESC_D_DIGIT (1U<<22) /* \d, \D */
#define ONIG_SYN_OP_LINE_ANCHOR (1U<<23) /* ^, $ */
#define ONIG_SYN_OP_POSIX_BRACKET (1U<<24) /* [:xxxx:] */
#define ONIG_SYN_OP_QMARK_NON_GREEDY (1U<<25) /* ??,*?,+?,{n,m}? */
#define ONIG_SYN_OP_ESC_CONTROL_CHARS (1U<<26) /* \n,\r,\t,\a ... */
#define ONIG_SYN_OP_ESC_C_CONTROL (1U<<27) /* \cx */
#define ONIG_SYN_OP_ESC_OCTAL3 (1U<<28) /* \OOO */
#define ONIG_SYN_OP_ESC_X_HEX2 (1U<<29) /* \xHH */
#define ONIG_SYN_OP_ESC_X_BRACE_HEX8 (1U<<30) /* \x{7HHHHHHH} */
#define ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE (1U<<0) /* \Q...\E */
#define ONIG_SYN_OP2_QMARK_GROUP_EFFECT (1U<<1) /* (?...) */
#define ONIG_SYN_OP2_OPTION_PERL (1U<<2) /* (?imsx),(?-imsx) */
#define ONIG_SYN_OP2_OPTION_RUBY (1U<<3) /* (?imx), (?-imx) */
#define ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT (1U<<4) /* ?+,*+,++ */
#define ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL (1U<<5) /* {n,m}+ */
#define ONIG_SYN_OP2_CCLASS_SET_OP (1U<<6) /* [...&&..[..]..] */
#define ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP (1U<<7) /* (?<name>...) */
#define ONIG_SYN_OP2_ESC_K_NAMED_BACKREF (1U<<8) /* \k<name> */
#define ONIG_SYN_OP2_ESC_G_SUBEXP_CALL (1U<<9) /* \g<name>, \g<n> */
#define ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY (1U<<10) /* (?@..),(?@<x>..) */
#define ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL (1U<<11) /* \C-x */
#define ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META (1U<<12) /* \M-x */
#define ONIG_SYN_OP2_ESC_V_VTAB (1U<<13) /* \v as VTAB */
#define ONIG_SYN_OP2_ESC_U_HEX4 (1U<<14) /* \uHHHH */
#define ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR (1U<<15) /* \`, \' */
#define ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY (1U<<16) /* \p{...}, \P{...} */
#define ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT (1U<<17) /* \p{^..}, \P{^..} */
/* #define ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS (1U<<18) */
#define ONIG_SYN_OP2_ESC_H_XDIGIT (1U<<19) /* \h, \H */
#define ONIG_SYN_OP2_INEFFECTIVE_ESCAPE (1U<<20) /* \ */
/* syntax (behavior) */
#define ONIG_SYN_CONTEXT_INDEP_ANCHORS (1U<<31) /* not implemented */
#define ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS (1U<<0) /* ?, *, +, {n,m} */
#define ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS (1U<<1) /* error or ignore */
#define ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP (1U<<2) /* ...)... */
#define ONIG_SYN_ALLOW_INVALID_INTERVAL (1U<<3) /* {??? */
#define ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV (1U<<4) /* {,n} => {0,n} */
#define ONIG_SYN_STRICT_CHECK_BACKREF (1U<<5) /* /(\1)/,/\1()/ ..*/
#define ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND (1U<<6) /* (?<=a|bc) */
#define ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP (1U<<7) /* see doc/RE */
#define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME (1U<<8) /* (?<x>)(?<x>) */
#define ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY (1U<<9) /* a{n}?=(?:a{n})? */
/* syntax (behavior) in char class [...] */
#define ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC (1U<<20) /* [^...] */
#define ONIG_SYN_BACKSLASH_ESCAPE_IN_CC (1U<<21) /* [..\w..] etc.. */
#define ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC (1U<<22)
#define ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC (1U<<23) /* [0-9-a]=[0-9\-a] */
/* syntax (behavior) warning */
#define ONIG_SYN_WARN_CC_OP_NOT_ESCAPED (1U<<24) /* [,-,] */
#define ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT (1U<<25) /* (?:a*)+ */
/* meta character specifiers (onig_set_meta_char()) */
#define ONIG_META_CHAR_ESCAPE 0
#define ONIG_META_CHAR_ANYCHAR 1
#define ONIG_META_CHAR_ANYTIME 2
#define ONIG_META_CHAR_ZERO_OR_ONE_TIME 3
#define ONIG_META_CHAR_ONE_OR_MORE_TIME 4
#define ONIG_META_CHAR_ANYCHAR_ANYTIME 5
#define ONIG_INEFFECTIVE_META_CHAR 0
/* error codes */
#define ONIG_IS_PATTERN_ERROR(ecode) ((ecode) <= -100 && (ecode) > -1000)
/* normal return */
#define ONIG_NORMAL 0
#define ONIG_MISMATCH -1
#define ONIG_NO_SUPPORT_CONFIG -2
/* internal error */
#define ONIGERR_MEMORY -5
#define ONIGERR_TYPE_BUG -6
#define ONIGERR_PARSER_BUG -11
#define ONIGERR_STACK_BUG -12
#define ONIGERR_UNDEFINED_BYTECODE -13
#define ONIGERR_UNEXPECTED_BYTECODE -14
#define ONIGERR_MATCH_STACK_LIMIT_OVER -15
#define ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED -21
#define ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR -22
#define ONIGERR_FAIL_TO_INITIALIZE -23
/* general error */
#define ONIGERR_INVALID_ARGUMENT -30
/* syntax error */
#define ONIGERR_END_PATTERN_AT_LEFT_BRACE -100
#define ONIGERR_END_PATTERN_AT_LEFT_BRACKET -101
#define ONIGERR_EMPTY_CHAR_CLASS -102
#define ONIGERR_PREMATURE_END_OF_CHAR_CLASS -103
#define ONIGERR_END_PATTERN_AT_ESCAPE -104
#define ONIGERR_END_PATTERN_AT_META -105
#define ONIGERR_END_PATTERN_AT_CONTROL -106
#define ONIGERR_META_CODE_SYNTAX -108
#define ONIGERR_CONTROL_CODE_SYNTAX -109
#define ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE -110
#define ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE -111
#define ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS -112
#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED -113
#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID -114
#define ONIGERR_NESTED_REPEAT_OPERATOR -115
#define ONIGERR_UNMATCHED_CLOSE_PARENTHESIS -116
#define ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS -117
#define ONIGERR_END_PATTERN_IN_GROUP -118
#define ONIGERR_UNDEFINED_GROUP_OPTION -119
#define ONIGERR_INVALID_POSIX_BRACKET_TYPE -121
#define ONIGERR_INVALID_LOOK_BEHIND_PATTERN -122
#define ONIGERR_INVALID_REPEAT_RANGE_PATTERN -123
/* values error (syntax error) */
#define ONIGERR_TOO_BIG_NUMBER -200
#define ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE -201
#define ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE -202
#define ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS -203
#define ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE -204
#define ONIGERR_TOO_MANY_MULTI_BYTE_RANGES -205
#define ONIGERR_TOO_SHORT_MULTI_BYTE_STRING -206
#define ONIGERR_TOO_BIG_BACKREF_NUMBER -207
#define ONIGERR_INVALID_BACKREF -208
#define ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED -209
#define ONIGERR_TOO_MANY_CAPTURES -210
#define ONIGERR_TOO_LONG_WIDE_CHAR_VALUE -212
#define ONIGERR_EMPTY_GROUP_NAME -214
#define ONIGERR_INVALID_GROUP_NAME -215
#define ONIGERR_INVALID_CHAR_IN_GROUP_NAME -216
#define ONIGERR_UNDEFINED_NAME_REFERENCE -217
#define ONIGERR_UNDEFINED_GROUP_REFERENCE -218
#define ONIGERR_MULTIPLEX_DEFINED_NAME -219
#define ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL -220
#define ONIGERR_NEVER_ENDING_RECURSION -221
#define ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY -222
#define ONIGERR_INVALID_CHAR_PROPERTY_NAME -223
#define ONIGERR_INVALID_CODE_POINT_VALUE -400
#define ONIGERR_INVALID_WIDE_CHAR_VALUE -400
#define ONIGERR_TOO_BIG_WIDE_CHAR_VALUE -401
#define ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION -402
#define ONIGERR_INVALID_COMBINATION_OF_OPTIONS -403
#define ONIGERR_TOO_MANY_USER_DEFINED_OBJECTS -404
#define ONIGERR_TOO_LONG_PROPERTY_NAME -405
#define ONIGERR_LIBRARY_IS_NOT_INITIALIZED -500
/* errors related to thread */
/* #define ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT -1001 */
/* must be smaller than BIT_STATUS_BITS_NUM (unsigned int * 8) */
#define ONIG_MAX_CAPTURE_HISTORY_GROUP 31
#define ONIG_IS_CAPTURE_HISTORY_GROUP(r, i) \
((i) <= ONIG_MAX_CAPTURE_HISTORY_GROUP && (r)->list && (r)->list[i])
typedef struct OnigCaptureTreeNodeStruct {
int group; /* group number */
int beg;
int end;
int allocated;
int num_childs;
struct OnigCaptureTreeNodeStruct** childs;
} OnigCaptureTreeNode;
/* match result region type */
struct re_registers {
int allocated;
int num_regs;
int* beg;
int* end;
/* extended */
OnigCaptureTreeNode* history_root; /* capture history tree root */
};
/* capture tree traverse */
#define ONIG_TRAVERSE_CALLBACK_AT_FIRST 1
#define ONIG_TRAVERSE_CALLBACK_AT_LAST 2
#define ONIG_TRAVERSE_CALLBACK_AT_BOTH \
( ONIG_TRAVERSE_CALLBACK_AT_FIRST | ONIG_TRAVERSE_CALLBACK_AT_LAST )
#define ONIG_REGION_NOTPOS -1
typedef struct re_registers OnigRegion;
typedef struct {
OnigEncoding enc;
OnigUChar* par;
OnigUChar* par_end;
} OnigErrorInfo;
typedef struct {
int lower;
int upper;
} OnigRepeatRange;
typedef void (*OnigWarnFunc) P_((const char* s));
extern void onig_null_warn P_((const char* s));
#define ONIG_NULL_WARN onig_null_warn
#define ONIG_CHAR_TABLE_SIZE 256
typedef struct re_pattern_buffer {
/* common members of BBuf(bytes-buffer) */
unsigned char* p; /* compiled pattern */
unsigned int used; /* used space for p */
unsigned int alloc; /* allocated space for p */
int num_mem; /* used memory(...) num counted from 1 */
int num_repeat; /* OP_REPEAT/OP_REPEAT_NG id-counter */
int num_null_check; /* OP_NULL_CHECK_START/END id counter */
int num_comb_exp_check; /* combination explosion check */
int num_call; /* number of subexp call */
unsigned int capture_history; /* (?@...) flag (1-31) */
unsigned int bt_mem_start; /* need backtrack flag */
unsigned int bt_mem_end; /* need backtrack flag */
int stack_pop_level;
int repeat_range_alloc;
OnigRepeatRange* repeat_range;
OnigEncoding enc;
OnigOptionType options;
OnigSyntaxType* syntax;
OnigCaseFoldType case_fold_flag;
void* name_table;
/* optimization info (string search, char-map and anchors) */
int optimize; /* optimize flag */
int threshold_len; /* search str-length for apply optimize */
int anchor; /* BEGIN_BUF, BEGIN_POS, (SEMI_)END_BUF */
OnigLen anchor_dmin; /* (SEMI_)END_BUF anchor distance */
OnigLen anchor_dmax; /* (SEMI_)END_BUF anchor distance */
int sub_anchor; /* start-anchor for exact or map */
unsigned char *exact;
unsigned char *exact_end;
unsigned char map[ONIG_CHAR_TABLE_SIZE]; /* used as BM skip or char-map */
int *int_map; /* BM skip for exact_len > 255 */
int *int_map_backward; /* BM skip for backward search */
OnigLen dmin; /* min-distance of exact or map */
OnigLen dmax; /* max-distance of exact or map */
/* regex_t link chain */
struct re_pattern_buffer* chain; /* escape compile-conflict */
} OnigRegexType;
typedef OnigRegexType* OnigRegex;
#ifndef ONIG_ESCAPE_REGEX_T_COLLISION
typedef OnigRegexType regex_t;
#endif
typedef struct {
int num_of_elements;
OnigEncoding pattern_enc;
OnigEncoding target_enc;
OnigSyntaxType* syntax;
OnigOptionType option;
OnigCaseFoldType case_fold_flag;
} OnigCompileInfo;
/* Oniguruma Native API */
ONIG_EXTERN
int onig_initialize P_((OnigEncoding encodings[], int n));
/* onig_init(): deprecated function. Use onig_initialize(). */
ONIG_EXTERN
int onig_init P_((void));
ONIG_EXTERN
int onig_error_code_to_str PV_((OnigUChar* s, int err_code, ...));
ONIG_EXTERN
void onig_set_warn_func P_((OnigWarnFunc f));
ONIG_EXTERN
void onig_set_verb_warn_func P_((OnigWarnFunc f));
ONIG_EXTERN
int onig_new P_((OnigRegex*, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));
ONIG_EXTERN
int onig_reg_init P_((regex_t* reg, OnigOptionType option, OnigCaseFoldType case_fold_flag, OnigEncoding enc, OnigSyntaxType* syntax));
int onig_new_without_alloc P_((OnigRegex, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));
ONIG_EXTERN
int onig_new_deluxe P_((OnigRegex* reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));
ONIG_EXTERN
void onig_free P_((OnigRegex));
ONIG_EXTERN
void onig_free_body P_((OnigRegex));
ONIG_EXTERN
int onig_scan(regex_t* reg, const OnigUChar* str, const OnigUChar* end, OnigRegion* region, OnigOptionType option, int (*scan_callback)(int, int, OnigRegion*, void*), void* callback_arg);
ONIG_EXTERN
int onig_search P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option));
ONIG_EXTERN
int onig_match P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option));
ONIG_EXTERN
OnigRegion* onig_region_new P_((void));
ONIG_EXTERN
void onig_region_init P_((OnigRegion* region));
ONIG_EXTERN
void onig_region_free P_((OnigRegion* region, int free_self));
ONIG_EXTERN
void onig_region_copy P_((OnigRegion* to, OnigRegion* from));
ONIG_EXTERN
void onig_region_clear P_((OnigRegion* region));
ONIG_EXTERN
int onig_region_resize P_((OnigRegion* region, int n));
ONIG_EXTERN
int onig_region_set P_((OnigRegion* region, int at, int beg, int end));
ONIG_EXTERN
int onig_name_to_group_numbers P_((OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, int** nums));
ONIG_EXTERN
int onig_name_to_backref_number P_((OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, OnigRegion *region));
ONIG_EXTERN
int onig_foreach_name P_((OnigRegex reg, int (*func)(const OnigUChar*, const OnigUChar*,int,int*,OnigRegex,void*), void* arg));
ONIG_EXTERN
int onig_number_of_names P_((OnigRegex reg));
ONIG_EXTERN
int onig_number_of_captures P_((OnigRegex reg));
ONIG_EXTERN
int onig_number_of_capture_histories P_((OnigRegex reg));
ONIG_EXTERN
OnigCaptureTreeNode* onig_get_capture_tree P_((OnigRegion* region));
ONIG_EXTERN
int onig_capture_tree_traverse P_((OnigRegion* region, int at, int(*callback_func)(int,int,int,int,int,void*), void* arg));
ONIG_EXTERN
int onig_noname_group_capture_is_active P_((OnigRegex reg));
ONIG_EXTERN
OnigEncoding onig_get_encoding P_((OnigRegex reg));
ONIG_EXTERN
OnigOptionType onig_get_options P_((OnigRegex reg));
ONIG_EXTERN
OnigCaseFoldType onig_get_case_fold_flag P_((OnigRegex reg));
ONIG_EXTERN
OnigSyntaxType* onig_get_syntax P_((OnigRegex reg));
ONIG_EXTERN
int onig_set_default_syntax P_((OnigSyntaxType* syntax));
ONIG_EXTERN
void onig_copy_syntax P_((OnigSyntaxType* to, OnigSyntaxType* from));
ONIG_EXTERN
unsigned int onig_get_syntax_op P_((OnigSyntaxType* syntax));
ONIG_EXTERN
unsigned int onig_get_syntax_op2 P_((OnigSyntaxType* syntax));
ONIG_EXTERN
unsigned int onig_get_syntax_behavior P_((OnigSyntaxType* syntax));
ONIG_EXTERN
OnigOptionType onig_get_syntax_options P_((OnigSyntaxType* syntax));
ONIG_EXTERN
void onig_set_syntax_op P_((OnigSyntaxType* syntax, unsigned int op));
ONIG_EXTERN
void onig_set_syntax_op2 P_((OnigSyntaxType* syntax, unsigned int op2));
ONIG_EXTERN
void onig_set_syntax_behavior P_((OnigSyntaxType* syntax, unsigned int behavior));
ONIG_EXTERN
void onig_set_syntax_options P_((OnigSyntaxType* syntax, OnigOptionType options));
ONIG_EXTERN
int onig_set_meta_char P_((OnigSyntaxType* syntax, unsigned int what, OnigCodePoint code));
ONIG_EXTERN
void onig_copy_encoding P_((OnigEncoding to, OnigEncoding from));
ONIG_EXTERN
OnigCaseFoldType onig_get_default_case_fold_flag P_((void));
ONIG_EXTERN
int onig_set_default_case_fold_flag P_((OnigCaseFoldType case_fold_flag));
ONIG_EXTERN
unsigned int onig_get_match_stack_limit_size P_((void));
ONIG_EXTERN
int onig_set_match_stack_limit_size P_((unsigned int size));
ONIG_EXTERN
int onig_unicode_define_user_property P_((const char* name, OnigCodePoint* ranges));
ONIG_EXTERN
int onig_end P_((void));
ONIG_EXTERN
const char* onig_version P_((void));
ONIG_EXTERN
const char* onig_copyright P_((void));
#ifdef __cplusplus
}
#endif
#endif /* ONIGURUMA_H */

View File

@@ -2,7 +2,7 @@
regenc.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -37,6 +37,17 @@ onigenc_init(void)
return 0;
}
extern int
onig_initialize_encoding(OnigEncoding enc)
{
if (enc->init != 0 && (enc->is_initialized() == 0)) {
int r = (enc->init)();
return r;
}
return 0;
}
extern OnigEncoding
onigenc_get_default_encoding(void)
{
@@ -97,6 +108,20 @@ onigenc_step_back(OnigEncoding enc, const UChar* start, const UChar* s, int n)
return (UChar* )s;
}
#if 0
extern int
onigenc_mbc_enc_len_end(OnigEncoding enc, const UChar* p, const UChar* end)
{
int len;
int n;
len = ONIGENC_MBC_ENC_LEN(enc, p);
n = (int )(end - p);
return (n < len ? n : len);
}
#endif
extern UChar*
onigenc_step(OnigEncoding enc, const UChar* p, const UChar* end, int n)
{
@@ -638,6 +663,33 @@ onigenc_always_false_is_allowed_reverse_match(const UChar* s ARG_UNUSED,
return FALSE;
}
extern int
onigenc_always_true_is_valid_mbc_string(const UChar* s ARG_UNUSED,
const UChar* end ARG_UNUSED)
{
return TRUE;
}
extern int
onigenc_length_check_is_valid_mbc_string(OnigEncoding enc,
const UChar* p, const UChar* end)
{
while (p < end) {
p += enclen(enc, p);
}
if (p != end)
return FALSE;
else
return TRUE;
}
extern int
onigenc_is_valid_mbc_string(OnigEncoding enc, const UChar* s, const UChar* end)
{
return ONIGENC_IS_VALID_MBC_STRING(enc, s, end);
}
extern OnigCodePoint
onigenc_mbn_mbc_to_code(OnigEncoding enc, const UChar* p, const UChar* end)
{
@@ -837,66 +889,29 @@ onigenc_with_ascii_strncmp(OnigEncoding enc, const UChar* p, const UChar* end,
return 0;
}
/* Property management */
static int
resize_property_list(int new_size, const OnigCodePoint*** plist, int* psize)
extern int
onig_codes_cmp(OnigCodePoint a[], OnigCodePoint b[], int n)
{
int size;
const OnigCodePoint **list = *plist;
int i;
size = sizeof(OnigCodePoint*) * new_size;
if (IS_NULL(list)) {
list = (const OnigCodePoint** )xmalloc(size);
for (i = 0; i < n; i++) {
if (a[i] != b[i])
return -1;
}
else {
list = (const OnigCodePoint** )xrealloc((void* )list, size);
}
if (IS_NULL(list)) return ONIGERR_MEMORY;
*plist = list;
*psize = new_size;
return 0;
}
extern int
onigenc_property_list_add_property(UChar* name, const OnigCodePoint* prop,
hash_table_type **table, const OnigCodePoint*** plist, int *pnum,
int *psize)
onig_codes_byte_at(OnigCodePoint codes[], int at)
{
#define PROP_INIT_SIZE 16
int index;
int b;
OnigCodePoint code;
int r;
index = at / 3;
b = at % 3;
code = codes[index];
if (*psize <= *pnum) {
int new_size = (*psize == 0 ? PROP_INIT_SIZE : *psize * 2);
r = resize_property_list(new_size, plist, psize);
if (r != 0) return r;
}
(*plist)[*pnum] = prop;
if (ONIG_IS_NULL(*table)) {
*table = onig_st_init_strend_table_with_size(PROP_INIT_SIZE);
if (ONIG_IS_NULL(*table)) return ONIGERR_MEMORY;
}
*pnum = *pnum + 1;
onig_st_insert_strend(*table, name, name + strlen((char* )name),
(hash_data_type )(*pnum + ONIGENC_MAX_STD_CTYPE));
return 0;
}
extern int
onigenc_property_list_init(int (*f)(void))
{
int r;
THREAD_ATOMIC_START;
r = f();
THREAD_ATOMIC_END;
return r;
return ((code >> ((2 - b) * 8)) & 0xff);
}

View File

@@ -4,7 +4,7 @@
regenc.h - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -71,7 +71,7 @@ typedef struct {
#define ONIG_CHECK_NULL_RETURN(p) if (ONIG_IS_NULL(p)) return NULL
#define ONIG_CHECK_NULL_RETURN_VAL(p,val) if (ONIG_IS_NULL(p)) return (val)
#define enclen(enc,p) ONIGENC_MBC_ENC_LEN(enc,p)
#define enclen(enc,p) ONIGENC_MBC_ENC_LEN(enc,p)
/* character types bit flag */
#define BIT_CTYPE_NEWLINE (1<< ONIGENC_CTYPE_NEWLINE)
@@ -102,11 +102,15 @@ typedef struct {
short int len;
} PosixBracketEntryType;
struct PropertyNameCtype {
char *name;
int ctype;
};
/* #define USE_CRNL_AS_LINE_TERMINATOR */
#define USE_UNICODE_PROPERTIES
/* #define USE_UNICODE_CASE_FOLD_TURKISH_AZERI */
/* #define USE_UNICODE_ALL_LINE_TERMINATORS */ /* see Unicode.org UTF#18 */
/* #define USE_UNICODE_ALL_LINE_TERMINATORS */ /* see Unicode.org UTS #18 */
#define ONIG_ENCODING_INIT_DEFAULT ONIG_ENCODING_ASCII
@@ -129,6 +133,8 @@ ONIG_EXTERN int onigenc_single_byte_code_to_mbc P_((OnigCodePoint code, UChar *b
ONIG_EXTERN UChar* onigenc_single_byte_left_adjust_char_head P_((const UChar* start, const UChar* s));
ONIG_EXTERN int onigenc_always_true_is_allowed_reverse_match P_((const UChar* s, const UChar* end));
ONIG_EXTERN int onigenc_always_false_is_allowed_reverse_match P_((const UChar* s, const UChar* end));
ONIG_EXTERN int onigenc_always_true_is_valid_mbc_string P_((const UChar* s, const UChar* end));
ONIG_EXTERN int onigenc_length_check_is_valid_mbc_string P_((OnigEncoding enc, const UChar* s, const UChar* end));
/* methods for multi byte encoding */
ONIG_EXTERN OnigCodePoint onigenc_mbn_mbc_to_code P_((OnigEncoding enc, const UChar* p, const UChar* end));
@@ -141,7 +147,9 @@ ONIG_EXTERN int onigenc_mb2_is_code_ctype P_((OnigEncoding enc, OnigCodePoint co
ONIG_EXTERN int onigenc_mb4_code_to_mbclen P_((OnigCodePoint code));
ONIG_EXTERN int onigenc_mb4_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, UChar *buf));
ONIG_EXTERN int onigenc_mb4_is_code_ctype P_((OnigEncoding enc, OnigCodePoint code, unsigned int ctype));
ONIG_EXTERN struct PropertyNameCtype* euc_jp_lookup_property_name P_((register const char *str, register unsigned int len));
ONIG_EXTERN struct PropertyNameCtype* sjis_lookup_property_name P_((register const char *str, register unsigned int len));
//ONIG_EXTERN const struct PropertyNameCtype* unicode_lookup_property_name P_((register const char *str, register unsigned int len));
/* in enc/unicode.c */
ONIG_EXTERN int onigenc_unicode_is_code_ctype P_((OnigCodePoint code, unsigned int ctype));
@@ -155,6 +163,51 @@ ONIG_EXTERN int onigenc_unicode_apply_all_case_fold P_((OnigCaseFoldType flag, O
#define UTF16_IS_SURROGATE_FIRST(c) (((c) & 0xfc) == 0xd8)
#define UTF16_IS_SURROGATE_SECOND(c) (((c) & 0xfc) == 0xdc)
/* from unicode generated codes */
#define FOLDS1_FOLD(i) (OnigUnicodeFolds1 + (i))
#define FOLDS2_FOLD(i) (OnigUnicodeFolds2 + (i))
#define FOLDS3_FOLD(i) (OnigUnicodeFolds3 + (i))
#define FOLDS1_UNFOLDS_NUM(i) (OnigUnicodeFolds1[(i)+1])
#define FOLDS2_UNFOLDS_NUM(i) (OnigUnicodeFolds2[(i)+2])
#define FOLDS3_UNFOLDS_NUM(i) (OnigUnicodeFolds3[(i)+3])
#define FOLDS1_UNFOLDS(i) (OnigUnicodeFolds1 + (i) + 2)
#define FOLDS2_UNFOLDS(i) (OnigUnicodeFolds2 + (i) + 3)
#define FOLDS3_UNFOLDS(i) (OnigUnicodeFolds3 + (i) + 4)
#define FOLDS1_NEXT_INDEX(i) ((i) + 2 + OnigUnicodeFolds1[(i)+1])
#define FOLDS2_NEXT_INDEX(i) ((i) + 3 + OnigUnicodeFolds2[(i)+2])
#define FOLDS3_NEXT_INDEX(i) ((i) + 4 + OnigUnicodeFolds3[(i)+3])
#define FOLDS_FOLD_ADDR_BUK(buk, addr) do {\
if ((buk)->fold_len == 1)\
addr = OnigUnicodeFolds1 + (buk)->index;\
else if ((buk)->fold_len == 2)\
addr = OnigUnicodeFolds2 + (buk)->index;\
else if ((buk)->fold_len == 3)\
addr = OnigUnicodeFolds3 + (buk)->index;\
else\
addr = 0;\
} while (0)
extern OnigCodePoint OnigUnicodeFolds1[];
extern OnigCodePoint OnigUnicodeFolds2[];
extern OnigCodePoint OnigUnicodeFolds3[];
struct ByUnfoldKey {
OnigCodePoint code;
int index;
int fold_len;
};
extern const struct ByUnfoldKey* unicode_unfold_key(OnigCodePoint code);
extern int unicode_fold1_key(OnigCodePoint code[]);
extern int unicode_fold2_key(OnigCodePoint code[]);
extern int unicode_fold3_key(OnigCodePoint code[]);
extern int onig_codes_cmp(OnigCodePoint a[], OnigCodePoint b[], int n);
extern int onig_codes_byte_at(OnigCodePoint code[], int at);
#define ONIGENC_ISO_8859_1_TO_LOWER_CASE(c) \
OnigEncISO_8859_1_ToLowerCaseTable[c]
#define ONIGENC_ISO_8859_1_TO_UPPER_CASE(c) \
@@ -176,6 +229,7 @@ ONIG_EXTERN const UChar OnigEncAsciiToLowerCaseTable[];
ONIG_EXTERN const UChar OnigEncAsciiToUpperCaseTable[];
ONIG_EXTERN const unsigned short OnigEncAsciiCtypeTable[];
#define ONIGENC_IS_ASCII_CODE(code) ((code) < 0x80)
#define ONIGENC_ASCII_CODE_TO_LOWER_CASE(c) OnigEncAsciiToLowerCaseTable[c]
#define ONIGENC_ASCII_CODE_TO_UPPER_CASE(c) OnigEncAsciiToUpperCaseTable[c]

View File

@@ -68,6 +68,8 @@ onig_error_code_to_format(int code)
p = "default multibyte-encoding is not setted"; break;
case ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR:
p = "can't convert to wide-char on specified multibyte-encoding"; break;
case ONIGERR_FAIL_TO_INITIALIZE:
p = "fail to initialize"; break;
case ONIGERR_INVALID_ARGUMENT:
p = "invalid argument"; break;
case ONIGERR_END_PATTERN_AT_LEFT_BRACE:
@@ -138,6 +140,8 @@ onig_error_code_to_format(int code)
#endif
case ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED:
p = "numbered backref/call is not allowed. (use name)"; break;
case ONIGERR_TOO_MANY_CAPTURES:
p = "too many captures"; break;
case ONIGERR_TOO_BIG_WIDE_CHAR_VALUE:
p = "too big wide-char value"; break;
case ONIGERR_TOO_LONG_WIDE_CHAR_VALUE:
@@ -172,8 +176,8 @@ onig_error_code_to_format(int code)
p = "not supported encoding combination"; break;
case ONIGERR_INVALID_COMBINATION_OF_OPTIONS:
p = "invalid combination of options"; break;
case ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT:
p = "over thread pass limit count"; break;
case ONIGERR_LIBRARY_IS_NOT_INITIALIZED:
p = "library is not initialized"; break;
default:
p = "undefined error code"; break;
@@ -184,12 +188,12 @@ onig_error_code_to_format(int code)
static void sprint_byte(char* s, unsigned int v)
{
sprintf(s, "%02x", (v & 0377));
xsnprintf(s, 3, "%02x", (v & 0377));
}
static void sprint_byte_with_x(char* s, unsigned int v)
{
sprintf(s, "\\x%02x", (v & 0377));
xsnprintf(s, 5, "\\x%02x", (v & 0377));
}
static int to_ascii(OnigEncoding enc, UChar *s, UChar *end,
@@ -339,7 +343,7 @@ onig_snprintf_with_pattern(buf, bufsize, enc, pat, pat_end, fmt, va_alist)
need = (pat_end - pat) * 4 + 4;
if (n + need < bufsize) {
strcat((char* )buf, ": /");
xstrcat((char* )buf, ": /", bufsize);
s = buf + onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, buf);
p = pat;

View File

@@ -200,23 +200,3 @@ onig_new_deluxe(regex_t** reg, const UChar* pattern, const UChar* pattern_end,
return r;
}
#ifdef USE_RECOMPILE_API
extern int
onig_recompile_deluxe(regex_t* reg, const UChar* pattern, const UChar* pattern_end,
OnigCompileInfo* ci, OnigErrorInfo* einfo)
{
int r;
regex_t *new_reg;
r = onig_new_deluxe(&new_reg, pattern, pattern_end, ci, einfo);
if (r) return r;
if (ONIG_STATE(reg) == ONIG_STATE_NORMAL) {
onig_transfer(reg, new_reg);
}
else {
onig_chain_link_add(reg, new_reg);
}
return 0;
}
#endif

View File

@@ -93,29 +93,6 @@ re_compile_pattern(const char* pattern, int size, regex_t* reg, char* ebuf)
return r;
}
#ifdef USE_RECOMPILE_API
extern int
re_recompile_pattern(const char* pattern, int size, regex_t* reg, char* ebuf)
{
int r;
OnigErrorInfo einfo;
OnigEncoding enc;
/* I think encoding and options should be arguments of this function.
But this is adapted to present re.c. (2002/11/29)
*/
enc = OnigEncDefaultCharEncoding;
r = onig_recompile(reg, (UChar* )pattern, (UChar* )(pattern + size),
reg->options, enc, OnigDefaultSyntax, &einfo);
if (r != ONIG_NORMAL) {
if (IS_NOT_NULL(ebuf))
(void )onig_error_code_to_str((UChar* )ebuf, r, &einfo);
}
return r;
}
#endif
extern void
re_free_pattern(regex_t* reg)
{
@@ -163,5 +140,8 @@ re_mbcinit(int mb_code)
break;
}
onig_initialize(0, 0);
onig_initialize_encoding(enc);
onigenc_set_default_encoding(enc);
}

View File

@@ -62,15 +62,12 @@
#define USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT /* /(?:()|())*\2/ */
#define USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE /* /\n$/ =~ "\n" */
#define USE_WARNING_REDUNDANT_NESTED_REPEAT_OPERATOR
/* #define USE_RECOMPILE_API */
/* !!! moved to regenc.h. */ /* #define USE_CRNL_AS_LINE_TERMINATOR */
/* internal config */
#define USE_PARSE_TREE_NODE_RECYCLE
#define USE_OP_PUSH_OR_JUMP_EXACT
#define USE_QTFR_PEEK_NEXT
#define USE_ST_LIBRARY
#define USE_SHARED_CCLASS_TABLE
#define INIT_MATCH_STACK_SIZE 160
#define DEFAULT_MATCH_STACK_LIMIT_SIZE 0 /* unlimited */
@@ -95,12 +92,6 @@
#define USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE
/* #define USE_COMBINATION_EXPLOSION_CHECK */ /* (X*)* */
/* #define USE_MULTI_THREAD_SYSTEM */
#define THREAD_SYSTEM_INIT /* depend on thread system */
#define THREAD_SYSTEM_END /* depend on thread system */
#define THREAD_ATOMIC_START /* depend on thread system */
#define THREAD_ATOMIC_END /* depend on thread system */
#define THREAD_PASS /* depend on thread system */
#define xmalloc malloc
#define xrealloc realloc
#define xcalloc calloc
@@ -131,41 +122,23 @@
#define STATE_CHECK_STRING_THRESHOLD_LEN 7
#define STATE_CHECK_BUFF_MAX_SIZE 0x4000
#define THREAD_PASS_LIMIT_COUNT 8
#define xmemset memset
#define xmemcpy memcpy
#define xmemmove memmove
#if defined(_WIN32) && !defined(__GNUC__)
#define xalloca _alloca
#define xvsnprintf _vsnprintf
#define xvsnprintf(buf,size,fmt,args) _vsnprintf_s(buf,size,_TRUNCATE,fmt,args)
#define xsnprintf sprintf_s
#define xstrcat(dest,src,size) strcat_s(dest,size,src)
#else
#define xalloca alloca
#define xvsnprintf vsnprintf
#define xsnprintf snprintf
#define xstrcat(dest,src,size) strcat(dest,src)
#endif
#if defined(USE_RECOMPILE_API) && defined(USE_MULTI_THREAD_SYSTEM)
#define ONIG_STATE_INC(reg) (reg)->state++
#define ONIG_STATE_DEC(reg) (reg)->state--
#define ONIG_STATE_INC_THREAD(reg) do {\
THREAD_ATOMIC_START;\
(reg)->state++;\
THREAD_ATOMIC_END;\
} while(0)
#define ONIG_STATE_DEC_THREAD(reg) do {\
THREAD_ATOMIC_START;\
(reg)->state--;\
THREAD_ATOMIC_END;\
} while(0)
#else
#define ONIG_STATE_INC(reg) /* Nothing */
#define ONIG_STATE_DEC(reg) /* Nothing */
#define ONIG_STATE_INC_THREAD(reg) /* Nothing */
#define ONIG_STATE_DEC_THREAD(reg) /* Nothing */
#endif /* USE_RECOMPILE_API && USE_MULTI_THREAD_SYSTEM */
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -227,11 +200,7 @@
} while(0)
/* sizeof(OnigCodePoint) */
#ifdef SIZEOF_SIZE_T
# define WORD_ALIGNMENT_SIZE SIZEOF_SIZE_T
#else
# define WORD_ALIGNMENT_SIZE SIZEOF_LONG
#endif
#define WORD_ALIGNMENT_SIZE SIZEOF_SIZE_T
#define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\
(pad_size) = WORD_ALIGNMENT_SIZE \
@@ -720,7 +689,7 @@ typedef struct _OnigStackType {
struct {
int num; /* memory num */
UChar *pstr; /* start/end position */
/* Following information is setted, if this stack type is MEM-START */
/* Following information is set, if this stack type is MEM-START */
OnigStackIndex start; /* prev. info (for backtrack "(...)*" ) */
OnigStackIndex end; /* prev. info (for backtrack "(...)*" ) */
} mem;
@@ -743,6 +712,7 @@ typedef struct {
int stack_n;
OnigOptionType options;
OnigRegion* region;
int ptr_num;
const UChar* start; /* search start position (for \G: BEGIN_POSITION) */
#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE
int best_len; /* for ONIG_OPTION_FIND_LONGEST */
@@ -785,12 +755,11 @@ extern void onig_print_statistics P_((FILE* f));
#endif
#endif
extern void onig_warning(const char* s);
extern UChar* onig_error_code_to_format P_((int code));
extern void onig_snprintf_with_pattern PV_((UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const UChar *fmt, ...));
extern int onig_bbuf_init P_((BBuf* buf, int size));
extern int onig_compile P_((regex_t* reg, const UChar* pattern, const UChar* pattern_end, OnigErrorInfo* einfo));
extern void onig_chain_reduce P_((regex_t* reg));
extern void onig_chain_link_add P_((regex_t* to, regex_t* add));
extern void onig_transfer P_((regex_t* to, regex_t* from));
extern int onig_is_code_in_cc P_((OnigEncoding enc, OnigCodePoint code, CClassNode* cc));
extern int onig_is_code_in_cc_len P_((int enclen, OnigCodePoint code, CClassNode* cc));
@@ -808,23 +777,6 @@ extern hash_table_type* onig_st_init_strend_table_with_size P_((int size));
extern int onig_st_lookup_strend P_((hash_table_type* table, const UChar* str_key, const UChar* end_key, hash_data_type *value));
extern int onig_st_insert_strend P_((hash_table_type* table, const UChar* str_key, const UChar* end_key, hash_data_type value));
/* encoding property management */
#define PROPERTY_LIST_ADD_PROP(Name, CR) \
r = onigenc_property_list_add_property((UChar* )Name, CR,\
&PropertyNameTable, &PropertyList, &PropertyListNum,\
&PropertyListSize);\
if (r != 0) goto end
#define PROPERTY_LIST_INIT_CHECK \
if (PropertyInited == 0) {\
int r = onigenc_property_list_init(init_property_list);\
if (r != 0) return r;\
}
extern int onigenc_property_list_add_property P_((UChar* name, const OnigCodePoint* prop, hash_table_type **table, const OnigCodePoint*** plist, int *pnum, int *psize));
typedef int (*ONIGENC_INIT_PROPERTY_LIST_FUNC_TYPE)(void);
extern int onigenc_property_list_init P_((ONIGENC_INIT_PROPERTY_LIST_FUNC_TYPE));
#endif /* REGINT_H */

View File

@@ -191,8 +191,8 @@ typedef struct {
struct _Node* target;
AbsAddrType call_addr;
/* for multiple call reference */
OnigDistance min_len; /* min length (byte) */
OnigDistance max_len; /* max length (byte) */
OnigLen min_len; /* min length (byte) */
OnigLen max_len; /* max length (byte) */
int char_len; /* character length */
int opt_count; /* referenced count in optimize_node_left() */
} EncloseNode;
@@ -337,7 +337,6 @@ extern Node* onig_node_new_list P_((Node* left, Node* right));
extern Node* onig_node_list_add P_((Node* list, Node* x));
extern Node* onig_node_new_alt P_((Node* left, Node* right));
extern void onig_node_str_clear P_((Node* node));
extern int onig_free_node_list P_((void));
extern int onig_names_free P_((regex_t* reg));
extern int onig_parse_make_tree P_((Node** root, const UChar* pattern, const UChar* end, regex_t* reg, ScanEnv* env));
extern int onig_free_shared_cclass_table P_((void));

View File

@@ -42,6 +42,14 @@
# define ARG_UNUSED
#endif
#if defined(_WIN32) && !defined(__GNUC__)
#define xsnprintf sprintf_s
#define xstrncpy(dest,src,size) strncpy_s(dest,size,src,_TRUNCATE)
#else
#define xsnprintf snprintf
#define xstrncpy strncpy
#endif
static char* ESTRING[] = {
NULL,
"failed to match", /* REG_NOMATCH */
@@ -61,8 +69,7 @@ static char* ESTRING[] = {
/* Extended errors */
"internal error", /* REG_EONIG_INTERNAL */
"invalid wide char value", /* REG_EONIG_BADWC */
"invalid argument", /* REG_EONIG_BADARG */
"multi-thread error" /* REG_EONIG_THREAD */
"invalid argument" /* REG_EONIG_BADARG */
};
#include <stdio.h>
@@ -84,14 +91,14 @@ regerror(int posix_ecode, const regex_t* reg ARG_UNUSED, char* buf,
s = "";
}
else {
sprintf(tbuf, "undefined error code (%d)", posix_ecode);
xsnprintf(tbuf, sizeof(tbuf), "undefined error code (%d)", posix_ecode);
s = tbuf;
}
len = strlen(s) + 1; /* use strlen() because s is ascii encoding. */
if (buf != NULL && size > 0) {
strncpy(buf, s, size - 1);
xstrncpy(buf, s, size - 1);
buf[size - 1] = '\0';
}
return len;

View File

@@ -67,6 +67,7 @@ onig2posix_error_code(int code)
{ ONIGERR_UNEXPECTED_BYTECODE, REG_EONIG_INTERNAL },
{ ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED, REG_EONIG_BADARG },
{ ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR, REG_EONIG_BADARG },
{ ONIGERR_FAIL_TO_INITIALIZE, REG_EONIG_INTERNAL },
{ ONIGERR_INVALID_ARGUMENT, REG_EONIG_BADARG },
{ ONIGERR_END_PATTERN_AT_LEFT_BRACE, REG_EBRACE },
{ ONIGERR_END_PATTERN_AT_LEFT_BRACKET, REG_EBRACK },
@@ -114,8 +115,7 @@ onig2posix_error_code(int code)
{ ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY, REG_BADPAT },
{ ONIGERR_INVALID_CHAR_PROPERTY_NAME, REG_BADPAT },
{ ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION, REG_EONIG_BADARG },
{ ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT, REG_EONIG_THREAD }
{ ONIGERR_LIBRARY_IS_NOT_INITIALIZED, REG_EONIG_INTERNAL }
};
int i;
@@ -257,6 +257,9 @@ reg_set_encoding(int mb_code)
break;
}
onig_initialize(0, 0);
onig_initialize_encoding(enc);
onigenc_set_default_encoding(enc);
}

View File

@@ -28,7 +28,7 @@
*/
#include "config.h"
#include "oniguruma.h"
#include "regint.h"
#include <stdio.h>
extern const char*
@@ -36,10 +36,10 @@ onig_version(void)
{
static char s[12];
sprintf(s, "%d.%d.%d",
ONIGURUMA_VERSION_MAJOR,
ONIGURUMA_VERSION_MINOR,
ONIGURUMA_VERSION_TEENY);
xsnprintf(s, sizeof(s), "%d.%d.%d",
ONIGURUMA_VERSION_MAJOR,
ONIGURUMA_VERSION_MINOR,
ONIGURUMA_VERSION_TEENY);
return s;
}
@@ -48,9 +48,10 @@ onig_copyright(void)
{
static char s[58];
sprintf(s, "Oniguruma %d.%d.%d : Copyright (C) 2002-2008 K.Kosako",
ONIGURUMA_VERSION_MAJOR,
ONIGURUMA_VERSION_MINOR,
ONIGURUMA_VERSION_TEENY);
xsnprintf(s, sizeof(s),
"Oniguruma %d.%d.%d : Copyright (C) 2002-2016 K.Kosako",
ONIGURUMA_VERSION_MAJOR,
ONIGURUMA_VERSION_MINOR,
ONIGURUMA_VERSION_TEENY);
return s;
}

View File

@@ -2,7 +2,7 @@
sjis.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -76,6 +76,39 @@ mbc_enc_len(const UChar* p)
return EncLen_SJIS[*p];
}
static int
is_valid_mbc_string(const UChar* p, const UChar* end)
{
while (p < end) {
if (*p < 0x80) {
p++;
}
else if (*p < 0xa1) {
if (*p == 0xa0 || *p == 0x80)
return FALSE;
p++;
if (p >= end) return FALSE;
if (*p < 0x40 || *p > 0xfc || *p == 0x7f)
return FALSE;
p++;
}
else if (*p < 0xe0) {
p++;
}
else if (*p < 0xfd) {
p++;
if (p >= end) return FALSE;
if (*p < 0x40 || *p > 0xfc || *p == 0x7f)
return FALSE;
p++;
}
else
return FALSE;
}
return TRUE;
}
static int
code_to_mbclen(OnigCodePoint code)
{
@@ -206,12 +239,6 @@ is_allowed_reverse_match(const UChar* s, const UChar* end ARG_UNUSED)
}
static int PropertyInited = 0;
static const OnigCodePoint** PropertyList;
static int PropertyListNum;
static int PropertyListSize;
static hash_table_type* PropertyNameTable;
static const OnigCodePoint CR_Hiragana[] = {
1,
0x829f, 0x82f1
@@ -225,31 +252,28 @@ static const OnigCodePoint CR_Katakana[] = {
0x8380, 0x8396,
}; /* CR_Katakana */
static int
init_property_list(void)
{
int r;
static const OnigCodePoint* PropertyList[] = {
CR_Hiragana,
CR_Katakana
};
PROPERTY_LIST_ADD_PROP("Hiragana", CR_Hiragana);
PROPERTY_LIST_ADD_PROP("Katakana", CR_Katakana);
PropertyInited = 1;
end:
return r;
}
static int
property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end)
{
hash_data_type ctype;
struct PropertyNameCtype* pc;
int len = end - p;
char q[32];
PROPERTY_LIST_INIT_CHECK;
if (onig_st_lookup_strend(PropertyNameTable, p, end, &ctype) == 0) {
return onigenc_minimum_property_name_to_ctype(enc, p, end);
if (len < sizeof(q) - 1) {
xmemcpy(q, p, (size_t )len);
q[len] = '\0';
pc = euc_jp_lookup_property_name(q, len);
if (pc != 0)
return pc->ctype;
}
return (int )ctype;
return ONIGERR_INVALID_CHAR_PROPERTY_NAME;
}
static int
@@ -265,10 +289,8 @@ is_code_ctype(OnigCodePoint code, unsigned int ctype)
}
}
else {
PROPERTY_LIST_INIT_CHECK;
ctype -= (ONIGENC_MAX_STD_CTYPE + 1);
if (ctype >= (unsigned int )PropertyListNum)
if (ctype >= (unsigned int )(sizeof(PropertyList)/sizeof(PropertyList[0])))
return ONIGERR_TYPE_BUG;
return onig_is_in_code_range((UChar* )PropertyList[ctype], code);
@@ -287,10 +309,8 @@ get_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out,
else {
*sb_out = 0x80;
PROPERTY_LIST_INIT_CHECK;
ctype -= (ONIGENC_MAX_STD_CTYPE + 1);
if (ctype >= (OnigCtype )PropertyListNum)
if (ctype >= (OnigCtype )(sizeof(PropertyList)/sizeof(PropertyList[0])))
return ONIGERR_TYPE_BUG;
*ranges = PropertyList[ctype];
@@ -314,5 +334,8 @@ OnigEncodingType OnigEncodingSJIS = {
is_code_ctype,
get_ctype_code_range,
left_adjust_char_head,
is_allowed_reverse_match
is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
is_valid_mbc_string
};

View File

@@ -0,0 +1,158 @@
/* ANSI-C code produced by gperf version 3.0.4 */
/* Command-line: gperf -pt -T -L ANSI-C -N sjis_lookup_property_name --output-file sjis_prop.c sjis_prop.gperf */
/* Computed positions: -k'1,3' */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
&& ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
&& ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
&& ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
&& ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
&& ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
&& ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
&& ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
&& ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
&& ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
&& ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
&& ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
&& ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
&& ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
&& ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
&& ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
/* The character set is not based on ISO-646. */
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
#endif
#line 1 "sjis_prop.gperf"
#include <string.h>
#include "regenc.h"
#define TOTAL_KEYWORDS 16
#define MIN_WORD_LENGTH 4
#define MAX_WORD_LENGTH 8
#define MIN_HASH_VALUE 4
#define MAX_HASH_VALUE 55
/* maximum key range = 52, duplicates = 0 */
#ifdef __GNUC__
__inline
#else
#ifdef __cplusplus
inline
#endif
#endif
static unsigned int
hash (register const char *str, register unsigned int len)
{
static unsigned char asso_values[] =
{
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 0, 3, 10, 25, 56,
56, 30, 0, 56, 56, 0, 20, 56, 56, 56,
15, 56, 56, 20, 56, 30, 56, 0, 0, 56,
56, 56, 56, 56, 56, 56, 56, 15, 56, 56,
56, 56, 56, 25, 56, 10, 56, 56, 56, 56,
5, 56, 0, 56, 0, 56, 5, 56, 56, 20,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56
};
return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]];
}
#ifdef __GNUC__
__inline
#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
__attribute__ ((__gnu_inline__))
#endif
#endif
struct PropertyNameCtype *
sjis_lookup_property_name (register const char *str, register unsigned int len)
{
static struct PropertyNameCtype wordlist[] =
{
{""}, {""}, {""}, {""},
#line 23 "sjis_prop.gperf"
{"Word", 12},
#line 12 "sjis_prop.gperf"
{"Alpha", 1},
{""}, {""},
#line 26 "sjis_prop.gperf"
{"Hiragana", 15},
{""},
#line 24 "sjis_prop.gperf"
{"Alnum", 13},
{""}, {""},
#line 27 "sjis_prop.gperf"
{"Katakana", 16},
{""},
#line 25 "sjis_prop.gperf"
{"ASCII", 14},
#line 22 "sjis_prop.gperf"
{"XDigit", 11},
{""}, {""}, {""},
#line 14 "sjis_prop.gperf"
{"Cntrl", 3},
{""}, {""},
#line 13 "sjis_prop.gperf"
{"Blank", 2},
{""},
#line 19 "sjis_prop.gperf"
{"Punct", 8},
{""}, {""}, {""}, {""},
#line 18 "sjis_prop.gperf"
{"Print", 7},
{""}, {""}, {""}, {""},
#line 21 "sjis_prop.gperf"
{"Upper", 10},
{""}, {""}, {""}, {""},
#line 20 "sjis_prop.gperf"
{"Space", 9},
{""}, {""}, {""}, {""},
#line 17 "sjis_prop.gperf"
{"Lower", 6},
{""}, {""}, {""}, {""},
#line 16 "sjis_prop.gperf"
{"Graph", 5},
{""}, {""}, {""}, {""},
#line 15 "sjis_prop.gperf"
{"Digit", 4}
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
register int key = hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
{
register const char *s = wordlist[key].name;
if (*str == *s && !strcmp (str + 1, s + 1))
return &wordlist[key];
}
}
return 0;
}

View File

@@ -0,0 +1,664 @@
/**********************************************************************
unicode.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include "regint.h"
#define ONIGENC_IS_UNICODE_ISO_8859_1_CTYPE(code,ctype) \
((EncUNICODE_ISO_8859_1_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
static const unsigned short EncUNICODE_ISO_8859_1_CtypeTable[256] = {
0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,
0x4008, 0x428c, 0x4289, 0x4288, 0x4288, 0x4288, 0x4008, 0x4008,
0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,
0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,
0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,
0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,
0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,
0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,
0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,
0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,
0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,
0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,
0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,
0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,
0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,
0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,
0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0288, 0x0008, 0x0008,
0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
0x0284, 0x01a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0,
0x00a0, 0x00a0, 0x30e2, 0x01a0, 0x00a0, 0x00a8, 0x00a0, 0x00a0,
0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x00a0, 0x30e2, 0x00a0, 0x01a0,
0x00a0, 0x10a0, 0x30e2, 0x01a0, 0x10a0, 0x10a0, 0x10a0, 0x01a0,
0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0,
0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2,
0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,
0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,
0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0,
0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2
};
#ifdef USE_UNICODE_PROPERTIES
#include "unicode_property_data.c"
#else
#include "unicode_property_data_posix.c"
#endif
#include "st.h"
#define USER_DEFINED_PROPERTY_MAX_NUM 20
typedef struct {
int ctype;
OnigCodePoint* ranges;
} UserDefinedPropertyValue;
static int UserDefinedPropertyNum;
static UserDefinedPropertyValue
UserDefinedPropertyRanges[USER_DEFINED_PROPERTY_MAX_NUM];
static st_table* UserDefinedPropertyTable;
extern int
onig_unicode_define_user_property(const char* name, OnigCodePoint* ranges)
{
UserDefinedPropertyValue* e;
int i;
int n;
int len;
int c;
char* s;
if (UserDefinedPropertyNum >= USER_DEFINED_PROPERTY_MAX_NUM)
return ONIGERR_TOO_MANY_USER_DEFINED_OBJECTS;
len = strlen(name);
if (len >= PROPERTY_NAME_MAX_SIZE)
return ONIGERR_TOO_LONG_PROPERTY_NAME;
s = (char* )xmalloc(len + 1);
if (s == 0)
return ONIGERR_MEMORY;
n = 0;
for (i = 0; i < len; i++) {
c = name[i];
if (c <= 0 || c >= 0x80) {
xfree(s);
return ONIGERR_INVALID_CHAR_PROPERTY_NAME;
}
if (c != ' ' && c != '-' && c != '_') {
s[n] = c;
n++;
}
}
s[n] = '\0';
if (UserDefinedPropertyTable == 0) {
UserDefinedPropertyTable = onig_st_init_strend_table_with_size(10);
}
e = UserDefinedPropertyRanges + UserDefinedPropertyNum;
e->ctype = CODE_RANGES_NUM + UserDefinedPropertyNum;
e->ranges = ranges;
onig_st_insert_strend(UserDefinedPropertyTable,
(const UChar* )s, (const UChar* )s + n,
(hash_data_type )((void* )e));
UserDefinedPropertyNum++;
return 0;
}
extern int
onigenc_unicode_is_code_ctype(OnigCodePoint code, unsigned int ctype)
{
if (
#ifdef USE_UNICODE_PROPERTIES
ctype <= ONIGENC_MAX_STD_CTYPE &&
#endif
code < 256) {
return ONIGENC_IS_UNICODE_ISO_8859_1_CTYPE(code, ctype);
}
if (ctype >= CODE_RANGES_NUM) {
int index = ctype - CODE_RANGES_NUM;
if (index < UserDefinedPropertyNum)
return onig_is_in_code_range((UChar* )UserDefinedPropertyRanges[index].ranges, code);
else
return ONIGERR_TYPE_BUG;
}
return onig_is_in_code_range((UChar* )CodeRanges[ctype], code);
}
extern int
onigenc_unicode_ctype_code_range(int ctype, const OnigCodePoint* ranges[])
{
if (ctype >= CODE_RANGES_NUM) {
int index = ctype - CODE_RANGES_NUM;
if (index < UserDefinedPropertyNum) {
*ranges = UserDefinedPropertyRanges[index].ranges;
return 0;
}
else
return ONIGERR_TYPE_BUG;
}
*ranges = CodeRanges[ctype];
return 0;
}
extern int
onigenc_utf16_32_get_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out,
const OnigCodePoint* ranges[])
{
*sb_out = 0x00;
return onigenc_unicode_ctype_code_range(ctype, ranges);
}
extern int
onigenc_unicode_property_name_to_ctype(OnigEncoding enc, UChar* name, UChar* end)
{
int len;
UChar *p;
OnigCodePoint code;
const struct PropertyNameCtype* pc;
char buf[PROPERTY_NAME_MAX_SIZE];
p = name;
len = 0;
while (p < end) {
code = ONIGENC_MBC_TO_CODE(enc, p, end);
if (code >= 0x80)
return ONIGERR_INVALID_CHAR_PROPERTY_NAME;
if (code != ' ' && code != '-' && code != '_') {
buf[len++] = (char )code;
if (len >= PROPERTY_NAME_MAX_SIZE)
return ONIGERR_INVALID_CHAR_PROPERTY_NAME;
}
p += enclen(enc, p);
}
buf[len] = 0;
if (UserDefinedPropertyTable != 0) {
UserDefinedPropertyValue* e;
e = (UserDefinedPropertyValue* )NULL;
onig_st_lookup_strend(UserDefinedPropertyTable,
(const UChar* )buf, (const UChar* )buf + len,
(hash_data_type* )((void* )(&e)));
if (e != 0) {
return e->ctype;
}
}
pc = unicode_lookup_property_name(buf, len);
if (pc != 0) {
/* fprintf(stderr, "LOOKUP: %s: %d\n", buf, pc->ctype); */
#ifndef USE_UNICODE_PROPERTIES
if (pc->ctype > ONIGENC_MAX_STD_CTYPE)
return ONIGERR_INVALID_CHAR_PROPERTY_NAME;
#endif
return pc->ctype;
}
return ONIGERR_INVALID_CHAR_PROPERTY_NAME;
}
/* for use macros in unicode_fold_data.c */
#include "unicode_fold_data.c"
extern int
onigenc_unicode_mbc_case_fold(OnigEncoding enc,
OnigCaseFoldType flag ARG_UNUSED, const UChar** pp, const UChar* end,
UChar* fold)
{
const struct ByUnfoldKey* buk;
OnigCodePoint code;
int i, len, rlen;
const UChar *p = *pp;
code = ONIGENC_MBC_TO_CODE(enc, p, end);
len = enclen(enc, p);
*pp += len;
#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {
if (code == 0x0130) {
return ONIGENC_CODE_TO_MBC(enc, 0x0069, fold);
}
#if 0
if (code == 0x0049) {
return ONIGENC_CODE_TO_MBC(enc, 0x0131, fold);
}
#endif
}
#endif
buk = unicode_unfold_key(code);
if (buk != 0) {
if (buk->fold_len == 1) {
return ONIGENC_CODE_TO_MBC(enc, *FOLDS1_FOLD(buk->index), fold);
}
else {
OnigCodePoint* addr;
FOLDS_FOLD_ADDR_BUK(buk, addr);
rlen = 0;
for (i = 0; i < buk->fold_len; i++) {
OnigCodePoint c = addr[i];
len = ONIGENC_CODE_TO_MBC(enc, c, fold);
fold += len;
rlen += len;
}
return rlen;
}
}
for (i = 0; i < len; i++) {
*fold++ = *p++;
}
return len;
}
static int
apply_case_fold1(int from, int to, OnigApplyAllCaseFoldFunc f, void* arg)
{
int i, j, k, n, r;
for (i = from; i < to; ) {
OnigCodePoint fold = *FOLDS1_FOLD(i);
n = FOLDS1_UNFOLDS_NUM(i);
for (j = 0; j < n; j++) {
OnigCodePoint unfold = FOLDS1_UNFOLDS(i)[j];
r = (*f)(fold, &unfold, 1, arg);
if (r != 0) return r;
r = (*f)(unfold, &fold, 1, arg);
if (r != 0) return r;
for (k = 0; k < j; k++) {
OnigCodePoint unfold2 = FOLDS1_UNFOLDS(i)[k];
r = (*f)(unfold, &unfold2, 1, arg);
if (r != 0) return r;
r = (*f)(unfold2, &unfold, 1, arg);
if (r != 0) return r;
}
}
i = FOLDS1_NEXT_INDEX(i);
}
return 0;
}
static int
apply_case_fold2(int from, int to, OnigApplyAllCaseFoldFunc f, void* arg)
{
int i, j, k, n, r;
for (i = from; i < to; ) {
OnigCodePoint* fold = FOLDS2_FOLD(i);
n = FOLDS2_UNFOLDS_NUM(i);
for (j = 0; j < n; j++) {
OnigCodePoint unfold = FOLDS2_UNFOLDS(i)[j];
r = (*f)(unfold, fold, 2, arg);
if (r != 0) return r;
for (k = 0; k < j; k++) {
OnigCodePoint unfold2 = FOLDS2_UNFOLDS(i)[k];
r = (*f)(unfold, &unfold2, 1, arg);
if (r != 0) return r;
r = (*f)(unfold2, &unfold, 1, arg);
if (r != 0) return r;
}
}
i = FOLDS2_NEXT_INDEX(i);
}
return 0;
}
static int
apply_case_fold3(int from, int to, OnigApplyAllCaseFoldFunc f, void* arg)
{
int i, j, k, n, r;
for (i = from; i < to; ) {
OnigCodePoint* fold = FOLDS3_FOLD(i);
n = FOLDS3_UNFOLDS_NUM(i);
for (j = 0; j < n; j++) {
OnigCodePoint unfold = FOLDS3_UNFOLDS(i)[j];
r = (*f)(unfold, fold, 3, arg);
if (r != 0) return r;
for (k = 0; k < j; k++) {
OnigCodePoint unfold2 = FOLDS3_UNFOLDS(i)[k];
r = (*f)(unfold, &unfold2, 1, arg);
if (r != 0) return r;
r = (*f)(unfold2, &unfold, 1, arg);
if (r != 0) return r;
}
}
i = FOLDS3_NEXT_INDEX(i);
}
return 0;
}
extern int
onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag,
OnigApplyAllCaseFoldFunc f, void* arg)
{
int r;
r = apply_case_fold1(0, FOLDS1_NORMAL_END_INDEX, f, arg);
if (r != 0) return r;
#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {
code = 0x0131;
r = (*f)(0x0049, &code, 1, arg);
if (r != 0) return r;
code = 0x0049;
r = (*f)(0x0131, &code, 1, arg);
if (r != 0) return r;
code = 0x0130;
r = (*f)(0x0069, &code, 1, arg);
if (r != 0) return r;
code = 0x0069;
r = (*f)(0x0130, &code, 1, arg);
if (r != 0) return r;
}
else {
#endif
r = apply_case_fold1(FOLDS1_NORMAL_END_INDEX, FOLDS1_END_INDEX, f, arg);
if (r != 0) return r;
#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
}
#endif
if ((flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) == 0)
return 0;
r = apply_case_fold2(0, FOLDS2_NORMAL_END_INDEX, f, arg);
if (r != 0) return r;
#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) == 0) {
#endif
r = apply_case_fold2(FOLDS2_NORMAL_END_INDEX, FOLDS2_END_INDEX, f, arg);
if (r != 0) return r;
#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
}
#endif
r = apply_case_fold3(0, FOLDS3_NORMAL_END_INDEX, f, arg);
if (r != 0) return r;
return 0;
}
extern int
onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end,
OnigCaseFoldCodeItem items[])
{
int n, m, i, j, k, len;
OnigCodePoint code, codes[3];
const struct ByUnfoldKey* buk;
n = 0;
code = ONIGENC_MBC_TO_CODE(enc, p, end);
len = enclen(enc, p);
#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {
if (code == 0x0049) {
items[0].byte_len = len;
items[0].code_len = 1;
items[0].code[0] = 0x0131;
return 1;
}
else if (code == 0x0130) {
items[0].byte_len = len;
items[0].code_len = 1;
items[0].code[0] = 0x0069;
return 1;
}
else if (code == 0x0131) {
items[0].byte_len = len;
items[0].code_len = 1;
items[0].code[0] = 0x0049;
return 1;
}
else if (code == 0x0069) {
items[0].byte_len = len;
items[0].code_len = 1;
items[0].code[0] = 0x0130;
return 1;
}
}
#endif
buk = unicode_unfold_key(code);
if (buk != 0) {
if (buk->fold_len == 1) {
int un;
items[0].byte_len = len;
items[0].code_len = 1;
items[0].code[0] = *FOLDS1_FOLD(buk->index);
n++;
un = FOLDS1_UNFOLDS_NUM(buk->index);
for (i = 0; i < un; i++) {
OnigCodePoint unfold = FOLDS1_UNFOLDS(buk->index)[i];
if (unfold != code) {
items[n].byte_len = len;
items[n].code_len = 1;
items[n].code[0] = unfold;
n++;
}
}
code = items[0].code[0]; // for multi-code to unfold search.
}
else if ((flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
OnigCodePoint cs[3][4];
int fn, ncs[3];
if (buk->fold_len == 2) {
m = FOLDS2_UNFOLDS_NUM(buk->index);
for (i = 0; i < m; i++) {
OnigCodePoint unfold = FOLDS2_UNFOLDS(buk->index)[i];
if (unfold == code) continue;
items[n].byte_len = len;
items[n].code_len = 1;
items[n].code[0] = unfold;
n++;
}
for (fn = 0; fn < 2; fn++) {
int index;
cs[fn][0] = FOLDS2_FOLD(buk->index)[fn];
index = unicode_fold1_key(&cs[fn][0]);
if (index >= 0) {
int m = FOLDS1_UNFOLDS_NUM(index);
for (i = 0; i < m; i++) {
cs[fn][i+1] = FOLDS1_UNFOLDS(index)[i];
}
ncs[fn] = m + 1;
}
else
ncs[fn] = 1;
}
for (i = 0; i < ncs[0]; i++) {
for (j = 0; j < ncs[1]; j++) {
items[n].byte_len = len;
items[n].code_len = 2;
items[n].code[0] = cs[0][i];
items[n].code[1] = cs[1][j];
n++;
}
}
}
else { /* fold_len == 3 */
m = FOLDS3_UNFOLDS_NUM(buk->index);
for (i = 0; i < m; i++) {
OnigCodePoint unfold = FOLDS3_UNFOLDS(buk->index)[i];
if (unfold == code) continue;
items[n].byte_len = len;
items[n].code_len = 1;
items[n].code[0] = unfold;
n++;
}
for (fn = 0; fn < 3; fn++) {
int index;
cs[fn][0] = FOLDS3_FOLD(buk->index)[fn];
index = unicode_fold1_key(&cs[fn][0]);
if (index >= 0) {
int m = FOLDS1_UNFOLDS_NUM(index);
for (i = 0; i < m; i++) {
cs[fn][i+1] = FOLDS1_UNFOLDS(index)[i];
}
ncs[fn] = m + 1;
}
else
ncs[fn] = 1;
}
for (i = 0; i < ncs[0]; i++) {
for (j = 0; j < ncs[1]; j++) {
for (k = 0; k < ncs[2]; k++) {
items[n].byte_len = len;
items[n].code_len = 3;
items[n].code[0] = cs[0][i];
items[n].code[1] = cs[1][j];
items[n].code[2] = cs[2][k];
n++;
}
}
}
}
/* multi char folded code is not head of another folded multi char */
return n;
}
}
else {
int index = unicode_fold1_key(&code);
if (index >= 0) {
int m = FOLDS1_UNFOLDS_NUM(index);
for (i = 0; i < m; i++) {
items[n].byte_len = len;
items[n].code_len = 1;
items[n].code[0] = FOLDS1_UNFOLDS(index)[i];
n++;
}
}
}
if ((flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) == 0)
return n;
p += len;
if (p < end) {
int clen;
int index;
codes[0] = code;
code = ONIGENC_MBC_TO_CODE(enc, p, end);
buk = unicode_unfold_key(code);
if (buk != 0 && buk->fold_len == 1) {
codes[1] = *FOLDS1_FOLD(buk->index);
}
else
codes[1] = code;
clen = enclen(enc, p);
len += clen;
index = unicode_fold2_key(codes);
if (index >= 0) {
m = FOLDS2_UNFOLDS_NUM(index);
for (i = 0; i < m; i++) {
items[n].byte_len = len;
items[n].code_len = 1;
items[n].code[0] = FOLDS2_UNFOLDS(index)[i];
n++;
}
}
p += clen;
if (p < end) {
code = ONIGENC_MBC_TO_CODE(enc, p, end);
buk = unicode_unfold_key(code);
if (buk != 0 && buk->fold_len == 1) {
codes[2] = *FOLDS1_FOLD(buk->index);
}
else
codes[2] = code;
clen = enclen(enc, p);
len += clen;
index = unicode_fold3_key(codes);
if (index >= 0) {
m = FOLDS3_UNFOLDS_NUM(index);
for (i = 0; i < m; i++) {
items[n].byte_len = len;
items[n].code_len = 1;
items[n].code[0] = FOLDS3_UNFOLDS(index)[i];
n++;
}
}
}
}
return n;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,203 @@
/* This file was converted by gperf_fold_key_conv.py
from gperf output file. */
/* ANSI-C code produced by gperf version 3.0.3 */
/* Command-line: /Library/Developer/CommandLineTools/usr/bin/gperf -n -C -T -c -t -j1 -L ANSI-C -F,-1 -N unicode_fold2_key unicode_fold2_key.gperf */
/* Computed positions: -k'3,6' */
/* This gperf source file was generated by make_unicode_fold_data.py */
#include <string.h>
#include "regenc.h"
#define TOTAL_KEYWORDS 59
#define MIN_WORD_LENGTH 6
#define MAX_WORD_LENGTH 6
#define MIN_HASH_VALUE 0
#define MAX_HASH_VALUE 58
/* maximum key range = 59, duplicates = 0 */
#ifdef __GNUC__
__inline
#else
#ifdef __cplusplus
inline
#endif
#endif
/*ARGSUSED*/
static unsigned int
hash(OnigCodePoint codes[])
{
static const unsigned char asso_values[] =
{
58, 57, 56, 55, 54, 53, 52, 16, 50, 59,
15, 59, 25, 59, 59, 59, 59, 59, 59, 3,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 49, 48, 47, 46, 45, 44, 43, 42,
59, 59, 59, 59, 59, 59, 59, 59, 59, 21,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 2, 59, 59, 59,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 40, 20, 39, 38,
37, 14, 5, 36, 20, 7, 25, 34, 29, 32,
16, 59, 31, 59, 59, 2, 1, 59, 25, 15,
59, 14, 59, 59, 28, 59, 2, 59, 59, 59,
11, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 24, 59, 22, 59, 59, 11, 59, 59,
59, 59, 59, 7, 59, 0, 59, 59, 16, 59,
1, 59, 59, 16, 59, 59, 59, 15, 59, 59,
59, 6, 59, 59, 59, 59, 0, 59, 59, 59,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59
};
return asso_values[(unsigned char)onig_codes_byte_at(codes, 5)] + asso_values[(unsigned char)onig_codes_byte_at(codes, 2)];
}
int
unicode_fold2_key(OnigCodePoint codes[])
{
static const int wordlist[] =
{
101,
253,
76,
29,
24,
239,
96,
71,
92,
67,
4,
62,
8,
58,
234,
109,
164,
88,
84,
80,
214,
0,
54,
261,
50,
105,
121,
125,
257,
42,
38,
249,
46,
117,
12,
113,
244,
229,
224,
219,
209,
16,
204,
199,
194,
189,
184,
179,
174,
169,
20,
34,
159,
154,
149,
144,
139,
134,
129
};
if (0 == 0)
{
int key = hash(codes);
if (key <= MAX_HASH_VALUE)
{
int index = wordlist[key];
if (index >= 0 && onig_codes_cmp(codes, OnigUnicodeFolds2 + index, 2) == 0)
return index;
}
}
return -1;
}

View File

@@ -0,0 +1,113 @@
/* This file was converted by gperf_fold_key_conv.py
from gperf output file. */
/* ANSI-C code produced by gperf version 3.0.3 */
/* Command-line: /Library/Developer/CommandLineTools/usr/bin/gperf -n -C -T -c -t -j1 -L ANSI-C -F,-1 -N unicode_fold3_key unicode_fold3_key.gperf */
/* Computed positions: -k'3,6,9' */
/* This gperf source file was generated by make_unicode_fold_data.py */
#include <string.h>
#include "regenc.h"
#define TOTAL_KEYWORDS 14
#define MIN_WORD_LENGTH 9
#define MAX_WORD_LENGTH 9
#define MIN_HASH_VALUE 0
#define MAX_HASH_VALUE 13
/* maximum key range = 14, duplicates = 0 */
#ifdef __GNUC__
__inline
#else
#ifdef __cplusplus
inline
#endif
#endif
/*ARGSUSED*/
static unsigned int
hash(OnigCodePoint codes[])
{
static const unsigned char asso_values[] =
{
6, 3, 14, 14, 14, 14, 14, 14, 1, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 0,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 0, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 4, 14, 14, 5, 14, 14, 4, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 10, 14, 14,
14, 14, 14, 9, 14, 1, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 0, 14, 14,
14, 8, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14
};
return asso_values[(unsigned char)onig_codes_byte_at(codes, 8)] + asso_values[(unsigned char)onig_codes_byte_at(codes, 5)] + asso_values[(unsigned char)onig_codes_byte_at(codes, 2)];
}
int
unicode_fold3_key(OnigCodePoint codes[])
{
static const int wordlist[] =
{
62,
47,
31,
57,
41,
25,
52,
36,
20,
67,
15,
10,
5,
0
};
if (0 == 0)
{
int key = hash(codes);
if (key <= MAX_HASH_VALUE)
{
int index = wordlist[key];
if (index >= 0 && onig_codes_cmp(codes, OnigUnicodeFolds3 + index, 3) == 0)
return index;
}
}
return -1;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
utf16_be.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -54,6 +54,12 @@ utf16be_mbc_enc_len(const UChar* p)
return EncLen_UTF16[*p];
}
static int
is_valid_mbc_string(const UChar* s, const UChar* end)
{
return onigenc_length_check_is_valid_mbc_string(ONIG_ENCODING_UTF16_BE, s, end);
}
static int
utf16be_is_mbc_newline(const UChar* p, const UChar* end)
{
@@ -63,10 +69,11 @@ utf16be_is_mbc_newline(const UChar* p, const UChar* end)
#ifdef USE_UNICODE_ALL_LINE_TERMINATORS
if ((
#ifndef USE_CRNL_AS_LINE_TERMINATOR
*(p+1) == 0x0d ||
*(p+1) == 0x0d ||
#endif
*(p+1) == 0x85) && *p == 0x00)
*(p+1) == 0x85) && *p == 0x00)
return 1;
if (*p == 0x20 && (*(p+1) == 0x29 || *(p+1) == 0x28))
return 1;
#endif
@@ -130,10 +137,10 @@ utf16be_mbc_case_fold(OnigCaseFoldType flag,
#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {
if (*p == 0x49) {
*fold++ = 0x01;
*fold = 0x31;
(*pp) += 2;
return 2;
*fold++ = 0x01;
*fold = 0x31;
(*pp) += 2;
return 2;
}
}
#endif
@@ -171,9 +178,9 @@ utf16be_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* e
if ((v | BIT_CTYPE_LOWER) != 0) {
/* 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */
if (c >= 0xaa && c <= 0xba)
return FALSE;
return FALSE;
else
return TRUE;
return TRUE;
}
return (v != 0 ? TRUE : FALSE);
}
@@ -221,5 +228,8 @@ OnigEncodingType OnigEncodingUTF16_BE = {
onigenc_unicode_is_code_ctype,
onigenc_utf16_32_get_ctype_code_range,
utf16be_left_adjust_char_head,
onigenc_always_false_is_allowed_reverse_match
onigenc_always_false_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
utf16_le.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -60,6 +60,21 @@ utf16le_mbc_enc_len(const UChar* p)
return EncLen_UTF16[*(p+1)];
}
static int
is_valid_mbc_string(const UChar* p, const UChar* end)
{
const UChar* end1 = end - 1;
while (p < end1) {
p += utf16le_mbc_enc_len(p);
}
if (p != end)
return FALSE;
else
return TRUE;
}
static int
utf16le_is_mbc_newline(const UChar* p, const UChar* end)
{
@@ -69,10 +84,11 @@ utf16le_is_mbc_newline(const UChar* p, const UChar* end)
#ifdef USE_UNICODE_ALL_LINE_TERMINATORS
if ((
#ifndef USE_CRNL_AS_LINE_TERMINATOR
*p == 0x0d ||
*p == 0x0d ||
#endif
*p == 0x85) && *(p+1) == 0x00)
*p == 0x85) && *(p+1) == 0x00)
return 1;
if (*(p+1) == 0x20 && (*p == 0x29 || *p == 0x28))
return 1;
#endif
@@ -132,10 +148,10 @@ utf16le_mbc_case_fold(OnigCaseFoldType flag,
#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {
if (*p == 0x49) {
*fold++ = 0x31;
*fold = 0x01;
(*pp) += 2;
return 2;
*fold++ = 0x31;
*fold = 0x01;
(*pp) += 2;
return 2;
}
}
#endif
@@ -172,9 +188,9 @@ utf16le_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp,
if ((v | BIT_CTYPE_LOWER) != 0) {
/* 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */
if (c >= 0xaa && c <= 0xba)
return FALSE;
return FALSE;
else
return TRUE;
return TRUE;
}
return (v != 0 ? TRUE : FALSE);
}
@@ -222,5 +238,8 @@ OnigEncodingType OnigEncodingUTF16_LE = {
onigenc_unicode_is_code_ctype,
onigenc_utf16_32_get_ctype_code_range,
utf16le_left_adjust_char_head,
onigenc_always_false_is_allowed_reverse_match
onigenc_always_false_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
utf32_be.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -35,6 +35,12 @@ utf32be_mbc_enc_len(const UChar* p ARG_UNUSED)
return 4;
}
static int
is_valid_mbc_string(const UChar* s, const UChar* end)
{
return onigenc_length_check_is_valid_mbc_string(ONIG_ENCODING_UTF32_BE, s, end);
}
static int
utf32be_is_mbc_newline(const UChar* p, const UChar* end)
{
@@ -44,13 +50,14 @@ utf32be_is_mbc_newline(const UChar* p, const UChar* end)
#ifdef USE_UNICODE_ALL_LINE_TERMINATORS
if ((
#ifndef USE_CRNL_AS_LINE_TERMINATOR
*(p+3) == 0x0d ||
*(p+3) == 0x0d ||
#endif
*(p+3) == 0x85)
&& *(p+2) == 0 && *(p+1) == 0 && *p == 0x00)
*(p+3) == 0x85)
&& *(p+2) == 0 && *(p+1) == 0 && *p == 0x00)
return 1;
if (*(p+2) == 0x20 && (*(p+3) == 0x29 || *(p+3) == 0x28)
&& *(p+1) == 0 && *p == 0)
&& *(p+1) == 0 && *p == 0)
return 1;
#endif
}
@@ -94,10 +101,10 @@ utf32be_mbc_case_fold(OnigCaseFoldType flag,
#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {
if (*(p+3) == 0x49) {
*fold++ = 0x01;
*fold = 0x31;
(*pp) += 4;
return 4;
*fold++ = 0x01;
*fold = 0x31;
(*pp) += 4;
return 4;
}
}
#endif
@@ -134,9 +141,9 @@ utf32be_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* e
if ((v | BIT_CTYPE_LOWER) != 0) {
/* 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */
if (c >= 0xaa && c <= 0xba)
return FALSE;
return FALSE;
else
return TRUE;
return TRUE;
}
return (v != 0 ? TRUE : FALSE);
}
@@ -180,5 +187,8 @@ OnigEncodingType OnigEncodingUTF32_BE = {
onigenc_unicode_is_code_ctype,
onigenc_utf16_32_get_ctype_code_range,
utf32be_left_adjust_char_head,
onigenc_always_false_is_allowed_reverse_match
onigenc_always_false_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
utf32_le.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -35,6 +35,12 @@ utf32le_mbc_enc_len(const UChar* p ARG_UNUSED)
return 4;
}
static int
is_valid_mbc_string(const UChar* s, const UChar* end)
{
return onigenc_length_check_is_valid_mbc_string(ONIG_ENCODING_UTF32_LE, s, end);
}
static int
utf32le_is_mbc_newline(const UChar* p, const UChar* end)
{
@@ -44,13 +50,14 @@ utf32le_is_mbc_newline(const UChar* p, const UChar* end)
#ifdef USE_UNICODE_ALL_LINE_TERMINATORS
if ((
#ifndef USE_CRNL_AS_LINE_TERMINATOR
*p == 0x0d ||
*p == 0x0d ||
#endif
*p == 0x85)
&& *(p+1) == 0x00 && (p+2) == 0x00 && *(p+3) == 0x00)
*p == 0x85)
&& *(p+1) == 0x00 && (p+2) == 0x00 && *(p+3) == 0x00)
return 1;
if (*(p+1) == 0x20 && (*p == 0x29 || *p == 0x28)
&& *(p+2) == 0x00 && *(p+3) == 0x00)
&& *(p+2) == 0x00 && *(p+3) == 0x00)
return 1;
#endif
}
@@ -91,8 +98,8 @@ utf32le_mbc_case_fold(OnigCaseFoldType flag,
#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {
if (*p == 0x49) {
*fold++ = 0x31;
*fold++ = 0x01;
*fold++ = 0x31;
*fold++ = 0x01;
}
}
else {
@@ -110,7 +117,7 @@ utf32le_mbc_case_fold(OnigCaseFoldType flag,
}
else
return onigenc_unicode_mbc_case_fold(ONIG_ENCODING_UTF32_LE, flag, pp, end,
fold);
fold);
}
#if 0
@@ -134,9 +141,9 @@ utf32le_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* e
if ((v | BIT_CTYPE_LOWER) != 0) {
/* 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */
if (c >= 0xaa && c <= 0xba)
return FALSE;
return FALSE;
else
return TRUE;
return TRUE;
}
return (v != 0 ? TRUE : FALSE);
}
@@ -180,5 +187,8 @@ OnigEncodingType OnigEncodingUTF32_LE = {
onigenc_unicode_is_code_ctype,
onigenc_utf16_32_get_ctype_code_range,
utf32le_left_adjust_char_head,
onigenc_always_false_is_allowed_reverse_match
onigenc_always_false_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
is_valid_mbc_string
};

View File

@@ -2,7 +2,7 @@
utf8.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,7 +29,7 @@
#include "regenc.h"
#define USE_INVALID_CODE_SCHEME
//#define USE_INVALID_CODE_SCHEME
#ifdef USE_INVALID_CODE_SCHEME
/* virtual codepoint values for invalid encoding byte 0xfe and 0xff */
@@ -39,6 +39,7 @@
#endif
#define utf8_islead(c) ((UChar )((c) & 0xc0) != 0x80)
#define utf8_istail(c) ((UChar )((c) & 0xc0) == 0x80)
static const int EncLen_UTF8[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -65,6 +66,30 @@ mbc_enc_len(const UChar* p)
return EncLen_UTF8[*p];
}
static int
is_valid_mbc_string(const UChar* p, const UChar* end)
{
int i, len;
while (p < end) {
if (! utf8_islead(*p))
return FALSE;
len = mbc_enc_len(p++);
if (len > 1) {
for (i = 1; i < len; i++) {
if (p == end)
return FALSE;
if (! utf8_istail(*p++))
return FALSE;
}
}
}
return TRUE;
}
static int
is_mbc_newline(const UChar* p, const UChar* end)
{
@@ -77,11 +102,11 @@ is_mbc_newline(const UChar* p, const UChar* end)
#endif
if (p + 1 < end) {
if (*(p+1) == 0x85 && *p == 0xc2) /* U+0085 */
return 1;
return 1;
if (p + 2 < end) {
if ((*(p+2) == 0xa8 || *(p+2) == 0xa9)
&& *(p+1) == 0x80 && *p == 0xe2) /* U+2028, U+2029 */
return 1;
if ((*(p+2) == 0xa8 || *(p+2) == 0xa9)
&& *(p+1) == 0x80 && *p == 0xe2) /* U+2028, U+2029 */
return 1;
}
}
#endif
@@ -203,10 +228,10 @@ mbc_case_fold(OnigCaseFoldType flag, const UChar** pp,
#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {
if (*p == 0x49) {
*fold++ = 0xc4;
*fold = 0xb1;
(*pp)++;
return 2;
*fold++ = 0xc4;
*fold = 0xb1;
(*pp)++;
return 2;
}
}
#endif
@@ -237,17 +262,17 @@ is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
if (*p == 0xc3) {
int c = *(p + 1);
if (c >= 0x80) {
if (c <= (UChar )0x9e) { /* upper */
if (c == (UChar )0x97) return FALSE;
return TRUE;
}
else if (c >= (UChar )0xa0 && c <= (UChar )0xbe) { /* lower */
if (c == (UChar )'\267') return FALSE;
return TRUE;
}
if (c <= (UChar )0x9e) { /* upper */
if (c == (UChar )0x97) return FALSE;
return TRUE;
}
else if (c >= (UChar )0xa0 && c <= (UChar )0xbe) { /* lower */
if (c == (UChar )'\267') return FALSE;
return TRUE;
}
else if (c == (UChar )0x9f &&
(flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
return TRUE;
return TRUE;
}
}
}
@@ -303,5 +328,8 @@ OnigEncodingType OnigEncodingUTF8 = {
onigenc_unicode_is_code_ctype,
get_ctype_code_range,
left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match
onigenc_always_true_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
is_valid_mbc_string
};

View File

View File

@@ -1,863 +0,0 @@
/*
* This program was generated by testconv.rb.
*/
#include "config.h"
#ifdef ONIG_ESCAPE_UCHAR_COLLISION
#undef ONIG_ESCAPE_UCHAR_COLLISION
#endif
#include <stdio.h>
#ifdef POSIX_TEST
#include "onigposix.h"
#else
#include "oniguruma.h"
#endif
#ifdef HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
#endif
#define SLEN(s) strlen(s)
static int nsucc = 0;
static int nfail = 0;
static int nerror = 0;
static FILE* err_file;
#ifndef POSIX_TEST
static OnigRegion* region;
#endif
static void xx(char* pattern, char* str, int from, int to, int mem, int not)
{
int r;
#ifdef POSIX_TEST
regex_t reg;
char buf[200];
regmatch_t pmatch[25];
r = regcomp(&reg, pattern, REG_EXTENDED | REG_NEWLINE);
if (r) {
regerror(r, &reg, buf, sizeof(buf));
fprintf(err_file, "ERROR: %s\n", buf);
nerror++;
return ;
}
r = regexec(&reg, str, reg.re_nsub + 1, pmatch, 0);
if (r != 0 && r != REG_NOMATCH) {
regerror(r, &reg, buf, sizeof(buf));
fprintf(err_file, "ERROR: %s\n", buf);
nerror++;
return ;
}
if (r == REG_NOMATCH) {
if (not) {
fprintf(stdout, "OK(N): /%s/ '%s'\n", pattern, str);
nsucc++;
}
else {
fprintf(stdout, "FAIL: /%s/ '%s'\n", pattern, str);
nfail++;
}
}
else {
if (not) {
fprintf(stdout, "FAIL(N): /%s/ '%s'\n", pattern, str);
nfail++;
}
else {
if (pmatch[mem].rm_so == from && pmatch[mem].rm_eo == to) {
fprintf(stdout, "OK: /%s/ '%s'\n", pattern, str);
nsucc++;
}
else {
fprintf(stdout, "FAIL: /%s/ '%s' %d-%d : %d-%d\n", pattern, str,
from, to, pmatch[mem].rm_so, pmatch[mem].rm_eo);
nfail++;
}
}
}
regfree(&reg);
#else
regex_t* reg;
OnigErrorInfo einfo;
r = onig_new(&reg, (UChar* )pattern, (UChar* )(pattern + SLEN(pattern)),
ONIG_OPTION_DEFAULT, ONIG_ENCODING_EUC_JP, ONIG_SYNTAX_DEFAULT, &einfo);
if (r) {
char s[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str((UChar* )s, r, &einfo);
fprintf(err_file, "ERROR: %s\n", s);
nerror++;
return ;
}
r = onig_search(reg, (UChar* )str, (UChar* )(str + SLEN(str)),
(UChar* )str, (UChar* )(str + SLEN(str)),
region, ONIG_OPTION_NONE);
if (r < ONIG_MISMATCH) {
char s[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str((UChar* )s, r);
fprintf(err_file, "ERROR: %s\n", s);
nerror++;
return ;
}
if (r == ONIG_MISMATCH) {
if (not) {
fprintf(stdout, "OK(N): /%s/ '%s'\n", pattern, str);
nsucc++;
}
else {
fprintf(stdout, "FAIL: /%s/ '%s'\n", pattern, str);
nfail++;
}
}
else {
if (not) {
fprintf(stdout, "FAIL(N): /%s/ '%s'\n", pattern, str);
nfail++;
}
else {
if (region->beg[mem] == from && region->end[mem] == to) {
fprintf(stdout, "OK: /%s/ '%s'\n", pattern, str);
nsucc++;
}
else {
fprintf(stdout, "FAIL: /%s/ '%s' %d-%d : %d-%d\n", pattern, str,
from, to, region->beg[mem], region->end[mem]);
nfail++;
}
}
}
onig_free(reg);
#endif
}
static void x2(char* pattern, char* str, int from, int to)
{
xx(pattern, str, from, to, 0, 0);
}
static void x3(char* pattern, char* str, int from, int to, int mem)
{
xx(pattern, str, from, to, mem, 0);
}
static void n(char* pattern, char* str)
{
xx(pattern, str, 0, 0, 0, 1);
}
extern int main(int argc, char* argv[])
{
err_file = stdout;
#ifdef POSIX_TEST
reg_set_encoding(REG_POSIX_ENCODING_EUC_JP);
#else
region = onig_region_new();
#endif
x2("", "", 0, 0);
x2("^", "", 0, 0);
x2("$", "", 0, 0);
x2("\\G", "", 0, 0);
x2("\\A", "", 0, 0);
x2("\\Z", "", 0, 0);
x2("\\z", "", 0, 0);
x2("^$", "", 0, 0);
x2("\\ca", "\001", 0, 1);
x2("\\C-b", "\002", 0, 1);
x2("\\c\\\\", "\034", 0, 1);
x2("q[\\c\\\\]", "q\034", 0, 2);
x2("", "a", 0, 0);
x2("a", "a", 0, 1);
x2("\\x61", "a", 0, 1);
x2("aa", "aa", 0, 2);
x2("aaa", "aaa", 0, 3);
x2("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 0, 35);
x2("ab", "ab", 0, 2);
x2("b", "ab", 1, 2);
x2("bc", "abc", 1, 3);
x2("(?i:#RET#)", "#INS##RET#", 5, 10);
x2("\\17", "\017", 0, 1);
x2("\\x1f", "\x1f", 0, 1);
x2("a(?#....\\\\JJJJ)b", "ab", 0, 2);
x2("(?x) G (o O(?-x)oO) g L", "GoOoOgLe", 0, 7);
x2(".", "a", 0, 1);
n(".", "");
x2("..", "ab", 0, 2);
x2("\\w", "e", 0, 1);
n("\\W", "e");
x2("\\s", " ", 0, 1);
x2("\\S", "b", 0, 1);
x2("\\d", "4", 0, 1);
n("\\D", "4");
x2("\\b", "z ", 0, 0);
x2("\\b", " z", 1, 1);
x2("\\B", "zz ", 1, 1);
x2("\\B", "z ", 2, 2);
x2("\\B", " z", 0, 0);
x2("[ab]", "b", 0, 1);
n("[ab]", "c");
x2("[a-z]", "t", 0, 1);
n("[^a]", "a");
x2("[^a]", "\n", 0, 1);
x2("[]]", "]", 0, 1);
n("[^]]", "]");
x2("[\\^]+", "0^^1", 1, 3);
x2("[b-]", "b", 0, 1);
x2("[b-]", "-", 0, 1);
x2("[\\w]", "z", 0, 1);
n("[\\w]", " ");
x2("[\\W]", "b$", 1, 2);
x2("[\\d]", "5", 0, 1);
n("[\\d]", "e");
x2("[\\D]", "t", 0, 1);
n("[\\D]", "3");
x2("[\\s]", " ", 0, 1);
n("[\\s]", "a");
x2("[\\S]", "b", 0, 1);
n("[\\S]", " ");
x2("[\\w\\d]", "2", 0, 1);
n("[\\w\\d]", " ");
x2("[[:upper:]]", "B", 0, 1);
x2("[*[:xdigit:]+]", "+", 0, 1);
x2("[*[:xdigit:]+]", "GHIKK-9+*", 6, 7);
x2("[*[:xdigit:]+]", "-@^+", 3, 4);
n("[[:upper]]", "A");
x2("[[:upper]]", ":", 0, 1);
x2("[\\044-\\047]", "\046", 0, 1);
x2("[\\x5a-\\x5c]", "\x5b", 0, 1);
x2("[\\x6A-\\x6D]", "\x6c", 0, 1);
n("[\\x6A-\\x6D]", "\x6E");
n("^[0-9A-F]+ 0+ UNDEF ", "75F 00000000 SECT14A notype () External | _rb_apply");
x2("[\\[]", "[", 0, 1);
x2("[\\]]", "]", 0, 1);
x2("[&]", "&", 0, 1);
x2("[[ab]]", "b", 0, 1);
x2("[[ab]c]", "c", 0, 1);
n("[[^a]]", "a");
n("[^[a]]", "a");
x2("[[ab]&&bc]", "b", 0, 1);
n("[[ab]&&bc]", "a");
n("[[ab]&&bc]", "c");
x2("[a-z&&b-y&&c-x]", "w", 0, 1);
n("[^a-z&&b-y&&c-x]", "w");
x2("[[^a&&a]&&a-z]", "b", 0, 1);
n("[[^a&&a]&&a-z]", "a");
x2("[[^a-z&&bcdef]&&[^c-g]]", "h", 0, 1);
n("[[^a-z&&bcdef]&&[^c-g]]", "c");
x2("[^[^abc]&&[^cde]]", "c", 0, 1);
x2("[^[^abc]&&[^cde]]", "e", 0, 1);
n("[^[^abc]&&[^cde]]", "f");
x2("[a-&&-a]", "-", 0, 1);
n("[a\\-&&\\-a]", "&");
n("\\wabc", " abc");
x2("a\\Wbc", "a bc", 0, 4);
x2("a.b.c", "aabbc", 0, 5);
x2(".\\wb\\W..c", "abb bcc", 0, 7);
x2("\\s\\wzzz", " zzzz", 0, 5);
x2("aa.b", "aabb", 0, 4);
n(".a", "ab");
x2(".a", "aa", 0, 2);
x2("^a", "a", 0, 1);
x2("^a$", "a", 0, 1);
x2("^\\w$", "a", 0, 1);
n("^\\w$", " ");
x2("^\\wab$", "zab", 0, 3);
x2("^\\wabcdef$", "zabcdef", 0, 7);
x2("^\\w...def$", "zabcdef", 0, 7);
x2("\\w\\w\\s\\Waaa\\d", "aa aaa4", 0, 8);
x2("\\A\\Z", "", 0, 0);
x2("\\Axyz", "xyz", 0, 3);
x2("xyz\\Z", "xyz", 0, 3);
x2("xyz\\z", "xyz", 0, 3);
x2("a\\Z", "a", 0, 1);
x2("\\Gaz", "az", 0, 2);
n("\\Gz", "bza");
n("az\\G", "az");
n("az\\A", "az");
n("a\\Az", "az");
x2("\\^\\$", "^$", 0, 2);
x2("^x?y", "xy", 0, 2);
x2("^(x?y)", "xy", 0, 2);
x2("\\w", "_", 0, 1);
n("\\W", "_");
x2("(?=z)z", "z", 0, 1);
n("(?=z).", "a");
x2("(?!z)a", "a", 0, 1);
n("(?!z)a", "z");
x2("(?i:a)", "a", 0, 1);
x2("(?i:a)", "A", 0, 1);
x2("(?i:A)", "a", 0, 1);
n("(?i:A)", "b");
x2("(?i:[A-Z])", "a", 0, 1);
x2("(?i:[f-m])", "H", 0, 1);
x2("(?i:[f-m])", "h", 0, 1);
n("(?i:[f-m])", "e");
x2("(?i:[A-c])", "D", 0, 1);
n("(?i:[^a-z])", "A");
n("(?i:[^a-z])", "a");
x2("(?i:[!-k])", "Z", 0, 1);
x2("(?i:[!-k])", "7", 0, 1);
x2("(?i:[T-}])", "b", 0, 1);
x2("(?i:[T-}])", "{", 0, 1);
x2("(?i:\\?a)", "?A", 0, 2);
x2("(?i:\\*A)", "*a", 0, 2);
n(".", "\n");
x2("(?m:.)", "\n", 0, 1);
x2("(?m:a.)", "a\n", 0, 2);
x2("(?m:.b)", "a\nb", 1, 3);
x2(".*abc", "dddabdd\nddabc", 8, 13);
x2("(?m:.*abc)", "dddabddabc", 0, 10);
n("(?i)(?-i)a", "A");
n("(?i)(?-i:a)", "A");
x2("a?", "", 0, 0);
x2("a?", "b", 0, 0);
x2("a?", "a", 0, 1);
x2("a*", "", 0, 0);
x2("a*", "a", 0, 1);
x2("a*", "aaa", 0, 3);
x2("a*", "baaaa", 0, 0);
n("a+", "");
x2("a+", "a", 0, 1);
x2("a+", "aaaa", 0, 4);
x2("a+", "aabbb", 0, 2);
x2("a+", "baaaa", 1, 5);
x2(".?", "", 0, 0);
x2(".?", "f", 0, 1);
x2(".?", "\n", 0, 0);
x2(".*", "", 0, 0);
x2(".*", "abcde", 0, 5);
x2(".+", "z", 0, 1);
x2(".+", "zdswer\n", 0, 6);
x2("(.*)a\\1f", "babfbac", 0, 4);
x2("(.*)a\\1f", "bacbabf", 3, 7);
x2("((.*)a\\2f)", "bacbabf", 3, 7);
x2("(.*)a\\1f", "baczzzzzz\nbazz\nzzzzbabf", 19, 23);
x2("a|b", "a", 0, 1);
x2("a|b", "b", 0, 1);
x2("|a", "a", 0, 0);
x2("(|a)", "a", 0, 0);
x2("ab|bc", "ab", 0, 2);
x2("ab|bc", "bc", 0, 2);
x2("z(?:ab|bc)", "zbc", 0, 3);
x2("a(?:ab|bc)c", "aabc", 0, 4);
x2("ab|(?:ac|az)", "az", 0, 2);
x2("a|b|c", "dc", 1, 2);
x2("a|b|cd|efg|h|ijk|lmn|o|pq|rstuvwx|yz", "pqr", 0, 2);
n("a|b|cd|efg|h|ijk|lmn|o|pq|rstuvwx|yz", "mn");
x2("a|^z", "ba", 1, 2);
x2("a|^z", "za", 0, 1);
x2("a|\\Gz", "bza", 2, 3);
x2("a|\\Gz", "za", 0, 1);
x2("a|\\Az", "bza", 2, 3);
x2("a|\\Az", "za", 0, 1);
x2("a|b\\Z", "ba", 1, 2);
x2("a|b\\Z", "b", 0, 1);
x2("a|b\\z", "ba", 1, 2);
x2("a|b\\z", "b", 0, 1);
x2("\\w|\\s", " ", 0, 1);
n("\\w|\\w", " ");
x2("\\w|%", "%", 0, 1);
x2("\\w|[&$]", "&", 0, 1);
x2("[b-d]|[^e-z]", "a", 0, 1);
x2("(?:a|[c-f])|bz", "dz", 0, 1);
x2("(?:a|[c-f])|bz", "bz", 0, 2);
x2("abc|(?=zz)..f", "zzf", 0, 3);
x2("abc|(?!zz)..f", "abf", 0, 3);
x2("(?=za)..a|(?=zz)..a", "zza", 0, 3);
n("(?>a|abd)c", "abdc");
x2("(?>abd|a)c", "abdc", 0, 4);
x2("a?|b", "a", 0, 1);
x2("a?|b", "b", 0, 0);
x2("a?|b", "", 0, 0);
x2("a*|b", "aa", 0, 2);
x2("a*|b*", "ba", 0, 0);
x2("a*|b*", "ab", 0, 1);
x2("a+|b*", "", 0, 0);
x2("a+|b*", "bbb", 0, 3);
x2("a+|b*", "abbb", 0, 1);
n("a+|b+", "");
x2("(a|b)?", "b", 0, 1);
x2("(a|b)*", "ba", 0, 2);
x2("(a|b)+", "bab", 0, 3);
x2("(ab|ca)+", "caabbc", 0, 4);
x2("(ab|ca)+", "aabca", 1, 5);
x2("(ab|ca)+", "abzca", 0, 2);
x2("(a|bab)+", "ababa", 0, 5);
x2("(a|bab)+", "ba", 1, 2);
x2("(a|bab)+", "baaaba", 1, 4);
x2("(?:a|b)(?:a|b)", "ab", 0, 2);
x2("(?:a*|b*)(?:a*|b*)", "aaabbb", 0, 3);
x2("(?:a*|b*)(?:a+|b+)", "aaabbb", 0, 6);
x2("(?:a+|b+){2}", "aaabbb", 0, 6);
x2("h{0,}", "hhhh", 0, 4);
x2("(?:a+|b+){1,2}", "aaabbb", 0, 6);
n("ax{2}*a", "0axxxa1");
n("a.{0,2}a", "0aXXXa0");
n("a.{0,2}?a", "0aXXXa0");
n("a.{0,2}?a", "0aXXXXa0");
x2("^a{2,}?a$", "aaa", 0, 3);
x2("^[a-z]{2,}?$", "aaa", 0, 3);
x2("(?:a+|\\Ab*)cc", "cc", 0, 2);
n("(?:a+|\\Ab*)cc", "abcc");
x2("(?:^a+|b+)*c", "aabbbabc", 6, 8);
x2("(?:^a+|b+)*c", "aabbbbc", 0, 7);
x2("a|(?i)c", "C", 0, 1);
x2("(?i)c|a", "C", 0, 1);
x2("(?i)c|a", "A", 0, 1);
x2("(?i:c)|a", "C", 0, 1);
n("(?i:c)|a", "A");
x2("[abc]?", "abc", 0, 1);
x2("[abc]*", "abc", 0, 3);
x2("[^abc]*", "abc", 0, 0);
n("[^abc]+", "abc");
x2("a?\?", "aaa", 0, 0);
x2("ba?\?b", "bab", 0, 3);
x2("a*?", "aaa", 0, 0);
x2("ba*?", "baa", 0, 1);
x2("ba*?b", "baab", 0, 4);
x2("a+?", "aaa", 0, 1);
x2("ba+?", "baa", 0, 2);
x2("ba+?b", "baab", 0, 4);
x2("(?:a?)?\?", "a", 0, 0);
x2("(?:a?\?)?", "a", 0, 0);
x2("(?:a?)+?", "aaa", 0, 1);
x2("(?:a+)?\?", "aaa", 0, 0);
x2("(?:a+)?\?b", "aaab", 0, 4);
x2("(?:ab)?{2}", "", 0, 0);
x2("(?:ab)?{2}", "ababa", 0, 4);
x2("(?:ab)*{0}", "ababa", 0, 0);
x2("(?:ab){3,}", "abababab", 0, 8);
n("(?:ab){3,}", "abab");
x2("(?:ab){2,4}", "ababab", 0, 6);
x2("(?:ab){2,4}", "ababababab", 0, 8);
x2("(?:ab){2,4}?", "ababababab", 0, 4);
x2("(?:ab){,}", "ab{,}", 0, 5);
x2("(?:abc)+?{2}", "abcabcabc", 0, 6);
x2("(?:X*)(?i:xa)", "XXXa", 0, 4);
x2("(d+)([^abc]z)", "dddz", 0, 4);
x2("([^abc]*)([^abc]z)", "dddz", 0, 4);
x2("(\\w+)(\\wz)", "dddz", 0, 4);
x3("(a)", "a", 0, 1, 1);
x3("(ab)", "ab", 0, 2, 1);
x2("((ab))", "ab", 0, 2);
x3("((ab))", "ab", 0, 2, 1);
x3("((ab))", "ab", 0, 2, 2);
x3("((((((((((((((((((((ab))))))))))))))))))))", "ab", 0, 2, 20);
x3("(ab)(cd)", "abcd", 0, 2, 1);
x3("(ab)(cd)", "abcd", 2, 4, 2);
x3("()(a)bc(def)ghijk", "abcdefghijk", 3, 6, 3);
x3("(()(a)bc(def)ghijk)", "abcdefghijk", 3, 6, 4);
x2("(^a)", "a", 0, 1);
x3("(a)|(a)", "ba", 1, 2, 1);
x3("(^a)|(a)", "ba", 1, 2, 2);
x3("(a?)", "aaa", 0, 1, 1);
x3("(a*)", "aaa", 0, 3, 1);
x3("(a*)", "", 0, 0, 1);
x3("(a+)", "aaaaaaa", 0, 7, 1);
x3("(a+|b*)", "bbbaa", 0, 3, 1);
x3("(a+|b?)", "bbbaa", 0, 1, 1);
x3("(abc)?", "abc", 0, 3, 1);
x3("(abc)*", "abc", 0, 3, 1);
x3("(abc)+", "abc", 0, 3, 1);
x3("(xyz|abc)+", "abc", 0, 3, 1);
x3("([xyz][abc]|abc)+", "abc", 0, 3, 1);
x3("((?i:abc))", "AbC", 0, 3, 1);
x2("(abc)(?i:\\1)", "abcABC", 0, 6);
x3("((?m:a.c))", "a\nc", 0, 3, 1);
x3("((?=az)a)", "azb", 0, 1, 1);
x3("abc|(.abd)", "zabd", 0, 4, 1);
x2("(?:abc)|(ABC)", "abc", 0, 3);
x3("(?i:(abc))|(zzz)", "ABC", 0, 3, 1);
x3("a*(.)", "aaaaz", 4, 5, 1);
x3("a*?(.)", "aaaaz", 0, 1, 1);
x3("a*?(c)", "aaaac", 4, 5, 1);
x3("[bcd]a*(.)", "caaaaz", 5, 6, 1);
x3("(\\Abb)cc", "bbcc", 0, 2, 1);
n("(\\Abb)cc", "zbbcc");
x3("(^bb)cc", "bbcc", 0, 2, 1);
n("(^bb)cc", "zbbcc");
x3("cc(bb$)", "ccbb", 2, 4, 1);
n("cc(bb$)", "ccbbb");
n("(\\1)", "");
n("\\1(a)", "aa");
n("(a(b)\\1)\\2+", "ababb");
n("(?:(?:\\1|z)(a))+$", "zaa");
x2("(?:(?:\\1|z)(a))+$", "zaaa", 0, 4);
x2("(a)(?=\\1)", "aa", 0, 1);
n("(a)$|\\1", "az");
x2("(a)\\1", "aa", 0, 2);
n("(a)\\1", "ab");
x2("(a?)\\1", "aa", 0, 2);
x2("(a?\?)\\1", "aa", 0, 0);
x2("(a*)\\1", "aaaaa", 0, 4);
x3("(a*)\\1", "aaaaa", 0, 2, 1);
x2("a(b*)\\1", "abbbb", 0, 5);
x2("a(b*)\\1", "ab", 0, 1);
x2("(a*)(b*)\\1\\2", "aaabbaaabb", 0, 10);
x2("(a*)(b*)\\2", "aaabbbb", 0, 7);
x2("(((((((a*)b))))))c\\7", "aaabcaaa", 0, 8);
x3("(((((((a*)b))))))c\\7", "aaabcaaa", 0, 3, 7);
x2("(a)(b)(c)\\2\\1\\3", "abcbac", 0, 6);
x2("([a-d])\\1", "cc", 0, 2);
x2("(\\w\\d\\s)\\1", "f5 f5 ", 0, 6);
n("(\\w\\d\\s)\\1", "f5 f5");
x2("(who|[a-c]{3})\\1", "whowho", 0, 6);
x2("...(who|[a-c]{3})\\1", "abcwhowho", 0, 9);
x2("(who|[a-c]{3})\\1", "cbccbc", 0, 6);
x2("(^a)\\1", "aa", 0, 2);
n("(^a)\\1", "baa");
n("(a$)\\1", "aa");
n("(ab\\Z)\\1", "ab");
x2("(a*\\Z)\\1", "a", 1, 1);
x2(".(a*\\Z)\\1", "ba", 1, 2);
x3("(.(abc)\\2)", "zabcabc", 0, 7, 1);
x3("(.(..\\d.)\\2)", "z12341234", 0, 9, 1);
x2("((?i:az))\\1", "AzAz", 0, 4);
n("((?i:az))\\1", "Azaz");
x2("(?<=a)b", "ab", 1, 2);
n("(?<=a)b", "bb");
x2("(?<=a|b)b", "bb", 1, 2);
x2("(?<=a|bc)b", "bcb", 2, 3);
x2("(?<=a|bc)b", "ab", 1, 2);
x2("(?<=a|bc||defghij|klmnopq|r)z", "rz", 1, 2);
x2("(a)\\g<1>", "aa", 0, 2);
x2("(?<!a)b", "cb", 1, 2);
n("(?<!a)b", "ab");
x2("(?<!a|bc)b", "bbb", 0, 1);
n("(?<!a|bc)z", "bcz");
x2("(?<name1>a)", "a", 0, 1);
x2("(?<name_2>ab)\\g<name_2>", "abab", 0, 4);
x2("(?<name_3>.zv.)\\k<name_3>", "azvbazvb", 0, 8);
x2("(?<=\\g<ab>)|-\\zEND (?<ab>XyZ)", "XyZ", 3, 3);
x2("(?<n>|a\\g<n>)+", "", 0, 0);
x2("(?<n>|\\(\\g<n>\\))+$", "()(())", 0, 6);
x3("\\g<n>(?<n>.){0}", "X", 0, 1, 1);
x2("\\g<n>(abc|df(?<n>.YZ){2,8}){0}", "XYZ", 0, 3);
x2("\\A(?<n>(a\\g<n>)|)\\z", "aaaa", 0, 4);
x2("(?<n>|\\g<m>\\g<n>)\\z|\\zEND (?<m>a|(b)\\g<m>)", "bbbbabba", 0, 8);
x2("(?<name1240>\\w+\\sx)a+\\k<name1240>", " fg xaaaaaaaafg x", 2, 18);
x3("(z)()()(?<_9>a)\\g<_9>", "zaa", 2, 3, 1);
x2("(.)(((?<_>a)))\\k<_>", "zaa", 0, 3);
x2("((?<name1>\\d)|(?<name2>\\w))(\\k<name1>|\\k<name2>)", "ff", 0, 2);
x2("(?:(?<x>)|(?<x>efg))\\k<x>", "", 0, 0);
x2("(?:(?<x>abc)|(?<x>efg))\\k<x>", "abcefgefg", 3, 9);
n("(?:(?<x>abc)|(?<x>efg))\\k<x>", "abcefg");
x2("(?:(?<n1>.)|(?<n1>..)|(?<n1>...)|(?<n1>....)|(?<n1>.....)|(?<n1>......)|(?<n1>.......)|(?<n1>........)|(?<n1>.........)|(?<n1>..........)|(?<n1>...........)|(?<n1>............)|(?<n1>.............)|(?<n1>..............))\\k<n1>$", "a-pyumpyum", 2, 10);
x3("(?:(?<n1>.)|(?<n1>..)|(?<n1>...)|(?<n1>....)|(?<n1>.....)|(?<n1>......)|(?<n1>.......)|(?<n1>........)|(?<n1>.........)|(?<n1>..........)|(?<n1>...........)|(?<n1>............)|(?<n1>.............)|(?<n1>..............))\\k<n1>$", "xxxxabcdefghijklmnabcdefghijklmn", 4, 18, 14);
x3("(?<name1>)(?<name2>)(?<name3>)(?<name4>)(?<name5>)(?<name6>)(?<name7>)(?<name8>)(?<name9>)(?<name10>)(?<name11>)(?<name12>)(?<name13>)(?<name14>)(?<name15>)(?<name16>aaa)(?<name17>)$", "aaa", 0, 3, 16);
x2("(?<foo>a|\\(\\g<foo>\\))", "a", 0, 1);
x2("(?<foo>a|\\(\\g<foo>\\))", "((((((a))))))", 0, 13);
x3("(?<foo>a|\\(\\g<foo>\\))", "((((((((a))))))))", 0, 17, 1);
x2("\\g<bar>|\\zEND(?<bar>.*abc$)", "abcxxxabc", 0, 9);
x2("\\g<1>|\\zEND(.a.)", "bac", 0, 3);
x3("\\g<_A>\\g<_A>|\\zEND(.a.)(?<_A>.b.)", "xbxyby", 3, 6, 1);
x2("\\A(?:\\g<pon>|\\g<pan>|\\zEND (?<pan>a|c\\g<pon>c)(?<pon>b|d\\g<pan>d))$", "cdcbcdc", 0, 7);
x2("\\A(?<n>|a\\g<m>)\\z|\\zEND (?<m>\\g<n>)", "aaaa", 0, 4);
x2("(?<n>(a|b\\g<n>c){3,5})", "baaaaca", 1, 5);
x2("(?<n>(a|b\\g<n>c){3,5})", "baaaacaaaaa", 0, 10);
x2("(?<pare>\\(([^\\(\\)]++|\\g<pare>)*+\\))", "((a))", 0, 5);
x2("()*\\1", "", 0, 0);
x2("(?:()|())*\\1\\2", "", 0, 0);
x3("(?:\\1a|())*", "a", 0, 0, 1);
x2("x((.)*)*x", "0x1x2x3", 1, 6);
x2("x((.)*)*x(?i:\\1)\\Z", "0x1x2x1X2", 1, 9);
x2("(?:()|()|()|()|()|())*\\2\\5", "", 0, 0);
x2("(?:()|()|()|(x)|()|())*\\2b\\5", "b", 0, 1);
x2("\\xED\\xF2", "\xed\xf2", 0, 2);
x2("", "", 0, 0);
x2("", "", 0, 2);
n("", "");
x2("うう", "うう", 0, 4);
x2("あいう", "あいう", 0, 6);
x2("こここここここここここここここここここここここここここここここここここ", "こここここここここここここここここここここここここここここここここここ", 0, 70);
x2("", "いあ", 2, 4);
x2("いう", "あいう", 2, 6);
x2("\\xca\\xb8", "\xca\xb8", 0, 2);
x2(".", "", 0, 2);
x2("..", "かき", 0, 4);
x2("\\w", "", 0, 2);
n("\\W", "");
x2("[\\W]", "う$", 2, 3);
x2("\\S", "", 0, 2);
x2("\\S", "", 0, 2);
x2("\\b", "", 0, 0);
x2("\\b", "", 1, 1);
x2("\\B", "せそ ", 2, 2);
x2("\\B", "", 3, 3);
x2("\\B", "", 0, 0);
x2("[たち]", "", 0, 2);
n("[なに]", "");
x2("[う-お]", "", 0, 2);
n("[^け]", "");
x2("[\\w]", "", 0, 2);
n("[\\d]", "");
x2("[\\D]", "", 0, 2);
n("[\\s]", "");
x2("[\\S]", "", 0, 2);
x2("[\\w\\d]", "", 0, 2);
x2("[\\w\\d]", "", 3, 5);
n("\\w鬼車", " 鬼車");
x2("\\W車", "鬼 車", 0, 5);
x2("あ.い.う", "ああいいう", 0, 10);
x2(".\\wう\\W..ぞ", "えうう うぞぞ", 0, 13);
x2("\\s\\wこここ", " ここここ", 0, 9);
x2("ああ.け", "ああけけ", 0, 8);
n(".い", "いえ");
x2(".お", "おお", 0, 4);
x2("^あ", "", 0, 2);
x2("^む$", "", 0, 2);
x2("^\\w$", "", 0, 2);
x2("^\\wかきくけこ$", "zかきくけこ", 0, 11);
x2("^\\w...うえお$", "zあいううえお", 0, 13);
x2("\\w\\w\\s\\Wおおお\\d", "aお おおお4", 0, 12);
x2("\\Aたちつ", "たちつ", 0, 6);
x2("むめも\\Z", "むめも", 0, 6);
x2("かきく\\z", "かきく", 0, 6);
x2("かきく\\Z", "かきく\n", 0, 6);
x2("\\Gぽぴ", "ぽぴ", 0, 4);
n("\\Gえ", "うえお");
n("とて\\G", "とて");
n("まみ\\A", "まみ");
n("\\Aみ", "まみ");
x2("(?=せ)せ", "", 0, 2);
n("(?=う).", "");
x2("(?!う)か", "", 0, 2);
n("(?!と)あ", "");
x2("(?i:あ)", "", 0, 2);
x2("(?i:ぶべ)", "ぶべ", 0, 4);
n("(?i:い)", "");
x2("(?m:よ.)", "\n", 0, 3);
x2("(?m:.め)", "\n", 2, 5);
x2("あ?", "", 0, 0);
x2("変?", "", 0, 0);
x2("変?", "", 0, 2);
x2("量*", "", 0, 0);
x2("量*", "", 0, 2);
x2("子*", "子子子", 0, 6);
x2("馬*", "鹿馬馬馬馬", 0, 0);
n("山+", "");
x2("河+", "", 0, 2);
x2("時+", "時時時時", 0, 8);
x2("え+", "ええううう", 0, 4);
x2("う+", "おうううう", 2, 10);
x2(".?", "", 0, 2);
x2(".*", "ぱぴぷぺ", 0, 8);
x2(".+", "", 0, 2);
x2(".+", "いうえか\n", 0, 8);
x2("あ|い", "", 0, 2);
x2("あ|い", "", 0, 2);
x2("あい|いう", "あい", 0, 4);
x2("あい|いう", "いう", 0, 4);
x2("を(?:かき|きく)", "をかき", 0, 6);
x2("を(?:かき|きく)け", "をきくけ", 0, 8);
x2("あい|(?:あう|あを)", "あを", 0, 4);
x2("あ|い|う", "えう", 2, 4);
x2("あ|い|うえ|おかき|く|けこさ|しすせ|そ|たち|つてとなに|ぬね", "しすせ", 0, 6);
n("あ|い|うえ|おかき|く|けこさ|しすせ|そ|たち|つてとなに|ぬね", "すせ");
x2("あ|^わ", "ぶあ", 2, 4);
x2("あ|^を", "をあ", 0, 2);
x2("鬼|\\G車", "け車鬼", 4, 6);
x2("鬼|\\G車", "車鬼", 0, 2);
x2("鬼|\\A車", "b車鬼", 3, 5);
x2("鬼|\\A車", "", 0, 2);
x2("鬼|車\\Z", "車鬼", 2, 4);
x2("鬼|車\\Z", "", 0, 2);
x2("鬼|車\\Z", "\n", 0, 2);
x2("鬼|車\\z", "車鬼", 2, 4);
x2("鬼|車\\z", "", 0, 2);
x2("\\w|\\s", "", 0, 2);
x2("\\w|%", "%お", 0, 1);
x2("\\w|[&$]", "う&", 0, 2);
x2("[い-け]", "", 0, 2);
x2("[い-け]|[^か-こ]", "", 0, 2);
x2("[い-け]|[^か-こ]", "", 0, 2);
x2("[^あ]", "\n", 0, 1);
x2("(?:あ|[う-き])|いを", "うを", 0, 2);
x2("(?:あ|[う-き])|いを", "いを", 0, 4);
x2("あいう|(?=けけ)..ほ", "けけほ", 0, 6);
x2("あいう|(?!けけ)..ほ", "あいほ", 0, 6);
x2("(?=をあ)..あ|(?=をを)..あ", "ををあ", 0, 6);
x2("(?<=あ|いう)い", "いうい", 4, 6);
n("(?>あ|あいえ)う", "あいえう");
x2("(?>あいえ|あ)う", "あいえう", 0, 8);
x2("あ?|い", "", 0, 2);
x2("あ?|い", "", 0, 0);
x2("あ?|い", "", 0, 0);
x2("あ*|い", "ああ", 0, 4);
x2("あ*|い*", "いあ", 0, 0);
x2("あ*|い*", "あい", 0, 2);
x2("[aあ]*|い*", "aあいいい", 0, 3);
x2("あ+|い*", "", 0, 0);
x2("あ+|い*", "いいい", 0, 6);
x2("あ+|い*", "あいいい", 0, 2);
x2("あ+|い*", "aあいいい", 0, 0);
n("あ+|い+", "");
x2("(あ|い)?", "", 0, 2);
x2("(あ|い)*", "いあ", 0, 4);
x2("(あ|い)+", "いあい", 0, 6);
x2("(あい|うあ)+", "うああいうえ", 0, 8);
x2("(あい|うえ)+", "うああいうえ", 4, 12);
x2("(あい|うあ)+", "ああいうあ", 2, 10);
x2("(あい|うあ)+", "あいをうあ", 0, 4);
x2("(あい|うあ)+", "$$zzzzあいをうあ", 6, 10);
x2("(あ|いあい)+", "あいあいあ", 0, 10);
x2("(あ|いあい)+", "いあ", 2, 4);
x2("(あ|いあい)+", "いあああいあ", 2, 8);
x2("(?:あ|い)(?:あ|い)", "あい", 0, 4);
x2("(?:あ*|い*)(?:あ*|い*)", "あああいいい", 0, 6);
x2("(?:あ*|い*)(?:あ+|い+)", "あああいいい", 0, 12);
x2("(?:あ+|い+){2}", "あああいいい", 0, 12);
x2("(?:あ+|い+){1,2}", "あああいいい", 0, 12);
x2("(?:あ+|\\Aい*)うう", "うう", 0, 4);
n("(?:あ+|\\Aい*)うう", "あいうう");
x2("(?:^あ+|い+)*う", "ああいいいあいう", 12, 16);
x2("(?:^あ+|い+)*う", "ああいいいいう", 0, 14);
x2("う{0,}", "うううう", 0, 8);
x2("あ|(?i)c", "C", 0, 1);
x2("(?i)c|あ", "C", 0, 1);
x2("(?i:あ)|a", "a", 0, 1);
n("(?i:あ)|a", "A");
x2("[あいう]?", "あいう", 0, 2);
x2("[あいう]*", "あいう", 0, 6);
x2("[^あいう]*", "あいう", 0, 0);
n("[^あいう]+", "あいう");
x2("あ?\?", "あああ", 0, 0);
x2("いあ?\?い", "いあい", 0, 6);
x2("あ*?", "あああ", 0, 0);
x2("いあ*?", "いああ", 0, 2);
x2("いあ*?い", "いああい", 0, 8);
x2("あ+?", "あああ", 0, 2);
x2("いあ+?", "いああ", 0, 4);
x2("いあ+?い", "いああい", 0, 8);
x2("(?:天?)?\?", "", 0, 0);
x2("(?:天?\?)?", "", 0, 0);
x2("(?:夢?)+?", "夢夢夢", 0, 2);
x2("(?:風+)?\?", "風風風", 0, 0);
x2("(?:雪+)?\?霜", "雪雪雪霜", 0, 8);
x2("(?:あい)?{2}", "", 0, 0);
x2("(?:鬼車)?{2}", "鬼車鬼車鬼", 0, 8);
x2("(?:鬼車)*{0}", "鬼車鬼車鬼", 0, 0);
x2("(?:鬼車){3,}", "鬼車鬼車鬼車鬼車", 0, 16);
n("(?:鬼車){3,}", "鬼車鬼車");
x2("(?:鬼車){2,4}", "鬼車鬼車鬼車", 0, 12);
x2("(?:鬼車){2,4}", "鬼車鬼車鬼車鬼車鬼車", 0, 16);
x2("(?:鬼車){2,4}?", "鬼車鬼車鬼車鬼車鬼車", 0, 8);
x2("(?:鬼車){,}", "鬼車{,}", 0, 7);
x2("(?:かきく)+?{2}", "かきくかきくかきく", 0, 12);
x3("(火)", "", 0, 2, 1);
x3("(火水)", "火水", 0, 4, 1);
x2("((時間))", "時間", 0, 4);
x3("((風水))", "風水", 0, 4, 1);
x3("((昨日))", "昨日", 0, 4, 2);
x3("((((((((((((((((((((量子))))))))))))))))))))", "量子", 0, 4, 20);
x3("(あい)(うえ)", "あいうえ", 0, 4, 1);
x3("(あい)(うえ)", "あいうえ", 4, 8, 2);
x3("()(あ)いう(えおか)きくけこ", "あいうえおかきくけこ", 6, 12, 3);
x3("(()(あ)いう(えおか)きくけこ)", "あいうえおかきくけこ", 6, 12, 4);
x3(".*(フォ)ン・マ(ン()シュタ)イン", "フォン・マンシュタイン", 10, 18, 2);
x2("(^あ)", "", 0, 2);
x3("(あ)|(あ)", "いあ", 2, 4, 1);
x3("(^あ)|(あ)", "いあ", 2, 4, 2);
x3("(あ?)", "あああ", 0, 2, 1);
x3("(ま*)", "ままま", 0, 6, 1);
x3("(と*)", "", 0, 0, 1);
x3("(る+)", "るるるるるるる", 0, 14, 1);
x3("(ふ+|へ*)", "ふふふへへ", 0, 6, 1);
x3("(あ+|い?)", "いいいああ", 0, 2, 1);
x3("(あいう)?", "あいう", 0, 6, 1);
x3("(あいう)*", "あいう", 0, 6, 1);
x3("(あいう)+", "あいう", 0, 6, 1);
x3("(さしす|あいう)+", "あいう", 0, 6, 1);
x3("([なにぬ][かきく]|かきく)+", "かきく", 0, 6, 1);
x3("((?i:あいう))", "あいう", 0, 6, 1);
x3("((?m:あ.う))", "\n", 0, 5, 1);
x3("((?=あん)あ)", "あんい", 0, 2, 1);
x3("あいう|(.あいえ)", "んあいえ", 0, 8, 1);
x3("あ*(.)", "ああああん", 8, 10, 1);
x3("あ*?(.)", "ああああん", 0, 2, 1);
x3("あ*?(ん)", "ああああん", 8, 10, 1);
x3("[いうえ]あ*(.)", "えああああん", 10, 12, 1);
x3("(\\Aいい)うう", "いいうう", 0, 4, 1);
n("(\\Aいい)うう", "んいいうう");
x3("(^いい)うう", "いいうう", 0, 4, 1);
n("(^いい)うう", "んいいうう");
x3("ろろ(るる$)", "ろろるる", 4, 8, 1);
n("ろろ(るる$)", "ろろるるる");
x2("(無)\\1", "無無", 0, 4);
n("(無)\\1", "無武");
x2("(空?)\\1", "空空", 0, 4);
x2("(空?\?)\\1", "空空", 0, 0);
x2("(空*)\\1", "空空空空空", 0, 8);
x3("(空*)\\1", "空空空空空", 0, 4, 1);
x2("あ(い*)\\1", "あいいいい", 0, 10);
x2("あ(い*)\\1", "あい", 0, 2);
x2("(あ*)(い*)\\1\\2", "あああいいあああいい", 0, 20);
x2("(あ*)(い*)\\2", "あああいいいい", 0, 14);
x3("(あ*)(い*)\\2", "あああいいいい", 6, 10, 2);
x2("(((((((ぽ*)ぺ))))))ぴ\\7", "ぽぽぽぺぴぽぽぽ", 0, 16);
x3("(((((((ぽ*)ぺ))))))ぴ\\7", "ぽぽぽぺぴぽぽぽ", 0, 6, 7);
x2("(は)(ひ)(ふ)\\2\\1\\3", "はひふひはふ", 0, 12);
x2("([き-け])\\1", "くく", 0, 4);
x2("(\\w\\d\\s)\\1", "あ5 あ5 ", 0, 8);
n("(\\w\\d\\s)\\1", "あ5 あ5");
x2("(誰?|[あ-う]{3})\\1", "誰?誰?", 0, 8);
x2("...(誰?|[あ-う]{3})\\1", "あaあ誰", 0, 13);
x2("(誰?|[あ-う]{3})\\1", "ういうういう", 0, 12);
x2("(^こ)\\1", "ここ", 0, 4);
n("(^む)\\1", "めむむ");
n("(あ$)\\1", "ああ");
n("(あい\\Z)\\1", "あい");
x2("(あ*\\Z)\\1", "", 2, 2);
x2(".(あ*\\Z)\\1", "いあ", 2, 4);
x3("(.(やいゆ)\\2)", "zやいゆやいゆ", 0, 13, 1);
x3("(.(..\\d.)\\2)", "あ12341234", 0, 10, 1);
x2("((?i:あvず))\\1", "あvずあvず", 0, 10);
x2("(?<愚か>変|\\(\\g<愚か>\\))", "((((((変))))))", 0, 14);
x2("\\A(?:\\g<阿_1>|\\g<云_2>|\\z終了 (?<阿_1>観|自\\g<云_2>自)(?<云_2>在|菩薩\\g<阿_1>菩薩))$", "菩薩自菩薩自在自菩薩自菩薩", 0, 26);
x2("[[ひふ]]", "", 0, 2);
x2("[[いおう]か]", "", 0, 2);
n("[[^あ]]", "");
n("[^[あ]]", "");
x2("[^[^あ]]", "", 0, 2);
x2("[[かきく]&&きく]", "", 0, 2);
n("[[かきく]&&きく]", "");
n("[[かきく]&&きく]", "");
x2("[あ-ん&&い-を&&う-ゑ]", "", 0, 2);
n("[^あ-ん&&い-を&&う-ゑ]", "");
x2("[[^あ&&あ]&&あ-ん]", "", 0, 2);
n("[[^あ&&あ]&&あ-ん]", "");
x2("[[^あ-ん&&いうえお]&&[^う-か]]", "", 0, 2);
n("[[^あ-ん&&いうえお]&&[^う-か]]", "");
x2("[^[^あいう]&&[^うえお]]", "", 0, 2);
x2("[^[^あいう]&&[^うえお]]", "", 0, 2);
n("[^[^あいう]&&[^うえお]]", "");
x2("[あ-&&-あ]", "-", 0, 1);
x2("[^[^a-zあいう]&&[^bcdefgうえお]q-w]", "", 0, 2);
x2("[^[^a-zあいう]&&[^bcdefgうえお]g-w]", "f", 0, 1);
x2("[^[^a-zあいう]&&[^bcdefgうえお]g-w]", "g", 0, 1);
n("[^[^a-zあいう]&&[^bcdefgうえお]g-w]", "2");
x2("a<b>バージョンのダウンロード<\\/b>", "a<b>バージョンのダウンロード</b>", 0, 32);
x2(".<b>バージョンのダウンロード<\\/b>", "a<b>バージョンのダウンロード</b>", 0, 32);
fprintf(stdout,
"\nRESULT SUCC: %d, FAIL: %d, ERROR: %d (by Oniguruma %s)\n",
nsucc, nfail, nerror, onig_version());
#ifndef POSIX_TEST
onig_region_free(region, 1);
onig_end();
#endif
return ((nfail == 0 && nerror == 0) ? 0 : -1);
}

View File

@@ -1,911 +0,0 @@
/*
* This program was generated by testconv.rb.
*/
#include<stdio.h>
#ifdef POSIX_TEST
#include "onigposix.h"
#else
#include "oniguruma.h"
#endif
static int nsucc = 0;
static int nfail = 0;
static int nerror = 0;
static FILE* err_file;
#ifndef POSIX_TEST
static OnigRegion* region;
static OnigEncoding ENC;
#endif
#define ulen(p) onigenc_str_bytelen_null(ENC, (UChar* )p)
static void uconv(char* from, char* to, int len)
{
int i;
unsigned char c;
char *q;
q = to;
for (i = 0; i < len; i += 2) {
c = (unsigned char )from[i];
if (c == 0) {
c = (unsigned char )from[i+1];
if (c < 0x20 || c >= 0x7f || c == 0x5c || c == 0x22) {
sprintf(q, "\\%03o", c);
q += 4;
}
else {
sprintf(q, "%c", c);
q++;
}
}
else {
sprintf(q, "\\%03o", c);
q += 4;
c = (unsigned char )from[i+1];
sprintf(q, "\\%03o", c);
q += 4;
}
}
*q = 0;
}
static void xx(char* pattern, char* str, int from, int to, int mem, int not)
{
int r;
char cpat[4000], cstr[4000];
#ifdef POSIX_TEST
regex_t reg;
char buf[200];
regmatch_t pmatch[20];
uconv(pattern, cpat, ulen(pattern));
uconv(str, cstr, ulen(str));
r = regcomp(&reg, pattern, REG_EXTENDED | REG_NEWLINE);
if (r) {
regerror(r, &reg, buf, sizeof(buf));
fprintf(err_file, "ERROR: %s\n", buf);
nerror++;
return ;
}
r = regexec(&reg, str, reg.re_nsub + 1, pmatch, 0);
if (r != 0 && r != REG_NOMATCH) {
regerror(r, &reg, buf, sizeof(buf));
fprintf(err_file, "ERROR: %s\n", buf);
nerror++;
return ;
}
if (r == REG_NOMATCH) {
if (not) {
fprintf(stdout, "OK(N): /%s/ '%s'\n", cpat, cstr);
nsucc++;
}
else {
fprintf(stdout, "FAIL: /%s/ '%s'\n", cpat, cstr);
nfail++;
}
}
else {
if (not) {
fprintf(stdout, "FAIL(N): /%s/ '%s'\n", cpat, cstr);
nfail++;
}
else {
if (pmatch[mem].rm_so == from && pmatch[mem].rm_eo == to) {
fprintf(stdout, "OK: /%s/ '%s'\n", cpat, cstr);
nsucc++;
}
else {
fprintf(stdout, "FAIL: /%s/ '%s' %d-%d : %d-%d\n", cpat, cstr,
from, to, pmatch[mem].rm_so, pmatch[mem].rm_eo);
nfail++;
}
}
}
regfree(&reg);
#else
regex_t* reg;
OnigCompileInfo ci;
OnigErrorInfo einfo;
uconv(pattern, cpat, ulen(pattern));
uconv(str, cstr, ulen(str));
#if 0
r = onig_new(&reg, (UChar* )pattern, (UChar* )(pattern + ulen(pattern)),
ONIG_OPTION_DEFAULT, ENC, ONIG_SYNTAX_DEFAULT, &einfo);
#else
ci.num_of_elements = 5;
ci.pattern_enc = ENC;
ci.target_enc = ENC;
ci.syntax = ONIG_SYNTAX_DEFAULT;
ci.option = ONIG_OPTION_DEFAULT;
ci.case_fold_flag = ONIGENC_CASE_FOLD_DEFAULT;
r = onig_new_deluxe(&reg, (UChar* )pattern,
(UChar* )(pattern + ulen(pattern)),
&ci, &einfo);
#endif
if (r) {
char s[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str(s, r, &einfo);
fprintf(err_file, "ERROR: %s\n", s);
nerror++;
return ;
}
r = onig_search(reg, (UChar* )str, (UChar* )(str + ulen(str)),
(UChar* )str, (UChar* )(str + ulen(str)),
region, ONIG_OPTION_NONE);
if (r < ONIG_MISMATCH) {
char s[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str(s, r);
fprintf(err_file, "ERROR: %s\n", s);
nerror++;
return ;
}
if (r == ONIG_MISMATCH) {
if (not) {
fprintf(stdout, "OK(N): /%s/ '%s'\n", cpat, cstr);
nsucc++;
}
else {
fprintf(stdout, "FAIL: /%s/ '%s'\n", cpat, cstr);
nfail++;
}
}
else {
if (not) {
fprintf(stdout, "FAIL(N): /%s/ '%s'\n", cpat, cstr);
nfail++;
}
else {
if (region->beg[mem] == from && region->end[mem] == to) {
fprintf(stdout, "OK: /%s/ '%s'\n", cpat, cstr);
nsucc++;
}
else {
fprintf(stdout, "FAIL: /%s/ '%s' %d-%d : %d-%d\n", cpat, cstr,
from, to, region->beg[mem], region->end[mem]);
nfail++;
}
}
}
onig_free(reg);
#endif
}
static void x2(char* pattern, char* str, int from, int to)
{
xx(pattern, str, from, to, 0, 0);
}
static void x3(char* pattern, char* str, int from, int to, int mem)
{
xx(pattern, str, from, to, mem, 0);
}
static void n(char* pattern, char* str)
{
xx(pattern, str, 0, 0, 0, 1);
}
extern int main(int argc, char* argv[])
{
err_file = stdout;
#ifndef POSIX_TEST
region = onig_region_new();
#endif
#ifdef POSIX_TEST
reg_set_encoding(REG_POSIX_ENCODING_UTF16_BE);
#else
ENC = ONIG_ENCODING_UTF16_BE;
#endif
x2("\000\000", "\000\000", 0, 0);
x2("\000^\000\000", "\000\000", 0, 0);
x2("\000$\000\000", "\000\000", 0, 0);
x2("\000\134\000G\000\000", "\000\000", 0, 0);
x2("\000\134\000A\000\000", "\000\000", 0, 0);
x2("\000\134\000Z\000\000", "\000\000", 0, 0);
x2("\000\134\000z\000\000", "\000\000", 0, 0);
x2("\000^\000$\000\000", "\000\000", 0, 0);
x2("\000\134\000c\000a\000\000", "\000\001\000\000", 0, 2);
x2("\000\134\000C\000-\000b\000\000", "\000\002\000\000", 0, 2);
x2("\000\134\000c\000\134\000\134\000\000", "\000\034\000\000", 0, 2);
x2("\000q\000[\000\134\000c\000\134\000\134\000]\000\000", "\000q\000\034\000\000", 0, 4);
x2("\000\000", "\000a\000\000", 0, 0);
x2("\000a\000\000", "\000a\000\000", 0, 2);
x2("\000\134\000x\0000\0000\000\134\000x\0006\0001\000\000", "\000a\000\000", 0, 2);
x2("\000a\000a\000\000", "\000a\000a\000\000", 0, 4);
x2("\000a\000a\000a\000\000", "\000a\000a\000a\000\000", 0, 6);
x2("\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000\000", "\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000\000", 0, 70);
x2("\000a\000b\000\000", "\000a\000b\000\000", 0, 4);
x2("\000b\000\000", "\000a\000b\000\000", 2, 4);
x2("\000b\000c\000\000", "\000a\000b\000c\000\000", 2, 6);
x2("\000(\000?\000i\000:\000#\000R\000E\000T\000#\000)\000\000", "\000#\000I\000N\000S\000#\000#\000R\000E\000T\000#\000\000", 10, 20);
x2("\000\134\0000\0000\0000\000\134\0001\0007\000\000", "\000\017\000\000", 0, 2);
x2("\000\134\000x\0000\0000\000\134\000x\0001\000f\000\000", "\000\037\000\000", 0, 2);
x2("\000a\000(\000?\000#\000.\000.\000.\000.\000\134\000\134\000J\000J\000J\000J\000)\000b\000\000", "\000a\000b\000\000", 0, 4);
x2("\000(\000?\000x\000)\000 \000 \000G\000 \000(\000o\000 \000O\000(\000?\000-\000x\000)\000o\000O\000)\000 \000g\000 \000L\000\000", "\000G\000o\000O\000o\000O\000g\000L\000e\000\000", 0, 14);
x2("\000.\000\000", "\000a\000\000", 0, 2);
n("\000.\000\000", "\000\000");
x2("\000.\000.\000\000", "\000a\000b\000\000", 0, 4);
x2("\000\134\000w\000\000", "\000e\000\000", 0, 2);
n("\000\134\000W\000\000", "\000e\000\000");
x2("\000\134\000s\000\000", "\000 \000\000", 0, 2);
x2("\000\134\000S\000\000", "\000b\000\000", 0, 2);
x2("\000\134\000d\000\000", "\0004\000\000", 0, 2);
n("\000\134\000D\000\000", "\0004\000\000");
x2("\000\134\000b\000\000", "\000z\000 \000\000", 0, 0);
x2("\000\134\000b\000\000", "\000 \000z\000\000", 2, 2);
x2("\000\134\000B\000\000", "\000z\000z\000 \000\000", 2, 2);
x2("\000\134\000B\000\000", "\000z\000 \000\000", 4, 4);
x2("\000\134\000B\000\000", "\000 \000z\000\000", 0, 0);
x2("\000[\000a\000b\000]\000\000", "\000b\000\000", 0, 2);
n("\000[\000a\000b\000]\000\000", "\000c\000\000");
x2("\000[\000a\000-\000z\000]\000\000", "\000t\000\000", 0, 2);
n("\000[\000^\000a\000]\000\000", "\000a\000\000");
x2("\000[\000^\000a\000]\000\000", "\000\012\000\000", 0, 2);
x2("\000[\000]\000]\000\000", "\000]\000\000", 0, 2);
n("\000[\000^\000]\000]\000\000", "\000]\000\000");
x2("\000[\000\134\000^\000]\000+\000\000", "\0000\000^\000^\0001\000\000", 2, 6);
x2("\000[\000b\000-\000]\000\000", "\000b\000\000", 0, 2);
x2("\000[\000b\000-\000]\000\000", "\000-\000\000", 0, 2);
x2("\000[\000\134\000w\000]\000\000", "\000z\000\000", 0, 2);
n("\000[\000\134\000w\000]\000\000", "\000 \000\000");
x2("\000[\000\134\000W\000]\000\000", "\000b\000$\000\000", 2, 4);
x2("\000[\000\134\000d\000]\000\000", "\0005\000\000", 0, 2);
n("\000[\000\134\000d\000]\000\000", "\000e\000\000");
x2("\000[\000\134\000D\000]\000\000", "\000t\000\000", 0, 2);
n("\000[\000\134\000D\000]\000\000", "\0003\000\000");
x2("\000[\000\134\000s\000]\000\000", "\000 \000\000", 0, 2);
n("\000[\000\134\000s\000]\000\000", "\000a\000\000");
x2("\000[\000\134\000S\000]\000\000", "\000b\000\000", 0, 2);
n("\000[\000\134\000S\000]\000\000", "\000 \000\000");
x2("\000[\000\134\000w\000\134\000d\000]\000\000", "\0002\000\000", 0, 2);
n("\000[\000\134\000w\000\134\000d\000]\000\000", "\000 \000\000");
x2("\000[\000[\000:\000u\000p\000p\000e\000r\000:\000]\000]\000\000", "\000B\000\000", 0, 2);
x2("\000[\000*\000[\000:\000x\000d\000i\000g\000i\000t\000:\000]\000+\000]\000\000", "\000+\000\000", 0, 2);
x2("\000[\000*\000[\000:\000x\000d\000i\000g\000i\000t\000:\000]\000+\000]\000\000", "\000G\000H\000I\000K\000K\000-\0009\000+\000*\000\000", 12, 14);
x2("\000[\000*\000[\000:\000x\000d\000i\000g\000i\000t\000:\000]\000+\000]\000\000", "\000-\000@\000^\000+\000\000", 6, 8);
n("\000[\000[\000:\000u\000p\000p\000e\000r\000]\000]\000\000", "\000A\000\000");
x2("\000[\000[\000:\000u\000p\000p\000e\000r\000]\000]\000\000", "\000:\000\000", 0, 2);
x2("\000[\000\134\0000\0000\0000\000\134\0000\0004\0004\000-\000\134\0000\0000\0000\000\134\0000\0004\0007\000]\000\000", "\000&\000\000", 0, 2);
x2("\000[\000\134\000x\0000\0000\000\134\000x\0005\000a\000-\000\134\000x\0000\0000\000\134\000x\0005\000c\000]\000\000", "\000[\000\000", 0, 2);
x2("\000[\000\134\000x\0000\0000\000\134\000x\0006\000A\000-\000\134\000x\0000\0000\000\134\000x\0006\000D\000]\000\000", "\000l\000\000", 0, 2);
n("\000[\000\134\000x\0000\0000\000\134\000x\0006\000A\000-\000\134\000x\0000\0000\000\134\000x\0006\000D\000]\000\000", "\000n\000\000");
n("\000^\000[\0000\000-\0009\000A\000-\000F\000]\000+\000 \0000\000+\000 \000U\000N\000D\000E\000F\000 \000\000", "\0007\0005\000F\000 \0000\0000\0000\0000\0000\0000\0000\0000\000 \000S\000E\000C\000T\0001\0004\000A\000 \000n\000o\000t\000y\000p\000e\000 \000(\000)\000 \000 \000 \000 \000E\000x\000t\000e\000r\000n\000a\000l\000 \000 \000 \000 \000|\000 \000_\000r\000b\000_\000a\000p\000p\000l\000y\000\000");
x2("\000[\000\134\000[\000]\000\000", "\000[\000\000", 0, 2);
x2("\000[\000\134\000]\000]\000\000", "\000]\000\000", 0, 2);
x2("\000[\000&\000]\000\000", "\000&\000\000", 0, 2);
x2("\000[\000[\000a\000b\000]\000]\000\000", "\000b\000\000", 0, 2);
x2("\000[\000[\000a\000b\000]\000c\000]\000\000", "\000c\000\000", 0, 2);
n("\000[\000[\000^\000a\000]\000]\000\000", "\000a\000\000");
n("\000[\000^\000[\000a\000]\000]\000\000", "\000a\000\000");
x2("\000[\000[\000a\000b\000]\000&\000&\000b\000c\000]\000\000", "\000b\000\000", 0, 2);
n("\000[\000[\000a\000b\000]\000&\000&\000b\000c\000]\000\000", "\000a\000\000");
n("\000[\000[\000a\000b\000]\000&\000&\000b\000c\000]\000\000", "\000c\000\000");
x2("\000[\000a\000-\000z\000&\000&\000b\000-\000y\000&\000&\000c\000-\000x\000]\000\000", "\000w\000\000", 0, 2);
n("\000[\000^\000a\000-\000z\000&\000&\000b\000-\000y\000&\000&\000c\000-\000x\000]\000\000", "\000w\000\000");
x2("\000[\000[\000^\000a\000&\000&\000a\000]\000&\000&\000a\000-\000z\000]\000\000", "\000b\000\000", 0, 2);
n("\000[\000[\000^\000a\000&\000&\000a\000]\000&\000&\000a\000-\000z\000]\000\000", "\000a\000\000");
x2("\000[\000[\000^\000a\000-\000z\000&\000&\000b\000c\000d\000e\000f\000]\000&\000&\000[\000^\000c\000-\000g\000]\000]\000\000", "\000h\000\000", 0, 2);
n("\000[\000[\000^\000a\000-\000z\000&\000&\000b\000c\000d\000e\000f\000]\000&\000&\000[\000^\000c\000-\000g\000]\000]\000\000", "\000c\000\000");
x2("\000[\000^\000[\000^\000a\000b\000c\000]\000&\000&\000[\000^\000c\000d\000e\000]\000]\000\000", "\000c\000\000", 0, 2);
x2("\000[\000^\000[\000^\000a\000b\000c\000]\000&\000&\000[\000^\000c\000d\000e\000]\000]\000\000", "\000e\000\000", 0, 2);
n("\000[\000^\000[\000^\000a\000b\000c\000]\000&\000&\000[\000^\000c\000d\000e\000]\000]\000\000", "\000f\000\000");
x2("\000[\000a\000-\000&\000&\000-\000a\000]\000\000", "\000-\000\000", 0, 2);
n("\000[\000a\000\134\000-\000&\000&\000\134\000-\000a\000]\000\000", "\000&\000\000");
n("\000\134\000w\000a\000b\000c\000\000", "\000 \000a\000b\000c\000\000");
x2("\000a\000\134\000W\000b\000c\000\000", "\000a\000 \000b\000c\000\000", 0, 8);
x2("\000a\000.\000b\000.\000c\000\000", "\000a\000a\000b\000b\000c\000\000", 0, 10);
x2("\000.\000\134\000w\000b\000\134\000W\000.\000.\000c\000\000", "\000a\000b\000b\000 \000b\000c\000c\000\000", 0, 14);
x2("\000\134\000s\000\134\000w\000z\000z\000z\000\000", "\000 \000z\000z\000z\000z\000\000", 0, 10);
x2("\000a\000a\000.\000b\000\000", "\000a\000a\000b\000b\000\000", 0, 8);
n("\000.\000a\000\000", "\000a\000b\000\000");
x2("\000.\000a\000\000", "\000a\000a\000\000", 0, 4);
x2("\000^\000a\000\000", "\000a\000\000", 0, 2);
x2("\000^\000a\000$\000\000", "\000a\000\000", 0, 2);
x2("\000^\000\134\000w\000$\000\000", "\000a\000\000", 0, 2);
n("\000^\000\134\000w\000$\000\000", "\000 \000\000");
x2("\000^\000\134\000w\000a\000b\000$\000\000", "\000z\000a\000b\000\000", 0, 6);
x2("\000^\000\134\000w\000a\000b\000c\000d\000e\000f\000$\000\000", "\000z\000a\000b\000c\000d\000e\000f\000\000", 0, 14);
x2("\000^\000\134\000w\000.\000.\000.\000d\000e\000f\000$\000\000", "\000z\000a\000b\000c\000d\000e\000f\000\000", 0, 14);
x2("\000\134\000w\000\134\000w\000\134\000s\000\134\000W\000a\000a\000a\000\134\000d\000\000", "\000a\000a\000 \000 \000a\000a\000a\0004\000\000", 0, 16);
x2("\000\134\000A\000\134\000Z\000\000", "\000\000", 0, 0);
x2("\000\134\000A\000x\000y\000z\000\000", "\000x\000y\000z\000\000", 0, 6);
x2("\000x\000y\000z\000\134\000Z\000\000", "\000x\000y\000z\000\000", 0, 6);
x2("\000x\000y\000z\000\134\000z\000\000", "\000x\000y\000z\000\000", 0, 6);
x2("\000a\000\134\000Z\000\000", "\000a\000\000", 0, 2);
x2("\000\134\000G\000a\000z\000\000", "\000a\000z\000\000", 0, 4);
n("\000\134\000G\000z\000\000", "\000b\000z\000a\000\000");
n("\000a\000z\000\134\000G\000\000", "\000a\000z\000\000");
n("\000a\000z\000\134\000A\000\000", "\000a\000z\000\000");
n("\000a\000\134\000A\000z\000\000", "\000a\000z\000\000");
x2("\000\134\000^\000\134\000$\000\000", "\000^\000$\000\000", 0, 4);
x2("\000^\000x\000?\000y\000\000", "\000x\000y\000\000", 0, 4);
x2("\000^\000(\000x\000?\000y\000)\000\000", "\000x\000y\000\000", 0, 4);
x2("\000\134\000w\000\000", "\000_\000\000", 0, 2);
n("\000\134\000W\000\000", "\000_\000\000");
x2("\000(\000?\000=\000z\000)\000z\000\000", "\000z\000\000", 0, 2);
n("\000(\000?\000=\000z\000)\000.\000\000", "\000a\000\000");
x2("\000(\000?\000!\000z\000)\000a\000\000", "\000a\000\000", 0, 2);
n("\000(\000?\000!\000z\000)\000a\000\000", "\000z\000\000");
x2("\000(\000?\000i\000:\000a\000)\000\000", "\000a\000\000", 0, 2);
x2("\000(\000?\000i\000:\000a\000)\000\000", "\000A\000\000", 0, 2);
x2("\000(\000?\000i\000:\000A\000)\000\000", "\000a\000\000", 0, 2);
n("\000(\000?\000i\000:\000A\000)\000\000", "\000b\000\000");
x2("\000(\000?\000i\000:\000[\000A\000-\000Z\000]\000)\000\000", "\000a\000\000", 0, 2);
x2("\000(\000?\000i\000:\000[\000f\000-\000m\000]\000)\000\000", "\000H\000\000", 0, 2);
x2("\000(\000?\000i\000:\000[\000f\000-\000m\000]\000)\000\000", "\000h\000\000", 0, 2);
n("\000(\000?\000i\000:\000[\000f\000-\000m\000]\000)\000\000", "\000e\000\000");
x2("\000(\000?\000i\000:\000[\000A\000-\000c\000]\000)\000\000", "\000D\000\000", 0, 2);
n("\000(\000?\000i\000:\000[\000^\000a\000-\000z\000]\000)\000\000", "\000A\000\000");
n("\000(\000?\000i\000:\000[\000^\000a\000-\000z\000]\000)\000\000", "\000a\000\000");
x2("\000(\000?\000i\000:\000[\000!\000-\000k\000]\000)\000\000", "\000Z\000\000", 0, 2);
x2("\000(\000?\000i\000:\000[\000!\000-\000k\000]\000)\000\000", "\0007\000\000", 0, 2);
x2("\000(\000?\000i\000:\000[\000T\000-\000}\000]\000)\000\000", "\000b\000\000", 0, 2);
x2("\000(\000?\000i\000:\000[\000T\000-\000}\000]\000)\000\000", "\000{\000\000", 0, 2);
x2("\000(\000?\000i\000:\000\134\000?\000a\000)\000\000", "\000?\000A\000\000", 0, 4);
x2("\000(\000?\000i\000:\000\134\000*\000A\000)\000\000", "\000*\000a\000\000", 0, 4);
n("\000.\000\000", "\000\012\000\000");
x2("\000(\000?\000m\000:\000.\000)\000\000", "\000\012\000\000", 0, 2);
x2("\000(\000?\000m\000:\000a\000.\000)\000\000", "\000a\000\012\000\000", 0, 4);
x2("\000(\000?\000m\000:\000.\000b\000)\000\000", "\000a\000\012\000b\000\000", 2, 6);
x2("\000.\000*\000a\000b\000c\000\000", "\000d\000d\000d\000a\000b\000d\000d\000\012\000d\000d\000a\000b\000c\000\000", 16, 26);
x2("\000(\000?\000m\000:\000.\000*\000a\000b\000c\000)\000\000", "\000d\000d\000d\000a\000b\000d\000d\000a\000b\000c\000\000", 0, 20);
n("\000(\000?\000i\000)\000(\000?\000-\000i\000)\000a\000\000", "\000A\000\000");
n("\000(\000?\000i\000)\000(\000?\000-\000i\000:\000a\000)\000\000", "\000A\000\000");
x2("\000a\000?\000\000", "\000\000", 0, 0);
x2("\000a\000?\000\000", "\000b\000\000", 0, 0);
x2("\000a\000?\000\000", "\000a\000\000", 0, 2);
x2("\000a\000*\000\000", "\000\000", 0, 0);
x2("\000a\000*\000\000", "\000a\000\000", 0, 2);
x2("\000a\000*\000\000", "\000a\000a\000a\000\000", 0, 6);
x2("\000a\000*\000\000", "\000b\000a\000a\000a\000a\000\000", 0, 0);
n("\000a\000+\000\000", "\000\000");
x2("\000a\000+\000\000", "\000a\000\000", 0, 2);
x2("\000a\000+\000\000", "\000a\000a\000a\000a\000\000", 0, 8);
x2("\000a\000+\000\000", "\000a\000a\000b\000b\000b\000\000", 0, 4);
x2("\000a\000+\000\000", "\000b\000a\000a\000a\000a\000\000", 2, 10);
x2("\000.\000?\000\000", "\000\000", 0, 0);
x2("\000.\000?\000\000", "\000f\000\000", 0, 2);
x2("\000.\000?\000\000", "\000\012\000\000", 0, 0);
x2("\000.\000*\000\000", "\000\000", 0, 0);
x2("\000.\000*\000\000", "\000a\000b\000c\000d\000e\000\000", 0, 10);
x2("\000.\000+\000\000", "\000z\000\000", 0, 2);
x2("\000.\000+\000\000", "\000z\000d\000s\000w\000e\000r\000\012\000\000", 0, 12);
x2("\000(\000.\000*\000)\000a\000\134\0001\000f\000\000", "\000b\000a\000b\000f\000b\000a\000c\000\000", 0, 8);
x2("\000(\000.\000*\000)\000a\000\134\0001\000f\000\000", "\000b\000a\000c\000b\000a\000b\000f\000\000", 6, 14);
x2("\000(\000(\000.\000*\000)\000a\000\134\0002\000f\000)\000\000", "\000b\000a\000c\000b\000a\000b\000f\000\000", 6, 14);
x2("\000(\000.\000*\000)\000a\000\134\0001\000f\000\000", "\000b\000a\000c\000z\000z\000z\000z\000z\000z\000\012\000b\000a\000z\000z\000\012\000z\000z\000z\000z\000b\000a\000b\000f\000\000", 38, 46);
x2("\000a\000|\000b\000\000", "\000a\000\000", 0, 2);
x2("\000a\000|\000b\000\000", "\000b\000\000", 0, 2);
x2("\000|\000a\000\000", "\000a\000\000", 0, 0);
x2("\000(\000|\000a\000)\000\000", "\000a\000\000", 0, 0);
x2("\000a\000b\000|\000b\000c\000\000", "\000a\000b\000\000", 0, 4);
x2("\000a\000b\000|\000b\000c\000\000", "\000b\000c\000\000", 0, 4);
x2("\000z\000(\000?\000:\000a\000b\000|\000b\000c\000)\000\000", "\000z\000b\000c\000\000", 0, 6);
x2("\000a\000(\000?\000:\000a\000b\000|\000b\000c\000)\000c\000\000", "\000a\000a\000b\000c\000\000", 0, 8);
x2("\000a\000b\000|\000(\000?\000:\000a\000c\000|\000a\000z\000)\000\000", "\000a\000z\000\000", 0, 4);
x2("\000a\000|\000b\000|\000c\000\000", "\000d\000c\000\000", 2, 4);
x2("\000a\000|\000b\000|\000c\000d\000|\000e\000f\000g\000|\000h\000|\000i\000j\000k\000|\000l\000m\000n\000|\000o\000|\000p\000q\000|\000r\000s\000t\000u\000v\000w\000x\000|\000y\000z\000\000", "\000p\000q\000r\000\000", 0, 4);
n("\000a\000|\000b\000|\000c\000d\000|\000e\000f\000g\000|\000h\000|\000i\000j\000k\000|\000l\000m\000n\000|\000o\000|\000p\000q\000|\000r\000s\000t\000u\000v\000w\000x\000|\000y\000z\000\000", "\000m\000n\000\000");
x2("\000a\000|\000^\000z\000\000", "\000b\000a\000\000", 2, 4);
x2("\000a\000|\000^\000z\000\000", "\000z\000a\000\000", 0, 2);
x2("\000a\000|\000\134\000G\000z\000\000", "\000b\000z\000a\000\000", 4, 6);
x2("\000a\000|\000\134\000G\000z\000\000", "\000z\000a\000\000", 0, 2);
x2("\000a\000|\000\134\000A\000z\000\000", "\000b\000z\000a\000\000", 4, 6);
x2("\000a\000|\000\134\000A\000z\000\000", "\000z\000a\000\000", 0, 2);
x2("\000a\000|\000b\000\134\000Z\000\000", "\000b\000a\000\000", 2, 4);
x2("\000a\000|\000b\000\134\000Z\000\000", "\000b\000\000", 0, 2);
x2("\000a\000|\000b\000\134\000z\000\000", "\000b\000a\000\000", 2, 4);
x2("\000a\000|\000b\000\134\000z\000\000", "\000b\000\000", 0, 2);
x2("\000\134\000w\000|\000\134\000s\000\000", "\000 \000\000", 0, 2);
n("\000\134\000w\000|\000\134\000w\000\000", "\000 \000\000");
x2("\000\134\000w\000|\000%\000\000", "\000%\000\000", 0, 2);
x2("\000\134\000w\000|\000[\000&\000$\000]\000\000", "\000&\000\000", 0, 2);
x2("\000[\000b\000-\000d\000]\000|\000[\000^\000e\000-\000z\000]\000\000", "\000a\000\000", 0, 2);
x2("\000(\000?\000:\000a\000|\000[\000c\000-\000f\000]\000)\000|\000b\000z\000\000", "\000d\000z\000\000", 0, 2);
x2("\000(\000?\000:\000a\000|\000[\000c\000-\000f\000]\000)\000|\000b\000z\000\000", "\000b\000z\000\000", 0, 4);
x2("\000a\000b\000c\000|\000(\000?\000=\000z\000z\000)\000.\000.\000f\000\000", "\000z\000z\000f\000\000", 0, 6);
x2("\000a\000b\000c\000|\000(\000?\000!\000z\000z\000)\000.\000.\000f\000\000", "\000a\000b\000f\000\000", 0, 6);
x2("\000(\000?\000=\000z\000a\000)\000.\000.\000a\000|\000(\000?\000=\000z\000z\000)\000.\000.\000a\000\000", "\000z\000z\000a\000\000", 0, 6);
n("\000(\000?\000>\000a\000|\000a\000b\000d\000)\000c\000\000", "\000a\000b\000d\000c\000\000");
x2("\000(\000?\000>\000a\000b\000d\000|\000a\000)\000c\000\000", "\000a\000b\000d\000c\000\000", 0, 8);
x2("\000a\000?\000|\000b\000\000", "\000a\000\000", 0, 2);
x2("\000a\000?\000|\000b\000\000", "\000b\000\000", 0, 0);
x2("\000a\000?\000|\000b\000\000", "\000\000", 0, 0);
x2("\000a\000*\000|\000b\000\000", "\000a\000a\000\000", 0, 4);
x2("\000a\000*\000|\000b\000*\000\000", "\000b\000a\000\000", 0, 0);
x2("\000a\000*\000|\000b\000*\000\000", "\000a\000b\000\000", 0, 2);
x2("\000a\000+\000|\000b\000*\000\000", "\000\000", 0, 0);
x2("\000a\000+\000|\000b\000*\000\000", "\000b\000b\000b\000\000", 0, 6);
x2("\000a\000+\000|\000b\000*\000\000", "\000a\000b\000b\000b\000\000", 0, 2);
n("\000a\000+\000|\000b\000+\000\000", "\000\000");
x2("\000(\000a\000|\000b\000)\000?\000\000", "\000b\000\000", 0, 2);
x2("\000(\000a\000|\000b\000)\000*\000\000", "\000b\000a\000\000", 0, 4);
x2("\000(\000a\000|\000b\000)\000+\000\000", "\000b\000a\000b\000\000", 0, 6);
x2("\000(\000a\000b\000|\000c\000a\000)\000+\000\000", "\000c\000a\000a\000b\000b\000c\000\000", 0, 8);
x2("\000(\000a\000b\000|\000c\000a\000)\000+\000\000", "\000a\000a\000b\000c\000a\000\000", 2, 10);
x2("\000(\000a\000b\000|\000c\000a\000)\000+\000\000", "\000a\000b\000z\000c\000a\000\000", 0, 4);
x2("\000(\000a\000|\000b\000a\000b\000)\000+\000\000", "\000a\000b\000a\000b\000a\000\000", 0, 10);
x2("\000(\000a\000|\000b\000a\000b\000)\000+\000\000", "\000b\000a\000\000", 2, 4);
x2("\000(\000a\000|\000b\000a\000b\000)\000+\000\000", "\000b\000a\000a\000a\000b\000a\000\000", 2, 8);
x2("\000(\000?\000:\000a\000|\000b\000)\000(\000?\000:\000a\000|\000b\000)\000\000", "\000a\000b\000\000", 0, 4);
x2("\000(\000?\000:\000a\000*\000|\000b\000*\000)\000(\000?\000:\000a\000*\000|\000b\000*\000)\000\000", "\000a\000a\000a\000b\000b\000b\000\000", 0, 6);
x2("\000(\000?\000:\000a\000*\000|\000b\000*\000)\000(\000?\000:\000a\000+\000|\000b\000+\000)\000\000", "\000a\000a\000a\000b\000b\000b\000\000", 0, 12);
x2("\000(\000?\000:\000a\000+\000|\000b\000+\000)\000{\0002\000}\000\000", "\000a\000a\000a\000b\000b\000b\000\000", 0, 12);
x2("\000h\000{\0000\000,\000}\000\000", "\000h\000h\000h\000h\000\000", 0, 8);
x2("\000(\000?\000:\000a\000+\000|\000b\000+\000)\000{\0001\000,\0002\000}\000\000", "\000a\000a\000a\000b\000b\000b\000\000", 0, 12);
n("\000a\000x\000{\0002\000}\000*\000a\000\000", "\0000\000a\000x\000x\000x\000a\0001\000\000");
n("\000a\000.\000{\0000\000,\0002\000}\000a\000\000", "\0000\000a\000X\000X\000X\000a\0000\000\000");
n("\000a\000.\000{\0000\000,\0002\000}\000?\000a\000\000", "\0000\000a\000X\000X\000X\000a\0000\000\000");
n("\000a\000.\000{\0000\000,\0002\000}\000?\000a\000\000", "\0000\000a\000X\000X\000X\000X\000a\0000\000\000");
x2("\000^\000a\000{\0002\000,\000}\000?\000a\000$\000\000", "\000a\000a\000a\000\000", 0, 6);
x2("\000^\000[\000a\000-\000z\000]\000{\0002\000,\000}\000?\000$\000\000", "\000a\000a\000a\000\000", 0, 6);
x2("\000(\000?\000:\000a\000+\000|\000\134\000A\000b\000*\000)\000c\000c\000\000", "\000c\000c\000\000", 0, 4);
n("\000(\000?\000:\000a\000+\000|\000\134\000A\000b\000*\000)\000c\000c\000\000", "\000a\000b\000c\000c\000\000");
x2("\000(\000?\000:\000^\000a\000+\000|\000b\000+\000)\000*\000c\000\000", "\000a\000a\000b\000b\000b\000a\000b\000c\000\000", 12, 16);
x2("\000(\000?\000:\000^\000a\000+\000|\000b\000+\000)\000*\000c\000\000", "\000a\000a\000b\000b\000b\000b\000c\000\000", 0, 14);
x2("\000a\000|\000(\000?\000i\000)\000c\000\000", "\000C\000\000", 0, 2);
x2("\000(\000?\000i\000)\000c\000|\000a\000\000", "\000C\000\000", 0, 2);
x2("\000(\000?\000i\000)\000c\000|\000a\000\000", "\000A\000\000", 0, 2);
x2("\000(\000?\000i\000:\000c\000)\000|\000a\000\000", "\000C\000\000", 0, 2);
n("\000(\000?\000i\000:\000c\000)\000|\000a\000\000", "\000A\000\000");
x2("\000[\000a\000b\000c\000]\000?\000\000", "\000a\000b\000c\000\000", 0, 2);
x2("\000[\000a\000b\000c\000]\000*\000\000", "\000a\000b\000c\000\000", 0, 6);
x2("\000[\000^\000a\000b\000c\000]\000*\000\000", "\000a\000b\000c\000\000", 0, 0);
n("\000[\000^\000a\000b\000c\000]\000+\000\000", "\000a\000b\000c\000\000");
x2("\000a\000?\000?\000\000", "\000a\000a\000a\000\000", 0, 0);
x2("\000b\000a\000?\000?\000b\000\000", "\000b\000a\000b\000\000", 0, 6);
x2("\000a\000*\000?\000\000", "\000a\000a\000a\000\000", 0, 0);
x2("\000b\000a\000*\000?\000\000", "\000b\000a\000a\000\000", 0, 2);
x2("\000b\000a\000*\000?\000b\000\000", "\000b\000a\000a\000b\000\000", 0, 8);
x2("\000a\000+\000?\000\000", "\000a\000a\000a\000\000", 0, 2);
x2("\000b\000a\000+\000?\000\000", "\000b\000a\000a\000\000", 0, 4);
x2("\000b\000a\000+\000?\000b\000\000", "\000b\000a\000a\000b\000\000", 0, 8);
x2("\000(\000?\000:\000a\000?\000)\000?\000?\000\000", "\000a\000\000", 0, 0);
x2("\000(\000?\000:\000a\000?\000?\000)\000?\000\000", "\000a\000\000", 0, 0);
x2("\000(\000?\000:\000a\000?\000)\000+\000?\000\000", "\000a\000a\000a\000\000", 0, 2);
x2("\000(\000?\000:\000a\000+\000)\000?\000?\000\000", "\000a\000a\000a\000\000", 0, 0);
x2("\000(\000?\000:\000a\000+\000)\000?\000?\000b\000\000", "\000a\000a\000a\000b\000\000", 0, 8);
x2("\000(\000?\000:\000a\000b\000)\000?\000{\0002\000}\000\000", "\000\000", 0, 0);
x2("\000(\000?\000:\000a\000b\000)\000?\000{\0002\000}\000\000", "\000a\000b\000a\000b\000a\000\000", 0, 8);
x2("\000(\000?\000:\000a\000b\000)\000*\000{\0000\000}\000\000", "\000a\000b\000a\000b\000a\000\000", 0, 0);
x2("\000(\000?\000:\000a\000b\000)\000{\0003\000,\000}\000\000", "\000a\000b\000a\000b\000a\000b\000a\000b\000\000", 0, 16);
n("\000(\000?\000:\000a\000b\000)\000{\0003\000,\000}\000\000", "\000a\000b\000a\000b\000\000");
x2("\000(\000?\000:\000a\000b\000)\000{\0002\000,\0004\000}\000\000", "\000a\000b\000a\000b\000a\000b\000\000", 0, 12);
x2("\000(\000?\000:\000a\000b\000)\000{\0002\000,\0004\000}\000\000", "\000a\000b\000a\000b\000a\000b\000a\000b\000a\000b\000\000", 0, 16);
x2("\000(\000?\000:\000a\000b\000)\000{\0002\000,\0004\000}\000?\000\000", "\000a\000b\000a\000b\000a\000b\000a\000b\000a\000b\000\000", 0, 8);
x2("\000(\000?\000:\000a\000b\000)\000{\000,\000}\000\000", "\000a\000b\000{\000,\000}\000\000", 0, 10);
x2("\000(\000?\000:\000a\000b\000c\000)\000+\000?\000{\0002\000}\000\000", "\000a\000b\000c\000a\000b\000c\000a\000b\000c\000\000", 0, 12);
x2("\000(\000?\000:\000X\000*\000)\000(\000?\000i\000:\000x\000a\000)\000\000", "\000X\000X\000X\000a\000\000", 0, 8);
x2("\000(\000d\000+\000)\000(\000[\000^\000a\000b\000c\000]\000z\000)\000\000", "\000d\000d\000d\000z\000\000", 0, 8);
x2("\000(\000[\000^\000a\000b\000c\000]\000*\000)\000(\000[\000^\000a\000b\000c\000]\000z\000)\000\000", "\000d\000d\000d\000z\000\000", 0, 8);
x2("\000(\000\134\000w\000+\000)\000(\000\134\000w\000z\000)\000\000", "\000d\000d\000d\000z\000\000", 0, 8);
x3("\000(\000a\000)\000\000", "\000a\000\000", 0, 2, 1);
x3("\000(\000a\000b\000)\000\000", "\000a\000b\000\000", 0, 4, 1);
x2("\000(\000(\000a\000b\000)\000)\000\000", "\000a\000b\000\000", 0, 4);
x3("\000(\000(\000a\000b\000)\000)\000\000", "\000a\000b\000\000", 0, 4, 1);
x3("\000(\000(\000a\000b\000)\000)\000\000", "\000a\000b\000\000", 0, 4, 2);
x3("\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000a\000b\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000\000", "\000a\000b\000\000", 0, 4, 20);
x3("\000(\000a\000b\000)\000(\000c\000d\000)\000\000", "\000a\000b\000c\000d\000\000", 0, 4, 1);
x3("\000(\000a\000b\000)\000(\000c\000d\000)\000\000", "\000a\000b\000c\000d\000\000", 4, 8, 2);
x3("\000(\000)\000(\000a\000)\000b\000c\000(\000d\000e\000f\000)\000g\000h\000i\000j\000k\000\000", "\000a\000b\000c\000d\000e\000f\000g\000h\000i\000j\000k\000\000", 6, 12, 3);
x3("\000(\000(\000)\000(\000a\000)\000b\000c\000(\000d\000e\000f\000)\000g\000h\000i\000j\000k\000)\000\000", "\000a\000b\000c\000d\000e\000f\000g\000h\000i\000j\000k\000\000", 6, 12, 4);
x2("\000(\000^\000a\000)\000\000", "\000a\000\000", 0, 2);
x3("\000(\000a\000)\000|\000(\000a\000)\000\000", "\000b\000a\000\000", 2, 4, 1);
x3("\000(\000^\000a\000)\000|\000(\000a\000)\000\000", "\000b\000a\000\000", 2, 4, 2);
x3("\000(\000a\000?\000)\000\000", "\000a\000a\000a\000\000", 0, 2, 1);
x3("\000(\000a\000*\000)\000\000", "\000a\000a\000a\000\000", 0, 6, 1);
x3("\000(\000a\000*\000)\000\000", "\000\000", 0, 0, 1);
x3("\000(\000a\000+\000)\000\000", "\000a\000a\000a\000a\000a\000a\000a\000\000", 0, 14, 1);
x3("\000(\000a\000+\000|\000b\000*\000)\000\000", "\000b\000b\000b\000a\000a\000\000", 0, 6, 1);
x3("\000(\000a\000+\000|\000b\000?\000)\000\000", "\000b\000b\000b\000a\000a\000\000", 0, 2, 1);
x3("\000(\000a\000b\000c\000)\000?\000\000", "\000a\000b\000c\000\000", 0, 6, 1);
x3("\000(\000a\000b\000c\000)\000*\000\000", "\000a\000b\000c\000\000", 0, 6, 1);
x3("\000(\000a\000b\000c\000)\000+\000\000", "\000a\000b\000c\000\000", 0, 6, 1);
x3("\000(\000x\000y\000z\000|\000a\000b\000c\000)\000+\000\000", "\000a\000b\000c\000\000", 0, 6, 1);
x3("\000(\000[\000x\000y\000z\000]\000[\000a\000b\000c\000]\000|\000a\000b\000c\000)\000+\000\000", "\000a\000b\000c\000\000", 0, 6, 1);
x3("\000(\000(\000?\000i\000:\000a\000b\000c\000)\000)\000\000", "\000A\000b\000C\000\000", 0, 6, 1);
x2("\000(\000a\000b\000c\000)\000(\000?\000i\000:\000\134\0001\000)\000\000", "\000a\000b\000c\000A\000B\000C\000\000", 0, 12);
x3("\000(\000(\000?\000m\000:\000a\000.\000c\000)\000)\000\000", "\000a\000\012\000c\000\000", 0, 6, 1);
x3("\000(\000(\000?\000=\000a\000z\000)\000a\000)\000\000", "\000a\000z\000b\000\000", 0, 2, 1);
x3("\000a\000b\000c\000|\000(\000.\000a\000b\000d\000)\000\000", "\000z\000a\000b\000d\000\000", 0, 8, 1);
x2("\000(\000?\000:\000a\000b\000c\000)\000|\000(\000A\000B\000C\000)\000\000", "\000a\000b\000c\000\000", 0, 6);
x3("\000(\000?\000i\000:\000(\000a\000b\000c\000)\000)\000|\000(\000z\000z\000z\000)\000\000", "\000A\000B\000C\000\000", 0, 6, 1);
x3("\000a\000*\000(\000.\000)\000\000", "\000a\000a\000a\000a\000z\000\000", 8, 10, 1);
x3("\000a\000*\000?\000(\000.\000)\000\000", "\000a\000a\000a\000a\000z\000\000", 0, 2, 1);
x3("\000a\000*\000?\000(\000c\000)\000\000", "\000a\000a\000a\000a\000c\000\000", 8, 10, 1);
x3("\000[\000b\000c\000d\000]\000a\000*\000(\000.\000)\000\000", "\000c\000a\000a\000a\000a\000z\000\000", 10, 12, 1);
x3("\000(\000\134\000A\000b\000b\000)\000c\000c\000\000", "\000b\000b\000c\000c\000\000", 0, 4, 1);
n("\000(\000\134\000A\000b\000b\000)\000c\000c\000\000", "\000z\000b\000b\000c\000c\000\000");
x3("\000(\000^\000b\000b\000)\000c\000c\000\000", "\000b\000b\000c\000c\000\000", 0, 4, 1);
n("\000(\000^\000b\000b\000)\000c\000c\000\000", "\000z\000b\000b\000c\000c\000\000");
x3("\000c\000c\000(\000b\000b\000$\000)\000\000", "\000c\000c\000b\000b\000\000", 4, 8, 1);
n("\000c\000c\000(\000b\000b\000$\000)\000\000", "\000c\000c\000b\000b\000b\000\000");
n("\000(\000\134\0001\000)\000\000", "\000\000");
n("\000\134\0001\000(\000a\000)\000\000", "\000a\000a\000\000");
n("\000(\000a\000(\000b\000)\000\134\0001\000)\000\134\0002\000+\000\000", "\000a\000b\000a\000b\000b\000\000");
n("\000(\000?\000:\000(\000?\000:\000\134\0001\000|\000z\000)\000(\000a\000)\000)\000+\000$\000\000", "\000z\000a\000a\000\000");
x2("\000(\000?\000:\000(\000?\000:\000\134\0001\000|\000z\000)\000(\000a\000)\000)\000+\000$\000\000", "\000z\000a\000a\000a\000\000", 0, 8);
x2("\000(\000a\000)\000(\000?\000=\000\134\0001\000)\000\000", "\000a\000a\000\000", 0, 2);
n("\000(\000a\000)\000$\000|\000\134\0001\000\000", "\000a\000z\000\000");
x2("\000(\000a\000)\000\134\0001\000\000", "\000a\000a\000\000", 0, 4);
n("\000(\000a\000)\000\134\0001\000\000", "\000a\000b\000\000");
x2("\000(\000a\000?\000)\000\134\0001\000\000", "\000a\000a\000\000", 0, 4);
x2("\000(\000a\000?\000?\000)\000\134\0001\000\000", "\000a\000a\000\000", 0, 0);
x2("\000(\000a\000*\000)\000\134\0001\000\000", "\000a\000a\000a\000a\000a\000\000", 0, 8);
x3("\000(\000a\000*\000)\000\134\0001\000\000", "\000a\000a\000a\000a\000a\000\000", 0, 4, 1);
x2("\000a\000(\000b\000*\000)\000\134\0001\000\000", "\000a\000b\000b\000b\000b\000\000", 0, 10);
x2("\000a\000(\000b\000*\000)\000\134\0001\000\000", "\000a\000b\000\000", 0, 2);
x2("\000(\000a\000*\000)\000(\000b\000*\000)\000\134\0001\000\134\0002\000\000", "\000a\000a\000a\000b\000b\000a\000a\000a\000b\000b\000\000", 0, 20);
x2("\000(\000a\000*\000)\000(\000b\000*\000)\000\134\0002\000\000", "\000a\000a\000a\000b\000b\000b\000b\000\000", 0, 14);
x2("\000(\000(\000(\000(\000(\000(\000(\000a\000*\000)\000b\000)\000)\000)\000)\000)\000)\000c\000\134\0007\000\000", "\000a\000a\000a\000b\000c\000a\000a\000a\000\000", 0, 16);
x3("\000(\000(\000(\000(\000(\000(\000(\000a\000*\000)\000b\000)\000)\000)\000)\000)\000)\000c\000\134\0007\000\000", "\000a\000a\000a\000b\000c\000a\000a\000a\000\000", 0, 6, 7);
x2("\000(\000a\000)\000(\000b\000)\000(\000c\000)\000\134\0002\000\134\0001\000\134\0003\000\000", "\000a\000b\000c\000b\000a\000c\000\000", 0, 12);
x2("\000(\000[\000a\000-\000d\000]\000)\000\134\0001\000\000", "\000c\000c\000\000", 0, 4);
x2("\000(\000\134\000w\000\134\000d\000\134\000s\000)\000\134\0001\000\000", "\000f\0005\000 \000f\0005\000 \000\000", 0, 12);
n("\000(\000\134\000w\000\134\000d\000\134\000s\000)\000\134\0001\000\000", "\000f\0005\000 \000f\0005\000\000");
x2("\000(\000w\000h\000o\000|\000[\000a\000-\000c\000]\000{\0003\000}\000)\000\134\0001\000\000", "\000w\000h\000o\000w\000h\000o\000\000", 0, 12);
x2("\000.\000.\000.\000(\000w\000h\000o\000|\000[\000a\000-\000c\000]\000{\0003\000}\000)\000\134\0001\000\000", "\000a\000b\000c\000w\000h\000o\000w\000h\000o\000\000", 0, 18);
x2("\000(\000w\000h\000o\000|\000[\000a\000-\000c\000]\000{\0003\000}\000)\000\134\0001\000\000", "\000c\000b\000c\000c\000b\000c\000\000", 0, 12);
x2("\000(\000^\000a\000)\000\134\0001\000\000", "\000a\000a\000\000", 0, 4);
n("\000(\000^\000a\000)\000\134\0001\000\000", "\000b\000a\000a\000\000");
n("\000(\000a\000$\000)\000\134\0001\000\000", "\000a\000a\000\000");
n("\000(\000a\000b\000\134\000Z\000)\000\134\0001\000\000", "\000a\000b\000\000");
x2("\000(\000a\000*\000\134\000Z\000)\000\134\0001\000\000", "\000a\000\000", 2, 2);
x2("\000.\000(\000a\000*\000\134\000Z\000)\000\134\0001\000\000", "\000b\000a\000\000", 2, 4);
x3("\000(\000.\000(\000a\000b\000c\000)\000\134\0002\000)\000\000", "\000z\000a\000b\000c\000a\000b\000c\000\000", 0, 14, 1);
x3("\000(\000.\000(\000.\000.\000\134\000d\000.\000)\000\134\0002\000)\000\000", "\000z\0001\0002\0003\0004\0001\0002\0003\0004\000\000", 0, 18, 1);
x2("\000(\000(\000?\000i\000:\000a\000z\000)\000)\000\134\0001\000\000", "\000A\000z\000A\000z\000\000", 0, 8);
n("\000(\000(\000?\000i\000:\000a\000z\000)\000)\000\134\0001\000\000", "\000A\000z\000a\000z\000\000");
x2("\000(\000?\000<\000=\000a\000)\000b\000\000", "\000a\000b\000\000", 2, 4);
n("\000(\000?\000<\000=\000a\000)\000b\000\000", "\000b\000b\000\000");
x2("\000(\000?\000<\000=\000a\000|\000b\000)\000b\000\000", "\000b\000b\000\000", 2, 4);
x2("\000(\000?\000<\000=\000a\000|\000b\000c\000)\000b\000\000", "\000b\000c\000b\000\000", 4, 6);
x2("\000(\000?\000<\000=\000a\000|\000b\000c\000)\000b\000\000", "\000a\000b\000\000", 2, 4);
x2("\000(\000?\000<\000=\000a\000|\000b\000c\000|\000|\000d\000e\000f\000g\000h\000i\000j\000|\000k\000l\000m\000n\000o\000p\000q\000|\000r\000)\000z\000\000", "\000r\000z\000\000", 2, 4);
x2("\000(\000a\000)\000\134\000g\000<\0001\000>\000\000", "\000a\000a\000\000", 0, 4);
x2("\000(\000?\000<\000!\000a\000)\000b\000\000", "\000c\000b\000\000", 2, 4);
n("\000(\000?\000<\000!\000a\000)\000b\000\000", "\000a\000b\000\000");
x2("\000(\000?\000<\000!\000a\000|\000b\000c\000)\000b\000\000", "\000b\000b\000b\000\000", 0, 2);
n("\000(\000?\000<\000!\000a\000|\000b\000c\000)\000z\000\000", "\000b\000c\000z\000\000");
x2("\000(\000?\000<\000n\000a\000m\000e\0001\000>\000a\000)\000\000", "\000a\000\000", 0, 2);
x2("\000(\000?\000<\000n\000a\000m\000e\000_\0002\000>\000a\000b\000)\000\134\000g\000<\000n\000a\000m\000e\000_\0002\000>\000\000", "\000a\000b\000a\000b\000\000", 0, 8);
x2("\000(\000?\000<\000n\000a\000m\000e\000_\0003\000>\000.\000z\000v\000.\000)\000\134\000k\000<\000n\000a\000m\000e\000_\0003\000>\000\000", "\000a\000z\000v\000b\000a\000z\000v\000b\000\000", 0, 16);
x2("\000(\000?\000<\000=\000\134\000g\000<\000a\000b\000>\000)\000|\000-\000\134\000z\000E\000N\000D\000 \000(\000?\000<\000a\000b\000>\000X\000y\000Z\000)\000\000", "\000X\000y\000Z\000\000", 6, 6);
x2("\000(\000?\000<\000n\000>\000|\000a\000\134\000g\000<\000n\000>\000)\000+\000\000", "\000\000", 0, 0);
x2("\000(\000?\000<\000n\000>\000|\000\134\000(\000\134\000g\000<\000n\000>\000\134\000)\000)\000+\000$\000\000", "\000(\000)\000(\000(\000)\000)\000\000", 0, 12);
x3("\000\134\000g\000<\000n\000>\000(\000?\000<\000n\000>\000.\000)\000{\0000\000}\000\000", "\000X\000\000", 0, 2, 1);
x2("\000\134\000g\000<\000n\000>\000(\000a\000b\000c\000|\000d\000f\000(\000?\000<\000n\000>\000.\000Y\000Z\000)\000{\0002\000,\0008\000}\000)\000{\0000\000}\000\000", "\000X\000Y\000Z\000\000", 0, 6);
x2("\000\134\000A\000(\000?\000<\000n\000>\000(\000a\000\134\000g\000<\000n\000>\000)\000|\000)\000\134\000z\000\000", "\000a\000a\000a\000a\000\000", 0, 8);
x2("\000(\000?\000<\000n\000>\000|\000\134\000g\000<\000m\000>\000\134\000g\000<\000n\000>\000)\000\134\000z\000|\000\134\000z\000E\000N\000D\000 \000(\000?\000<\000m\000>\000a\000|\000(\000b\000)\000\134\000g\000<\000m\000>\000)\000\000", "\000b\000b\000b\000b\000a\000b\000b\000a\000\000", 0, 16);
x2("\000(\000?\000<\000n\000a\000m\000e\0001\0002\0004\0000\000>\000\134\000w\000+\000\134\000s\000x\000)\000a\000+\000\134\000k\000<\000n\000a\000m\000e\0001\0002\0004\0000\000>\000\000", "\000 \000 \000f\000g\000 \000x\000a\000a\000a\000a\000a\000a\000a\000a\000f\000g\000 \000x\000\000", 4, 36);
x3("\000(\000z\000)\000(\000)\000(\000)\000(\000?\000<\000_\0009\000>\000a\000)\000\134\000g\000<\000_\0009\000>\000\000", "\000z\000a\000a\000\000", 4, 6, 1);
x2("\000(\000.\000)\000(\000(\000(\000?\000<\000_\000>\000a\000)\000)\000)\000\134\000k\000<\000_\000>\000\000", "\000z\000a\000a\000\000", 0, 6);
x2("\000(\000(\000?\000<\000n\000a\000m\000e\0001\000>\000\134\000d\000)\000|\000(\000?\000<\000n\000a\000m\000e\0002\000>\000\134\000w\000)\000)\000(\000\134\000k\000<\000n\000a\000m\000e\0001\000>\000|\000\134\000k\000<\000n\000a\000m\000e\0002\000>\000)\000\000", "\000f\000f\000\000", 0, 4);
x2("\000(\000?\000:\000(\000?\000<\000x\000>\000)\000|\000(\000?\000<\000x\000>\000e\000f\000g\000)\000)\000\134\000k\000<\000x\000>\000\000", "\000\000", 0, 0);
x2("\000(\000?\000:\000(\000?\000<\000x\000>\000a\000b\000c\000)\000|\000(\000?\000<\000x\000>\000e\000f\000g\000)\000)\000\134\000k\000<\000x\000>\000\000", "\000a\000b\000c\000e\000f\000g\000e\000f\000g\000\000", 6, 18);
n("\000(\000?\000:\000(\000?\000<\000x\000>\000a\000b\000c\000)\000|\000(\000?\000<\000x\000>\000e\000f\000g\000)\000)\000\134\000k\000<\000x\000>\000\000", "\000a\000b\000c\000e\000f\000g\000\000");
x2("\000(\000?\000:\000(\000?\000<\000n\0001\000>\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000)\000\134\000k\000<\000n\0001\000>\000$\000\000", "\000a\000-\000p\000y\000u\000m\000p\000y\000u\000m\000\000", 4, 20);
x3("\000(\000?\000:\000(\000?\000<\000n\0001\000>\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000)\000\134\000k\000<\000n\0001\000>\000$\000\000", "\000x\000x\000x\000x\000a\000b\000c\000d\000e\000f\000g\000h\000i\000j\000k\000l\000m\000n\000a\000b\000c\000d\000e\000f\000g\000h\000i\000j\000k\000l\000m\000n\000\000", 8, 36, 14);
x3("\000(\000?\000<\000n\000a\000m\000e\0001\000>\000)\000(\000?\000<\000n\000a\000m\000e\0002\000>\000)\000(\000?\000<\000n\000a\000m\000e\0003\000>\000)\000(\000?\000<\000n\000a\000m\000e\0004\000>\000)\000(\000?\000<\000n\000a\000m\000e\0005\000>\000)\000(\000?\000<\000n\000a\000m\000e\0006\000>\000)\000(\000?\000<\000n\000a\000m\000e\0007\000>\000)\000(\000?\000<\000n\000a\000m\000e\0008\000>\000)\000(\000?\000<\000n\000a\000m\000e\0009\000>\000)\000(\000?\000<\000n\000a\000m\000e\0001\0000\000>\000)\000(\000?\000<\000n\000a\000m\000e\0001\0001\000>\000)\000(\000?\000<\000n\000a\000m\000e\0001\0002\000>\000)\000(\000?\000<\000n\000a\000m\000e\0001\0003\000>\000)\000(\000?\000<\000n\000a\000m\000e\0001\0004\000>\000)\000(\000?\000<\000n\000a\000m\000e\0001\0005\000>\000)\000(\000?\000<\000n\000a\000m\000e\0001\0006\000>\000a\000a\000a\000)\000(\000?\000<\000n\000a\000m\000e\0001\0007\000>\000)\000$\000\000", "\000a\000a\000a\000\000", 0, 6, 16);
x2("\000(\000?\000<\000f\000o\000o\000>\000a\000|\000\134\000(\000\134\000g\000<\000f\000o\000o\000>\000\134\000)\000)\000\000", "\000a\000\000", 0, 2);
x2("\000(\000?\000<\000f\000o\000o\000>\000a\000|\000\134\000(\000\134\000g\000<\000f\000o\000o\000>\000\134\000)\000)\000\000", "\000(\000(\000(\000(\000(\000(\000a\000)\000)\000)\000)\000)\000)\000\000", 0, 26);
x3("\000(\000?\000<\000f\000o\000o\000>\000a\000|\000\134\000(\000\134\000g\000<\000f\000o\000o\000>\000\134\000)\000)\000\000", "\000(\000(\000(\000(\000(\000(\000(\000(\000a\000)\000)\000)\000)\000)\000)\000)\000)\000\000", 0, 34, 1);
x2("\000\134\000g\000<\000b\000a\000r\000>\000|\000\134\000z\000E\000N\000D\000(\000?\000<\000b\000a\000r\000>\000.\000*\000a\000b\000c\000$\000)\000\000", "\000a\000b\000c\000x\000x\000x\000a\000b\000c\000\000", 0, 18);
x2("\000\134\000g\000<\0001\000>\000|\000\134\000z\000E\000N\000D\000(\000.\000a\000.\000)\000\000", "\000b\000a\000c\000\000", 0, 6);
x3("\000\134\000g\000<\000_\000A\000>\000\134\000g\000<\000_\000A\000>\000|\000\134\000z\000E\000N\000D\000(\000.\000a\000.\000)\000(\000?\000<\000_\000A\000>\000.\000b\000.\000)\000\000", "\000x\000b\000x\000y\000b\000y\000\000", 6, 12, 1);
x2("\000\134\000A\000(\000?\000:\000\134\000g\000<\000p\000o\000n\000>\000|\000\134\000g\000<\000p\000a\000n\000>\000|\000\134\000z\000E\000N\000D\000 \000 \000(\000?\000<\000p\000a\000n\000>\000a\000|\000c\000\134\000g\000<\000p\000o\000n\000>\000c\000)\000(\000?\000<\000p\000o\000n\000>\000b\000|\000d\000\134\000g\000<\000p\000a\000n\000>\000d\000)\000)\000$\000\000", "\000c\000d\000c\000b\000c\000d\000c\000\000", 0, 14);
x2("\000\134\000A\000(\000?\000<\000n\000>\000|\000a\000\134\000g\000<\000m\000>\000)\000\134\000z\000|\000\134\000z\000E\000N\000D\000 \000(\000?\000<\000m\000>\000\134\000g\000<\000n\000>\000)\000\000", "\000a\000a\000a\000a\000\000", 0, 8);
x2("\000(\000?\000<\000n\000>\000(\000a\000|\000b\000\134\000g\000<\000n\000>\000c\000)\000{\0003\000,\0005\000}\000)\000\000", "\000b\000a\000a\000a\000a\000c\000a\000\000", 2, 10);
x2("\000(\000?\000<\000n\000>\000(\000a\000|\000b\000\134\000g\000<\000n\000>\000c\000)\000{\0003\000,\0005\000}\000)\000\000", "\000b\000a\000a\000a\000a\000c\000a\000a\000a\000a\000a\000\000", 0, 20);
x2("\000(\000?\000<\000p\000a\000r\000e\000>\000\134\000(\000(\000[\000^\000\134\000(\000\134\000)\000]\000+\000+\000|\000\134\000g\000<\000p\000a\000r\000e\000>\000)\000*\000+\000\134\000)\000)\000\000", "\000(\000(\000a\000)\000)\000\000", 0, 10);
x2("\000(\000)\000*\000\134\0001\000\000", "\000\000", 0, 0);
x2("\000(\000?\000:\000(\000)\000|\000(\000)\000)\000*\000\134\0001\000\134\0002\000\000", "\000\000", 0, 0);
x3("\000(\000?\000:\000\134\0001\000a\000|\000(\000)\000)\000*\000\000", "\000a\000\000", 0, 0, 1);
x2("\000x\000(\000(\000.\000)\000*\000)\000*\000x\000\000", "\0000\000x\0001\000x\0002\000x\0003\000\000", 2, 12);
x2("\000x\000(\000(\000.\000)\000*\000)\000*\000x\000(\000?\000i\000:\000\134\0001\000)\000\134\000Z\000\000", "\0000\000x\0001\000x\0002\000x\0001\000X\0002\000\000", 2, 18);
x2("\000(\000?\000:\000(\000)\000|\000(\000)\000|\000(\000)\000|\000(\000)\000|\000(\000)\000|\000(\000)\000)\000*\000\134\0002\000\134\0005\000\000", "\000\000", 0, 0);
x2("\000(\000?\000:\000(\000)\000|\000(\000)\000|\000(\000)\000|\000(\000x\000)\000|\000(\000)\000|\000(\000)\000)\000*\000\134\0002\000b\000\134\0005\000\000", "\000b\000\000", 0, 2);
x2("\217\372\000\000", "\217\372\000\000", 0, 2);
x2("\000\000", "0B\000\000", 0, 0);
x2("0B\000\000", "0B\000\000", 0, 2);
n("0D\000\000", "0B\000\000");
x2("0F0F\000\000", "0F0F\000\000", 0, 4);
x2("0B0D0F\000\000", "0B0D0F\000\000", 0, 6);
x2("0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S\000\000", "0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S\000\000", 0, 70);
x2("0B\000\000", "0D0B\000\000", 2, 4);
x2("0D0F\000\000", "0B0D0F\000\000", 2, 6);
x2("e\207\000\000", "e\207\000\000", 0, 2);
x2("\000.\000\000", "0B\000\000", 0, 2);
x2("\000.\000.\000\000", "0K0M\000\000", 0, 4);
x2("\000\134\000w\000\000", "0J\000\000", 0, 2);
n("\000\134\000W\000\000", "0B\000\000");
x2("\000[\000\134\000W\000]\000\000", "0F\000$\000\000", 2, 4);
x2("\000\134\000S\000\000", "0]\000\000", 0, 2);
x2("\000\134\000S\000\000", "o\042\000\000", 0, 2);
x2("\000\134\000b\000\000", "l\027\000 \000\000", 0, 0);
x2("\000\134\000b\000\000", "\000 0{\000\000", 2, 2);
x2("\000\134\000B\000\000", "0[0]\000 \000\000", 2, 2);
x2("\000\134\000B\000\000", "0F\000 \000\000", 4, 4);
x2("\000\134\000B\000\000", "\000 0D\000\000", 0, 0);
x2("\000[0_0a\000]\000\000", "0a\000\000", 0, 2);
n("\000[0j0k\000]\000\000", "0l\000\000");
x2("\000[0F\000-0J\000]\000\000", "0H\000\000", 0, 2);
n("\000[\000^0Q\000]\000\000", "0Q\000\000");
x2("\000[\000\134\000w\000]\000\000", "0m\000\000", 0, 2);
n("\000[\000\134\000d\000]\000\000", "0u\000\000");
x2("\000[\000\134\000D\000]\000\000", "0o\000\000", 0, 2);
n("\000[\000\134\000s\000]\000\000", "0O\000\000");
x2("\000[\000\134\000S\000]\000\000", "0x\000\000", 0, 2);
x2("\000[\000\134\000w\000\134\000d\000]\000\000", "0\210\000\000", 0, 2);
x2("\000[\000\134\000w\000\134\000d\000]\000\000", "\000 \000 \000 0\210\000\000", 6, 8);
n("\000\134\000w\233<\216\312\000\000", "\000 \233<\216\312\000\000");
x2("\233<\000\134\000W\216\312\000\000", "\233<\000 \216\312\000\000", 0, 6);
x2("0B\000.0D\000.0F\000\000", "0B0B0D0D0F\000\000", 0, 10);
x2("\000.\000\134\000w0F\000\134\000W\000.\000.0^\000\000", "0H0F0F\000 0F0^0^\000\000", 0, 14);
x2("\000\134\000s\000\134\000w0S0S0S\000\000", "\000 0S0S0S0S\000\000", 0, 10);
x2("0B0B\000.0Q\000\000", "0B0B0Q0Q\000\000", 0, 8);
n("\000.0D\000\000", "0D0H\000\000");
x2("\000.0J\000\000", "0J0J\000\000", 0, 4);
x2("\000^0B\000\000", "0B\000\000", 0, 2);
x2("\000^0\200\000$\000\000", "0\200\000\000", 0, 2);
x2("\000^\000\134\000w\000$\000\000", "0k\000\000", 0, 2);
x2("\000^\000\134\000w0K0M0O0Q0S\000$\000\000", "\000z0K0M0O0Q0S\000\000", 0, 12);
x2("\000^\000\134\000w\000.\000.\000.0F0H0J\000$\000\000", "\000z0B0D0F0F0H0J\000\000", 0, 14);
x2("\000\134\000w\000\134\000w\000\134\000s\000\134\000W0J0J0J\000\134\000d\000\000", "\000a0J\000 \000 0J0J0J\0004\000\000", 0, 16);
x2("\000\134\000A0_0a0d\000\000", "0_0a0d\000\000", 0, 6);
x2("0\2000\2010\202\000\134\000Z\000\000", "0\2000\2010\202\000\000", 0, 6);
x2("0K0M0O\000\134\000z\000\000", "0K0M0O\000\000", 0, 6);
x2("0K0M0O\000\134\000Z\000\000", "0K0M0O\000\012\000\000", 0, 6);
x2("\000\134\000G0}0t\000\000", "0}0t\000\000", 0, 4);
n("\000\134\000G0H\000\000", "0F0H0J\000\000");
n("0h0f\000\134\000G\000\000", "0h0f\000\000");
n("0~0\177\000\134\000A\000\000", "0~0\177\000\000");
n("0~\000\134\000A0\177\000\000", "0~0\177\000\000");
x2("\000(\000?\000=0[\000)0[\000\000", "0[\000\000", 0, 2);
n("\000(\000?\000=0F\000)\000.\000\000", "0D\000\000");
x2("\000(\000?\000!0F\000)0K\000\000", "0K\000\000", 0, 2);
n("\000(\000?\000!0h\000)0B\000\000", "0h\000\000");
x2("\000(\000?\000i\000:0B\000)\000\000", "0B\000\000", 0, 2);
x2("\000(\000?\000i\000:0v0y\000)\000\000", "0v0y\000\000", 0, 4);
n("\000(\000?\000i\000:0D\000)\000\000", "0F\000\000");
x2("\000(\000?\000m\000:0\210\000.\000)\000\000", "0\210\000\012\000\000", 0, 4);
x2("\000(\000?\000m\000:\000.0\201\000)\000\000", "0~\000\0120\201\000\000", 2, 6);
x2("0B\000?\000\000", "\000\000", 0, 0);
x2("Y\011\000?\000\000", "S\026\000\000", 0, 0);
x2("Y\011\000?\000\000", "Y\011\000\000", 0, 2);
x2("\221\317\000*\000\000", "\000\000", 0, 0);
x2("\221\317\000*\000\000", "\221\317\000\000", 0, 2);
x2("[P\000*\000\000", "[P[P[P\000\000", 0, 6);
x2("\231\254\000*\000\000", "\236\177\231\254\231\254\231\254\231\254\000\000", 0, 0);
n("\134q\000+\000\000", "\000\000");
x2("l\263\000+\000\000", "l\263\000\000", 0, 2);
x2("fB\000+\000\000", "fBfBfBfB\000\000", 0, 8);
x2("0H\000+\000\000", "0H0H0F0F0F\000\000", 0, 4);
x2("0F\000+\000\000", "0J0F0F0F0F\000\000", 2, 10);
x2("\000.\000?\000\000", "0_\000\000", 0, 2);
x2("\000.\000*\000\000", "0q0t0w0z\000\000", 0, 8);
x2("\000.\000+\000\000", "0\215\000\000", 0, 2);
x2("\000.\000+\000\000", "0D0F0H0K\000\012\000\000", 0, 8);
x2("0B\000|0D\000\000", "0B\000\000", 0, 2);
x2("0B\000|0D\000\000", "0D\000\000", 0, 2);
x2("0B0D\000|0D0F\000\000", "0B0D\000\000", 0, 4);
x2("0B0D\000|0D0F\000\000", "0D0F\000\000", 0, 4);
x2("0\222\000(\000?\000:0K0M\000|0M0O\000)\000\000", "0\2220K0M\000\000", 0, 6);
x2("0\222\000(\000?\000:0K0M\000|0M0O\000)0Q\000\000", "0\2220M0O0Q\000\000", 0, 8);
x2("0B0D\000|\000(\000?\000:0B0F\000|0B0\222\000)\000\000", "0B0\222\000\000", 0, 4);
x2("0B\000|0D\000|0F\000\000", "0H0F\000\000", 2, 4);
x2("0B\000|0D\000|0F0H\000|0J0K0M\000|0O\000|0Q0S0U\000|0W0Y0[\000|0]\000|0_0a\000|0d0f0h0j0k\000|0l0m\000\000", "0W0Y0[\000\000", 0, 6);
n("0B\000|0D\000|0F0H\000|0J0K0M\000|0O\000|0Q0S0U\000|0W0Y0[\000|0]\000|0_0a\000|0d0f0h0j0k\000|0l0m\000\000", "0Y0[\000\000");
x2("0B\000|\000^0\217\000\000", "0v0B\000\000", 2, 4);
x2("0B\000|\000^0\222\000\000", "0\2220B\000\000", 0, 2);
x2("\233<\000|\000\134\000G\216\312\000\000", "0Q\216\312\233<\000\000", 4, 6);
x2("\233<\000|\000\134\000G\216\312\000\000", "\216\312\233<\000\000", 0, 2);
x2("\233<\000|\000\134\000A\216\312\000\000", "\000b\216\312\233<\000\000", 4, 6);
x2("\233<\000|\000\134\000A\216\312\000\000", "\216\312\000\000", 0, 2);
x2("\233<\000|\216\312\000\134\000Z\000\000", "\216\312\233<\000\000", 2, 4);
x2("\233<\000|\216\312\000\134\000Z\000\000", "\216\312\000\000", 0, 2);
x2("\233<\000|\216\312\000\134\000Z\000\000", "\216\312\000\012\000\000", 0, 2);
x2("\233<\000|\216\312\000\134\000z\000\000", "\216\312\233<\000\000", 2, 4);
x2("\233<\000|\216\312\000\134\000z\000\000", "\216\312\000\000", 0, 2);
x2("\000\134\000w\000|\000\134\000s\000\000", "0J\000\000", 0, 2);
x2("\000\134\000w\000|\000%\000\000", "\000%0J\000\000", 0, 2);
x2("\000\134\000w\000|\000[\000&\000$\000]\000\000", "0F\000&\000\000", 0, 2);
x2("\000[0D\000-0Q\000]\000\000", "0F\000\000", 0, 2);
x2("\000[0D\000-0Q\000]\000|\000[\000^0K\000-0S\000]\000\000", "0B\000\000", 0, 2);
x2("\000[0D\000-0Q\000]\000|\000[\000^0K\000-0S\000]\000\000", "0K\000\000", 0, 2);
x2("\000[\000^0B\000]\000\000", "\000\012\000\000", 0, 2);
x2("\000(\000?\000:0B\000|\000[0F\000-0M\000]\000)\000|0D0\222\000\000", "0F0\222\000\000", 0, 2);
x2("\000(\000?\000:0B\000|\000[0F\000-0M\000]\000)\000|0D0\222\000\000", "0D0\222\000\000", 0, 4);
x2("0B0D0F\000|\000(\000?\000=0Q0Q\000)\000.\000.0{\000\000", "0Q0Q0{\000\000", 0, 6);
x2("0B0D0F\000|\000(\000?\000!0Q0Q\000)\000.\000.0{\000\000", "0B0D0{\000\000", 0, 6);
x2("\000(\000?\000=0\2220B\000)\000.\000.0B\000|\000(\000?\000=0\2220\222\000)\000.\000.0B\000\000", "0\2220\2220B\000\000", 0, 6);
x2("\000(\000?\000<\000=0B\000|0D0F\000)0D\000\000", "0D0F0D\000\000", 4, 6);
n("\000(\000?\000>0B\000|0B0D0H\000)0F\000\000", "0B0D0H0F\000\000");
x2("\000(\000?\000>0B0D0H\000|0B\000)0F\000\000", "0B0D0H0F\000\000", 0, 8);
x2("0B\000?\000|0D\000\000", "0B\000\000", 0, 2);
x2("0B\000?\000|0D\000\000", "0D\000\000", 0, 0);
x2("0B\000?\000|0D\000\000", "\000\000", 0, 0);
x2("0B\000*\000|0D\000\000", "0B0B\000\000", 0, 4);
x2("0B\000*\000|0D\000*\000\000", "0D0B\000\000", 0, 0);
x2("0B\000*\000|0D\000*\000\000", "0B0D\000\000", 0, 2);
x2("\000[\000a0B\000]\000*\000|0D\000*\000\000", "\000a0B0D0D0D\000\000", 0, 4);
x2("0B\000+\000|0D\000*\000\000", "\000\000", 0, 0);
x2("0B\000+\000|0D\000*\000\000", "0D0D0D\000\000", 0, 6);
x2("0B\000+\000|0D\000*\000\000", "0B0D0D0D\000\000", 0, 2);
x2("0B\000+\000|0D\000*\000\000", "\000a0B0D0D0D\000\000", 0, 0);
n("0B\000+\000|0D\000+\000\000", "\000\000");
x2("\000(0B\000|0D\000)\000?\000\000", "0D\000\000", 0, 2);
x2("\000(0B\000|0D\000)\000*\000\000", "0D0B\000\000", 0, 4);
x2("\000(0B\000|0D\000)\000+\000\000", "0D0B0D\000\000", 0, 6);
x2("\000(0B0D\000|0F0B\000)\000+\000\000", "0F0B0B0D0F0H\000\000", 0, 8);
x2("\000(0B0D\000|0F0H\000)\000+\000\000", "0F0B0B0D0F0H\000\000", 4, 12);
x2("\000(0B0D\000|0F0B\000)\000+\000\000", "0B0B0D0F0B\000\000", 2, 10);
x2("\000(0B0D\000|0F0B\000)\000+\000\000", "0B0D0\2220F0B\000\000", 0, 4);
x2("\000(0B0D\000|0F0B\000)\000+\000\000", "\000$\000$\000z\000z\000z\000z0B0D0\2220F0B\000\000", 12, 16);
x2("\000(0B\000|0D0B0D\000)\000+\000\000", "0B0D0B0D0B\000\000", 0, 10);
x2("\000(0B\000|0D0B0D\000)\000+\000\000", "0D0B\000\000", 2, 4);
x2("\000(0B\000|0D0B0D\000)\000+\000\000", "0D0B0B0B0D0B\000\000", 2, 8);
x2("\000(\000?\000:0B\000|0D\000)\000(\000?\000:0B\000|0D\000)\000\000", "0B0D\000\000", 0, 4);
x2("\000(\000?\000:0B\000*\000|0D\000*\000)\000(\000?\000:0B\000*\000|0D\000*\000)\000\000", "0B0B0B0D0D0D\000\000", 0, 6);
x2("\000(\000?\000:0B\000*\000|0D\000*\000)\000(\000?\000:0B\000+\000|0D\000+\000)\000\000", "0B0B0B0D0D0D\000\000", 0, 12);
x2("\000(\000?\000:0B\000+\000|0D\000+\000)\000{\0002\000}\000\000", "0B0B0B0D0D0D\000\000", 0, 12);
x2("\000(\000?\000:0B\000+\000|0D\000+\000)\000{\0001\000,\0002\000}\000\000", "0B0B0B0D0D0D\000\000", 0, 12);
x2("\000(\000?\000:0B\000+\000|\000\134\000A0D\000*\000)0F0F\000\000", "0F0F\000\000", 0, 4);
n("\000(\000?\000:0B\000+\000|\000\134\000A0D\000*\000)0F0F\000\000", "0B0D0F0F\000\000");
x2("\000(\000?\000:\000^0B\000+\000|0D\000+\000)\000*0F\000\000", "0B0B0D0D0D0B0D0F\000\000", 12, 16);
x2("\000(\000?\000:\000^0B\000+\000|0D\000+\000)\000*0F\000\000", "0B0B0D0D0D0D0F\000\000", 0, 14);
x2("0F\000{\0000\000,\000}\000\000", "0F0F0F0F\000\000", 0, 8);
x2("0B\000|\000(\000?\000i\000)\000c\000\000", "\000C\000\000", 0, 2);
x2("\000(\000?\000i\000)\000c\000|0B\000\000", "\000C\000\000", 0, 2);
x2("\000(\000?\000i\000:0B\000)\000|\000a\000\000", "\000a\000\000", 0, 2);
n("\000(\000?\000i\000:0B\000)\000|\000a\000\000", "\000A\000\000");
x2("\000[0B0D0F\000]\000?\000\000", "0B0D0F\000\000", 0, 2);
x2("\000[0B0D0F\000]\000*\000\000", "0B0D0F\000\000", 0, 6);
x2("\000[\000^0B0D0F\000]\000*\000\000", "0B0D0F\000\000", 0, 0);
n("\000[\000^0B0D0F\000]\000+\000\000", "0B0D0F\000\000");
x2("0B\000?\000?\000\000", "0B0B0B\000\000", 0, 0);
x2("0D0B\000?\000?0D\000\000", "0D0B0D\000\000", 0, 6);
x2("0B\000*\000?\000\000", "0B0B0B\000\000", 0, 0);
x2("0D0B\000*\000?\000\000", "0D0B0B\000\000", 0, 2);
x2("0D0B\000*\000?0D\000\000", "0D0B0B0D\000\000", 0, 8);
x2("0B\000+\000?\000\000", "0B0B0B\000\000", 0, 2);
x2("0D0B\000+\000?\000\000", "0D0B0B\000\000", 0, 4);
x2("0D0B\000+\000?0D\000\000", "0D0B0B0D\000\000", 0, 8);
x2("\000(\000?\000:Y)\000?\000)\000?\000?\000\000", "Y)\000\000", 0, 0);
x2("\000(\000?\000:Y)\000?\000?\000)\000?\000\000", "Y)\000\000", 0, 0);
x2("\000(\000?\000:Y\042\000?\000)\000+\000?\000\000", "Y\042Y\042Y\042\000\000", 0, 2);
x2("\000(\000?\000:\230\250\000+\000)\000?\000?\000\000", "\230\250\230\250\230\250\000\000", 0, 0);
x2("\000(\000?\000:\226\352\000+\000)\000?\000?\227\034\000\000", "\226\352\226\352\226\352\227\034\000\000", 0, 8);
x2("\000(\000?\000:0B0D\000)\000?\000{\0002\000}\000\000", "\000\000", 0, 0);
x2("\000(\000?\000:\233<\216\312\000)\000?\000{\0002\000}\000\000", "\233<\216\312\233<\216\312\233<\000\000", 0, 8);
x2("\000(\000?\000:\233<\216\312\000)\000*\000{\0000\000}\000\000", "\233<\216\312\233<\216\312\233<\000\000", 0, 0);
x2("\000(\000?\000:\233<\216\312\000)\000{\0003\000,\000}\000\000", "\233<\216\312\233<\216\312\233<\216\312\233<\216\312\000\000", 0, 16);
n("\000(\000?\000:\233<\216\312\000)\000{\0003\000,\000}\000\000", "\233<\216\312\233<\216\312\000\000");
x2("\000(\000?\000:\233<\216\312\000)\000{\0002\000,\0004\000}\000\000", "\233<\216\312\233<\216\312\233<\216\312\000\000", 0, 12);
x2("\000(\000?\000:\233<\216\312\000)\000{\0002\000,\0004\000}\000\000", "\233<\216\312\233<\216\312\233<\216\312\233<\216\312\233<\216\312\000\000", 0, 16);
x2("\000(\000?\000:\233<\216\312\000)\000{\0002\000,\0004\000}\000?\000\000", "\233<\216\312\233<\216\312\233<\216\312\233<\216\312\233<\216\312\000\000", 0, 8);
x2("\000(\000?\000:\233<\216\312\000)\000{\000,\000}\000\000", "\233<\216\312\000{\000,\000}\000\000", 0, 10);
x2("\000(\000?\000:0K0M0O\000)\000+\000?\000{\0002\000}\000\000", "0K0M0O0K0M0O0K0M0O\000\000", 0, 12);
x3("\000(pk\000)\000\000", "pk\000\000", 0, 2, 1);
x3("\000(pkl4\000)\000\000", "pkl4\000\000", 0, 4, 1);
x2("\000(\000(fB\225\223\000)\000)\000\000", "fB\225\223\000\000", 0, 4);
x3("\000(\000(\230\250l4\000)\000)\000\000", "\230\250l4\000\000", 0, 4, 1);
x3("\000(\000(f(e\345\000)\000)\000\000", "f(e\345\000\000", 0, 4, 2);
x3("\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\221\317[P\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000\000", "\221\317[P\000\000", 0, 4, 20);
x3("\000(0B0D\000)\000(0F0H\000)\000\000", "0B0D0F0H\000\000", 0, 4, 1);
x3("\000(0B0D\000)\000(0F0H\000)\000\000", "0B0D0F0H\000\000", 4, 8, 2);
x3("\000(\000)\000(0B\000)0D0F\000(0H0J0K\000)0M0O0Q0S\000\000", "0B0D0F0H0J0K0M0O0Q0S\000\000", 6, 12, 3);
x3("\000(\000(\000)\000(0B\000)0D0F\000(0H0J0K\000)0M0O0Q0S\000)\000\000", "0B0D0F0H0J0K0M0O0Q0S\000\000", 6, 12, 4);
x3("\000.\000*\000(0\3250\251\000)0\3630\3730\336\000(0\363\000(\000)0\2670\3450\277\000)0\2440\363\000\000", "0\3250\2510\3630\3730\3360\3630\2670\3450\2770\2440\363\000\000", 10, 18, 2);
x2("\000(\000^0B\000)\000\000", "0B\000\000", 0, 2);
x3("\000(0B\000)\000|\000(0B\000)\000\000", "0D0B\000\000", 2, 4, 1);
x3("\000(\000^0B\000)\000|\000(0B\000)\000\000", "0D0B\000\000", 2, 4, 2);
x3("\000(0B\000?\000)\000\000", "0B0B0B\000\000", 0, 2, 1);
x3("\000(0~\000*\000)\000\000", "0~0~0~\000\000", 0, 6, 1);
x3("\000(0h\000*\000)\000\000", "\000\000", 0, 0, 1);
x3("\000(0\213\000+\000)\000\000", "0\2130\2130\2130\2130\2130\2130\213\000\000", 0, 14, 1);
x3("\000(0u\000+\000|0x\000*\000)\000\000", "0u0u0u0x0x\000\000", 0, 6, 1);
x3("\000(0B\000+\000|0D\000?\000)\000\000", "0D0D0D0B0B\000\000", 0, 2, 1);
x3("\000(0B0D0F\000)\000?\000\000", "0B0D0F\000\000", 0, 6, 1);
x3("\000(0B0D0F\000)\000*\000\000", "0B0D0F\000\000", 0, 6, 1);
x3("\000(0B0D0F\000)\000+\000\000", "0B0D0F\000\000", 0, 6, 1);
x3("\000(0U0W0Y\000|0B0D0F\000)\000+\000\000", "0B0D0F\000\000", 0, 6, 1);
x3("\000(\000[0j0k0l\000]\000[0K0M0O\000]\000|0K0M0O\000)\000+\000\000", "0K0M0O\000\000", 0, 6, 1);
x3("\000(\000(\000?\000i\000:0B0D0F\000)\000)\000\000", "0B0D0F\000\000", 0, 6, 1);
x3("\000(\000(\000?\000m\000:0B\000.0F\000)\000)\000\000", "0B\000\0120F\000\000", 0, 6, 1);
x3("\000(\000(\000?\000=0B0\223\000)0B\000)\000\000", "0B0\2230D\000\000", 0, 2, 1);
x3("0B0D0F\000|\000(\000.0B0D0H\000)\000\000", "0\2230B0D0H\000\000", 0, 8, 1);
x3("0B\000*\000(\000.\000)\000\000", "0B0B0B0B0\223\000\000", 8, 10, 1);
x3("0B\000*\000?\000(\000.\000)\000\000", "0B0B0B0B0\223\000\000", 0, 2, 1);
x3("0B\000*\000?\000(0\223\000)\000\000", "0B0B0B0B0\223\000\000", 8, 10, 1);
x3("\000[0D0F0H\000]0B\000*\000(\000.\000)\000\000", "0H0B0B0B0B0\223\000\000", 10, 12, 1);
x3("\000(\000\134\000A0D0D\000)0F0F\000\000", "0D0D0F0F\000\000", 0, 4, 1);
n("\000(\000\134\000A0D0D\000)0F0F\000\000", "0\2230D0D0F0F\000\000");
x3("\000(\000^0D0D\000)0F0F\000\000", "0D0D0F0F\000\000", 0, 4, 1);
n("\000(\000^0D0D\000)0F0F\000\000", "0\2230D0D0F0F\000\000");
x3("0\2150\215\000(0\2130\213\000$\000)\000\000", "0\2150\2150\2130\213\000\000", 4, 8, 1);
n("0\2150\215\000(0\2130\213\000$\000)\000\000", "0\2150\2150\2130\2130\213\000\000");
x2("\000(q!\000)\000\134\0001\000\000", "q!q!\000\000", 0, 4);
n("\000(q!\000)\000\134\0001\000\000", "q!kf\000\000");
x2("\000(zz\000?\000)\000\134\0001\000\000", "zzzz\000\000", 0, 4);
x2("\000(zz\000?\000?\000)\000\134\0001\000\000", "zzzz\000\000", 0, 0);
x2("\000(zz\000*\000)\000\134\0001\000\000", "zzzzzzzzzz\000\000", 0, 8);
x3("\000(zz\000*\000)\000\134\0001\000\000", "zzzzzzzzzz\000\000", 0, 4, 1);
x2("0B\000(0D\000*\000)\000\134\0001\000\000", "0B0D0D0D0D\000\000", 0, 10);
x2("0B\000(0D\000*\000)\000\134\0001\000\000", "0B0D\000\000", 0, 2);
x2("\000(0B\000*\000)\000(0D\000*\000)\000\134\0001\000\134\0002\000\000", "0B0B0B0D0D0B0B0B0D0D\000\000", 0, 20);
x2("\000(0B\000*\000)\000(0D\000*\000)\000\134\0002\000\000", "0B0B0B0D0D0D0D\000\000", 0, 14);
x3("\000(0B\000*\000)\000(0D\000*\000)\000\134\0002\000\000", "0B0B0B0D0D0D0D\000\000", 6, 10, 2);
x2("\000(\000(\000(\000(\000(\000(\000(0}\000*\000)0z\000)\000)\000)\000)\000)\000)0t\000\134\0007\000\000", "0}0}0}0z0t0}0}0}\000\000", 0, 16);
x3("\000(\000(\000(\000(\000(\000(\000(0}\000*\000)0z\000)\000)\000)\000)\000)\000)0t\000\134\0007\000\000", "0}0}0}0z0t0}0}0}\000\000", 0, 6, 7);
x2("\000(0o\000)\000(0r\000)\000(0u\000)\000\134\0002\000\134\0001\000\134\0003\000\000", "0o0r0u0r0o0u\000\000", 0, 12);
x2("\000(\000[0M\000-0Q\000]\000)\000\134\0001\000\000", "0O0O\000\000", 0, 4);
x2("\000(\000\134\000w\000\134\000d\000\134\000s\000)\000\134\0001\000\000", "0B\0005\000 0B\0005\000 \000\000", 0, 12);
n("\000(\000\134\000w\000\134\000d\000\134\000s\000)\000\134\0001\000\000", "0B\0005\000 0B\0005\000\000");
x2("\000(\212\260\377\037\000|\000[0B\000-0F\000]\000{\0003\000}\000)\000\134\0001\000\000", "\212\260\377\037\212\260\377\037\000\000", 0, 8);
x2("\000.\000.\000.\000(\212\260\377\037\000|\000[0B\000-0F\000]\000{\0003\000}\000)\000\134\0001\000\000", "0B\000a0B\212\260\377\037\212\260\377\037\000\000", 0, 14);
x2("\000(\212\260\377\037\000|\000[0B\000-0F\000]\000{\0003\000}\000)\000\134\0001\000\000", "0F0D0F0F0D0F\000\000", 0, 12);
x2("\000(\000^0S\000)\000\134\0001\000\000", "0S0S\000\000", 0, 4);
n("\000(\000^0\200\000)\000\134\0001\000\000", "0\2010\2000\200\000\000");
n("\000(0B\000$\000)\000\134\0001\000\000", "0B0B\000\000");
n("\000(0B0D\000\134\000Z\000)\000\134\0001\000\000", "0B0D\000\000");
x2("\000(0B\000*\000\134\000Z\000)\000\134\0001\000\000", "0B\000\000", 2, 2);
x2("\000.\000(0B\000*\000\134\000Z\000)\000\134\0001\000\000", "0D0B\000\000", 2, 4);
x3("\000(\000.\000(0\2040D0\206\000)\000\134\0002\000)\000\000", "\000z0\2040D0\2060\2040D0\206\000\000", 0, 14, 1);
x3("\000(\000.\000(\000.\000.\000\134\000d\000.\000)\000\134\0002\000)\000\000", "0B\0001\0002\0003\0004\0001\0002\0003\0004\000\000", 0, 18, 1);
x2("\000(\000(\000?\000i\000:0B\000v0Z\000)\000)\000\134\0001\000\000", "0B\000v0Z0B\000v0Z\000\000", 0, 12);
x2("\000(\000?\000<a\0320K\000>Y\011\000|\000\134\000(\000\134\000g\000<a\0320K\000>\000\134\000)\000)\000\000", "\000(\000(\000(\000(\000(\000(Y\011\000)\000)\000)\000)\000)\000)\000\000", 0, 26);
x2("\000\134\000A\000(\000?\000:\000\134\000g\000<\226?\000_\0001\000>\000|\000\134\000g\000<N\221\000_\0002\000>\000|\000\134\000z}BN\206\000 \000 \000(\000?\000<\226?\000_\0001\000>\211\263\000|\201\352\000\134\000g\000<N\221\000_\0002\000>\201\352\000)\000(\000?\000<N\221\000_\0002\000>W(\000|\203\351\205\251\000\134\000g\000<\226?\000_\0001\000>\203\351\205\251\000)\000)\000$\000\000", "\203\351\205\251\201\352\203\351\205\251\201\352W(\201\352\203\351\205\251\201\352\203\351\205\251\000\000", 0, 26);
x2("\000[\000[0r0u\000]\000]\000\000", "0u\000\000", 0, 2);
x2("\000[\000[0D0J0F\000]0K\000]\000\000", "0K\000\000", 0, 2);
n("\000[\000[\000^0B\000]\000]\000\000", "0B\000\000");
n("\000[\000^\000[0B\000]\000]\000\000", "0B\000\000");
x2("\000[\000^\000[\000^0B\000]\000]\000\000", "0B\000\000", 0, 2);
x2("\000[\000[0K0M0O\000]\000&\000&0M0O\000]\000\000", "0O\000\000", 0, 2);
n("\000[\000[0K0M0O\000]\000&\000&0M0O\000]\000\000", "0K\000\000");
n("\000[\000[0K0M0O\000]\000&\000&0M0O\000]\000\000", "0Q\000\000");
x2("\000[0B\000-0\223\000&\000&0D\000-0\222\000&\000&0F\000-0\221\000]\000\000", "0\221\000\000", 0, 2);
n("\000[\000^0B\000-0\223\000&\000&0D\000-0\222\000&\000&0F\000-0\221\000]\000\000", "0\221\000\000");
x2("\000[\000[\000^0B\000&\000&0B\000]\000&\000&0B\000-0\223\000]\000\000", "0D\000\000", 0, 2);
n("\000[\000[\000^0B\000&\000&0B\000]\000&\000&0B\000-0\223\000]\000\000", "0B\000\000");
x2("\000[\000[\000^0B\000-0\223\000&\000&0D0F0H0J\000]\000&\000&\000[\000^0F\000-0K\000]\000]\000\000", "0M\000\000", 0, 2);
n("\000[\000[\000^0B\000-0\223\000&\000&0D0F0H0J\000]\000&\000&\000[\000^0F\000-0K\000]\000]\000\000", "0D\000\000");
x2("\000[\000^\000[\000^0B0D0F\000]\000&\000&\000[\000^0F0H0J\000]\000]\000\000", "0F\000\000", 0, 2);
x2("\000[\000^\000[\000^0B0D0F\000]\000&\000&\000[\000^0F0H0J\000]\000]\000\000", "0H\000\000", 0, 2);
n("\000[\000^\000[\000^0B0D0F\000]\000&\000&\000[\000^0F0H0J\000]\000]\000\000", "0K\000\000");
x2("\000[0B\000-\000&\000&\000-0B\000]\000\000", "\000-\000\000", 0, 2);
x2("\000[\000^\000[\000^\000a\000-\000z0B0D0F\000]\000&\000&\000[\000^\000b\000c\000d\000e\000f\000g0F0H0J\000]\000q\000-\000w\000]\000\000", "0H\000\000", 0, 2);
x2("\000[\000^\000[\000^\000a\000-\000z0B0D0F\000]\000&\000&\000[\000^\000b\000c\000d\000e\000f\000g0F0H0J\000]\000g\000-\000w\000]\000\000", "\000f\000\000", 0, 2);
x2("\000[\000^\000[\000^\000a\000-\000z0B0D0F\000]\000&\000&\000[\000^\000b\000c\000d\000e\000f\000g0F0H0J\000]\000g\000-\000w\000]\000\000", "\000g\000\000", 0, 2);
n("\000[\000^\000[\000^\000a\000-\000z0B0D0F\000]\000&\000&\000[\000^\000b\000c\000d\000e\000f\000g0F0H0J\000]\000g\000-\000w\000]\000\000", "\0002\000\000");
x2("\000a\000<\000b\000>0\3200\3740\2700\3470\3630n0\3000\2460\3630\3550\3740\311\000<\000\134\000/\000b\000>\000\000", "\000a\000<\000b\000>0\3200\3740\2700\3470\3630n0\3000\2460\3630\3550\3740\311\000<\000/\000b\000>\000\000", 0, 40);
x2("\000.\000<\000b\000>0\3200\3740\2700\3470\3630n0\3000\2460\3630\3550\3740\311\000<\000\134\000/\000b\000>\000\000", "\000a\000<\000b\000>0\3200\3740\2700\3470\3630n0\3000\2460\3630\3550\3740\311\000<\000/\000b\000>\000\000", 0, 40);
fprintf(stdout,
"\nRESULT SUCC: %d, FAIL: %d, ERROR: %d (by Oniguruma %s)\n",
nsucc, nfail, nerror, onig_version());
#ifndef POSIX_TEST
onig_region_free(region, 1);
onig_end();
#endif
return ((nfail == 0 && nerror == 0) ? 0 : -1);
}

View File

@@ -1,200 +0,0 @@
# Oniguruma Makefile for Win32
product_name = oniguruma
CPPFLAGS =
CFLAGS = -O2 -nologo /W3
LDFLAGS =
LOADLIBES =
ARLIB = lib
ARLIB_FLAGS = -nologo
ARDLL = cl
ARDLL_FLAGS = -nologo -LD $(LINKFLAGS) -dll
LINKFLAGS = -link -incremental:no -pdb:none
INSTALL = install -c
CP = copy
CC = cl
DEFS = -DHAVE_CONFIG_H -DNOT_RUBY -DEXPORT
RUBYDIR = ..
subdirs =
libbase = onig
libname = $(libbase)_s.lib
dllname = $(libbase).dll
dlllib = $(libbase).lib
onigheaders = oniguruma.h regint.h regparse.h regenc.h st.h
posixheaders = onigposix.h
headers = $(posixheaders) $(onigheaders)
onigobjs = reggnu.obj regerror.obj regparse.obj regext.obj regcomp.obj \
regexec.obj regenc.obj regsyntax.obj regtrav.obj \
regversion.obj st.obj
posixobjs = regposix.obj regposerr.obj
libobjs = $(onigobjs) $(posixobjs)
jp_objs = $(encdir)\euc_jp.obj $(encdir)\sjis.obj
iso8859_objs = $(encdir)\iso8859_1.obj $(encdir)\iso8859_2.obj \
$(encdir)\iso8859_3.obj $(encdir)\iso8859_4.obj \
$(encdir)\iso8859_5.obj $(encdir)\iso8859_6.obj \
$(encdir)\iso8859_7.obj $(encdir)\iso8859_8.obj \
$(encdir)\iso8859_9.obj $(encdir)\iso8859_10.obj \
$(encdir)\iso8859_11.obj $(encdir)\iso8859_13.obj \
$(encdir)\iso8859_14.obj $(encdir)\iso8859_15.obj \
$(encdir)\iso8859_16.obj
encobjs = $(encdir)\ascii.obj $(encdir)\utf8.obj \
$(encdir)\unicode.obj \
$(encdir)\utf16_be.obj $(encdir)\utf16_le.obj \
$(encdir)\utf32_be.obj $(encdir)\utf32_le.obj \
$(jp_objs) $(iso8859_objs) \
$(encdir)\euc_tw.obj $(encdir)\euc_kr.obj $(encdir)\big5.obj \
$(encdir)\gb18030.obj \
$(encdir)\koi8_r.obj \
$(encdir)\cp1251.obj # $(encdir)\koi8.obj
onigsources = regerror.c regparse.c regext.c regcomp.c regexec.c regenc.c \
regsyntax.c regtrav.c regversion.c reggnu.c st.c
posixsources = regposix.c regposerr.c
libsources = $(posixsources) $(onigsources)
rubysources = $(onigsources)
encdir = enc
patchfiles = re.c.168.patch re.c.181.patch
distfiles = README COPYING HISTORY \
Makefile.in configure.in config.h.in configure \
$(headers) $(libsources) $(patchfiles) \
test.rb testconv.rb
testc = testc
testp = testp
makeargs = $(MFLAGS) CPPFLAGS='$(CPPFLAGS)' CFLAGS='$(CFLAGS)' CC='$(CC)'
.SUFFIXES:
.SUFFIXES: .obj .c .h .ps .dvi .info .texinfo
.c.obj:
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) /I. /I.. /Fo$@ /c $<
# targets
default: all
setup:
$(CP) win32\config.h config.h
$(CP) win32\testc.c testc.c
all: $(libname) $(dllname)
$(libname): $(libobjs) $(encobjs)
$(ARLIB) $(ARLIB_FLAGS) -out:$@ $(libobjs) $(encobjs)
$(dllname): $(libobjs) $(encobjs)
$(ARDLL) $(libobjs) $(encobjs) -Fe$@ $(ARDLL_FLAGS)
regparse.obj: regparse.c $(onigheaders) config.h st.h
regext.obj: regext.c $(onigheaders) config.h
regtrav.obj: regtrav.c $(onigheaders) config.h
regcomp.obj: regcomp.c $(onigheaders) config.h
regexec.obj: regexec.c regint.h regenc.h oniguruma.h config.h
reggnu.obj: reggnu.c regint.h regenc.h oniguruma.h config.h oniggnu.h
regerror.obj: regerror.c regint.h regenc.h oniguruma.h config.h
regenc.obj: regenc.c regenc.h oniguruma.h config.h
regsyntax.obj: regsyntax.c regint.h regenc.h oniguruma.h config.h
regversion.obj: regversion.c oniguruma.h config.h
regposix.obj: regposix.c $(posixheaders) oniguruma.h config.h
regposerr.obj: regposerr.c $(posixheaders) config.h
st.obj: st.c regint.h oniguruma.h config.h st.h
$(encdir)\ascii.obj: $(encdir)\ascii.c regenc.h config.h
$(encdir)\unicode.obj: $(encdir)\unicode.c regenc.h config.h
$(encdir)\utf8.obj: $(encdir)\utf8.c regenc.h config.h
$(encdir)\utf16_be.obj: $(encdir)\utf16_be.c regenc.h config.h
$(encdir)\utf16_le.obj: $(encdir)\utf16_le.c regenc.h config.h
$(encdir)\utf32_be.obj: $(encdir)\utf32_be.c regenc.h config.h
$(encdir)\utf32_le.obj: $(encdir)\utf32_le.c regenc.h config.h
$(encdir)\euc_jp.obj: $(encdir)\euc_jp.c regenc.h config.h
$(encdir)\euc_tw.obj: $(encdir)\euc_tw.c regenc.h config.h
$(encdir)\euc_kr.obj: $(encdir)\euc_kr.c regenc.h config.h
$(encdir)\sjis.obj: $(encdir)\sjis.c regenc.h config.h
$(encdir)\iso8859_1.obj: $(encdir)\iso8859_1.c regenc.h config.h
$(encdir)\iso8859_2.obj: $(encdir)\iso8859_2.c regenc.h config.h
$(encdir)\iso8859_3.obj: $(encdir)\iso8859_3.c regenc.h config.h
$(encdir)\iso8859_4.obj: $(encdir)\iso8859_4.c regenc.h config.h
$(encdir)\iso8859_5.obj: $(encdir)\iso8859_5.c regenc.h config.h
$(encdir)\iso8859_6.obj: $(encdir)\iso8859_6.c regenc.h config.h
$(encdir)\iso8859_7.obj: $(encdir)\iso8859_7.c regenc.h config.h
$(encdir)\iso8859_8.obj: $(encdir)\iso8859_8.c regenc.h config.h
$(encdir)\iso8859_9.obj: $(encdir)\iso8859_9.c regenc.h config.h
$(encdir)\iso8859_10.obj: $(encdir)\iso8859_10.c regenc.h config.h
$(encdir)\iso8859_11.obj: $(encdir)\iso8859_11.c regenc.h config.h
$(encdir)\iso8859_13.obj: $(encdir)\iso8859_13.c regenc.h config.h
$(encdir)\iso8859_14.obj: $(encdir)\iso8859_14.c regenc.h config.h
$(encdir)\iso8859_15.obj: $(encdir)\iso8859_15.c regenc.h config.h
$(encdir)\iso8859_16.obj: $(encdir)\iso8859_16.c regenc.h config.h
$(encdir)\koi8.obj: $(encdir)\koi8.c regenc.h config.h
$(encdir)\koi8_r.obj: $(encdir)\koi8_r.c regenc.h config.h
$(encdir)\cp1251.obj: $(encdir)\cp1251.c regenc.h config.h
$(encdir)\big5.obj: $(encdir)\big5.c regenc.h config.h
$(encdir)\gb18030.obj: $(encdir)\gb18030.c regenc.h config.h
# Ruby test
rtest:
$(RUBYDIR)\win32\ruby -w -Ke test.rb
# C library test
ctest: $(testc)
.\$(testc)
# POSIX C library test
ptest: $(testp)
.\$(testp)
$(testc): $(testc).c $(libname)
$(CC) -nologo -o $(testc) -DONIG_EXTERN=extern $(testc).c $(libname)
$(testp): $(testc).c $(dlllib)
$(CC) -nologo -DPOSIX_TEST -o $(testp) $(testc).c $(dlllib)
#$(testc)u.c: test.rb testconvu.rb
# ruby -Ke testconvu.rb test.rb > $@
$(testc)u: $(testc)u.c $(libname)
$(CC) -nologo -o $(testc)u -DONIG_EXTERN=extern $(testc)u.c $(libname)
clean:
del *.obj $(encdir)\*.obj *.lib *.exp *.dll $(testp).exe $(testc).exe $(testc).obj
# backup file suffix
SORIG = ruby_orig
# ruby 1.9 source update
19:
$(CP) regerror.c $(RUBYDIR)
$(CP) regparse.c $(RUBYDIR)
$(CP) regcomp.c $(RUBYDIR)
$(CP) regexec.c $(RUBYDIR)
$(CP) regenc.c $(RUBYDIR)
$(CP) regint.h $(RUBYDIR)
$(CP) regparse.h $(RUBYDIR)
$(CP) regenc.h $(RUBYDIR)
$(CP) oniguruma.h $(RUBYDIR)
$(CP) enc\ascii.c $(RUBYDIR)
$(CP) enc\utf8.c $(RUBYDIR)
$(CP) enc\euc_jp.c $(RUBYDIR)
$(CP) enc\sjis.c $(RUBYDIR)
$(CP) enc\unicode.c $(RUBYDIR)
samples: all
$(CC) $(CFLAGS) -I. -o simple sample\simple.c $(dlllib)
$(CC) $(CFLAGS) -I. -o posix sample\posix.c $(dlllib)
$(CC) $(CFLAGS) -I. -o names sample\names.c $(dlllib)
$(CC) $(CFLAGS) -I. -o listcap sample\listcap.c $(dlllib)
$(CC) $(CFLAGS) -I. -o sql sample\sql.c $(dlllib)
$(CC) $(CFLAGS) -I. -o encode sample\encode.c $(dlllib)
$(CC) $(CFLAGS) -I. -o syntax sample\syntax.c $(dlllib)

View File

@@ -1,863 +0,0 @@
/*
* This program was generated by testconv.rb.
*/
#include "config.h"
#ifdef ONIG_ESCAPE_UCHAR_COLLISION
#undef ONIG_ESCAPE_UCHAR_COLLISION
#endif
#include <stdio.h>
#ifdef POSIX_TEST
#include "onigposix.h"
#else
#include "oniguruma.h"
#endif
#ifdef HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
#endif
#define SLEN(s) strlen(s)
static int nsucc = 0;
static int nfail = 0;
static int nerror = 0;
static FILE* err_file;
#ifndef POSIX_TEST
static OnigRegion* region;
#endif
static void xx(char* pattern, char* str, int from, int to, int mem, int not)
{
int r;
#ifdef POSIX_TEST
regex_t reg;
char buf[200];
regmatch_t pmatch[25];
r = regcomp(&reg, pattern, REG_EXTENDED | REG_NEWLINE);
if (r) {
regerror(r, &reg, buf, sizeof(buf));
fprintf(err_file, "ERROR: %s\n", buf);
nerror++;
return ;
}
r = regexec(&reg, str, reg.re_nsub + 1, pmatch, 0);
if (r != 0 && r != REG_NOMATCH) {
regerror(r, &reg, buf, sizeof(buf));
fprintf(err_file, "ERROR: %s\n", buf);
nerror++;
return ;
}
if (r == REG_NOMATCH) {
if (not) {
fprintf(stdout, "OK(N): /%s/ '%s'\n", pattern, str);
nsucc++;
}
else {
fprintf(stdout, "FAIL: /%s/ '%s'\n", pattern, str);
nfail++;
}
}
else {
if (not) {
fprintf(stdout, "FAIL(N): /%s/ '%s'\n", pattern, str);
nfail++;
}
else {
if (pmatch[mem].rm_so == from && pmatch[mem].rm_eo == to) {
fprintf(stdout, "OK: /%s/ '%s'\n", pattern, str);
nsucc++;
}
else {
fprintf(stdout, "FAIL: /%s/ '%s' %d-%d : %d-%d\n", pattern, str,
from, to, pmatch[mem].rm_so, pmatch[mem].rm_eo);
nfail++;
}
}
}
regfree(&reg);
#else
regex_t* reg;
OnigErrorInfo einfo;
r = onig_new(&reg, (UChar* )pattern, (UChar* )(pattern + SLEN(pattern)),
ONIG_OPTION_DEFAULT, ONIG_ENCODING_SJIS, ONIG_SYNTAX_DEFAULT, &einfo);
if (r) {
char s[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str((UChar* )s, r, &einfo);
fprintf(err_file, "ERROR: %s\n", s);
nerror++;
return ;
}
r = onig_search(reg, (UChar* )str, (UChar* )(str + SLEN(str)),
(UChar* )str, (UChar* )(str + SLEN(str)),
region, ONIG_OPTION_NONE);
if (r < ONIG_MISMATCH) {
char s[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str((UChar* )s, r);
fprintf(err_file, "ERROR: %s\n", s);
nerror++;
return ;
}
if (r == ONIG_MISMATCH) {
if (not) {
fprintf(stdout, "OK(N): /%s/ '%s'\n", pattern, str);
nsucc++;
}
else {
fprintf(stdout, "FAIL: /%s/ '%s'\n", pattern, str);
nfail++;
}
}
else {
if (not) {
fprintf(stdout, "FAIL(N): /%s/ '%s'\n", pattern, str);
nfail++;
}
else {
if (region->beg[mem] == from && region->end[mem] == to) {
fprintf(stdout, "OK: /%s/ '%s'\n", pattern, str);
nsucc++;
}
else {
fprintf(stdout, "FAIL: /%s/ '%s' %d-%d : %d-%d\n", pattern, str,
from, to, region->beg[mem], region->end[mem]);
nfail++;
}
}
}
onig_free(reg);
#endif
}
static void x2(char* pattern, char* str, int from, int to)
{
xx(pattern, str, from, to, 0, 0);
}
static void x3(char* pattern, char* str, int from, int to, int mem)
{
xx(pattern, str, from, to, mem, 0);
}
static void n(char* pattern, char* str)
{
xx(pattern, str, 0, 0, 0, 1);
}
extern int main(int argc, char* argv[])
{
err_file = stdout;
#ifdef POSIX_TEST
reg_set_encoding(REG_POSIX_ENCODING_SJIS);
#else
region = onig_region_new();
#endif
x2("", "", 0, 0);
x2("^", "", 0, 0);
x2("$", "", 0, 0);
x2("\\G", "", 0, 0);
x2("\\A", "", 0, 0);
x2("\\Z", "", 0, 0);
x2("\\z", "", 0, 0);
x2("^$", "", 0, 0);
x2("\\ca", "\001", 0, 1);
x2("\\C-b", "\002", 0, 1);
x2("\\c\\\\", "\034", 0, 1);
x2("q[\\c\\\\]", "q\034", 0, 2);
x2("", "a", 0, 0);
x2("a", "a", 0, 1);
x2("\\x61", "a", 0, 1);
x2("aa", "aa", 0, 2);
x2("aaa", "aaa", 0, 3);
x2("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 0, 35);
x2("ab", "ab", 0, 2);
x2("b", "ab", 1, 2);
x2("bc", "abc", 1, 3);
x2("(?i:#RET#)", "#INS##RET#", 5, 10);
x2("\\17", "\017", 0, 1);
x2("\\x1f", "\x1f", 0, 1);
x2("a(?#....\\\\JJJJ)b", "ab", 0, 2);
x2("(?x) G (o O(?-x)oO) g L", "GoOoOgLe", 0, 7);
x2(".", "a", 0, 1);
n(".", "");
x2("..", "ab", 0, 2);
x2("\\w", "e", 0, 1);
n("\\W", "e");
x2("\\s", " ", 0, 1);
x2("\\S", "b", 0, 1);
x2("\\d", "4", 0, 1);
n("\\D", "4");
x2("\\b", "z ", 0, 0);
x2("\\b", " z", 1, 1);
x2("\\B", "zz ", 1, 1);
x2("\\B", "z ", 2, 2);
x2("\\B", " z", 0, 0);
x2("[ab]", "b", 0, 1);
n("[ab]", "c");
x2("[a-z]", "t", 0, 1);
n("[^a]", "a");
x2("[^a]", "\n", 0, 1);
x2("[]]", "]", 0, 1);
n("[^]]", "]");
x2("[\\^]+", "0^^1", 1, 3);
x2("[b-]", "b", 0, 1);
x2("[b-]", "-", 0, 1);
x2("[\\w]", "z", 0, 1);
n("[\\w]", " ");
x2("[\\W]", "b$", 1, 2);
x2("[\\d]", "5", 0, 1);
n("[\\d]", "e");
x2("[\\D]", "t", 0, 1);
n("[\\D]", "3");
x2("[\\s]", " ", 0, 1);
n("[\\s]", "a");
x2("[\\S]", "b", 0, 1);
n("[\\S]", " ");
x2("[\\w\\d]", "2", 0, 1);
n("[\\w\\d]", " ");
x2("[[:upper:]]", "B", 0, 1);
x2("[*[:xdigit:]+]", "+", 0, 1);
x2("[*[:xdigit:]+]", "GHIKK-9+*", 6, 7);
x2("[*[:xdigit:]+]", "-@^+", 3, 4);
n("[[:upper]]", "A");
x2("[[:upper]]", ":", 0, 1);
x2("[\\044-\\047]", "\046", 0, 1);
x2("[\\x5a-\\x5c]", "\x5b", 0, 1);
x2("[\\x6A-\\x6D]", "\x6c", 0, 1);
n("[\\x6A-\\x6D]", "\x6E");
n("^[0-9A-F]+ 0+ UNDEF ", "75F 00000000 SECT14A notype () External | _rb_apply");
x2("[\\[]", "[", 0, 1);
x2("[\\]]", "]", 0, 1);
x2("[&]", "&", 0, 1);
x2("[[ab]]", "b", 0, 1);
x2("[[ab]c]", "c", 0, 1);
n("[[^a]]", "a");
n("[^[a]]", "a");
x2("[[ab]&&bc]", "b", 0, 1);
n("[[ab]&&bc]", "a");
n("[[ab]&&bc]", "c");
x2("[a-z&&b-y&&c-x]", "w", 0, 1);
n("[^a-z&&b-y&&c-x]", "w");
x2("[[^a&&a]&&a-z]", "b", 0, 1);
n("[[^a&&a]&&a-z]", "a");
x2("[[^a-z&&bcdef]&&[^c-g]]", "h", 0, 1);
n("[[^a-z&&bcdef]&&[^c-g]]", "c");
x2("[^[^abc]&&[^cde]]", "c", 0, 1);
x2("[^[^abc]&&[^cde]]", "e", 0, 1);
n("[^[^abc]&&[^cde]]", "f");
x2("[a-&&-a]", "-", 0, 1);
n("[a\\-&&\\-a]", "&");
n("\\wabc", " abc");
x2("a\\Wbc", "a bc", 0, 4);
x2("a.b.c", "aabbc", 0, 5);
x2(".\\wb\\W..c", "abb bcc", 0, 7);
x2("\\s\\wzzz", " zzzz", 0, 5);
x2("aa.b", "aabb", 0, 4);
n(".a", "ab");
x2(".a", "aa", 0, 2);
x2("^a", "a", 0, 1);
x2("^a$", "a", 0, 1);
x2("^\\w$", "a", 0, 1);
n("^\\w$", " ");
x2("^\\wab$", "zab", 0, 3);
x2("^\\wabcdef$", "zabcdef", 0, 7);
x2("^\\w...def$", "zabcdef", 0, 7);
x2("\\w\\w\\s\\Waaa\\d", "aa aaa4", 0, 8);
x2("\\A\\Z", "", 0, 0);
x2("\\Axyz", "xyz", 0, 3);
x2("xyz\\Z", "xyz", 0, 3);
x2("xyz\\z", "xyz", 0, 3);
x2("a\\Z", "a", 0, 1);
x2("\\Gaz", "az", 0, 2);
n("\\Gz", "bza");
n("az\\G", "az");
n("az\\A", "az");
n("a\\Az", "az");
x2("\\^\\$", "^$", 0, 2);
x2("^x?y", "xy", 0, 2);
x2("^(x?y)", "xy", 0, 2);
x2("\\w", "_", 0, 1);
n("\\W", "_");
x2("(?=z)z", "z", 0, 1);
n("(?=z).", "a");
x2("(?!z)a", "a", 0, 1);
n("(?!z)a", "z");
x2("(?i:a)", "a", 0, 1);
x2("(?i:a)", "A", 0, 1);
x2("(?i:A)", "a", 0, 1);
n("(?i:A)", "b");
x2("(?i:[A-Z])", "a", 0, 1);
x2("(?i:[f-m])", "H", 0, 1);
x2("(?i:[f-m])", "h", 0, 1);
n("(?i:[f-m])", "e");
x2("(?i:[A-c])", "D", 0, 1);
n("(?i:[^a-z])", "A");
n("(?i:[^a-z])", "a");
x2("(?i:[!-k])", "Z", 0, 1);
x2("(?i:[!-k])", "7", 0, 1);
x2("(?i:[T-}])", "b", 0, 1);
x2("(?i:[T-}])", "{", 0, 1);
x2("(?i:\\?a)", "?A", 0, 2);
x2("(?i:\\*A)", "*a", 0, 2);
n(".", "\n");
x2("(?m:.)", "\n", 0, 1);
x2("(?m:a.)", "a\n", 0, 2);
x2("(?m:.b)", "a\nb", 1, 3);
x2(".*abc", "dddabdd\nddabc", 8, 13);
x2("(?m:.*abc)", "dddabddabc", 0, 10);
n("(?i)(?-i)a", "A");
n("(?i)(?-i:a)", "A");
x2("a?", "", 0, 0);
x2("a?", "b", 0, 0);
x2("a?", "a", 0, 1);
x2("a*", "", 0, 0);
x2("a*", "a", 0, 1);
x2("a*", "aaa", 0, 3);
x2("a*", "baaaa", 0, 0);
n("a+", "");
x2("a+", "a", 0, 1);
x2("a+", "aaaa", 0, 4);
x2("a+", "aabbb", 0, 2);
x2("a+", "baaaa", 1, 5);
x2(".?", "", 0, 0);
x2(".?", "f", 0, 1);
x2(".?", "\n", 0, 0);
x2(".*", "", 0, 0);
x2(".*", "abcde", 0, 5);
x2(".+", "z", 0, 1);
x2(".+", "zdswer\n", 0, 6);
x2("(.*)a\\1f", "babfbac", 0, 4);
x2("(.*)a\\1f", "bacbabf", 3, 7);
x2("((.*)a\\2f)", "bacbabf", 3, 7);
x2("(.*)a\\1f", "baczzzzzz\nbazz\nzzzzbabf", 19, 23);
x2("a|b", "a", 0, 1);
x2("a|b", "b", 0, 1);
x2("|a", "a", 0, 0);
x2("(|a)", "a", 0, 0);
x2("ab|bc", "ab", 0, 2);
x2("ab|bc", "bc", 0, 2);
x2("z(?:ab|bc)", "zbc", 0, 3);
x2("a(?:ab|bc)c", "aabc", 0, 4);
x2("ab|(?:ac|az)", "az", 0, 2);
x2("a|b|c", "dc", 1, 2);
x2("a|b|cd|efg|h|ijk|lmn|o|pq|rstuvwx|yz", "pqr", 0, 2);
n("a|b|cd|efg|h|ijk|lmn|o|pq|rstuvwx|yz", "mn");
x2("a|^z", "ba", 1, 2);
x2("a|^z", "za", 0, 1);
x2("a|\\Gz", "bza", 2, 3);
x2("a|\\Gz", "za", 0, 1);
x2("a|\\Az", "bza", 2, 3);
x2("a|\\Az", "za", 0, 1);
x2("a|b\\Z", "ba", 1, 2);
x2("a|b\\Z", "b", 0, 1);
x2("a|b\\z", "ba", 1, 2);
x2("a|b\\z", "b", 0, 1);
x2("\\w|\\s", " ", 0, 1);
n("\\w|\\w", " ");
x2("\\w|%", "%", 0, 1);
x2("\\w|[&$]", "&", 0, 1);
x2("[b-d]|[^e-z]", "a", 0, 1);
x2("(?:a|[c-f])|bz", "dz", 0, 1);
x2("(?:a|[c-f])|bz", "bz", 0, 2);
x2("abc|(?=zz)..f", "zzf", 0, 3);
x2("abc|(?!zz)..f", "abf", 0, 3);
x2("(?=za)..a|(?=zz)..a", "zza", 0, 3);
n("(?>a|abd)c", "abdc");
x2("(?>abd|a)c", "abdc", 0, 4);
x2("a?|b", "a", 0, 1);
x2("a?|b", "b", 0, 0);
x2("a?|b", "", 0, 0);
x2("a*|b", "aa", 0, 2);
x2("a*|b*", "ba", 0, 0);
x2("a*|b*", "ab", 0, 1);
x2("a+|b*", "", 0, 0);
x2("a+|b*", "bbb", 0, 3);
x2("a+|b*", "abbb", 0, 1);
n("a+|b+", "");
x2("(a|b)?", "b", 0, 1);
x2("(a|b)*", "ba", 0, 2);
x2("(a|b)+", "bab", 0, 3);
x2("(ab|ca)+", "caabbc", 0, 4);
x2("(ab|ca)+", "aabca", 1, 5);
x2("(ab|ca)+", "abzca", 0, 2);
x2("(a|bab)+", "ababa", 0, 5);
x2("(a|bab)+", "ba", 1, 2);
x2("(a|bab)+", "baaaba", 1, 4);
x2("(?:a|b)(?:a|b)", "ab", 0, 2);
x2("(?:a*|b*)(?:a*|b*)", "aaabbb", 0, 3);
x2("(?:a*|b*)(?:a+|b+)", "aaabbb", 0, 6);
x2("(?:a+|b+){2}", "aaabbb", 0, 6);
x2("h{0,}", "hhhh", 0, 4);
x2("(?:a+|b+){1,2}", "aaabbb", 0, 6);
n("ax{2}*a", "0axxxa1");
n("a.{0,2}a", "0aXXXa0");
n("a.{0,2}?a", "0aXXXa0");
n("a.{0,2}?a", "0aXXXXa0");
x2("^a{2,}?a$", "aaa", 0, 3);
x2("^[a-z]{2,}?$", "aaa", 0, 3);
x2("(?:a+|\\Ab*)cc", "cc", 0, 2);
n("(?:a+|\\Ab*)cc", "abcc");
x2("(?:^a+|b+)*c", "aabbbabc", 6, 8);
x2("(?:^a+|b+)*c", "aabbbbc", 0, 7);
x2("a|(?i)c", "C", 0, 1);
x2("(?i)c|a", "C", 0, 1);
x2("(?i)c|a", "A", 0, 1);
x2("(?i:c)|a", "C", 0, 1);
n("(?i:c)|a", "A");
x2("[abc]?", "abc", 0, 1);
x2("[abc]*", "abc", 0, 3);
x2("[^abc]*", "abc", 0, 0);
n("[^abc]+", "abc");
x2("a?\?", "aaa", 0, 0);
x2("ba?\?b", "bab", 0, 3);
x2("a*?", "aaa", 0, 0);
x2("ba*?", "baa", 0, 1);
x2("ba*?b", "baab", 0, 4);
x2("a+?", "aaa", 0, 1);
x2("ba+?", "baa", 0, 2);
x2("ba+?b", "baab", 0, 4);
x2("(?:a?)?\?", "a", 0, 0);
x2("(?:a?\?)?", "a", 0, 0);
x2("(?:a?)+?", "aaa", 0, 1);
x2("(?:a+)?\?", "aaa", 0, 0);
x2("(?:a+)?\?b", "aaab", 0, 4);
x2("(?:ab)?{2}", "", 0, 0);
x2("(?:ab)?{2}", "ababa", 0, 4);
x2("(?:ab)*{0}", "ababa", 0, 0);
x2("(?:ab){3,}", "abababab", 0, 8);
n("(?:ab){3,}", "abab");
x2("(?:ab){2,4}", "ababab", 0, 6);
x2("(?:ab){2,4}", "ababababab", 0, 8);
x2("(?:ab){2,4}?", "ababababab", 0, 4);
x2("(?:ab){,}", "ab{,}", 0, 5);
x2("(?:abc)+?{2}", "abcabcabc", 0, 6);
x2("(?:X*)(?i:xa)", "XXXa", 0, 4);
x2("(d+)([^abc]z)", "dddz", 0, 4);
x2("([^abc]*)([^abc]z)", "dddz", 0, 4);
x2("(\\w+)(\\wz)", "dddz", 0, 4);
x3("(a)", "a", 0, 1, 1);
x3("(ab)", "ab", 0, 2, 1);
x2("((ab))", "ab", 0, 2);
x3("((ab))", "ab", 0, 2, 1);
x3("((ab))", "ab", 0, 2, 2);
x3("((((((((((((((((((((ab))))))))))))))))))))", "ab", 0, 2, 20);
x3("(ab)(cd)", "abcd", 0, 2, 1);
x3("(ab)(cd)", "abcd", 2, 4, 2);
x3("()(a)bc(def)ghijk", "abcdefghijk", 3, 6, 3);
x3("(()(a)bc(def)ghijk)", "abcdefghijk", 3, 6, 4);
x2("(^a)", "a", 0, 1);
x3("(a)|(a)", "ba", 1, 2, 1);
x3("(^a)|(a)", "ba", 1, 2, 2);
x3("(a?)", "aaa", 0, 1, 1);
x3("(a*)", "aaa", 0, 3, 1);
x3("(a*)", "", 0, 0, 1);
x3("(a+)", "aaaaaaa", 0, 7, 1);
x3("(a+|b*)", "bbbaa", 0, 3, 1);
x3("(a+|b?)", "bbbaa", 0, 1, 1);
x3("(abc)?", "abc", 0, 3, 1);
x3("(abc)*", "abc", 0, 3, 1);
x3("(abc)+", "abc", 0, 3, 1);
x3("(xyz|abc)+", "abc", 0, 3, 1);
x3("([xyz][abc]|abc)+", "abc", 0, 3, 1);
x3("((?i:abc))", "AbC", 0, 3, 1);
x2("(abc)(?i:\\1)", "abcABC", 0, 6);
x3("((?m:a.c))", "a\nc", 0, 3, 1);
x3("((?=az)a)", "azb", 0, 1, 1);
x3("abc|(.abd)", "zabd", 0, 4, 1);
x2("(?:abc)|(ABC)", "abc", 0, 3);
x3("(?i:(abc))|(zzz)", "ABC", 0, 3, 1);
x3("a*(.)", "aaaaz", 4, 5, 1);
x3("a*?(.)", "aaaaz", 0, 1, 1);
x3("a*?(c)", "aaaac", 4, 5, 1);
x3("[bcd]a*(.)", "caaaaz", 5, 6, 1);
x3("(\\Abb)cc", "bbcc", 0, 2, 1);
n("(\\Abb)cc", "zbbcc");
x3("(^bb)cc", "bbcc", 0, 2, 1);
n("(^bb)cc", "zbbcc");
x3("cc(bb$)", "ccbb", 2, 4, 1);
n("cc(bb$)", "ccbbb");
n("(\\1)", "");
n("\\1(a)", "aa");
n("(a(b)\\1)\\2+", "ababb");
n("(?:(?:\\1|z)(a))+$", "zaa");
x2("(?:(?:\\1|z)(a))+$", "zaaa", 0, 4);
x2("(a)(?=\\1)", "aa", 0, 1);
n("(a)$|\\1", "az");
x2("(a)\\1", "aa", 0, 2);
n("(a)\\1", "ab");
x2("(a?)\\1", "aa", 0, 2);
x2("(a?\?)\\1", "aa", 0, 0);
x2("(a*)\\1", "aaaaa", 0, 4);
x3("(a*)\\1", "aaaaa", 0, 2, 1);
x2("a(b*)\\1", "abbbb", 0, 5);
x2("a(b*)\\1", "ab", 0, 1);
x2("(a*)(b*)\\1\\2", "aaabbaaabb", 0, 10);
x2("(a*)(b*)\\2", "aaabbbb", 0, 7);
x2("(((((((a*)b))))))c\\7", "aaabcaaa", 0, 8);
x3("(((((((a*)b))))))c\\7", "aaabcaaa", 0, 3, 7);
x2("(a)(b)(c)\\2\\1\\3", "abcbac", 0, 6);
x2("([a-d])\\1", "cc", 0, 2);
x2("(\\w\\d\\s)\\1", "f5 f5 ", 0, 6);
n("(\\w\\d\\s)\\1", "f5 f5");
x2("(who|[a-c]{3})\\1", "whowho", 0, 6);
x2("...(who|[a-c]{3})\\1", "abcwhowho", 0, 9);
x2("(who|[a-c]{3})\\1", "cbccbc", 0, 6);
x2("(^a)\\1", "aa", 0, 2);
n("(^a)\\1", "baa");
n("(a$)\\1", "aa");
n("(ab\\Z)\\1", "ab");
x2("(a*\\Z)\\1", "a", 1, 1);
x2(".(a*\\Z)\\1", "ba", 1, 2);
x3("(.(abc)\\2)", "zabcabc", 0, 7, 1);
x3("(.(..\\d.)\\2)", "z12341234", 0, 9, 1);
x2("((?i:az))\\1", "AzAz", 0, 4);
n("((?i:az))\\1", "Azaz");
x2("(?<=a)b", "ab", 1, 2);
n("(?<=a)b", "bb");
x2("(?<=a|b)b", "bb", 1, 2);
x2("(?<=a|bc)b", "bcb", 2, 3);
x2("(?<=a|bc)b", "ab", 1, 2);
x2("(?<=a|bc||defghij|klmnopq|r)z", "rz", 1, 2);
x2("(a)\\g<1>", "aa", 0, 2);
x2("(?<!a)b", "cb", 1, 2);
n("(?<!a)b", "ab");
x2("(?<!a|bc)b", "bbb", 0, 1);
n("(?<!a|bc)z", "bcz");
x2("(?<name1>a)", "a", 0, 1);
x2("(?<name_2>ab)\\g<name_2>", "abab", 0, 4);
x2("(?<name_3>.zv.)\\k<name_3>", "azvbazvb", 0, 8);
x2("(?<=\\g<ab>)|-\\zEND (?<ab>XyZ)", "XyZ", 3, 3);
x2("(?<n>|a\\g<n>)+", "", 0, 0);
x2("(?<n>|\\(\\g<n>\\))+$", "()(())", 0, 6);
x3("\\g<n>(?<n>.){0}", "X", 0, 1, 1);
x2("\\g<n>(abc|df(?<n>.YZ){2,8}){0}", "XYZ", 0, 3);
x2("\\A(?<n>(a\\g<n>)|)\\z", "aaaa", 0, 4);
x2("(?<n>|\\g<m>\\g<n>)\\z|\\zEND (?<m>a|(b)\\g<m>)", "bbbbabba", 0, 8);
x2("(?<name1240>\\w+\\sx)a+\\k<name1240>", " fg xaaaaaaaafg x", 2, 18);
x3("(z)()()(?<_9>a)\\g<_9>", "zaa", 2, 3, 1);
x2("(.)(((?<_>a)))\\k<_>", "zaa", 0, 3);
x2("((?<name1>\\d)|(?<name2>\\w))(\\k<name1>|\\k<name2>)", "ff", 0, 2);
x2("(?:(?<x>)|(?<x>efg))\\k<x>", "", 0, 0);
x2("(?:(?<x>abc)|(?<x>efg))\\k<x>", "abcefgefg", 3, 9);
n("(?:(?<x>abc)|(?<x>efg))\\k<x>", "abcefg");
x2("(?:(?<n1>.)|(?<n1>..)|(?<n1>...)|(?<n1>....)|(?<n1>.....)|(?<n1>......)|(?<n1>.......)|(?<n1>........)|(?<n1>.........)|(?<n1>..........)|(?<n1>...........)|(?<n1>............)|(?<n1>.............)|(?<n1>..............))\\k<n1>$", "a-pyumpyum", 2, 10);
x3("(?:(?<n1>.)|(?<n1>..)|(?<n1>...)|(?<n1>....)|(?<n1>.....)|(?<n1>......)|(?<n1>.......)|(?<n1>........)|(?<n1>.........)|(?<n1>..........)|(?<n1>...........)|(?<n1>............)|(?<n1>.............)|(?<n1>..............))\\k<n1>$", "xxxxabcdefghijklmnabcdefghijklmn", 4, 18, 14);
x3("(?<name1>)(?<name2>)(?<name3>)(?<name4>)(?<name5>)(?<name6>)(?<name7>)(?<name8>)(?<name9>)(?<name10>)(?<name11>)(?<name12>)(?<name13>)(?<name14>)(?<name15>)(?<name16>aaa)(?<name17>)$", "aaa", 0, 3, 16);
x2("(?<foo>a|\\(\\g<foo>\\))", "a", 0, 1);
x2("(?<foo>a|\\(\\g<foo>\\))", "((((((a))))))", 0, 13);
x3("(?<foo>a|\\(\\g<foo>\\))", "((((((((a))))))))", 0, 17, 1);
x2("\\g<bar>|\\zEND(?<bar>.*abc$)", "abcxxxabc", 0, 9);
x2("\\g<1>|\\zEND(.a.)", "bac", 0, 3);
x3("\\g<_A>\\g<_A>|\\zEND(.a.)(?<_A>.b.)", "xbxyby", 3, 6, 1);
x2("\\A(?:\\g<pon>|\\g<pan>|\\zEND (?<pan>a|c\\g<pon>c)(?<pon>b|d\\g<pan>d))$", "cdcbcdc", 0, 7);
x2("\\A(?<n>|a\\g<m>)\\z|\\zEND (?<m>\\g<n>)", "aaaa", 0, 4);
x2("(?<n>(a|b\\g<n>c){3,5})", "baaaaca", 1, 5);
x2("(?<n>(a|b\\g<n>c){3,5})", "baaaacaaaaa", 0, 10);
x2("(?<pare>\\(([^\\(\\)]++|\\g<pare>)*+\\))", "((a))", 0, 5);
x2("()*\\1", "", 0, 0);
x2("(?:()|())*\\1\\2", "", 0, 0);
x3("(?:\\1a|())*", "a", 0, 0, 1);
x2("x((.)*)*x", "0x1x2x3", 1, 6);
x2("x((.)*)*x(?i:\\1)\\Z", "0x1x2x1X2", 1, 9);
x2("(?:()|()|()|()|()|())*\\2\\5", "", 0, 0);
x2("(?:()|()|()|(x)|()|())*\\2b\\5", "b", 0, 1);
x2("\\xED\\xF2", "\xed\xf2", 0, 2);
x2("", "", 0, 0);
x2("", "", 0, 2);
n("", "");
x2("うう", "うう", 0, 4);
x2("あいう", "あいう", 0, 6);
x2("こここここここここここここここここここここここここここここここここここ", "こここここここここここここここここここここここここここここここここここ", 0, 70);
x2("", "いあ", 2, 4);
x2("いう", "あいう", 2, 6);
x2("\\xca\\xb8", "\xca\xb8", 0, 2);
x2(".", "", 0, 2);
x2("..", "かき", 0, 4);
x2("\\w", "", 0, 2);
n("\\W", "");
x2("[\\W]", "う$", 2, 3);
x2("\\S", "", 0, 2);
x2("\\S", "", 0, 2);
x2("\\b", "", 0, 0);
x2("\\b", "", 1, 1);
x2("\\B", "せそ ", 2, 2);
x2("\\B", "", 3, 3);
x2("\\B", "", 0, 0);
x2("[たち]", "", 0, 2);
n("[なに]", "");
x2("[う-お]", "", 0, 2);
n("[^け]", "");
x2("[\\w]", "", 0, 2);
n("[\\d]", "");
x2("[\\D]", "", 0, 2);
n("[\\s]", "");
x2("[\\S]", "", 0, 2);
x2("[\\w\\d]", "", 0, 2);
x2("[\\w\\d]", "", 3, 5);
n("\\w鬼車", " 鬼車");
x2("\\W車", "鬼 車", 0, 5);
x2("あ.い.う", "ああいいう", 0, 10);
x2(".\\wう\\W..ぞ", "えうう うぞぞ", 0, 13);
x2("\\s\\wこここ", " ここここ", 0, 9);
x2("ああ.け", "ああけけ", 0, 8);
n(".い", "いえ");
x2(".お", "おお", 0, 4);
x2("^あ", "", 0, 2);
x2("^む$", "", 0, 2);
x2("^\\w$", "", 0, 2);
x2("^\\wかきくけこ$", "zかきくけこ", 0, 11);
x2("^\\w...うえお$", "zあいううえお", 0, 13);
x2("\\w\\w\\s\\Wおおお\\d", "aお おおお4", 0, 12);
x2("\\Aたちつ", "たちつ", 0, 6);
x2("むめも\\Z", "むめも", 0, 6);
x2("かきく\\z", "かきく", 0, 6);
x2("かきく\\Z", "かきく\n", 0, 6);
x2("\\Gぽぴ", "ぽぴ", 0, 4);
n("\\Gえ", "うえお");
n("とて\\G", "とて");
n("まみ\\A", "まみ");
n("\\Aみ", "まみ");
x2("(?=せ)せ", "", 0, 2);
n("(?=う).", "");
x2("(?!う)か", "", 0, 2);
n("(?!と)あ", "");
x2("(?i:あ)", "", 0, 2);
x2("(?i:ぶべ)", "ぶべ", 0, 4);
n("(?i:い)", "");
x2("(?m:よ.)", "\n", 0, 3);
x2("(?m:.め)", "\n", 2, 5);
x2("あ?", "", 0, 0);
x2("変?", "", 0, 0);
x2("変?", "", 0, 2);
x2("量*", "", 0, 0);
x2("量*", "", 0, 2);
x2("子*", "子子子", 0, 6);
x2("馬*", "鹿馬馬馬馬", 0, 0);
n("山+", "");
x2("河+", "", 0, 2);
x2("時+", "時時時時", 0, 8);
x2("え+", "ええううう", 0, 4);
x2("う+", "おうううう", 2, 10);
x2(".?", "", 0, 2);
x2(".*", "ぱぴぷぺ", 0, 8);
x2(".+", "", 0, 2);
x2(".+", "いうえか\n", 0, 8);
x2("あ|い", "", 0, 2);
x2("あ|い", "", 0, 2);
x2("あい|いう", "あい", 0, 4);
x2("あい|いう", "いう", 0, 4);
x2("を(?:かき|きく)", "をかき", 0, 6);
x2("を(?:かき|きく)け", "をきくけ", 0, 8);
x2("あい|(?:あう|あを)", "あを", 0, 4);
x2("あ|い|う", "えう", 2, 4);
x2("あ|い|うえ|おかき|く|けこさ|しすせ|そ|たち|つてとなに|ぬね", "しすせ", 0, 6);
n("あ|い|うえ|おかき|く|けこさ|しすせ|そ|たち|つてとなに|ぬね", "すせ");
x2("あ|^わ", "ぶあ", 2, 4);
x2("あ|^を", "をあ", 0, 2);
x2("鬼|\\G車", "け車鬼", 4, 6);
x2("鬼|\\G車", "車鬼", 0, 2);
x2("鬼|\\A車", "b車鬼", 3, 5);
x2("鬼|\\A車", "", 0, 2);
x2("鬼|車\\Z", "車鬼", 2, 4);
x2("鬼|車\\Z", "", 0, 2);
x2("鬼|車\\Z", "\n", 0, 2);
x2("鬼|車\\z", "車鬼", 2, 4);
x2("鬼|車\\z", "", 0, 2);
x2("\\w|\\s", "", 0, 2);
x2("\\w|%", "%お", 0, 1);
x2("\\w|[&$]", "う&", 0, 2);
x2("[い-け]", "", 0, 2);
x2("[い-け]|[^か-こ]", "", 0, 2);
x2("[い-け]|[^か-こ]", "", 0, 2);
x2("[^あ]", "\n", 0, 1);
x2("(?:あ|[う-き])|いを", "うを", 0, 2);
x2("(?:あ|[う-き])|いを", "いを", 0, 4);
x2("あいう|(?=けけ)..ほ", "けけほ", 0, 6);
x2("あいう|(?!けけ)..ほ", "あいほ", 0, 6);
x2("(?=をあ)..あ|(?=をを)..あ", "ををあ", 0, 6);
x2("(?<=あ|いう)い", "いうい", 4, 6);
n("(?>あ|あいえ)う", "あいえう");
x2("(?>あいえ|あ)う", "あいえう", 0, 8);
x2("あ?|い", "", 0, 2);
x2("あ?|い", "", 0, 0);
x2("あ?|い", "", 0, 0);
x2("あ*|い", "ああ", 0, 4);
x2("あ*|い*", "いあ", 0, 0);
x2("あ*|い*", "あい", 0, 2);
x2("[aあ]*|い*", "aあいいい", 0, 3);
x2("あ+|い*", "", 0, 0);
x2("あ+|い*", "いいい", 0, 6);
x2("あ+|い*", "あいいい", 0, 2);
x2("あ+|い*", "aあいいい", 0, 0);
n("あ+|い+", "");
x2("(あ|い)?", "", 0, 2);
x2("(あ|い)*", "いあ", 0, 4);
x2("(あ|い)+", "いあい", 0, 6);
x2("(あい|うあ)+", "うああいうえ", 0, 8);
x2("(あい|うえ)+", "うああいうえ", 4, 12);
x2("(あい|うあ)+", "ああいうあ", 2, 10);
x2("(あい|うあ)+", "あいをうあ", 0, 4);
x2("(あい|うあ)+", "$$zzzzあいをうあ", 6, 10);
x2("(あ|いあい)+", "あいあいあ", 0, 10);
x2("(あ|いあい)+", "いあ", 2, 4);
x2("(あ|いあい)+", "いあああいあ", 2, 8);
x2("(?:あ|い)(?:あ|い)", "あい", 0, 4);
x2("(?:あ*|い*)(?:あ*|い*)", "あああいいい", 0, 6);
x2("(?:あ*|い*)(?:あ+|い+)", "あああいいい", 0, 12);
x2("(?:あ+|い+){2}", "あああいいい", 0, 12);
x2("(?:あ+|い+){1,2}", "あああいいい", 0, 12);
x2("(?:あ+|\\Aい*)うう", "うう", 0, 4);
n("(?:あ+|\\Aい*)うう", "あいうう");
x2("(?:^あ+|い+)*う", "ああいいいあいう", 12, 16);
x2("(?:^あ+|い+)*う", "ああいいいいう", 0, 14);
x2("う{0,}", "うううう", 0, 8);
x2("あ|(?i)c", "C", 0, 1);
x2("(?i)c|あ", "C", 0, 1);
x2("(?i:あ)|a", "a", 0, 1);
n("(?i:あ)|a", "A");
x2("[あいう]?", "あいう", 0, 2);
x2("[あいう]*", "あいう", 0, 6);
x2("[^あいう]*", "あいう", 0, 0);
n("[^あいう]+", "あいう");
x2("あ?\?", "あああ", 0, 0);
x2("いあ?\?い", "いあい", 0, 6);
x2("あ*?", "あああ", 0, 0);
x2("いあ*?", "いああ", 0, 2);
x2("いあ*?い", "いああい", 0, 8);
x2("あ+?", "あああ", 0, 2);
x2("いあ+?", "いああ", 0, 4);
x2("いあ+?い", "いああい", 0, 8);
x2("(?:天?)?\?", "", 0, 0);
x2("(?:天?\?)?", "", 0, 0);
x2("(?:夢?)+?", "夢夢夢", 0, 2);
x2("(?:風+)?\?", "風風風", 0, 0);
x2("(?:雪+)?\?霜", "雪雪雪霜", 0, 8);
x2("(?:あい)?{2}", "", 0, 0);
x2("(?:鬼車)?{2}", "鬼車鬼車鬼", 0, 8);
x2("(?:鬼車)*{0}", "鬼車鬼車鬼", 0, 0);
x2("(?:鬼車){3,}", "鬼車鬼車鬼車鬼車", 0, 16);
n("(?:鬼車){3,}", "鬼車鬼車");
x2("(?:鬼車){2,4}", "鬼車鬼車鬼車", 0, 12);
x2("(?:鬼車){2,4}", "鬼車鬼車鬼車鬼車鬼車", 0, 16);
x2("(?:鬼車){2,4}?", "鬼車鬼車鬼車鬼車鬼車", 0, 8);
x2("(?:鬼車){,}", "鬼車{,}", 0, 7);
x2("(?:かきく)+?{2}", "かきくかきくかきく", 0, 12);
x3("(火)", "", 0, 2, 1);
x3("(火水)", "火水", 0, 4, 1);
x2("((時間))", "時間", 0, 4);
x3("((風水))", "風水", 0, 4, 1);
x3("((昨日))", "昨日", 0, 4, 2);
x3("((((((((((((((((((((量子))))))))))))))))))))", "量子", 0, 4, 20);
x3("(あい)(うえ)", "あいうえ", 0, 4, 1);
x3("(あい)(うえ)", "あいうえ", 4, 8, 2);
x3("()(あ)いう(えおか)きくけこ", "あいうえおかきくけこ", 6, 12, 3);
x3("(()(あ)いう(えおか)きくけこ)", "あいうえおかきくけこ", 6, 12, 4);
x3(".*(フォ)ン・マ(ン()シュタ)イン", "フォン・マンシュタイン", 10, 18, 2);
x2("(^あ)", "", 0, 2);
x3("(あ)|(あ)", "いあ", 2, 4, 1);
x3("(^あ)|(あ)", "いあ", 2, 4, 2);
x3("(あ?)", "あああ", 0, 2, 1);
x3("(ま*)", "ままま", 0, 6, 1);
x3("(と*)", "", 0, 0, 1);
x3("(る+)", "るるるるるるる", 0, 14, 1);
x3("(ふ+|へ*)", "ふふふへへ", 0, 6, 1);
x3("(あ+|い?)", "いいいああ", 0, 2, 1);
x3("(あいう)?", "あいう", 0, 6, 1);
x3("(あいう)*", "あいう", 0, 6, 1);
x3("(あいう)+", "あいう", 0, 6, 1);
x3("(さしす|あいう)+", "あいう", 0, 6, 1);
x3("([なにぬ][かきく]|かきく)+", "かきく", 0, 6, 1);
x3("((?i:あいう))", "あいう", 0, 6, 1);
x3("((?m:あ.う))", "\n", 0, 5, 1);
x3("((?=あん)あ)", "あんい", 0, 2, 1);
x3("あいう|(.あいえ)", "んあいえ", 0, 8, 1);
x3("あ*(.)", "ああああん", 8, 10, 1);
x3("あ*?(.)", "ああああん", 0, 2, 1);
x3("あ*?(ん)", "ああああん", 8, 10, 1);
x3("[いうえ]あ*(.)", "えああああん", 10, 12, 1);
x3("(\\Aいい)うう", "いいうう", 0, 4, 1);
n("(\\Aいい)うう", "んいいうう");
x3("(^いい)うう", "いいうう", 0, 4, 1);
n("(^いい)うう", "んいいうう");
x3("ろろ(るる$)", "ろろるる", 4, 8, 1);
n("ろろ(るる$)", "ろろるるる");
x2("(無)\\1", "無無", 0, 4);
n("(無)\\1", "無武");
x2("(空?)\\1", "空空", 0, 4);
x2("(空?\?)\\1", "空空", 0, 0);
x2("(空*)\\1", "空空空空空", 0, 8);
x3("(空*)\\1", "空空空空空", 0, 4, 1);
x2("あ(い*)\\1", "あいいいい", 0, 10);
x2("あ(い*)\\1", "あい", 0, 2);
x2("(あ*)(い*)\\1\\2", "あああいいあああいい", 0, 20);
x2("(あ*)(い*)\\2", "あああいいいい", 0, 14);
x3("(あ*)(い*)\\2", "あああいいいい", 6, 10, 2);
x2("(((((((ぽ*)ぺ))))))ぴ\\7", "ぽぽぽぺぴぽぽぽ", 0, 16);
x3("(((((((ぽ*)ぺ))))))ぴ\\7", "ぽぽぽぺぴぽぽぽ", 0, 6, 7);
x2("(は)(ひ)(ふ)\\2\\1\\3", "はひふひはふ", 0, 12);
x2("([き-け])\\1", "くく", 0, 4);
x2("(\\w\\d\\s)\\1", "あ5 あ5 ", 0, 8);
n("(\\w\\d\\s)\\1", "あ5 あ5");
x2("(誰?|[あ-う]{3})\\1", "誰?誰?", 0, 8);
x2("...(誰?|[あ-う]{3})\\1", "あaあ誰", 0, 13);
x2("(誰?|[あ-う]{3})\\1", "ういうういう", 0, 12);
x2("(^こ)\\1", "ここ", 0, 4);
n("(^む)\\1", "めむむ");
n("(あ$)\\1", "ああ");
n("(あい\\Z)\\1", "あい");
x2("(あ*\\Z)\\1", "", 2, 2);
x2(".(あ*\\Z)\\1", "いあ", 2, 4);
x3("(.(やいゆ)\\2)", "zやいゆやいゆ", 0, 13, 1);
x3("(.(..\\d.)\\2)", "あ12341234", 0, 10, 1);
x2("((?i:あvず))\\1", "あvずあvず", 0, 10);
x2("(?<愚か>変|\\(\\g<愚か>\\))", "((((((変))))))", 0, 14);
x2("\\A(?:\\g<阿_1>|\\g<云_2>|\\z終了 (?<阿_1>観|自\\g<云_2>自)(?<云_2>在|菩薩\\g<阿_1>菩薩))$", "菩薩自菩薩自在自菩薩自菩薩", 0, 26);
x2("[[ひふ]]", "", 0, 2);
x2("[[いおう]か]", "", 0, 2);
n("[[^あ]]", "");
n("[^[あ]]", "");
x2("[^[^あ]]", "", 0, 2);
x2("[[かきく]&&きく]", "", 0, 2);
n("[[かきく]&&きく]", "");
n("[[かきく]&&きく]", "");
x2("[あ-ん&&い-を&&う-ゑ]", "", 0, 2);
n("[^あ-ん&&い-を&&う-ゑ]", "");
x2("[[^あ&&あ]&&あ-ん]", "", 0, 2);
n("[[^あ&&あ]&&あ-ん]", "");
x2("[[^あ-ん&&いうえお]&&[^う-か]]", "", 0, 2);
n("[[^あ-ん&&いうえお]&&[^う-か]]", "");
x2("[^[^あいう]&&[^うえお]]", "", 0, 2);
x2("[^[^あいう]&&[^うえお]]", "", 0, 2);
n("[^[^あいう]&&[^うえお]]", "");
x2("[あ-&&-あ]", "-", 0, 1);
x2("[^[^a-zあいう]&&[^bcdefgうえお]q-w]", "", 0, 2);
x2("[^[^a-zあいう]&&[^bcdefgうえお]g-w]", "f", 0, 1);
x2("[^[^a-zあいう]&&[^bcdefgうえお]g-w]", "g", 0, 1);
n("[^[^a-zあいう]&&[^bcdefgうえお]g-w]", "2");
x2("a<b>バージョンのダウンロード<\\/b>", "a<b>バージョンのダウンロード</b>", 0, 32);
x2(".<b>バージョンのダウンロード<\\/b>", "a<b>バージョンのダウンロード</b>", 0, 32);
fprintf(stdout,
"\nRESULT SUCC: %d, FAIL: %d, ERROR: %d (by Oniguruma %s)\n",
nsucc, nfail, nerror, onig_version());
#ifndef POSIX_TEST
onig_region_free(region, 1);
onig_end();
#endif
return ((nfail == 0 && nerror == 0) ? 0 : -1);
}

View File

@@ -156,4 +156,4 @@ array(1) {
[0]=>
string(8) "M2I1RA=="
}
Done
Done